diff --git a/system/controllers/pool.php b/system/controllers/pool.php index 69b06371..925f2ef5 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -15,9 +15,6 @@ if ($admin['user_type'] != 'Admin') { r2(U . "dashboard", 'e', $_L['Do_Not_Access']); } -use PEAR2\Net\RouterOS; - -require_once 'system/autoload/PEAR2/Autoload.php'; switch ($action) { case 'list': diff --git a/system/controllers/services.php b/system/controllers/services.php index ed44feb3..6dc69fdf 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -53,10 +53,10 @@ switch ($action) { $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { $ui->assign('d', $d); + $p = ORM::for_table('tbl_pool')->where('routers', $d['routers'])->find_many(); + $ui->assign('p', $p); $b = ORM::for_table('tbl_bandwidth')->find_many(); $ui->assign('b', $b); - $r = ORM::for_table('tbl_routers')->find_many(); - $ui->assign('r', $r); run_hook('view_edit_plan'); #HOOK $ui->display('hotspot-edit.tpl'); } else { @@ -96,6 +96,7 @@ switch ($action) { $validity = _post('validity'); $validity_unit = _post('validity_unit'); $routers = _post('routers'); + $pool_expired = _post('pool_expired'); $enabled = _post('enabled'); $msg = ''; @@ -151,6 +152,7 @@ switch ($action) { $d->validity_unit = $validity_unit; $d->shared_users = $sharedusers; $d->routers = $routers; + $d->pool_expired = $pool_expired; $d->enabled = $enabled; $d->save(); @@ -176,6 +178,7 @@ switch ($action) { $validity = _post('validity'); $validity_unit = _post('validity_unit'); $routers = _post('routers'); + $pool_expired = _post('pool_expired'); $enabled = _post('enabled'); $msg = ''; @@ -228,6 +231,7 @@ switch ($action) { $d->validity_unit = $validity_unit; $d->shared_users = $sharedusers; $d->routers = $routers; + $d->pool_expired = $pool_expired; $d->enabled = $enabled; $d->save(); @@ -260,8 +264,6 @@ switch ($action) { $ui->assign('_title', $_L['PPPOE_Plans']); $d = ORM::for_table('tbl_bandwidth')->find_many(); $ui->assign('d', $d); - $p = ORM::for_table('tbl_pool')->find_many(); - $ui->assign('p', $p); $r = ORM::for_table('tbl_routers')->find_many(); $ui->assign('r', $r); run_hook('view_add_ppoe'); #HOOK @@ -274,10 +276,10 @@ switch ($action) { $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { $ui->assign('d', $d); + $p = ORM::for_table('tbl_pool')->where('routers', $d['routers'])->find_many(); + $ui->assign('p', $p); $b = ORM::for_table('tbl_bandwidth')->find_many(); $ui->assign('b', $b); - $p = ORM::for_table('tbl_pool')->find_many(); - $ui->assign('p', $p); $r = ORM::for_table('tbl_routers')->find_many(); $ui->assign('r', $r); run_hook('view_edit_ppoe'); #HOOK @@ -312,6 +314,7 @@ switch ($action) { $validity_unit = _post('validity_unit'); $routers = _post('routers'); $pool = _post('pool_name'); + $pool_expired = _post('pool_expired'); $enabled = _post('enabled'); $msg = ''; @@ -359,6 +362,7 @@ switch ($action) { $d->validity_unit = $validity_unit; $d->routers = $routers; $d->pool = $pool; + $d->pool_expired = $pool_expired; $d->enabled = $enabled; $d->save(); @@ -377,6 +381,7 @@ switch ($action) { $validity_unit = _post('validity_unit'); $routers = _post('routers'); $pool = _post('pool_name'); + $pool_expired = _post('pool_expired'); $enabled = _post('enabled'); $msg = ''; @@ -423,6 +428,7 @@ switch ($action) { $d->validity_unit = $validity_unit; $d->routers = $routers; $d->pool = $pool; + $d->pool_expired = $pool_expired; $d->enabled = $enabled; $d->save(); diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index f24fbd1c..05f63cc9 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -340,3 +340,4 @@ $_L['Customer_can_deposit_money_to_buy_voucher'] = 'Pelanggan dapat topup saldo $_L['Allow_balance_transfer_between_customers'] = 'Bolehkan transfer saldo antar pelanggan'; $_L['Refill_Balance'] = 'Refill Balance'; $_L['Balance_Plans'] = 'Balance Plans'; +$_L['Expired_IP_Pool'] = 'Expired IP Pool'; diff --git a/system/updates.json b/system/updates.json index b400aaad..77023a3d 100644 --- a/system/updates.json +++ b/system/updates.json @@ -19,6 +19,7 @@ "ALTER TABLE `tbl_transactions` ADD `recharged_time` time NOT NULL DEFAULT '00:00:00' AFTER `recharged_on`;" ], "2023.9.5" : [ - "DROP TABLE `tbl_language`;" + "DROP TABLE `tbl_language`;", + "ALTER TABLE `tbl_plans` ADD `pool_expired` varchar(40) NOT NULL DEFAULT '' AFTER `pool`;" ] } \ No newline at end of file diff --git a/ui/ui/autoload-pool.tpl b/ui/ui/autoload-pool.tpl index bb1b6d75..c4f825de 100644 --- a/ui/ui/autoload-pool.tpl +++ b/ui/ui/autoload-pool.tpl @@ -1,4 +1,4 @@ - + {foreach $d as $ds} {/foreach} \ No newline at end of file diff --git a/ui/ui/autoload-server.tpl b/ui/ui/autoload-server.tpl index 9260b1b9..51e6616b 100644 --- a/ui/ui/autoload-server.tpl +++ b/ui/ui/autoload-server.tpl @@ -1,4 +1,4 @@ - + {foreach $d as $ds} {/foreach} \ No newline at end of file diff --git a/ui/ui/hotspot-add.tpl b/ui/ui/hotspot-add.tpl index 448dc26b..de325104 100644 --- a/ui/ui/hotspot-add.tpl +++ b/ui/ui/hotspot-add.tpl @@ -112,7 +112,8 @@
- + {foreach $r as $rs} {/foreach} @@ -120,9 +121,16 @@

{Lang::T('Cannot be change after saved')}

- +
+ +
+ +
+
-
+
Or {$_L['Cancel']}
diff --git a/ui/ui/hotspot-edit.tpl b/ui/ui/hotspot-edit.tpl index 769c2ff4..e1868445 100644 --- a/ui/ui/hotspot-edit.tpl +++ b/ui/ui/hotspot-edit.tpl @@ -114,9 +114,20 @@
+
+ +
+ +
+
-
+
Or {$_L['Cancel']}
diff --git a/ui/ui/hotspot.tpl b/ui/ui/hotspot.tpl index 1d26c376..a7d3acf8 100644 --- a/ui/ui/hotspot.tpl +++ b/ui/ui/hotspot.tpl @@ -35,6 +35,7 @@ {$_L['Data_Limit']} {$_L['Plan_Validity']} {$_L['Routers']} + {Lang::T('Expired IP Pool')} {$_L['Manage']} @@ -49,6 +50,7 @@ {$ds['data_limit']} {$ds['data_unit']} {$ds['validity']} {$ds['validity_unit']} {$ds['routers']} + {$ds['pool_expired']} {$_L['Edit']} {$_L['Delete']} diff --git a/ui/ui/pppoe-add.tpl b/ui/ui/pppoe-add.tpl index a79920d1..f3c0716b 100644 --- a/ui/ui/pppoe-add.tpl +++ b/ui/ui/pppoe-add.tpl @@ -60,7 +60,7 @@
- {foreach $r as $rs} @@ -72,14 +72,21 @@
-
-
-
+ +
+ +
+
+
+
Or {$_L['Cancel']}
diff --git a/ui/ui/pppoe-edit.tpl b/ui/ui/pppoe-edit.tpl index aa23412a..70833f63 100644 --- a/ui/ui/pppoe-edit.tpl +++ b/ui/ui/pppoe-edit.tpl @@ -62,7 +62,17 @@
+
+
+
+ +
+
diff --git a/ui/ui/pppoe.tpl b/ui/ui/pppoe.tpl index 6d14b1c7..e9d2ccb8 100644 --- a/ui/ui/pppoe.tpl +++ b/ui/ui/pppoe.tpl @@ -32,6 +32,7 @@ {$_L['Plan_Price']} {$_L['Plan_Validity']} {$_L['Pool']} + {Lang::T('Expired IP Pool')} {$_L['Routers']} {$_L['Manage']} @@ -44,6 +45,7 @@ {Lang::moneyFormat($ds['price'])} {$ds['validity']} {$ds['validity_unit']} {$ds['pool']} + {$ds['pool_expired']} {$ds['routers']} {$_L['Edit']} diff --git a/ui/ui/scripts/custom.js b/ui/ui/scripts/custom.js index 54e7f8bd..b7f9b122 100644 --- a/ui/ui/scripts/custom.js +++ b/ui/ui/scripts/custom.js @@ -14,7 +14,7 @@ $(document).ready(function () { $('#TimeLimit').show(); $('#DataLimit').show(); } - + if ($('#Unlimited').is(':checked')) { $('#Type').hide(); $('#TimeLimit').hide(); @@ -26,12 +26,12 @@ $(document).ready(function () { if ($('#Hotspot').is(':checked')) { $('#p').hide(); $('#h').show(); - } + } if ($('#PPPOE').is(':checked')) { $('#p').show(); $('#h').hide(); } - + }); }); $("#Hotspot").prop("checked", true).change(); @@ -48,6 +48,7 @@ $(document).ready(function(){ cache: false, success: function(msg){ $("#pool_name").html(msg); + $("#pool_expired").html(msg); } }); }); @@ -62,10 +63,10 @@ $(function() { dataType: "html", url: "index.php?_route=autoload/server", success: function(msg){ - $("#server").html(msg); + $("#server").html(msg); } }); - + $("#server").change(getAjaxAlamat); function getAjaxAlamat(){ var server = $("#server").val();