View file billing/stat.php

File size: 2.56Kb
<?
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';
include_once '../sys/inc/shif.php';



$set['title']='Статистика биллинга';
include_once '../sys/inc/thead.php';
title();
err();
aut();
only_reg();
$stat = mysql_fetch_assoc(mysql_query("select `stat` from `billing` "));

if($stat['stat'] == 1) { 
only_reg(); }
else {
only_level(4);
}

$vsego=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` "),0);
echo '<div class="main_menu"> Всего операций: <b> '.$vsego.'  </b> </div>';

$sgdn=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `time` > '".(time()-3600*24)."' "),0);
echo '<div class="main_menu"> За 24 часов: <b> '.$sgdn.'  </b> </div>';

$pop=mysql_result(mysql_query("select sum(wmr) from `billing_operations` where `op` = 'add' "),0);
if($pop == NULL) $pop2 = 0;
else $pop2 = mysql_result(mysql_query("select sum(wmr) from `billing_operations` where `op` = 'add' "),0);

echo '<div class="main_menu"> Пополнений на сумму: <b> '.$pop2.' wmr </b> </div>';

$op1=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'add' "),0);
echo '<hr /><div class="main_menu"> Пополнений счета: <b> '.$op1.'  </b>  </div>';

$op2=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'nick' "),0);
echo '<div class="main_menu"> Смена ника: <b> '.$op2.'  </b> </div>';


$op3=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'perevod' "),0);
echo '<div class="main_menu"> Переводов: <b> '.$op3.'  </b> </div>';

$op4=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'balls' "),0);
echo '<div class="main_menu"> Покупка баллов: <b> '.$op4.'  </b> </div>';

$op5=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'money' "),0);
echo '<div class="main_menu"> Покупка монет: <b> '.$op5.'  </b> </div>';

$op6=mysql_result(mysql_query("SELECT COUNT(*) FROM `billing_operations` where `op` = 'icon' "),0);
echo '<div class="main_menu"> Покупка иконок: <b> '.$op6.'  </b> </div>';

echo '<div class="foot"><img src="img/billing.png"> <a href="index.php">Биллинг</a></div>';

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