<?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="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/market"style="text-decoration:none; color:white;"> Маркет</a> :: Страница продавца ' . $u['nick'] . '</div></div></div>';

if (!empty($u['ava'])) {
echo '<div class="list-group-item media"><img src="/'.$u['ava'].'" alt="" style="max-width: 208px; max-height: 208px;"/></div>';
}
echo'<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i> Информация</div></div></div><div class="list-group-item media">';
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="list-group-item media"><a href="/view_mess.php?id='.$u['id'].'"><span class="glyphicon glyphicon-envelope"></span> Отправить сообщение</a></div>';
}

echo'<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i> Данные WebMoney</div></div></div>';
if($u['wm'] == 0){
echo '<div class="alert alert-danger"role="alert">WMID не заполнен! Не рекомендуем проводить денежные операции! </div>';
} else {
echo '<div class="list-group-item media">
&#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="list-group-item media"><a href="/market/ustovc/' . $u['id'] . '"><i class="zmdi zmdi-shuffle"></i> Товары в магазине: ('.DB::$dbs->querySingle("SELECT COUNT(id) FROM magazin_file WHERE user_id = ?", [$u['id']]).')</div></a>';
echo '<div class="list-group-item media"><a href="/info/rating.html?id='.$u['id'].'"><i class="zmdi zmdi-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();

?>