Additional Cost, and Confirm Recharge

This commit is contained in:
Ibnu Maksum 2024-03-14 12:14:11 +07:00
parent ca27c47b75
commit e206a583fd
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
11 changed files with 263 additions and 117 deletions

View File

@ -317,3 +317,4 @@ ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `
ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`; ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`; ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid'; ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';
ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;

View File

@ -123,8 +123,11 @@ class Message
$textInvoice = str_replace('[[plan_name]]', $trx['plan_name'], $textInvoice); $textInvoice = str_replace('[[plan_name]]', $trx['plan_name'], $textInvoice);
$textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($trx['price']), $textInvoice); $textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($trx['price']), $textInvoice);
$textInvoice = str_replace('[[name]]', $cust['fullname'], $textInvoice); $textInvoice = str_replace('[[name]]', $cust['fullname'], $textInvoice);
$textInvoice = str_replace('[[note]]', $cust['note'], $textInvoice);
$textInvoice = str_replace('[[user_name]]', $trx['username'], $textInvoice); $textInvoice = str_replace('[[user_name]]', $trx['username'], $textInvoice);
$textInvoice = str_replace('[[user_password]]', $cust['password'], $textInvoice); $textInvoice = str_replace('[[user_password]]', $cust['password'], $textInvoice);
$textInvoice = str_replace('[[username]]', $trx['username'], $textInvoice);
$textInvoice = str_replace('[[password]]', $cust['password'], $textInvoice);
$textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice); $textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice);
$textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice); $textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice);

View File

@ -17,7 +17,7 @@ class Package
* @param string $channel channel payment gateway * @param string $channel channel payment gateway
* @return boolean * @return boolean
*/ */
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel) public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel, $note = '')
{ {
global $config, $admin, $c, $p, $b, $t, $d, $zero; global $config, $admin, $c, $p, $b, $t, $d, $zero;
$date_now = date("Y-m-d H:i:s"); $date_now = date("Y-m-d H:i:s");
@ -34,14 +34,20 @@ class Package
// Additional cost // Additional cost
$add_cost = 0; $add_cost = 0;
$add_cycle = User::getAttribute("Additional Cycle", $id_customer); $add_rem = User::getAttribute("Additional Remaining", $id_customer);
// if empty then it doesnt have cycle, if zero then it finish // if empty then it doesnt have cycle, if zero then it finish
if ($add_cycle != 0) { if ($add_rem != 0) {
$add_cost = User::getAttribute("Additional Cost", $id_customer); $add_cost = User::getAttribute("Additional Cost", $id_customer);
if (empty($add_cost)) { if (empty($add_cost)) {
$add_cost = 0; $add_cost = 0;
} }
} }
if ($add_cost > 0 && $router_name != 'balance') {
$bills = User::getAttributes("Bill", $id_customer);
foreach ($bills as $k => $v) {
$note .= $k . " : " . Lang::moneyFormat($v) . "\n";
}
}
// Zero cost recharge // Zero cost recharge
if (isset($zero) && $zero == 1) { if (isset($zero) && $zero == 1) {
@ -247,6 +253,7 @@ class Package
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
$t->routers = $router_name; $t->routers = $router_name;
$t->note = $note;
$t->type = "Hotspot"; $t->type = "Hotspot";
if ($admin) { if ($admin) {
$t->admin_id = ($admin['id']) ? $admin['id'] : '0'; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
@ -333,6 +340,7 @@ class Package
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
$t->routers = $router_name; $t->routers = $router_name;
$t->note = $note;
$t->type = "Hotspot"; $t->type = "Hotspot";
if ($admin) { if ($admin) {
$t->admin_id = ($admin['id']) ? $admin['id'] : '0'; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
@ -432,6 +440,7 @@ class Package
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
$t->routers = $router_name; $t->routers = $router_name;
$t->note = $note;
$t->type = "PPPOE"; $t->type = "PPPOE";
if ($admin) { if ($admin) {
$t->admin_id = ($admin['id']) ? $admin['id'] : '0'; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
@ -516,6 +525,7 @@ class Package
$t->expiration = $date_exp; $t->expiration = $date_exp;
$t->time = $time; $t->time = $time;
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
$t->note = $note;
$t->routers = $router_name; $t->routers = $router_name;
if ($admin) { if ($admin) {
$t->admin_id = ($admin['id']) ? $admin['id'] : '0'; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
@ -552,8 +562,8 @@ class Package
"\nPrice: " . Lang::moneyFormat($p['price'])); "\nPrice: " . Lang::moneyFormat($p['price']));
} }
} }
if ($add_cycle > 0) { if ($add_rem > 0) {
User::setAttribute('Additional Cycle', ($add_cycle - 1), $id_customer); User::setAttribute('Additional Remaining', ($add_rem - 1), $id_customer);
} }
run_hook("recharge_user_finish"); run_hook("recharge_user_finish");
Message::sendInvoice($c, $t); Message::sendInvoice($c, $t);
@ -675,7 +685,11 @@ class Package
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n"; $invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
if(!empty($in['note'])){
$invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pad($in['note'], ' ', 2);
}
$invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
if ($in['type'] != 'Balance') { if ($in['type'] != 'Balance') {
@ -699,7 +713,11 @@ class Package
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n"; $invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
if(!empty($in['note'])){
$invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pad($in['note'], ' ', 2);
}
$invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n"; $invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
if ($in['type'] != 'Balance') { if ($in['type'] != 'Balance') {

View File

@ -99,12 +99,46 @@ switch ($action) {
$id_customer = $routes['2']; $id_customer = $routes['2'];
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one(); $b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
if ($b) { if ($b) {
if (Package::rechargeUser($id_customer, $b['routers'], $b['plan_id'], "Recharge", $admin['fullname'])) { $gateway = 'Recharge';
r2(U . 'customers/view/' . $id_customer, 's', 'Success Recharge Customer'); $channel = $admin['fullname'];
} else { $cust = User::_info($id_customer);
r2(U . 'customers/view/' . $id_customer, 'e', 'Customer plan is inactive'); $plan = ORM::for_table('tbl_plans')->find_one($b['plan_id']);
$add_cost = 0;
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
if($add_rem != 0){
$add_cost = User::getAttribute("Additional Cost", $id_customer);
if (empty($add_cost)) {
$add_cost = 0;
} }
} }
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
if (!$cust) {
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
}
if (!$plan) {
r2(U . 'prepaid/recharge', 'e', Lang::T('Plan not found'));
}
if ($cust['balance'] < ($plan['price'] + $add_cost)) {
r2(U . 'prepaid/recharge', 'e', Lang::T('insufficient balance'));
}
$gateway = 'Recharge Balance';
}
if ($using == 'zero') {
$zero = 1;
$gateway = 'Recharge Zero';
}
$bills = User::getAttributes("Bill", $id_customer);
$ui->assign('bills', $bills);
$ui->assign('add_cost', $add_cost);
$ui->assign('add_rem', $add_rem);
$ui->assign('cust', $cust);
$ui->assign('gateway', $gateway);
$ui->assign('channel', $channel);
$ui->assign('server', $b['routers']);
$ui->assign('using', 'default');
$ui->assign('plan', $plan);
$ui->display('recharge-confirm.tpl');
}
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan'); r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
case 'deactivate': case 'deactivate':
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
@ -499,7 +533,7 @@ switch ($action) {
} }
} }
} }
r2(U . 'customers/list', 's', 'User Updated Successfully'); r2(U . 'customers/view/' . $id, 's', 'User Updated Successfully');
} else { } else {
r2(U . 'customers/edit/' . $id, 'e', $msg); r2(U . 'customers/edit/' . $id, 'e', $msg);
} }

View File

@ -96,37 +96,17 @@ switch ($action) {
$ui->display('recharge.tpl'); $ui->display('recharge.tpl');
break; break;
case 'recharge-user': case 'recharge-confirm':
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
}
$id = $routes['2'];
$ui->assign('id', $id);
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
run_hook('view_recharge_customer'); #HOOK
$ui->display('recharge-user.tpl');
break;
case 'recharge-post':
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
} }
$id_customer = _post('id_customer'); $id_customer = _post('id_customer');
$type = _post('type');
$server = _post('server'); $server = _post('server');
$planId = _post('plan'); $planId = _post('plan');
$using = _post('using'); $using = _post('using');
$date_only = date("Y-m-d");
$time = date("H:i:s");
$msg = ''; $msg = '';
if ($id_customer == '' or $type == '' or $server == '' or $planId == '') { if ($id_customer == '' or $server == '' or $planId == '' or $using == '') {
$msg .= Lang::T('All field is required') . '<br>'; $msg .= Lang::T('All field is required') . '<br>';
} }
@ -134,11 +114,74 @@ switch ($action) {
$gateway = 'Recharge'; $gateway = 'Recharge';
$channel = $admin['fullname']; $channel = $admin['fullname'];
$cust = User::_info($id_customer); $cust = User::_info($id_customer);
if ($using == 'balance' && $config['enable_balance'] == 'yes') { $plan = ORM::for_table('tbl_plans')->find_one($planId);
$add_cost = 0;
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
if($add_rem != 0){
$add_cost = User::getAttribute("Additional Cost", $id_customer); $add_cost = User::getAttribute("Additional Cost", $id_customer);
if (empty($add_cost)) { if (empty($add_cost)) {
$add_cost = 0; $add_cost = 0;
} }
}
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
if (!$cust) {
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
}
if (!$plan) {
r2(U . 'prepaid/recharge', 'e', Lang::T('Plan not found'));
}
if ($cust['balance'] < ($plan['price'] + $add_cost)) {
r2(U . 'prepaid/recharge', 'e', Lang::T('insufficient balance'));
}
$gateway = 'Recharge Balance';
}
if ($using == 'zero') {
$zero = 1;
$gateway = 'Recharge Zero';
}
$bills = User::getAttributes("Bill", $id_customer);
$ui->assign('bills', $bills);
$ui->assign('add_cost', $add_cost);
$ui->assign('add_rem', $add_rem);
$ui->assign('cust', $cust);
$ui->assign('gateway', $gateway);
$ui->assign('channel', $channel);
$ui->assign('server', $server);
$ui->assign('using', $using);
$ui->assign('plan', $plan);
$ui->display('recharge-confirm.tpl');
} else {
r2(U . 'prepaid/recharge', 'e', $msg);
}
break;
case 'recharge-post':
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
}
$id_customer = _post('id_customer');
$server = _post('server');
$planId = _post('plan');
$using = _post('using');
$msg = '';
if ($id_customer == '' or $server == '' or $planId == '' or $using == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
if ($msg == '') {
$gateway = 'Recharge';
$channel = $admin['fullname'];
$cust = User::_info($id_customer);
$add_cost = 0;
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
if($add_rem != 0){
$add_cost = User::getAttribute("Additional Cost", $id_customer);
if (empty($add_cost)) {
$add_cost = 0;
}
}
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
$plan = ORM::for_table('tbl_plans')->find_one($planId); $plan = ORM::for_table('tbl_plans')->find_one($planId);
if (!$cust) { if (!$cust) {
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found')); r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
@ -152,6 +195,7 @@ switch ($action) {
$gateway = 'Recharge Balance'; $gateway = 'Recharge Balance';
} }
if ($using == 'zero') { if ($using == 'zero') {
$add_cost = 0;
$zero = 1; $zero = 1;
$gateway = 'Recharge Zero'; $gateway = 'Recharge Zero';
} }

View File

@ -479,5 +479,12 @@
"PPPOE": "PPPOE", "PPPOE": "PPPOE",
"Bandwidth": "Bandwidth", "Bandwidth": "Bandwidth",
"Customers": "Customers", "Customers": "Customers",
"Actives": "Actives" "Actives": "Actives",
"Name": "Name",
"Confirm": "Confirm",
"Plan": "Plan",
"Total": "Total",
"Current_Cycle": "Current Cycle",
"Additional_Cost": "Additional Cost",
"Remaining": "Remaining"
} }

View File

@ -75,5 +75,8 @@
], ],
"2024.3.12" : [ "2024.3.12" : [
"ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';" "ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';"
],
"2024.3.14" : [
"ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;"
] ]
} }

View File

@ -92,7 +92,6 @@
<div class="panel-body"> <div class="panel-body">
<!-- Customers Attributes add start --> <!-- Customers Attributes add start -->
<div id="custom-fields-container"> <div id="custom-fields-container">
</div> </div>
<!-- Customers Attributes add end --> <!-- Customers Attributes add end -->
</div> </div>

View File

@ -0,0 +1,99 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Confirm')}</div>
<div class="panel-body">
<center><b>{Lang::T('Customer')}</b></center>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b>{Lang::T('Username')}</b> <span class="pull-right">{$cust['username']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Name')}</b> <span class="pull-right">{$cust['fullname']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Phone Number')}</b> <span class="pull-right">{$cust['phonenumber']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Email')}</b> <span class="pull-right">{$cust['email']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Address')}</b> <span class="pull-right">{$cust['address']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Balance')}</b> <span
class="pull-right">{Lang::moneyFormat($cust['balance'])}</span>
</li>
</ul>
<center><b>{Lang::T('Plan')}</b></center>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">
<b>{Lang::T('Plan Name')}</b> <span class="pull-right">{$plan['name_plan']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Location')}</b> <span
class="pull-right">{if $plan['is_radius']}Radius{else}{$plan['routers']}{/if}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Type')}</b> <span
class="pull-right">{if $plan['prepaid'] eq 'yes'}Prepaid{else}Postpaid{/if}
{$plan['type']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Plan Price')}</b> <span
class="pull-right">{if $using eq 'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']}
{$plan['validity_unit']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Using')}</b> <span class="pull-right">{$using}</span>
</li>
</ul>
<center><b>{Lang::T('Total')}</b></center>
<ul class="list-group list-group-unbordered">
{if $add_rem != 0 and $using neq 'zero' and $add_cost>0}
{foreach $bills as $k => $v}
<li class="list-group-item">
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
{if $add_rem != ''}
<li class="list-group-item">
<b>{Lang::T('Remaining')}</b> <span class="pull-right">{$add_rem}</span>
</li>
{/if}
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} +{Lang::T('Additional Cost')})</small><span class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost)}</span>
</li>
{else}
<li class="list-group-item">
<b>{Lang::T('Total')}</b> <span class="pull-right"
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{if $using eq 'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span>
</li>
{/if}
</ul>
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post">
<input type="hidden" name="id_customer" value="{$cust['id']}">
<input type="hidden" name="plan" value="{$plan['id']}">
<input type="hidden" name="server" value="{$server}">
<input type="hidden" name="using" value="{$using}">
<center>
<button class="btn btn-success" type="submit">{Lang::T('Recharge')}</button><br>
<a class="btn btn-link" href="{$_url}prepaid/recharge">{Lang::T('Cancel')}</a>
</center>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,62 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Recharge Account')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post" >
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
<div class="col-md-6">
<select id="personSelect" class="form-control select2" name="id_customer" style="width: 100%" data-placeholder="Select a customer...">
<option></option>
{foreach $c as $cs}
{if $id eq $cs['id']}
<option value="{$cs['id']}" selected>{$cs['username']}</option>
{else}
<option value="{$cs['id']}">{$cs['username']}</option>
{/if}
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
<div class="col-md-6">
<label><input type="radio" id="Hot" name="type" value="Hotspot"> {Lang::T('Hotspot Plans')}</label>
<label><input type="radio" id="POE" name="type" value="PPPOE"> {Lang::T('PPPOE Plans')}</label>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Routers')}</label>
<div class="col-md-6">
<select id="server" name="server" class="form-control select2">
<option value=''>Select Routers</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Plan')}</label>
<div class="col-md-6">
<select id="plan" name="plan" class="form-control select2">
<option value=''>Select Plans</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit">{Lang::T('Recharge')}</button>
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -5,7 +5,7 @@
<div class="panel panel-primary panel-hovered panel-stacked mb30"> <div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Recharge Account')}</div> <div class="panel-heading">{Lang::T('Recharge Account')}</div>
<div class="panel-body"> <div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post"> <form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-confirm">
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label> <label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
<div class="col-md-6"> <div class="col-md-6">