Файл: mlord.ru/admin/stat.php
Строк: 64
<?
require_once('../core/index.php');
require_once('../core/func.php');
admin(1);
$title='Статистика';
require_once('../design/head.php');
$count=$db->query("SELECT id FROM `users`")->rowCount();
$count_s=$db->query("SELECT id FROM `users` where `rasa`='1'")->rowCount();
$count_t=$db->query("SELECT id FROM `users` where `rasa`='2'")->rowCount();
echo '<div class="h2">Игроков: '.$count.'<br/> a) Спарта: '.$count_s.'<br/> a) Троя: '.$count_t.'</div>';
$count=$db->query("SELECT id FROM `them`")->rowCount();
echo '<div class="h2">Топиков в форуме всего: '.$count.'</div>';
$count=$db->query("SELECT id FROM `com_them`")->rowCount();
echo '<div class="h2">Комментариев к топикам всего: '.$count.'</div>';
$days_them=$db->query("SELECT id FROM `them` WHERE `time`>'".(time()-60*60*24)."'")->rowCount();
$days_com=$db->query("SELECT id FROM `com_them` WHERE `time`>'".(time()-60*60*24)."'")->rowCount();
echo '<div class="h2"><b>За сутки:</b><br/><table width="100%" cellspacing="1"><tr>
<td align="center" width="50%" style="border:1px solid #000">Топики</td>
<td align="center" width="50%" style="border:1px solid #000">Комментарии</td>
</tr><tr>
<td align="center" width="50%" style="border:1px solid #000">'.$days_them.'</td>
<td align="center" width="50%" style="border:1px solid #000">'.$days_com.'</td>
</tr></table></div>';
$start=mktime(date("H"), 0, 0, date("m")-1, date("d"), date("Y"));
$finish=mktime(date("H"), 0, 0, date("m"), date("d"), date("Y"));
$mes_them=$db->query("SELECT id FROM `them` WHERE `time` BETWEEN '".$start."' AND '".$finish."'")->rowCount();
$mes_com=$db->query("SELECT id FROM `com_them` WHERE `time` BETWEEN '".$start."' AND '".$finish."'")->rowCount();
echo '<div class="h2"><b>За месяц:</b><br/><table width="100%" cellspacing="1"><tr>
<td align="center" width="50%" style="border:1px solid #000">Топики</td>
<td align="center" width="50%" style="border:1px solid #000">Комментарии</td>
</tr><tr>
<td align="center" width="50%" style="border:1px solid #000">'.$mes_them.'</td>
<td align="center" width="50%" style="border:1px solid #000">'.$mes_com.'</td>
</tr></table></div>';
$start_m=mktime(date("H"), 0, 0, date("m")-1, date("d"), date("Y"));
$finish_m=mktime(date("H"), 0, 0, date("m"), date("d")+1, date("Y"));
$days_us=$db->query("SELECT id FROM `users` WHERE `time_reg`>'".(time()-60*60*24)."'")->rowCount();
$mes_us=$db->query("SELECT id FROM `users` WHERE `time_reg` BETWEEN '".$start_m."' AND '".$finish_m."'")->rowCount();
echo '<div class="h2"><b>Новых игроков:</b><br/><table width="100%" cellspacing="1"><tr>
<td align="center" width="50%" style="border:1px solid #000">За сутки</td>
<td align="center" width="50%" style="border:1px solid #000">За месяц</td>
</tr><tr>
<td align="center" width="50%" style="border:1px solid #000">'.$days_us.'</td>
<td align="center" width="50%" style="border:1px solid #000">'.$mes_us.'</td>
</tr></table></div>';
echo '<div class="rzd"></div><div class="h2"><a href=/admin>Адм. панель</a></div>';
require_once('../design/foot.php');
?>