Файл: download/files.php
Строк: 61
<?
////////////////////////////////////////
///// Kyber ApiCMS 2013 apicms.ru //////
///// Запрещается продажа данной CMS ///
///// Автор Евгений Медянкин Kyber /////
///// ICQ 626-000-895 или 37-22-47 /////
////////////////////////////////////////
/////////////////////////////////////////
require_once '../api_core/apicms_system.php';
/////////////////////////////////////////
if (isset($_GET['id']))$razdel_id = intval($_GET['id']);
$razd_name = mysql_fetch_assoc(mysql_query("SELECT * FROM `download_podcat` WHERE `id` = '$razdel_id' LIMIT 1"));
$title = 'APICMS - '.htmlspecialchars($razd_name['name']).'';
require_once '../api_core/head.php';
/////////////////////////////////////////
if (isset($_GET['id']) && mysql_result(mysql_query("SELECT COUNT(*) FROM `download_podcat` WHERE `id` = '".$razdel_id."'"),0)==1){
$k_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `download_files` WHERE `id_cat` = '$razdel_id'"),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 `download_files` WHERE `id_cat` = '$razdel_id' ORDER BY id DESC LIMIT $start, $api_settings[on_page]");
while ($a = mysql_fetch_assoc($qii)){
$who_load = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = $a[id_user] LIMIT 1"));
echo '<div class="subhead"><table width="100%" ><tr><td width="10%"><center>';
if ($a['ras']=='rar')echo " <img src='/design/download/rar.png'/> ";
if ($a['ras']=='zip')echo " <img src='/design/download/zip.png'/> ";
if ($a['ras']=='mp3')echo " <img src='/design/download/mp3.png'/> ";
if ($a['ras']=='jar')echo " <img src='/design/download/jar.png'/> ";
if ($a['ras']=='3gp')echo " <img src='/design/download/3gp.png'/> ";
if ($a['ras']=='avi')echo " <img src='/design/download/avi.png'/> ";
if ($a['ras']=='pdf')echo " <img src='/design/download/pdf.png'/> ";
if ($a['ras']=='txt')echo " <img src='/design/download/txt.png'/> ";
if ($a['ras']=='apk')echo " <img src='/design/download/apk.png'/> ";
echo '</center></td><td width="90%"> <a href="del_file.php?id='.$a['id'].'"> <img src="/design/download/del.png"> </a> ';
echo '<a href="file.php?id='.$a['id'].'"><b>'.$a['name'].'</b></a> </br> <small>Выгрузил: '.$who_load['login'].' </br>';
echo '</td></tr></table></div>';
}
/////////////////////////////////////////
if ($k_page > 1){
echo '<div class="subhead"><center>';
str('files.php?id='.$razdel_id.'&',$k_page,$page); // генерируем постраничную навигацию
echo '</center></div>';
}
echo '</center></div>';
}else{
echo "<div class='erors'><center>Извините, раздела не существует</center></div>n";
}
/////////////////////////////////////////
apicms_foot();
?>