<?php
include "config.php";
include "mikrotik.php";

$now = date("H:i");

$offers = $conn->query("
SELECT * FROM offers
WHERE is_active=1
AND start_time <= '$now'
AND end_time >= '$now'
");

while($o = $offers->fetch_assoc()){
    $subs = $conn->query("SELECT * FROM subscribers WHERE status='active'");
    while($s = $subs->fetch_assoc()){
        sendToMikrotik($s['ip_address'], $o['extra_speed']);
    }
}
?>
