Файл: stat.php
Строк: 30
<?php
/**
* @author [FaNiska]
* @copyright 2009
* Загруз центр
* Предложения, идеи, вопросы и об ошибках писать в icq 65-64-538 или на mobi-m-ru@ya.ru
*/
include 'inc/db_connect.php';
include 'inc/function.php';
include 'inc/set.php';
include 'inc/head.php';
$query = mysql_query('SELECT `id`, `s_name` FROM `category` WHERE `s_name`!="vlink" && `s_name`!="vrazdel" && `s_name`!="link";');
$size = $files = $newfiles = $loads = 0;
while ($papka = mysql_fetch_array($query))
{
$table = str_replace('files/', '', $papka['s_name']);
$all_size = mysql_fetch_row(mysql_query('SELECT SUM(`size`) FROM `' . $table . '` WHERE `type`=2'));
$size = $size + $all_size['0'];
$all_files = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `' . $table . '` WHERE `type`=2;'));
$files = $files + $all_files['0'];
$all_newfiles = mysql_fetch_row(mysql_query('SELECT COUNT(*) FROM `' . $table . '` WHERE `type`=2 AND `up_time`>' . $new_time . ';'));
$newfiles = $newfiles + $all_newfiles['0'];
$all_loads = mysql_fetch_row(mysql_query('SELECT SUM(`count`) FROM `' . $table . '` WHERE `type`=2'));
$loads = $loads + $all_loads['0'];
}
echo '<div class="title">Статистика загруз центра</div>';
echo '<div>Всего файлов: ' . $files . ' шт.</div>';
echo '<div>Новых файлов: ' . $newfiles . ' шт.</div>';
echo '<div>Общий размер: ' . size_file($size) . '</div>';
echo '<div>Всего загрузок: ' . $loads . '</div>';
include 'inc/foot.php';
?>