diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql index 826d30db..66eefea0 100644 --- a/install/phpnuxbill.sql +++ b/install/phpnuxbill.sql @@ -203,6 +203,8 @@ ALTER TABLE `tbl_users` CHANGE `user_type` `user_type` ENUM('SuperAdmin','Admin' ALTER TABLE `tbl_users` CHANGE `password` `password` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL; ALTER TABLE `tbl_users` ADD `phone` VARCHAR(32) NOT NULL DEFAULT '' AFTER `password`, ADD `email` VARCHAR(128) NOT NULL DEFAULT '' AFTER `phone`, ADD `city` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kota' AFTER `email`, ADD `subdistrict` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kecamatan' AFTER `city`, ADD `ward` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kelurahan' AFTER `subdistrict`; ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `auto_renewal`; +ALTER TABLE `tbl_plans` ADD `list_expired` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'address list' AFTER `pool_expired`; +ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `rate_up_unit`; ALTER TABLE `tbl_appconfig` ADD PRIMARY KEY (`id`); diff --git a/system/controllers/bandwidth.php b/system/controllers/bandwidth.php index 0ce48730..15791b5f 100644 --- a/system/controllers/bandwidth.php +++ b/system/controllers/bandwidth.php @@ -67,6 +67,7 @@ switch ($action) { $rate_down_unit = _post('rate_down_unit'); $rate_up = _post('rate_up'); $rate_up_unit = _post('rate_up_unit'); + $burst = _post('burst'); run_hook('add_bandwidth'); #HOOK $msg = ''; if(Validator::Length($name,16,4) == false){ @@ -88,6 +89,7 @@ switch ($action) { $d->rate_down_unit = $rate_down_unit; $d->rate_up = $rate_up; $d->rate_up_unit = $rate_up_unit; + $d->burst = $burst; $d->save(); r2(U . 'bandwidth/list', 's', Lang::T('Data Created Successfully')); @@ -102,6 +104,7 @@ switch ($action) { $rate_down_unit = _post('rate_down_unit'); $rate_up = _post('rate_up'); $rate_up_unit = _post('rate_up_unit'); + $burst = _post('burst'); run_hook('edit_bandwidth'); #HOOK $msg = ''; if(Validator::Length($name,16,4) == false){ @@ -128,6 +131,7 @@ switch ($action) { $d->rate_down_unit = $rate_down_unit; $d->rate_up = $rate_up; $d->rate_up_unit = $rate_up_unit; + $d->burst = $burst; $d->save(); r2(U . 'bandwidth/list', 's', Lang::T('Data Updated Successfully')); diff --git a/system/controllers/services.php b/system/controllers/services.php index 0e9fa8d9..38d2a29a 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -173,7 +173,7 @@ switch ($action) { Mikrotik::removeHotspotPlan($client, $d['name_plan']); } catch (Exception $e) { //ignore exception, it means router has already deleted - } catch(Throwable $e){ + } catch (Throwable $e) { //ignore exception, it means router has already deleted } } @@ -200,6 +200,7 @@ switch ($action) { $validity_unit = _post('validity_unit'); $routers = _post('routers'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); $allow_purchase = _post('allow_purchase'); @@ -243,6 +244,7 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); $d = ORM::for_table('tbl_plans')->create(); $d->name_plan = $name; @@ -264,8 +266,9 @@ switch ($action) { } else { $d->is_radius = 0; $d->routers = $routers; - $d->pool_expired = $pool_expired; } + $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; $d->allow_purchase = $allow_purchase; $d->save(); @@ -305,6 +308,7 @@ switch ($action) { $validity = _post('validity'); $validity_unit = _post('validity_unit'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); $allow_purchase = _post('allow_purchase'); $routers = _post('routers'); @@ -343,6 +347,8 @@ switch ($action) { $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); + if ($d['is_radius']) { Radius::planUpSert($id, $radiusRate); } else { @@ -367,6 +373,7 @@ switch ($action) { $d->validity_unit = $validity_unit; $d->shared_users = $sharedusers; $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; $d->allow_purchase = $allow_purchase; $d->save(); @@ -443,7 +450,7 @@ switch ($action) { Mikrotik::removePpoePlan($client, $d['name_plan']); } catch (Exception $e) { //ignore exception, it means router has already deleted - } catch(Throwable $e){ + } catch (Throwable $e) { //ignore exception, it means router has already deleted } } @@ -506,6 +513,7 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); $d = ORM::for_table('tbl_plans')->create(); $d->type = 'PPPOE'; @@ -593,6 +601,7 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); if ($d['is_radius']) { Radius::planUpSert($id, $radiusRate, $pool); diff --git a/system/lan/english.json b/system/lan/english.json index 616f7717..bdf1f135 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -413,5 +413,9 @@ "Ward": "Ward", "Credentials": "Credentials", "Agent": "Agent", - "This_Token_will_act_as_SuperAdmin_Admin": "This Token will act as SuperAdmin\/Admin" + "This_Token_will_act_as_SuperAdmin_Admin": "This Token will act as SuperAdmin\/Admin", + "Login": "Login", + "Expired_Action": "Expired Action", + "Expired_Address_List_Name": "Expired Address List Name", + "Address_List": "Address List" } \ No newline at end of file diff --git a/system/updates.json b/system/updates.json index 9e3478ce..b6a03853 100644 --- a/system/updates.json +++ b/system/updates.json @@ -58,5 +58,9 @@ ], "2024.2.19": [ "CREATE TABLE `tbl_customers_fields` (`id` INT PRIMARY KEY AUTO_INCREMENT, `customer_id` INT NOT NULL, `field_name` VARCHAR(255) NOT NULL, `field_value` VARCHAR(255) NOT NULL, FOREIGN KEY (customer_id) REFERENCES tbl_customers(id));" + ], + "2024.2.20" : [ + "ALTER TABLE `tbl_plans` ADD `list_expired` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'address list' AFTER `pool_expired`;", + "ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `rate_up_unit`;" ] } \ No newline at end of file diff --git a/ui/ui/bandwidth-add.tpl b/ui/ui/bandwidth-add.tpl index 3b0c4aee..f7c6ae96 100644 --- a/ui/ui/bandwidth-add.tpl +++ b/ui/ui/bandwidth-add.tpl @@ -1,19 +1,19 @@ {include file="sections/header.tpl"} -
-
-
-
{Lang::T('Add New Bandwidth')}
-
- -
-
+
+
+
+
{Lang::T('Add New Bandwidth')}
+
+ + +
-
-
+
+
@@ -24,8 +24,8 @@
-
-
+
+
@@ -36,19 +36,25 @@
-
- +
+
+ +
+ +
+
- + Or {Lang::T('Cancel')}
- - -
-
+ +
+
+
-{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/bandwidth-edit.tpl b/ui/ui/bandwidth-edit.tpl index ee5c75ea..c8f986c3 100644 --- a/ui/ui/bandwidth-edit.tpl +++ b/ui/ui/bandwidth-edit.tpl @@ -1,55 +1,67 @@ {include file="sections/header.tpl"} -
-
-
-
{Lang::T('Edit Bandwidth')}
-
- -
- -
+
+
+
+
{Lang::T('Edit Bandwidth')}
+
+ + + +
-
-
+
+
- +
-
-
+
+
-
- +
+ +
+ +
+ +
+
- + Or {Lang::T('Cancel')}
- - -
-
-
-
+ -{include file="sections/footer.tpl"} +
+
+
+
+ +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/hotspot-add.tpl b/ui/ui/hotspot-add.tpl index ef63caa8..37784ee2 100644 --- a/ui/ui/hotspot-add.tpl +++ b/ui/ui/hotspot-add.tpl @@ -148,6 +148,19 @@
+ +
+ +    + +    + +
+
+
@@ -156,6 +169,12 @@
+