Файл: 4mast/profmas.ru/pages/shop/incfiles/whobuy.php
Строк: 20
<?php
define('ROOT', $_SERVER['DOCUMENT_ROOT'].'/');
require_once(ROOT.'includes/Headers.php');
require_once(ROOT.'includes/PDO_func.php');
$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'] != $us['id']) {
header ('location: /');
exit();
}
H('Покупатели товара '.$file['name'], '<a href="/pages/shop/file/'.$file['id'].'" style="color:white;">'.$file['name'].'</a> | Покупатели товара '.$file['name']);
$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="block">'.Nick($arr['user_buyid']).' ('.datef($arr['time']).')</div>';
}
require_once(ROOT.'includes/Footers.php');
?>