<?php
define('ROOT', $_SERVER['DOCUMENT_ROOT'].'/');
require_once(ROOT.'/classes/body.class.php');
require_once(ROOT.'/classes/db.class.php');
require_once(ROOT.'/classes/system.class.php');
$title= new Body;
if (!isset ($_GET['id'])) {
header ('location: /');
exit;
}
$query = DB :: $dbs -> query ("SELECT * FROM `blogger` WHERE `id`=?", [(int)$_GET['id']]);
if ($query -> rowCount () == 0) {
header ('location: /');
exit;
}
$u = $query -> fetch ();
$title->SetTitle('Маркет - Страница продавца ' . $u['nick'] . '');
///Подключаем шапку
$title->GetHeader();
echo '<div class="container-fluid page_header"><div class="container"><div class="row"><div class="col-xs-12 col-sm-8 col-md-9 col-lg-9"><h1>Маркет - Страница продавца ' . $u['nick'] . ' </h1><ol class="breadcrumb" xmlns:v="http://'.homeurl.'/#"><li typeof="v:Breadcrumb"><a href="/" rel="v:url" property="v:title">'.homeurl.'</a></li><li typeof="v:Breadcrumb"><a href="/market" rel="v:url" property="v:title">Маркет</a></li><li class="active" typeof="v:Breadcrumb"><span property="v:title">Продавец ' . $u['nick'] . '</span></li></ol></div></div></div></div>';
echo'<div class="container page_body"><div class="row"><div class="col-xs-12 page_content col-lg-9"><div class="navbar page_content_navbar collapse hidden-lg"><div class="container-fluid"><div class="navbar-collapse"></div></div></div><div class="text_box hidden-lg pr_block_small hidden"></div><div class="container-fluid cols_table">';
echo '<div class="catSides"><a href="/market"><i class="md-format-list-bulleted"></i> Маркет</a> - Страница продавца ' . $u['nick'] . '</div>';

if (!empty($u['ava'])) {
echo '<div class="row text_box"><img src="/'.$u['ava'].'" alt="" style="max-width: 208px; max-height: 208px;"/></div>';
}
echo'<div class="catSides"><i class="md-format-list-bulleted"></i> Информация</div><div class="row text_box">';
echo '&#187; ID: <b>' . $u['id'] . '</b><br/>';
if (!empty ($u['name'])) { 
echo '&#187; Имя: ' . $u['name'] . ' </br>'; }
echo '&#187; Пол: ' . $u['sex'] . '</br>';
if (!empty ($u['icq'])) {
echo '&#187; ICQ: ' . $u['icq'] . '</br>'; }
if (!empty ($u['email'])) {
echo '&#187; E-mail: ' . $u['email'] . '</br>'; }
echo'</div>';
if ($u['id'] !=$b['id']) {
echo'<div class="row text_box"><a href="/messages?do=send&nick='.$u['id'].'"><span class="glyphicon glyphicon-envelope"></span> Отправить сообщение</a></div>';
}

echo'<div class="catSides"><i class="md-format-list-bulleted"></i> Данные WebMoney</div>';
if($u['wm'] == NULL){
echo '<div class="error">WMID не заполнен! Не рекомендуем проводить денежные операции! </div>';
} else {
echo '<div class="row text_box">
&#187;   WMID: <a href="https://passport.webmoney.ru/asp/certView.asp?wmid='.$u['wmid'].'">'.$u['wmid'].' </a><br/>
&#187;   BL <img src="https://bl.wmtransfer.com/img/bl/'.$u['wmid'].'?w=35&h=18" /><br/>
&#187;   Претензии/Отзывы: <img src="http://arbitrage.webmoney.ru/xml/AL.aspx?wmid='.$u['wmid'].'" /><br/>
&#187;   WMR: <a href="http://search.wmtransfer.com/?w=w&q=R'.$u['wmr'].'">'.$u['wmr'].'</a><br/>
&#187;   <b>'.($u['wm']==0?'<font color="red">WMID Не подтвержден!</font>':'<font color="green">WMID подтвержден!</font>').'</b></div>';
}
echo '<div class="row text_box"><a href="/market/ustovc/' . $u['id'] . '"><i class="md-shuffle"></i> Товары в магазине: ('.DB::$dbs->querySingle("SELECT COUNT(id) FROM magazin_file WHERE user_id = ?", [$u['id']]).')</div></a>';
echo '<div class="row text_box"><a href="/info/rating.html?id='.$u['id'].'"><i class="md-shuffle"></i> Отзывы о ' . $u['nick'] . ': (<b><font color="green">'.DB :: $dbs -> querySingle("SELECT COUNT(id) FROM arbitage WHERE user_id = ? AND status = ? AND type = ?",[$u['id'],0,1]).'</font></b>/<b><font color="red">'.DB :: $dbs -> querySingle("SELECT COUNT(id) FROM arbitage WHERE user_id = ? AND status = ? AND type = ?",[$u['id'],0,2]).'</font></b>)</div></a>';

///Подключаем меню
$title->GetMenu();

///Подключаем футер
$title->GetFooter();

?>