Файл: 4mast/profmas.ru/pages/shop/incfiles/seller.php
Строк: 13
<?php
H('FORMAST.RU | Мои товары',' <center>Мои товары</center>');
$count = DB::$dbs->querySingle("SELECT COUNT(id) FROM magazin_file WHERE user_id = ?", [$us['id']]);
$items_per_page = 10;
$pages = ceil($count/$items_per_page);
$page = (int)$_GET['page'];
if ($page < 1) $page = 1;
if ($page > $pages)
$page = $pages;
$start = $page * $items_per_page - $items_per_page;
if ($count == 0) {
echo '<div class="error">Товаров нет!</div>';
}
else {
$sql = DB::$dbs->query("SELECT * FROM magazin_file WHERE user_id = ? ORDER BY time DESC LIMIT $start, $items_per_page", [$us['id']]);
while($a = $sql->fetch()) {
echo '<div class="lst"><a href="/pages/shop/file/'.$a['id'].'">'.$a['name'].'</a> ('.datef($a['time']).')<br/>Стоимость: <b>'.$a['price'].' р.</b></div>';
}
echo '' .page('/pages/shop/seller?'). '';
}
require_once(ROOT.'includes/Footers.php');
?>