Initial commit
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
function spbu_stats($conn) {
|
||||
$total = (int) $conn->query("SELECT COUNT(*) c FROM tempat")->fetch_assoc()['c'];
|
||||
$jam24 = (int) $conn->query("SELECT COUNT(*) c FROM tempat WHERE status='24 Jam'")->fetch_assoc()['c'];
|
||||
$tidak24 = $total - $jam24;
|
||||
$pct24 = $total > 0 ? round($jam24 / $total * 100) : 0;
|
||||
return compact('total', 'jam24', 'tidak24', 'pct24');
|
||||
}
|
||||
Reference in New Issue
Block a user