Fix daily_summary dan hourly_summary aggregation, tambah fallback logic untuk dashboard, update validator untuk camera dan location type
This commit is contained in:
34
bin/check_gates.php
Normal file
34
bin/check_gates.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use App\Config\AppConfig;
|
||||
use App\Support\Database;
|
||||
|
||||
AppConfig::loadEnv(__DIR__ . '/..');
|
||||
|
||||
$db = Database::getConnection(
|
||||
AppConfig::get('DB_HOST'),
|
||||
AppConfig::get('DB_NAME'),
|
||||
AppConfig::get('DB_USER'),
|
||||
AppConfig::get('DB_PASS')
|
||||
);
|
||||
|
||||
echo "=== Gates in database ===\n\n";
|
||||
|
||||
$stmt = $db->query('SELECT location_code, gate_code, name, direction, camera, is_active FROM gates ORDER BY location_code, gate_code');
|
||||
$gates = $stmt->fetchAll();
|
||||
|
||||
if (empty($gates)) {
|
||||
echo "No gates found in database!\n";
|
||||
} else {
|
||||
echo "Total gates: " . count($gates) . "\n\n";
|
||||
foreach ($gates as $gate) {
|
||||
echo "Location: {$gate['location_code']}\n";
|
||||
echo " Gate Code: {$gate['gate_code']}\n";
|
||||
echo " Name: {$gate['name']}\n";
|
||||
echo " Direction: {$gate['direction']}\n";
|
||||
echo " Camera: " . ($gate['camera'] ?: 'NULL') . "\n";
|
||||
echo " Active: " . ($gate['is_active'] ? 'Yes' : 'No') . "\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user