Файл: api_lib/index.php
Строк: 39
<?
////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////
/////////////////////////////////////////
$title = 'Библиотека';
require_once '../api_core/apicms_system.php';
require_once '../design/styles/'.htmlspecialchars($api_design).'/head.php';
/////////////////////////////////////////
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `api_lib_cat`"),0);
$k_page=k_page($k_post,$api_settings['on_page']);
$page=page($k_page);
$start=$api_settings['on_page']*$page-$api_settings['on_page'];
if ($k_post==0)echo "<div class='erors'><center>Разделов не найдено!</center></div>";
/////////////////////////////////////////
$qii=mysql_query("SELECT * FROM `api_lib_cat` ORDER BY id DESC LIMIT $start, $api_settings[on_page]");
while ($post_lib = mysql_fetch_assoc($qii)){
$counts = mysql_result(mysql_query("SELECT COUNT(*) FROM `api_lib_article` WHERE `cat` = '$post_lib[id]'"), 0);
echo '<div class="apicms_subhead"><table width="100%" ><tr><td width="10%"><center><img src="/design/styles/'.htmlspecialchars($api_design).'/lib/cat.png">';
echo "</center></td><td width='90%'>";
if ($user['level']==1 or $user['level']==2) echo ' <a href="delete_cat.php?id='.$post_lib['id'].'"><img src="/design/styles/'.htmlspecialchars($api_design).'/lib/del_cat.png"></a> ';
echo "<a href='article_list.php?id=$post_lib[id]'><b>".htmlspecialchars($post_lib['name'])." </b></a> </br>";
if ($post_lib['opis']!=NULL)echo ''.htmlspecialchars($post_lib['opis']).'';
echo " <span style='float:right'> Статей: ".$counts." </small></span></br></td></tr></table></div>";
}
/////////////////////////////////////////
if ($k_page > 1){
echo '<div class="apicms_subhead"><center>';
str('index.php?',$k_page,$page); // генерируем постраничную навигацию
echo '</center></div>';
}
/////////////////////////////////////////
if ($user['level']==1 or $user['level']==2)echo "<div class='apicms_subhead'> <table width='100%' ><tr><td width='50%'><center> <a href='lib_cat.php'>Создать раздел</a> </center></td><td width='50%'><center> <a href='new_article.php'>Создать статью</a></center></td></tr></table></div>";
/////////////////////////////////////////
require_once '../design/styles/'.htmlspecialchars($api_design).'/footer.php';
?>