Файл: 4mast/profmas.ru/pages/shop/incfiles/mybuy.php
Строк: 17
<?php
define('ROOT', $_SERVER['DOCUMENT_ROOT'].'/');
require_once(ROOT.'includes/Headers.php');
require_once(ROOT.'includes/PDO_func.php');
H('Мои покупки','<a href="/shop/">Магазин</a> | <b>Мои покупки</b>');
$count = DB::$dbs->querySingle("SELECT count(id) FROM `magazin_mybuy` WHERE `user_id` = ?",array($us['id']));
if ($count==0) {
echo '<div class="error">Покупок пока нет</div>';
}
$sql = DB::$dbs->query("SELECT * FROM `magazin_mybuy` WHERE `user_id` = ? ORDER BY id DESC",array($us['id']));
while($a = $sql->fetch()) {
$file = DB::$dbs->queryFetch("SELECT * FROM `magazin_file` WHERE `id` = ?",array($a['file']));
echo '<div class="lst"><a href="/pages/shop/file/'.$file['id'].'">'.$file['name'].'</a> ('.datef($file['time']).')<br /><small>'.mb_substr($file['opis'],0,40).'...</small><br/>» Продавец: '.Nick($a['user_buyid']).'<br/>Стоимость: '.$file['price'].' р.</div>';
}
require_once(ROOT.'includes/Footers.php');
?>