Fix Recharge time

This commit is contained in:
Ibnu Maksum 2023-08-28 09:44:57 +07:00
parent 51ac162642
commit b4f5cf8954
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
17 changed files with 124 additions and 282 deletions

View File

@ -228,6 +228,7 @@ CREATE TABLE
`plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL, `recharged_on` date NOT NULL,
`recharged_time` time NOT NULL DEFAULT '00:00:00',
`expiration` date NOT NULL, `expiration` date NOT NULL,
`time` time NOT NULL, `time` time NOT NULL,
`method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
@ -271,6 +272,7 @@ CREATE TABLE
`plan_id` int(10) NOT NULL, `plan_id` int(10) NOT NULL,
`namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL, `recharged_on` date NOT NULL,
`recharged_time` time NOT NULL DEFAULT '00:00:00',
`expiration` date NOT NULL, `expiration` date NOT NULL,
`time` time NOT NULL, `time` time NOT NULL,
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,

View File

@ -22,6 +22,7 @@ class Package
global $_c, $_L, $_notifmsg; global $_c, $_L, $_notifmsg;
$date_now = date("Y-m-d H:i:s"); $date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d"); $date_only = date("Y-m-d");
$time_only = date("H:i:s");
$time = date("H:i:s"); $time = date("H:i:s");
if ($id_customer == '' or $router_name == '' or $plan_id == '') { if ($id_customer == '' or $router_name == '' or $plan_id == '') {
@ -40,6 +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->expiration = $date_only; $t->expiration = $date_only;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -105,6 +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->expiration = $date_exp; $b->expiration = $date_exp;
$b->time = $time; $b->time = $time;
$b->status = "on"; $b->status = "on";
@ -120,6 +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->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -139,6 +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->expiration = $date_exp; $d->expiration = $date_exp;
$d->time = $time; $d->time = $time;
$d->status = "on"; $d->status = "on";
@ -154,6 +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->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -181,6 +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->expiration = $date_exp; $b->expiration = $date_exp;
$b->time = $time; $b->time = $time;
$b->status = "on"; $b->status = "on";
@ -196,6 +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->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
@ -215,6 +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->expiration = $date_exp; $d->expiration = $date_exp;
$d->time = $time; $d->time = $time;
$d->status = "on"; $d->status = "on";
@ -230,6 +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->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";

View File

@ -181,7 +181,7 @@ switch ($action) {
run_hook('edit_customer_plan'); #HOOK run_hook('edit_customer_plan'); #HOOK
$d->username = $username; $d->username = $username;
$d->plan_id = $id_plan; $d->plan_id = $id_plan;
$d->recharged_on = $recharged_on; //$d->recharged_on = $recharged_on;
$d->expiration = $expiration; $d->expiration = $expiration;
$d->time = $time; $d->time = $time;
$d->save(); $d->save();

View File

@ -26,187 +26,16 @@ switch ($action) {
case 'activation-post': case 'activation-post':
$code = _post('code'); $code = _post('code');
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one(); $v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
$c = ORM::for_table('tbl_customers')->find_one($user['id']);
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $user['id'])->find_one();
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
$mikrotik = Mikrotik::info($v1['routers']);
if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
} else if ($p['validity_unit'] == 'Mins') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
run_hook('customer_activate_voucher'); #HOOK run_hook('customer_activate_voucher'); #HOOK
if ($v1) { if ($v1) {
if ($v1['type'] == 'Hotspot') { if (Package::rechargeUser($user, $v1['routers'], $v1['id_plan'], "Activation", "Voucher")) {
if ($b) {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client, $c['username']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
} else {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
}
$v1->status = "1"; $v1->status = "1";
$v1->user = $c['username']; $v1->user = $c['username'];
$v1->save(); $v1->save();
// Telegram to Admin r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']);
Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #Hotspot\n" . $p['name_plan'] .
"\nCode: " . $code .
"\nRouter: " . $v1['routers'] .
"\nPrice: " . $p['price']);
} else { } else {
if ($b) { r2(U . 'voucher/activation', 'e', "Failed to refill account");
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client, $c['username']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
} else {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
// Telegram to Admin
Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #PPPOE\n" . $p['name_plan'] .
"\nCode: " . $code .
"\nRouter: " . $v1['routers'] .
"\nPrice: " . $p['price']);
} }
r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']);
} else { } else {
r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']); r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']);
} }

View File

@ -15,6 +15,7 @@
"ALTER TABLE `tbl_customers` CHANGE `pppoe_password` `pppoe_password` VARCHAR(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'For PPPOE Login';" "ALTER TABLE `tbl_customers` CHANGE `pppoe_password` `pppoe_password` VARCHAR(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'For PPPOE Login';"
], ],
"2023.8.28" : [ "2023.8.28" : [
"ALTER TABLE `tbl_user_recharges` CHANGE `recharged_on` `recharged_on` DATETIME NOT NULL;" "ALTER TABLE `tbl_user_recharges` ADD `recharged_time` time NOT NULL DEFAULT '00:00:00' AFTER `recharged_on`;",
"ALTER TABLE `tbl_transactions` ADD `recharged_time` time NOT NULL DEFAULT '00:00:00' AFTER `recharged_on`;"
] ]
} }

View File

@ -73,7 +73,8 @@
class="pull-right">{if $package['status']=='on'}yes{else}no{/if}</span> class="pull-right">{if $package['status']=='on'}yes{else}no{/if}</span>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{$_L['Created_On']} <span class="pull-right">{Lang::dateFormat($package['recharged_on'])}</span> {$_L['Created_On']} <span
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
{$_L['Expires_On']} <span {$_L['Expires_On']} <span
@ -116,9 +117,9 @@
<td>{$ds['plan_name']}</td> <td>{$ds['plan_name']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['type']}</td> <td>{$ds['type']}</td>
<td class="text-success">{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td class="text-success">{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
<td class="text-danger">{date($_c['date_format'], strtotime($ds['expiration']))} </td>
{$ds['time']}</td> <td class="text-danger">{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td>{$ds['method']}</td> <td>{$ds['method']}</td>
</tr> </tr>
{/foreach} {/foreach}
@ -146,12 +147,9 @@
<td>{$ds['routers']}</td> <td>{$ds['routers']}</td>
<td>{$ds['payment_channel']}</td> <td>{$ds['payment_channel']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}</td>
<td class="text-primary">{date("{$_c['date_format']} H:i", <td class="text-primary">{Lang::dateTimeFormat($ds['created_date'])}</td>
strtotime($ds['created_date']))}</td> <td class="text-danger">{Lang::dateTimeFormat($ds['expired_date'])}</td>
<td class="text-danger">{date("{$_c['date_format']} H:i", <td class="text-success">{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}</td>
strtotime($ds['expired_date']))}</td>
<td class="text-success">{if $ds['status']!=1}{date("{$_c['date_format']} H:i",
strtotime($ds['paid_date']))}{/if}</td>
<td>{if $ds['status']==1}{$_L['UNPAID']} <td>{if $ds['status']==1}{$_L['UNPAID']}
{elseif $ds['status']==2}{$_L['PAID']} {elseif $ds['status']==2}{$_L['PAID']}
{elseif $ds['status']==3}{$_L['FAILED']} {elseif $ds['status']==3}{$_L['FAILED']}

View File

@ -108,9 +108,9 @@
<tr> <tr>
<td>{$no++}</td> <td>{$no++}</td>
<td><a href="{$_url}customers/viewu/{$expired['username']}">{$expired['username']}</a></td> <td><a href="{$_url}customers/viewu/{$expired['username']}">{$expired['username']}</a></td>
<td>{date($_c['date_format'], strtotime($expired['recharged_on']))} <td>{Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}
</td> </td>
<td>{date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']} <td>{Lang::dateAndTimeFormat($expired['expiration'],$expired['time'])}
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@ -39,9 +39,8 @@
{$_L['Password']} : **********<br> {$_L['Password']} : **********<br>
{if $in['type'] != 'Balance'} {if $in['type'] != 'Balance'}
<br> <br>
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($d['recharged_on']))}</b><br> {$_L['Created_On']} : <b>{Lang::dateAndTimeFormat($d['recharged_on'],$d['recharged_time'])}</b><br>
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($d['expiration']))} {$_L['Expires_On']} : <b>{Lang::dateAndTimeFormat($d['expiration'],$d['time'])}</b><br>
{$d['time']}</b><br>
{/if} {/if}
============================================<br> ============================================<br>
<center>{$_c['note']}</center> <center>{$_c['note']}</center>

View File

@ -24,9 +24,8 @@
{$_L['Password']} : **********<br> {$_L['Password']} : **********<br>
{if $in['type'] != 'Balance'} {if $in['type'] != 'Balance'}
<br> <br>
{$_L['Created_On']} : <b>{date($_c['date_format'], strtotime($in['recharged_on']))}</b><br> {$_L['Created_On']} : <b>{Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time'])}</b><br>
{$_L['Expires_On']} : <b>{date($_c['date_format'], strtotime($in['expiration']))} {$_L['Expires_On']} : <b>{Lang::dateAndTimeFormat($in['expiration'],$in['time'])}</b><br>
{$in['time']}</b><br>
{/if} {/if}
=====================================================<br> =====================================================<br>
<center>{$_c['note']}</center> <center>{$_c['note']}</center>

View File

@ -32,8 +32,8 @@
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{$_L['Created_On']}</label> <label class="col-md-2 control-label">{$_L['Created_On']}</label>
<div class="col-md-6"> <div class="col-md-6">
<input type="date" class="form-control" id="recharged_on" name="recharged_on" <input type="date" class="form-control" id="recharged_on" name="recharged_on" readonly
value="{$d['recharged_on']}"> value="{$d['recharged_on']} {$d['recharged_time']}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">

View File

@ -1,66 +1,70 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<div class="row"> <div class="row">
<div class="col-sm-12"> <div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-primary"> <div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">{$_L['Prepaid_User']}</div> <div class="panel-heading">{$_L['Prepaid_User']}</div>
<div class="panel-body"> <div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px"> <div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8"> <div class="col-md-8">
<form id="site-search" method="post" action="{$_url}prepaid/list/"> <form id="site-search" method="post" action="{$_url}prepaid/list/">
<div class="input-group"> <div class="input-group">
<div class="input-group-addon"> <div class="input-group-addon">
<span class="fa fa-search"></span> <span class="fa fa-search"></span>
</div> </div>
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}..." value="{$cari}"> <input type="text" name="username" class="form-control"
<div class="input-group-btn"> placeholder="{$_L['Search_by_Username']}..." value="{$cari}">
<button class="btn btn-success" type="submit">{$_L['Search']}</button> <div class="input-group-btn">
</div> <button class="btn btn-success" type="submit">{$_L['Search']}</button>
</div> </div>
</form> </div>
</div> </form>
<div class="col-md-4"> </div>
<a href="{$_url}prepaid/recharge" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Recharge_Account']}</a> <div class="col-md-4">
</div>&nbsp; <a href="{$_url}prepaid/recharge" class="btn btn-primary btn-block waves-effect"><i
</div> class="ion ion-android-add"> </i> {$_L['Recharge_Account']}</a>
<div class="table-responsive"> </div>&nbsp;
<table id="datatable" class="table table-bordered table-striped table-condensed"> </div>
<thead> <div class="table-responsive">
<tr> <table id="datatable" class="table table-bordered table-striped table-condensed">
<th>{$_L['Username']}</th> <thead>
<th>{$_L['Plan_Name']}</th> <tr>
<th>{$_L['Type']}</th> <th>{$_L['Username']}</th>
<th>{$_L['Created_On']}</th> <th>{$_L['Plan_Name']}</th>
<th>{$_L['Expires_On']}</th> <th>{$_L['Type']}</th>
<th>{$_L['Method']}</th> <th>{$_L['Created_On']}</th>
<th>{$_L['Routers']}</th> <th>{$_L['Expires_On']}</th>
<th>{$_L['Manage']}</th> <th>{$_L['Method']}</th>
</tr> <th>{$_L['Routers']}</th>
</thead> <th>{$_L['Manage']}</th>
<tbody> </tr>
{foreach $d as $ds} </thead>
<tr> <tbody>
<td>{$ds['username']}</td> {foreach $d as $ds}
<td>{$ds['namebp']}</td> <tr>
<td>{$ds['type']}</td> <td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
<td>{$ds['recharged_on']}</td> <td>{$ds['namebp']}</td>
<td>{$ds['expiration']} {$ds['time']}</td> <td>{$ds['type']}</td>
<td>{$ds['method']}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{$ds['routers']}</td> <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td> <td>{$ds['method']}</td>
<a href="{$_url}prepaid/edit/{$ds['id']}" class="btn btn-warning btn-xs">{$_L['Edit']}</a> <td>{$ds['routers']}</td>
<a href="{$_url}prepaid/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-xs">{$_L['Delete']}</a> <td>
</td> <a href="{$_url}prepaid/edit/{$ds['id']}"
</tr> class="btn btn-warning btn-xs">{$_L['Edit']}</a>
{/foreach} <a href="{$_url}prepaid/delete/{$ds['id']}" id="{$ds['id']}"
</tbody> class="btn btn-danger btn-xs">{$_L['Delete']}</a>
</table> </td>
</div> </tr>
{$paginator['contents']} {/foreach}
</div> </tbody>
</div> </table>
</div> </div>
</div> {$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"} {include file="sections/footer.tpl"}

View File

@ -39,8 +39,8 @@
<td class="text-center">{$ds['plan_name']}</td> <td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td> <td class="text-center">{$ds['type']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td> <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td class="text-center">{$ds['method']}</td> <td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td> <td class="text-center">{$ds['routers']}</td>
</tr> </tr>

View File

@ -39,8 +39,8 @@
<td class="text-center">{$ds['plan_name']}</td> <td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td> <td class="text-center">{$ds['type']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td> <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td class="text-center">{$ds['method']}</td> <td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td> <td class="text-center">{$ds['routers']}</td>
</tr> </tr>

View File

@ -42,8 +42,8 @@
<td>{$ds['type']}</td> <td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td> <td>{$ds['plan_name']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td> <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td>{$ds['method']}</td> <td>{$ds['method']}</td>
<td>{$ds['routers']}</td> <td>{$ds['routers']}</td>
</tr> </tr>

View File

@ -53,8 +53,8 @@
<td>{$ds['type']}</td> <td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td> <td>{$ds['plan_name']}</td>
<td class="text-right">{Lang::moneyFormat($ds['price'])}</td> <td class="text-right">{Lang::moneyFormat($ds['price'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td> <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
<td>{$ds['method']}</td> <td>{$ds['method']}</td>
<td>{$ds['routers']}</td> <td>{$ds['routers']}</td>
</tr> </tr>

View File

@ -26,9 +26,8 @@
<td>{$ds['plan_name']}</td> <td>{$ds['plan_name']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td> <td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['type']}</td> <td>{$ds['type']}</td>
<td class="text-success">{date($_c['date_format'], strtotime($ds['recharged_on']))}</td> <td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td class="text-danger">{date($_c['date_format'], strtotime($ds['expiration']))} <td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
{$ds['time']}</td>
<td>{$ds['method']}</td> <td>{$ds['method']}</td>
</tr> </tr>
{/foreach} {/foreach}

View File

@ -84,14 +84,14 @@
<tr> <tr>
<td class="small text-info text-uppercase text-normal">{$_L['Created_On']}</td> <td class="small text-info text-uppercase text-normal">{$_L['Created_On']}</td>
<td class="small mb15"> <td class="small mb15">
{if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['recharged_on']))} {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{/if}&nbsp;</td> {/if}&nbsp;</td>
</tr> </tr>
<tr> <tr>
<td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td> <td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td>
<td class="small mb15"> <td class="small mb15">
{if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['expiration']))} {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}&nbsp;
{$_bill['time']}{/if}&nbsp;</td> </td>
</tr> </tr>
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'} {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
{if $nux_ip} {if $nux_ip}
@ -151,23 +151,24 @@
placeholder="{$_L['Username']}"> placeholder="{$_L['Username']}">
</div> </div>
<div class="col-sm-5"> <div class="col-sm-5">
<input type="number" id="balance" name="balance" autocomplete="off" class="form-control" required <input type="number" id="balance" name="balance" autocomplete="off" class="form-control"
placeholder="{$_L['Balance']}"> required placeholder="{$_L['Balance']}">
</div> </div>
<div class="form-group col-sm-2" align="center"> <div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send" value="balance"><i class="glyphicon glyphicon-send"></i></button> <button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
value="balance"><i class="glyphicon glyphicon-send"></i></button>
</div> </div>
</div> </div>
</form> </form>
<script> <script>
function askConfirm(){ function askConfirm() {
if(confirm('{Lang::T('Send your balance?')}')){ if(confirm('{Lang::T('Send your balance?')}')){
setTimeout(() => { setTimeout(() => {
document.getElementById('sendBtn').setAttribute('disabled', ''); document.getElementById('sendBtn').setAttribute('disabled', '');
}, 1000); }, 1000);
return true; return true;
} }
return false; return false;
} }
</script> </script>
</div> </div>