diff --git a/system/controllers/home.php b/system/controllers/home.php index 621a8967..3e99d443 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -100,25 +100,27 @@ $ui->assign('_bills', $_bill); // Sync plan to router if (isset($_GET['sync']) && !empty($_GET['sync'])) { foreach ($_bill as $tur) { - $p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']); - if ($p) { - $c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']); - if ($c) { - $dvc = Package::getDevice($p); - if ($_app_stage != 'demo') { - if (file_exists($dvc)) { - require_once $dvc; - (new $p['device'])->add_customer($c, $p); - } else { - new Exception(Lang::T("Devices Not Found")); + if($tur['status'] == 'on'){ + $p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']); + if ($p) { + $c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']); + if ($c) { + $dvc = Package::getDevice($p); + if ($_app_stage != 'demo') { + if (file_exists($dvc)) { + require_once $dvc; + (new $p['device'])->add_customer($c, $p); + } else { + new Exception(Lang::T("Devices Not Found")); + } } + $log .= "DONE : $ptur[namebp], $tur[type], $tur[routers]
"; + } else { + $log .= "Customer NOT FOUND : $tur[namebp], $tur[type], $tur[routers]
"; } - $log .= "DONE : $ptur[namebp], $tur[type], $tur[routers]
"; } else { - $log .= "Customer NOT FOUND : $tur[namebp], $tur[type], $tur[routers]
"; + $log .= "PLAN NOT FOUND : $tur[namebp], $tur[type], $tur[routers]
"; } - } else { - $log .= "PLAN NOT FOUND : $tur[namebp], $tur[type], $tur[routers]
"; } } r2(U . 'home', 's', $log); diff --git a/version.json b/version.json index 5695ed0e..cfbf489e 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.8.1.1" + "version": "2024.8.1.2" } \ No newline at end of file