Файл: app/index.php
Строк: 29
<?php
$allShop = $db->prepare('SELECT * FROM `shop`');
$allShop -> execute();
$allShop = $allShop -> rowCount();
$moneyUs = $db->prepare('SELECT * FROM `users`');
$moneyUs -> execute();
$moneyUs = $moneyUs -> rowCount();
$moneypay = $db->prepare('SELECT * FROM `payments`');
$moneypay -> execute();
$moneypay = $moneypay -> rowCount();
$month = $db->prepare('SELECT SUM(`summa`) as sum FROM `payments` WHERE `test` = ? and `status` = ?');
$month -> execute([0,3]);
$month = $month ->fetch(PDO :: FETCH_ASSOC);
echo $template->render('index', ['allShop'=>$allShop,'moneyUs'=>$moneyUs,'moneypay'=>$moneypay,'month'=>number_format($month['sum']/1000,1), 'index_active' => 'active']);