Файл: pages/_stat.php
Строк: 136
<?PHP
$_OPTIMIZATION["title"] = "Аккаунт - Профиль";
$tfstats = time() - 60*60*48;
$db->Query("SELECT
(SELECT COUNT(*) FROM db_users_a) all_users,
(SELECT SUM(insert_sum) FROM db_users_b) all_insert,
(SELECT SUM(payment_sum) FROM db_users_b) all_payment,
(SELECT COUNT(*) FROM db_users_a WHERE date_reg > '$tfstats') new_users");
$stats_data = $db->FetchArray();
?>
<?PHP
$db->Query("SELECT
COUNT(id) all_users,
SUM(money_b) money_b,
SUM(money_p) money_p,
SUM(a_b) a_b,
SUM(b_b) b_b,
SUM(c_b) c_b,
SUM(d_b) d_b,
SUM(e_b) e_b,
SUM(f_b) f_b,
SUM(all_time_a) all_time_a,
SUM(all_time_b) all_time_b,
SUM(all_time_c) all_time_c,
SUM(all_time_d) all_time_d,
SUM(all_time_e) all_time_e,
SUM(all_time_f) all_time_f,
SUM(payment_sum) payment_sum,
SUM(insert_sum) insert_sum
FROM db_users_b");
$data_stats = $db->FetchArray();
$db->Query("SELECT
SUM(a_t) a_t,
SUM(b_t) b_t,
SUM(c_t) c_t,
SUM(d_t) d_t,
SUM(e_t) e_t,
SUM(f_t) f_t
FROM db_voin");
$data_stats1 = $db->FetchArray();
?>
<?php
$ddd = time() - 60*60*24;
$db->Query("SELECT * FROM db_users_a WHERE date_login >= '$ddd'");
?>
<center><b>Online</b> Посетили за сутки:<br>
<?php
while($users = $db->FetchArray()){
?>
<?=$users["user"];?>.</center>
<?php
}
?>
<div class="block1
"><div class="h-title1
">Статистика по проекту</div></div>
<div class="block2"><br>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="2" align="center"> </td></tr>
<tr>
<td align="left" style="padding:3px;"><b>Пользователей:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><?=$stats_data["all_users"]; ?> чел.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Новых за 48 часов:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><?=($stats_data["new_users"]+0); ?> чел.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Выплачено всего:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><?=sprintf("%.2f",$stats_data["all_payment"]); ?></a></font><font color="#ffff00"> руб.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Резерв проекта:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><?=sprintf("%.2f",$stats_data["all_insert"]+0); ?><font color="#ffff00"> руб.</font></font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<?php
$data_trees_all=intval($data_stats1["a_t"])+intval($data_stats1["b_t"])+intval($data_stats1["c_t"])+intval($data_stats1["d_t"])+intval($data_stats1["e_t"])+intval($data_stats1["f_t"])+intval($data_stats["g_t"]);
?>
<td align="left" style="padding:3px;"><b>Куплено/Нанято (Авто/Механиков) всего:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><?=$data_trees_all; ?> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
</table>
</div>
<div class="block3"></div>
<div class="clr"></div>
<div class="clr"></div>
<div class="block1
"><div class="h-title1
">Статистика по Автомобилям и Механикам</div></div>
<div class="block2"><br>
<table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
<tr><td colspan="2" align="center"> </td></tr>
<tr>
<td align="left" style="padding:3px;"><b>Porsche 991 Carrera S:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["a_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Ferrari 458 Italia:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["b_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Bugatti Veyron 16.4:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["c_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Младший Механик:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["d_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Механик:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["e_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
<tr>
<td align="left" style="padding:3px;"><b>Старший Мехханик:</b></td>
<td align="left" style="padding:3px;"><font color="#ffff00"><b><?=intval($data_stats1["f_t"]); ?></b> шт.</font></td>
</tr>
<tr>
<td colspan="2">
<hr>
</td>
</tr>
</table>
</div>
<div class="block3"></div>
<div class="clr"></div>
<div class="clr"></div>