diff --git a/system/controllers/dashboard.php b/system/controllers/dashboard.php index 387ddaa4..ab7411c5 100644 --- a/system/controllers/dashboard.php +++ b/system/controllers/dashboard.php @@ -24,7 +24,6 @@ $reset_day = $config['reset_day']; if(empty($reset_day)){ $reset_day = 1; } -$reset_day = 20; //first day of month if($reset_day >= date("d")){ $first_day_month = date('Y-m-'.$reset_day); diff --git a/system/controllers/services.php b/system/controllers/services.php index 1c2eaac5..f2307fff 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -19,33 +19,33 @@ switch ($action) { case 'sync': set_time_limit(-1); if ($routes['2'] == 'hotspot') { - $plans = ORM::for_table('tbl_bandwidth')->left_outer_join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->where('tbl_plans.enabled', '1')->find_many(); + $plans = ORM::for_table('tbl_plans')->where('type', 'Hotspot')->find_many(); $log = ''; - $router = ''; foreach ($plans as $plan) { $dvc = Package::getDevice($plan); if ($_app_stage != 'demo') { if (file_exists($dvc)) { require_once $dvc; - (new $p['device'])->add_plan($plan); + (new $plan['device'])->add_plan($plan); + $log .= "DONE : $plan[name_plan], $plan[device]
"; } else { - new Exception(Lang::T("Devices Not Found")); + $log .= "FAILED : $plan[name_plan], $plan[device] | Device Not Found
"; } } } r2(U . 'services/hotspot', 's', $log); } else if ($routes['2'] == 'pppoe') { - $plans = ORM::for_table('tbl_bandwidth')->left_outer_join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->where('tbl_plans.enabled', '1')->find_many(); + $plans = ORM::for_table('tbl_plans')->where('type', 'PPPOE')->find_many(); $log = ''; - $router = ''; foreach ($plans as $plan) { $dvc = Package::getDevice($plan); if ($_app_stage != 'demo') { if (file_exists($dvc)) { require_once $dvc; - (new $p['device'])->add_plan($plan); + (new $plan['device'])->add_plan($plan); + $log .= "DONE : $plan[name_plan], $plan[device]
"; } else { - new Exception(Lang::T("Devices Not Found")); + $log .= "FAILED : $plan[name_plan], $plan[device] | Device Not Found
"; } } } diff --git a/system/lan/english.json b/system/lan/english.json index 8635cc24..246fcde4 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -645,5 +645,6 @@ "later": "later", "Package_Details": "Package Details", "Summary": "Summary", - "Devices_Not_Found": "Devices Not Found" + "Devices_Not_Found": "Devices Not Found", + "Income_reset_date": "Income reset date" } \ No newline at end of file diff --git a/ui/ui/app-settings.tpl b/ui/ui/app-settings.tpl index 37ecad48..3807a3c4 100644 --- a/ui/ui/app-settings.tpl +++ b/ui/ui/app-settings.tpl @@ -96,6 +96,15 @@

This used for admin to select payment in recharge, using comma for every new options

+ +
+ +
+ +
+ Income will reset every this day +