<?php
$title->SetTitle('Маркет - Покупатели товара ');
$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> :: Покупатели товара</div></div></div>';
$id = isset($_GET['id']) ? abs((int)$_GET['id']) : false;
if (empty($id)) {
header ('location: /');
exit;
}
$query = DB::$dbs->query("SELECT * FROM `magazin_file` WHERE `id`= ?", [$id]);
if ($query -> rowCount () == 0) {
header ('location: /');
exit();
}
$file = $query->fetch();
if ($file['user_id'] != $b['id']) {
header ('location: /');
exit();
}
$array = DB::$dbs->query("SELECT * FROM magazin_myout WHERE file = ? AND user_id = ? ORDER BY time DESC", [$id,$file['user_id']]);
if ($array->rowCount() == 0) {
echo '<div class="alert alert-danger"role="alert">Покупателей пока нет!</div>';
}
while($arr = $array->fetch()){
echo '<div class="list-group-item media">'.Nick($arr['user_buyid']).' ('.vr($arr['time']).')</div>';
}
?>