<?php
// Автор: Danis92
// Сайт: http://adminwap.ru
// Версия: 6.x.x
include_once 'sys/inc/start.php';
include_once 'sys/inc/compress.php';
include_once 'sys/inc/sess.php';
include_once 'sys/inc/home.php';
include_once 'sys/inc/settings.php';
include_once 'sys/inc/db_connect.php';
include_once 'sys/inc/ipua.php';
include_once 'sys/inc/fnc.php';
include_once 'sys/inc/user.php';
$set['title']='Полная статистика сайта';
include_once 'sys/inc/thead.php';
title();
err();
aut();

$day_st=mktime(0, 0, 0, date('n', time()), date('j',time()));
$day_fn=mktime(0, 0, 0, date('n', time()), date('j', time())+1);

if($_GET['act']=='posezalka')
{
echo"<div class='foot'>Посещаемость</div>\n";
$hit1=mysql_result(mysql_query("SELECT COUNT(*) FROM `visit_today`"),0);
$host1=mysql_result(mysql_query("SELECT COUNT(DISTINCT `ip`) FROM `visit_today`"),0);
$user_reg1=mysql_result(mysql_query("SELECT COUNT(*) FROM `user` WHERE `date_reg` >= '$day_st' AND `date_reg` < '$day_fn'"),0);
$hit=mysql_result(mysql_query("SELECT SUM(`hit`) FROM `visit_everyday`"),0) + mysql_result(mysql_query("SELECT COUNT(*) FROM `visit_today`"),0);
$host=mysql_result(mysql_query("SELECT SUM(`host`) FROM `visit_everyday`"),0) + mysql_result(mysql_query("SELECT COUNT(DISTINCT `ip`) FROM `visit_today`"),0);
$user_reg=mysql_result(mysql_query("SELECT COUNT(*) FROM `user`"),0);
echo "<div class='wm'>";
echo"<span class='ank_key'>Сегодня хостов:</span> $host1<br />\n";
echo"<span class='ank_key'>Сегодня хитов:</span> $hit1<br />\n";
echo"<span class='ank_key'>Сегодня регистраций:</span> $user_reg1<br />\n";
echo"<span class='ank_key'>Всего хостов:</span> $host<br />";
echo"<span class='ank_key'>Всего хитов:</span> $hit<br />";
echo"<span class='ank_key'>Всего регистраций:</span> $user_reg<br />";
include_once 'max_online.php';
echo"</div>";
echo "<div class='foot'>";
echo"&laquo;<a href='fullstats.php'>Назад</a><br />";
echo"</div>";

include_once 'sys/inc/tfoot.php';
}

