Файл: modules/domens/dirs.php
Строк: 40
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.org.ua *
**********************************/
$locate = 'in_share';
if(!isset($_GET['rid'])) { go('/domens/'); }
$rid = abs(intval($_GET['rid']));
if($db->query("SELECT * FROM `share` WHERE `id` = '". $rid ."'")->rowCount() == 0) {
$title = $lang->word('share');
require_once(SYS.'/view/header.php');
$tpl->div('menu', $lang->word('dir_not_exists'));
$tpl->div('block', HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
}
$sharef = $db->query("SELECT * FROM `share` WHERE `id` = '". $rid ."'")->fetch();
$title = $sharef['name'];
require_once(SYS.'/view/header.php');
$tpl->div('title', $sharef['name']);
$share_r = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $rid ."'")->rowCount();
if($share_r == 0) {
echo $tpl->div('menu', $lang->word('no_folders'));
}
else {
$share_q = $db->query("SELECT * FROM `share_c` WHERE `rid` = '". $rid ."' ORDER BY name");
while($share = $share_q->fetch()) {
$tpl->div('menu', img('folder.png') . ' <a href="/domens/folder/'. $share['id'] .'/">'. $share['name'] .'</a> ['. $db->query("SELECT * FROM `share_files` WHERE `cat_id` = '". $share['id'] ."'")->rowCount() .'] ' . ($user['level'] >= 6 ? ' <span style="float:right">( <a href="/domens/delete_folder/'.$share['id'].'/'. abs(intval($_GET['rid'])).'/">'.img('delete_11.png').'</a> | <a href="/domens/edit_folder/'.$share['id'].'/">'.img('edit_11.png').'</a> )</span>' : NULL) .' <br/>
<span style="font-size: xx-small;">'. $share['desc'] .'</span>');
}
}
$tpl->div('block', ($user['level'] >=6 ? NAV.' <a href="/domens/add_folder/'. $rid .'/">'. $lang->word('create_dir') .'</a><br/>' : NULL) . HICO .' <a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
?>