Файл: public_html/modules/library/index.php
Строк: 26
<?php
/**********************************
* @package: PerfCMS *
* @year: 2012 *
* @author: Artas *
* @link: http://perfcms.net *
* ------------------------------- *
* @package: PerfCMS Ultra *
* @year: 2013 *
* @author: wanya26ua & Tesla *
* @link: http://perfclub.ru *
**********************************/
$locate = 'in_library';
$title = $lang->word('library');
require_once(SYS.'/view/header.php');
$tpl->div('title', $lang->word('library'));
$cats_c = $db->query("SELECT * FROM `library_cats`")->rowCount();
$pages = new Paginator($cats_c, $ames);
if($cats_c == 0)
{
$tpl->div('menu', $lang->word('no_cat'));
} else {
$cat_sql = $db->query("SELECT * FROM `library_cats` ORDER by id DESC LIMIT $start, $ames");
while($cat = $cat_sql->fetch()) {
$tpl->div('menu', img('folder.png') .'<a href="/library/cat/'.$cat['id'] .'/">'.$cat['title'] .'</a> ['.$db->query("SELECT * FROM `library` WHERE `id_cat` = '".$cat['id']."' ")->rowCount().'] '.($user['level'] >= 6 ? '<span style="float:right">( <a href="/library/del_cat/?id='.$cat['id'] .'">'. img('delete_11.png') .'</a> | <a href="/library/edit_cat/?id='. $cat['id'] .'">'. img('edit_11.png') .'</a> )</span>' : NULL) .'');
}
$pages->view('/library/?');
}
$add_cat = ''.(isset($user) && $user['level'] >= '5' ? NAV .'<a href="/library/add_lib_cat/">'. $lang->word('add_cat') .'</a><br/>' : NULL).'';
$tpl->div('block', $add_cat . NAV .'<a href="/library/search/">'. $lang->word('search').'</a><br/>'. HICO .'<a href="/">'. $lang->word('home').'</a>');
require_once(SYS.'/view/footer.php');
?>