<?php
$title->SetTitle('Маркет - Покупатели товара ');
///Подключаем шапку
$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>Маркет - Покупатели товара </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">Покупатели товара</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> - Покупатели товара </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="error">Покупателей пока нет!</div>';
}
while($arr = $array->fetch()){
echo '<div class="row text_box">'.Nick($arr['user_buyid']).' ('.vr($arr['time']).')</div>';
}
echo '<ul class="nav nav-pills nav-stacked"><li><a href="/market/file/'.$id.'"><i class="md-apps"></i> Вернуться к файлу</a></ul>';


?>