Файл: app/doc/stat.php
Строк: 19
<?php
$allShop = $db->prepare('SELECT * FROM `shop`');
$allShop -> execute();
$allShop = $allShop -> rowCount();
$moneyUs = $db->prepare('SELECT * FROM `users`');
$moneyUs -> execute();
$moneyUs = $moneyUs -> rowCount();
$month = $db->prepare('SELECT SUM(`summa`) as sum FROM `payments` WHERE `test` = ? and `status` = ? and `time` > ?');
$month -> execute([0,3,time()-86400*30]);
$month = $month ->fetch(PDO :: FETCH_ASSOC);
if(empty($day['sum'])) $day['sum'] = 0;
echo $template->render('doc.stat', ['allShop'=>$allShop,'moneyUs'=>$moneyUs,'month'=>$month, 'stat_active' => 'active']);