php require_once _system PDO_connect php title Просмотр категорий requ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once('_system/PDO_connect.php');
$title = 'Просмотр категорий';
require_once('_system/Headers.php');
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
$inf = core::$dbs->queryFetch("SELECT * FROM `cat` WHERE `id` = ? LIMIT 1",array($id));
if(empty($inf['id'])){
header('location:/');
die();
}
echo '<div class="menu">'.$inf['name'].'</div><div class="obvodka">';
$count = core::$dbs->querySingle("SELECT COUNT(id) FROM work WHERE cid = '$id'",0);
$n = new pager($count,$end, '?');
if ($count == 0) err('Нет действующих работ!');
$array = core::$dbs->query("SELECT * FROM work WHERE cid = '$id' ORDER BY time DESC LIMIT $n->start,$end");
while($arr = $array -> fetch()){
echo '<a class="link-k" href="/work_'.$arr['id'].'.html">
<div class="bicon"><img src="'.$arr['screen'].'" alt="Скриншот" width="80" height="80"></div> '.$arr['name'].'</a>';
}
echo"</div>";
$n->pag();
require_once('_system/Footers.php');
?>