Файл: world-faces.ru/world-faces.ru/tovar/index.php
Строк: 26
<?
/* venix & bezh */
include_once '../i.php';
pdo();
$set['title']='Товары';
verh();
echo '<div class="onmenu">';
echo '<img src="img/find.png" alt="*"/> <a href="search">Поиск товара</a></div>
<div class="onmenu"><img src="/tovar/ext/top.gif" alt="*"/> <a href="top.php">Товары недели</a></div>';
$new_all_files = DB::$dbs->querySingle('SELECT COUNT(*) FROM `tovar` WHERE `timeupload` > '.($time-86400).'');
if($new_all_files[0]!=0) echo '<div class="onmenu"><img src="/tovar/ext/new.gif" alt="*"/> <a href="new">Новые товары (+'.$new_all_files[0].')</a></div>';
echo '<hr />';
$cate=0;
$time = $_SERVER['REQUEST_TIME'];
$cats = DB::$dbs->querySingle("SELECT count(*) from `tovar_category` where `id_cat` = ?",array($cate));
if($cats==0){echo'<div class="prof">Разделов нет!</div>';}else{
$c = DB::$dbs->query("SELECT * FROM `tovar_category` where `id_cat` = ? order by `pos` desc limit 10",array($cate));
while ($cat = $c -> Fetch()){
if(!is_dir($cat['path'])){
DB::$dbs->query("DELETE FROM `tovar_category` where `id` = ? limit 1",array($cat[id]));
DB::$dbs->query("DELETE FROM `tovar` where `id_cat` = ?",array($cat[id]));
}
$tovars = DB::$dbs->querySingle("Select count(*) from `tovar` where `path` = ?",array($cat[path]));
echo '<div class="prof"><img src="img/folder.png" alt="*"/><a href="dir.php?category='.$cat['id'].'">'.$cat['name'].'</a> ('.$tovars.')</div>';
}
}
echo '<div class="prof"><a href="admin.php?mod=addc&category=0">Создать раздел</a></div>';
echo '<div class="prof"><a href="/">В магазин</a></div>';
niz();
?>