From 8072fe40ebbbf95ee334304cacd3c740445eb44b Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Wed, 21 Feb 2024 14:11:19 +0700 Subject: [PATCH] change burst form --- CHANGELOG.md | 7 +++++++ system/controllers/bandwidth.php | 29 ++++++++++++++++++++++++++--- system/lan/english.json | 5 ++++- ui/ui/bandwidth-add.tpl | 26 +++++++++++++++++++++++++- ui/ui/bandwidth-edit.tpl | 32 ++++++++++++++++++++++++++++++-- ui/ui/bandwidth.tpl | 8 ++++---- version.json | 2 +- 7 files changed, 97 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4902a7b8..bdb858f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ # CHANGELOG +## 2024.2.21 + +- Fix SQL Installer +- remove multiple space in language +- Change Phone Number require OTP by @Focuslinkstech +- Change burst Form + ## 2024.2.20 - Fix list admin diff --git a/system/controllers/bandwidth.php b/system/controllers/bandwidth.php index 15791b5f..45d68b21 100644 --- a/system/controllers/bandwidth.php +++ b/system/controllers/bandwidth.php @@ -44,6 +44,7 @@ switch ($action) { run_hook('view_edit_bandwith'); #HOOK $d = ORM::for_table('tbl_bandwidth')->find_one($id); if($d){ + $ui->assign('burst',explode(" ", $d['burst'])); $ui->assign('d',$d); $ui->display('bandwidth-edit.tpl'); }else{ @@ -67,8 +68,19 @@ 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 + $isBurst = true; + $burst = ""; + if(isset($_POST['burst'])){ + foreach($_POST['burst'] as $b){ + if(empty($b)){ + $isBurst = false; + } + } + if($isBurst){ + $burst = implode(' ', $_POST['burst']); + }; + } $msg = ''; if(Validator::Length($name,16,4) == false){ $msg .= 'Name should be between 5 to 15 characters'. '
'; @@ -104,8 +116,19 @@ 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 + run_hook('edit_bandwidth'); #HOOK + $isBurst = true; + $burst = ""; + if(isset($_POST['burst'])){ + foreach($_POST['burst'] as $b){ + if(empty($b)){ + $isBurst = false; + } + } + if($isBurst){ + $burst = implode(' ', $_POST['burst']); + }; + } $msg = ''; if(Validator::Length($name,16,4) == false){ $msg .= 'Name should be between 5 to 15 characters'. '
'; diff --git a/system/lan/english.json b/system/lan/english.json index 03a44a52..37550777 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -438,5 +438,8 @@ "OTP": "OTP", "Enter_OTP_that_was_sent_to_your_phone": "Enter OTP that was sent to your phone", "Update": "Update", - "OTP_is_required_when_user_want_to_change_phone_number": "OTP is required when user want to change phone number" + "OTP_is_required_when_user_want_to_change_phone_number": "OTP is required when user want to change phone number", + "Rate": "Rate", + "Burst": "Burst", + "Editing_Bandwidth_will_not_automatically_update_the_plan__you_need_to_edit_the_plan_then_save_again": "Editing Bandwidth will not automatically update the plan, you need to edit the plan then save again" } \ No newline at end of file diff --git a/ui/ui/bandwidth-add.tpl b/ui/ui/bandwidth-add.tpl index f7c6ae96..c2d411d6 100644 --- a/ui/ui/bandwidth-add.tpl +++ b/ui/ui/bandwidth-add.tpl @@ -40,7 +40,31 @@
- + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
diff --git a/ui/ui/bandwidth-edit.tpl b/ui/ui/bandwidth-edit.tpl index c8f986c3..a6810dc9 100644 --- a/ui/ui/bandwidth-edit.tpl +++ b/ui/ui/bandwidth-edit.tpl @@ -43,11 +43,39 @@
-
- + +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ {Lang::T('Editing Bandwidth will not automatically update the plan, you need to edit the plan then save again')}
diff --git a/ui/ui/bandwidth.tpl b/ui/ui/bandwidth.tpl index 86c1edd4..06abdfa1 100644 --- a/ui/ui/bandwidth.tpl +++ b/ui/ui/bandwidth.tpl @@ -28,8 +28,8 @@ {Lang::T('Bandwidth Name')} - {Lang::T('Rate Download')} - {Lang::T('Rate Upload')} + {Lang::T('Rate')} + {Lang::T('Burst')} {Lang::T('Manage')} @@ -37,8 +37,8 @@ {foreach $d as $ds} {$ds['name_bw']} - {$ds['rate_down']} {$ds['rate_down_unit']} - {$ds['rate_up']} {$ds['rate_up_unit']} + {$ds['rate_down']} {$ds['rate_down_unit']} / {$ds['rate_up']} {$ds['rate_up_unit']} + {$ds['burst']} {Lang::T('Edit')} diff --git a/version.json b/version.json index 4a247ff5..28271150 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.2.20" + "version": "2024.2.21" } \ No newline at end of file