Файл: modules/phpcodes/folder.php
Строк: 24
<?php
$title = 'Полезные PHP коды | Просмотр папки';
include_once($_SERVER["DOCUMENT_ROOT"].'/style/head.php');
$_GET['id'] = abs(intval($_GET['id']));
if($db->query("SELECT `id` FROM `phpcodes_folders` WHERE `id`='".$_GET['id']."'")->num_rows==0){
error('Папки не существует.');
}
$folder = $db->query("SELECT * FROM `phpcodes_folders` WHERE `id`='".$_GET['id']."'")->fetch_assoc();
?>
<div class="title"><a href="/phpcodes">Полезные PHP коды</a> | <?=htmlspecialchars($folder['name'])?></div>
<?
$nav=new navig("SELECT * FROM `phpcodes_codes` WHERE `folder`='".$_GET['id']."' AND `moderation`='1'");
$q = $db->query("SELECT * FROM `phpcodes_codes` WHERE `folder`='".$_GET['id']."' AND `moderation`='1' ORDER BY `id` DESC LIMIT ".$nav->start.",".$nav->nstr."");
while($c=$q->fetch_assoc()){
?>
<div class="section"><a href="/phpcodes/code/<?=$c['id']?>"><?=htmlspecialchars($c['name'])?></a></div>
<?
}
?>
<div class="nvgstr">
<?
$nav->panel();
?>
</div>
<?
if($db->query("SELECT `id` FROM `phpcodes_codes` WHERE `folder`='".$_GET['id']."'")->num_rows==0){
?>
<div class="error">Кодов в даной папке не найдено.</div>
<?
}
if(isset($user['id'])){
?>
<div class="nvg"><a href="/phpcodes/new_code/<?=$_GET['id']?>">Добавить код</a></div>
<?
}
include_once($_SERVER["DOCUMENT_ROOT"].'/style/foot.php');
?>