Fix time Field

This commit is contained in:
Ibnu Maksum 2023-08-28 10:12:55 +07:00
parent 3eefec6e21
commit 1dd03168f0
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
4 changed files with 73 additions and 11 deletions

View File

@ -12,11 +12,14 @@ class Mikrotik
public static function getClient($ip, $user, $pass) public static function getClient($ip, $user, $pass)
{ {
global $ui;
try { try {
$iport = explode(":", $ip); $iport = explode(":", $ip);
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null); return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) { } catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage()); $ui->assign("error_meesage","Unable to connect to the router.<br>" . $e->getMessage());
$ui->display('router-error.tpl');
die();
} }
} }

View File

@ -41,7 +41,7 @@ class Package
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; $t->price = $p['price'];
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharge_time = date("H:i:s"); $t->recharged_time = date("H:i:s");
$t->expiration = $date_only; $t->expiration = $date_only;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -107,7 +107,7 @@ class Package
$b->plan_id = $plan_id; $b->plan_id = $plan_id;
$b->namebp = $p['name_plan']; $b->namebp = $p['name_plan'];
$b->recharged_on = $date_only; $b->recharged_on = $date_only;
$b->recharge_time = $time_only; $b->recharged_time = $time_only;
$b->expiration = $date_exp; $b->expiration = $date_exp;
$b->time = $time; $b->time = $time;
$b->status = "on"; $b->status = "on";
@ -123,7 +123,7 @@ class Package
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; $t->price = $p['price'];
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharge_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -143,7 +143,7 @@ class Package
$d->plan_id = $plan_id; $d->plan_id = $plan_id;
$d->namebp = $p['name_plan']; $d->namebp = $p['name_plan'];
$d->recharged_on = $date_only; $d->recharged_on = $date_only;
$d->recharge_time = $time_only; $d->recharged_time = $time_only;
$d->expiration = $date_exp; $d->expiration = $date_exp;
$d->time = $time; $d->time = $time;
$d->status = "on"; $d->status = "on";
@ -159,7 +159,7 @@ class Package
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; $t->price = $p['price'];
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharge_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -187,7 +187,7 @@ class Package
$b->plan_id = $plan_id; $b->plan_id = $plan_id;
$b->namebp = $p['name_plan']; $b->namebp = $p['name_plan'];
$b->recharged_on = $date_only; $b->recharged_on = $date_only;
$b->recharge_time = $time_only; $b->recharged_time = $time_only;
$b->expiration = $date_exp; $b->expiration = $date_exp;
$b->time = $time; $b->time = $time;
$b->status = "on"; $b->status = "on";
@ -203,7 +203,7 @@ class Package
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; $t->price = $p['price'];
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharge_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -223,7 +223,7 @@ class Package
$d->plan_id = $plan_id; $d->plan_id = $plan_id;
$d->namebp = $p['name_plan']; $d->namebp = $p['name_plan'];
$d->recharged_on = $date_only; $d->recharged_on = $date_only;
$d->recharge_time = $time_only; $d->recharged_time = $time_only;
$d->expiration = $date_exp; $d->expiration = $date_exp;
$d->time = $time; $d->time = $time;
$d->status = "on"; $d->status = "on";
@ -239,7 +239,7 @@ class Package
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; $t->price = $p['price'];
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharge_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";

View File

@ -43,7 +43,7 @@
value="{$d['expiration']}"> value="{$d['expiration']}">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<input type="time" class="form-control" id="time" name="time" min="00:00" max="23:59" <input type="time" class="form-control" id="time" name="time"
value="{$d['time']}"> value="{$d['time']}">
</div> </div>
</div> </div>

59
ui/ui/router-error.tpl Normal file
View File

@ -0,0 +1,59 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Router Error - PHPNuxBill</title>
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="ui/ui/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="ui/ui/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="ui/ui/fonts/MaterialDesign/css/materialdesignicons.min.css">
<link rel="stylesheet" href="ui/ui/styles/adminlte.min.css">
<link rel="stylesheet" href="ui/ui/styles/skin-blue.min.css">
<style>
::-moz-selection {
/* Code for Firefox */
color: red;
background: yellow;
}
::selection {
color: red;
background: yellow;
}
</style>
</head>
<body class="hold-transition skin-blue">
<div class="container">
<section class="content-header">
<h1 class="text-center">
Router Error
</h1>
</section>
<section class="content">
<div class="row">
<div class="col-md-3"></div>
<div class="col-md-6">
<div class="alert alert-danger text-center">
{$error_meesage}
</div>
<a href="javascript::history.back()" onclick="history.back()" class="btn btn-warning btn-block">back</a>
</div>
</div>
</section>
<footer class="footer text-center">
PHPNuxBill by <a href="https://github.com/hotspotbilling/phpnuxbill" rel="nofollow noreferrer noopener"
target="_blank">iBNuX</a>
</footer>
</div>
</body>
</html>