Файл: 4mast/profmas.ru/pages/shop/incfiles/corz.php
Строк: 17
<?php
H('Корзина', '<a href="/pages/shop"><font color="white">Магазин</font></a> | Корзина');
if (isset($_GET['del'])) {
$del = DB::$dbs->queryFetch("SELECT * FROM magazin_korz WHERE id = ? LIMIT 1", [abs((int)$_GET['del'])]);
if ($del['user_id'] == $us['id']) {
DB::$dbs->query("DELETE FROM magazin_korz WHERE id = ? LIMIT 1", [abs((int)$_GET['del'])]);
header('location: ?');
}
}
$count = DB::$dbs->querySingle("SELECT count(id) FROM magazin_korz WHERE user_id = ?", [$us['id']]);
$array = DB::$dbs->query("SELECT * FROM magazin_korz WHERE user_id = ? ORDER BY time DESC", [$us['id']]);
if ($count==0) {
echo '<div class="error">Корзина пуста</div>';
}
while($arr = $array->fetch()) {
$file = DB::$dbs->queryFetch("SELECT name,price,id FROM magazin_file WHERE id = ? LIMIT 1", [$arr['file']]);
echo '<div class="lst">[<a href="?del='.$arr['id'].'">X</a>] <a href="/pages/shop/file/'.$file['id'].'">'.$file['name'].'</a> ('.datef($arr['time']).')<br/>Стоимость: <b>'.$file['price'].' р.</b></div>';
}
?>