if($_GET['act']=='content')
{
echo"<div class='foot'>Контент</div>\n";
$loads1=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$obmen1=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$lib1=mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$loads=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list`"),0);
$obmen=mysql_result(mysql_query("SELECT COUNT(*) FROM `obmennik_files`"),0);
$lib=mysql_result(mysql_query("SELECT COUNT(*) FROM `lib_files`"),0);

$all_size = mysql_fetch_row(mysql_query('SELECT SUM(`size`) FROM `loads_list` WHERE `size` > 0'));
if($all_size[0] < 1048576){
$all_size[0] = round($all_size[0]/1024, 2).'Kb';
}
else{
$all_size[0] = round($all_size[0]/1024/1024, 2).'Mb';
}
$all_loads = mysql_fetch_row(mysql_query('SELECT SUM(`loads`) FROM `loads_list` WHERE `size` > 0'));

$all_size1 = mysql_fetch_row(mysql_query('SELECT SUM(`size`) FROM `obmennik_files` WHERE `size` > 0'));

if($all_size1[0] < 1048576){
$all_size1[0] = round($all_size1[0]/1024, 2).'Kb';
}
else{
$all_size1[0] = round($all_size1[0]/1024/1024, 2).'Mb';
}

$all_loads1 = mysql_fetch_row(mysql_query('SELECT SUM(`k_loads`) FROM `obmennik_files` WHERE `size` > 0'));

echo "<div class='wm'>";
echo"<span class='ank_key'>Сегодня новых загрузок:</span> $loads1<br />\n";
echo"<span class='ank_key'>Сегодня новых файлов в обменнике:</span> $obmen1<br />\n";
echo"<span class='ank_key'>Сегодня новых статей:</span> $lib1<br />\n";
echo"<span class='ank_key'>Всего загрузок:</span> $loads<br />\n";
echo"<span class='ank_key'>Всего скачиваний в загрузцентре:</span> $all_loads[0]<br />\n";
echo"<span class='ank_key'>Объем загрузок в загрузцентре:</span> $all_size[0]<br />\n";
echo"<span class='ank_key'>Всего файлов в обменнике:</span> $obmen<br />\n";
echo"<span class='ank_key'>Всего скачиваний в файлобменнике:</span> $all_loads1[0]<br />\n";
echo"<span class='ank_key'>Объем файлов в файлообменнике:</span> $all_size1[0]<br />\n";
echo"<span class='ank_key'>Всего статей</span> $lib<br />\n";
echo"</div>";
echo "<div class='foot'>";
echo"&laquo;<a href='fullstats.php'>Назад</a><br />";
echo"</div>";

include_once 'sys/inc/tfoot.php';
}

if($_GET['act']=='info')
{
echo"<div class='foot'>Информация о разделах сайта</div>\n";
$forum_them1=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t` WHERE `time_create` >= '$day_st' AND `time_create` < '$day_fn'"),0);
$forum_post1=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$news1=mysql_result(mysql_query("SELECT COUNT(*) FROM `news` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$guest1=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$gallery1=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery` WHERE `time_create` >= '$day_st' AND `time_create` < '$day_fn'"),0);
$loads1=mysql_result(mysql_query("SELECT COUNT(*) FROM `loads_list` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$blog1=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_list` WHERE `time` >= '$day_st' AND `time` < '$day_fn'"),0);
$forum_them=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_t`"),0);
$forum_post=mysql_result(mysql_query("SELECT COUNT(*) FROM `forum_p`"),0);
$news=mysql_result(mysql_query("SELECT COUNT(*) FROM `news`"),0);
$guest=mysql_result(mysql_query("SELECT COUNT(*) FROM `guest`"),0);
$gallery=mysql_result(mysql_query("SELECT COUNT(*) FROM `gallery`"),0);
$blog=mysql_result(mysql_query("SELECT COUNT(*) FROM `blog_list`"),0);
$votes=mysql_result(mysql_query("SELECT COUNT(*) FROM `votes`"),0);
echo "<div class='wm'>";
echo"<span class='ank_key'>Сегодня новых тем в форуме:</span> $forum_them1<br />";
echo"<span class='ank_key'>Сегодня новых сообщений в форум:</span> $forum_post1<br />";
echo"<span class='ank_key'>Сегодня новых новостей:</span> $news1<br />";
echo"<span class='ank_key'>Сегодня новых сообщений в гостевой:</span> $guest1<br />";
echo"<span class='ank_key'>Сегодня новых фотоальбомов:</span> $gallery1<br />";
echo"<span class='ank_key'>Сегодня новых записей в блоге:</span> $blog1<br />";
echo"<span class='ank_key'>Всего тем в форуме:</span> $forum_them<br />";
echo"<span class='ank_key'>Всего сообщений в форуме:</span> $forum_post<br />";
echo"<span class='ank_key'>Всего новостей:</span> $news<br />";
echo"<span class='ank_key'>Всего сообщений в гостевой:</span> $guest<br />";
echo"<span class='ank_key'>Всего фотоальбомов:</span> $gallery<br />";
echo"<span class='ank_key'>Всего голосований:</span> $votes<br />";
echo"<span class='ank_key'>Всего записей в блоге:</span> $blog<br />";
echo"</div>";
echo "<div class='foot'>";
echo"&laquo;<a href='fullstats.php'>Назад</a><br />";
echo"</div>";

include_once 'sys/inc/tfoot.php';
}
echo "<div class='anton'><img src='/style/icons/st.png' alt='' /> <a href='fullstats.php?act=posezalka'>Посещаемость сайта</a><br/></div>";
echo "<div class='anton'><img src='/style/icons/st.png' alt='' /> <a href='fullstats.php?act=content'>Контент сайта</a><br/></div>";
echo "<div class='anton'><img src='/style/icons/st.png' alt='' /> <a href='fullstats.php?act=info'>Информация о разделах сайта</a><br/></div>";


echo "<div class='foot'>";
echo"&laquo;<a href='/index.php'>Назад</a><br />";
echo"</div>";

include_once 'sys/inc/tfoot.php';
?>
