Файл: adm/zc.php
Строк: 9
<?php
include '../system/sys.php';
include '../system/funcs.php';
if (!isset ($us)) {
header ('location: /');
exit;
}
if ($us['level']<4) {
header ('location: /adm/');
exit;
}
switch ($_GET['mod']) {
default:
H ('Загруз-центр', 'Загруз-центр');
$query = DB :: $dbs -> query ("SELECT * FROM `zc_kat` ORDER BY `id`");
while ($kat = $query -> fetch()) {
echo '<a href="/adm/zc.php?mod=kat&id=' . $kat['id'] . '"><b>' . $kat['name'] . '</b></a><br/>';
if (DB :: $dbs -> querySingle ("SELECT COUNT(*) FROM `zc_pk` WHERE (`id_kat`='" . $kat['id'] . "')") != 0) {
$q = DB :: $dbs -> query ("SELECT * FROM `zc_pk` WHERE (`id_kat`='" . $kat['id'] . "') ORDER BY `id`");
while ($pk = $q -> fetch ()) {
echo '- <a href="/adm/zc.php?mod=pk&id=' . $pk['id'] . '&kat=' . $kat['id'] . '">' . $pk['name'] . '</a><br/>';
}
}
}
echo '<div class="list1"><a href="/adm/zc.php?mod=add_kat">Добавить раздел</a></div>';
break;
case add_kat:
break;
}
F ();
?>