<?php
require_once('../classes/body.class.php');
require_once('../classes/db.class.php');
require_once('../classes/system.class.php');
$title= new Body;
$title->SetTitle('Панель управления - Биллинг');
$title->GetHeader();
if ($b['level'] < 5) {
header('location: /');
die();
}
echo '<div class="tile"><div class="t-header th-alt bg-teal"><div class="th-title"><i class="zmdi zmdi-widgets"></i><a href="/"style="text-decoration:none; color:white;"> Главная</a> :: <a href="/administration/"style="text-decoration:none; color:white;"> Дата-центр</a> :: Биллинг</div></div>';
$pay = DB::$dbs->querySingle("SELECT COUNT(*) FROM pay WHERE type = ?", [3]);
$out = DB::$dbs->querySingle("SELECT COUNT(*) FROM billing_out WHERE type = ?", [0]);
echo '<ul class="nav nav-pills nav-stacked"><li><a href="pay.html" ><i class="zmdi zmdi-shuffle"></i>  Неоплаченные счета '.($pay > 0 ? '(<font color="red">+'.$pay.'</font>)':NULL).'</a></ul>';
echo '<ul class="nav nav-pills nav-stacked"><li><a href="wmout.html" ><i class="zmdi zmdi-shuffle"></i>  Вывод средств '.($out > 0 ? '(<font color="red">+'.$out.'</font>)':NULL).'</a></ul>';
echo '<ul class="nav nav-pills nav-stacked"><li><a href="bill_log.html" ><i class="zmdi zmdi-shuffle"></i>  Логи платежей (' . DB::$dbs -> querySingle ("SELECT COUNT(*) FROM `bill_log`") . '/<font color="red">+' . DB::$dbs->querySingle ("SELECT COUNT(*) FROM `bill_log` WHERE `time`> ?", [time()-86400]) . '</font>)</a></ul>';
echo '<ul class="nav nav-pills nav-stacked"><li><a href="ex_hist.html" ><i class="zmdi zmdi-shuffle"></i>  История обмена Gears ('.DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `billing_ex`"). '/<font color="red">+' . DB::$dbs->querySingle ("SELECT COUNT(*) FROM `billing_ex` WHERE `time`> ?", [time()-86400]) . '</font>)</a></ul>';
echo '<ul class="nav nav-pills nav-stacked"><li><a href="perevs_list.html" ><i class="zmdi zmdi-shuffle"></i>  История перевода средств ('.DB :: $dbs -> querySingle ("SELECT COUNT(id) FROM `billing_perevod`"). ')</a></ul></div>';

$title->GetMenu();
$title->GetFooter();
?>