Update Banyak

This commit is contained in:
WD - Dev
2025-09-21 21:40:17 +07:00
parent c6bee729c5
commit efca8f5f80
145 changed files with 195185 additions and 1378 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
include "/www/wwwroot/bilspro/config/connect.php";
include "/www/wwwroot/bilspro/config/routeros_api.class.php";
include "/www/wwwroot/bilspro/controller/remoteModem.php";
// Kurangi 30 menit dari waktu sekarang
$date = date('Y-m-d H:i:s', strtotime('-20 minutes'));
$stmt = $pdo->prepare("SELECT id_setting_mikrotik, remote_port
FROM log_remote
WHERE aktif_time <= :date
LIMIT 1");
$stmt->execute([':date' => $date]);
$data = $stmt->fetch(PDO::FETCH_ASSOC);
if ($data) {
// Tutup remote yang sudah expired
$remote = new RemoteModem($pdo);
$result = $remote->remote_close($data['id_setting_mikrotik'], $data['remote_port']);
echo "[" . date('Y-m-d H:i:s') . "] Remote port " . $data['remote_port'] . " berhasil ditutup.\n";
} else {
// Tidak ada yang perlu dihapus
echo "[" . date('Y-m-d H:i:s') . "] Tidak ada remote expired.\n";
}