From 1dd03168f02dd6b2b848aebe973ba6c600fbb63b Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 28 Aug 2023 10:12:55 +0700 Subject: [PATCH] Fix time Field --- system/autoload/Mikrotik.php | 5 ++- system/autoload/Package.php | 18 +++++------ ui/ui/prepaid-edit.tpl | 2 +- ui/ui/router-error.tpl | 59 ++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 ui/ui/router-error.tpl diff --git a/system/autoload/Mikrotik.php b/system/autoload/Mikrotik.php index 7b7f82ca..ae9809ec 100644 --- a/system/autoload/Mikrotik.php +++ b/system/autoload/Mikrotik.php @@ -12,11 +12,14 @@ class Mikrotik public static function getClient($ip, $user, $pass) { + global $ui; try { $iport = explode(":", $ip); return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null); } catch (Exception $e) { - die("Unable to connect to the router.
" . $e->getMessage()); + $ui->assign("error_meesage","Unable to connect to the router.
" . $e->getMessage()); + $ui->display('router-error.tpl'); + die(); } } diff --git a/system/autoload/Package.php b/system/autoload/Package.php index e99bf889..499067a8 100644 --- a/system/autoload/Package.php +++ b/system/autoload/Package.php @@ -41,7 +41,7 @@ class Package $t->plan_name = $p['name_plan']; $t->price = $p['price']; $t->recharged_on = $date_only; - $t->recharge_time = date("H:i:s"); + $t->recharged_time = date("H:i:s"); $t->expiration = $date_only; $t->time = $time; $t->method = "$gateway - $channel"; @@ -107,7 +107,7 @@ class Package $b->plan_id = $plan_id; $b->namebp = $p['name_plan']; $b->recharged_on = $date_only; - $b->recharge_time = $time_only; + $b->recharged_time = $time_only; $b->expiration = $date_exp; $b->time = $time; $b->status = "on"; @@ -123,7 +123,7 @@ class Package $t->plan_name = $p['name_plan']; $t->price = $p['price']; $t->recharged_on = $date_only; - $t->recharge_time = $time_only; + $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; @@ -143,7 +143,7 @@ class Package $d->plan_id = $plan_id; $d->namebp = $p['name_plan']; $d->recharged_on = $date_only; - $d->recharge_time = $time_only; + $d->recharged_time = $time_only; $d->expiration = $date_exp; $d->time = $time; $d->status = "on"; @@ -159,7 +159,7 @@ class Package $t->plan_name = $p['name_plan']; $t->price = $p['price']; $t->recharged_on = $date_only; - $t->recharge_time = $time_only; + $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; @@ -187,7 +187,7 @@ class Package $b->plan_id = $plan_id; $b->namebp = $p['name_plan']; $b->recharged_on = $date_only; - $b->recharge_time = $time_only; + $b->recharged_time = $time_only; $b->expiration = $date_exp; $b->time = $time; $b->status = "on"; @@ -203,7 +203,7 @@ class Package $t->plan_name = $p['name_plan']; $t->price = $p['price']; $t->recharged_on = $date_only; - $t->recharge_time = $time_only; + $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; @@ -223,7 +223,7 @@ class Package $d->plan_id = $plan_id; $d->namebp = $p['name_plan']; $d->recharged_on = $date_only; - $d->recharge_time = $time_only; + $d->recharged_time = $time_only; $d->expiration = $date_exp; $d->time = $time; $d->status = "on"; @@ -239,7 +239,7 @@ class Package $t->plan_name = $p['name_plan']; $t->price = $p['price']; $t->recharged_on = $date_only; - $t->recharge_time = $time_only; + $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; diff --git a/ui/ui/prepaid-edit.tpl b/ui/ui/prepaid-edit.tpl index 07080688..90a02adb 100644 --- a/ui/ui/prepaid-edit.tpl +++ b/ui/ui/prepaid-edit.tpl @@ -43,7 +43,7 @@ value="{$d['expiration']}">
-
diff --git a/ui/ui/router-error.tpl b/ui/ui/router-error.tpl new file mode 100644 index 00000000..fad1e26d --- /dev/null +++ b/ui/ui/router-error.tpl @@ -0,0 +1,59 @@ + + + + + + + Router Error - PHPNuxBill + + + + + + + + + + + + + + + +
+
+

+ Router Error +

+
+ +
+
+
+
+
+ {$error_meesage} +
+ back +
+
+
+ +
+ + + \ No newline at end of file