mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-02-24 15:36:33 +08:00
Formatting
This commit is contained in:
parent
a7502aa8fb
commit
8824489704
1 changed files with 35 additions and 39 deletions
|
@ -35,7 +35,7 @@ EOT;
|
|||
switch ($action) {
|
||||
case 'sync':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_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");
|
||||
}
|
||||
set_time_limit(-1);
|
||||
$plans = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
|
||||
|
@ -86,8 +86,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'recharge':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$ui->assign('xfooter', $select2_customer);
|
||||
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
|
||||
|
@ -102,8 +102,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'recharge-user':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
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);
|
||||
|
@ -119,8 +119,8 @@ switch ($action) {
|
|||
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");
|
||||
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');
|
||||
$type = _post('type');
|
||||
|
@ -138,8 +138,7 @@ switch ($action) {
|
|||
if (Package::rechargeUser($id_customer, $server, $plan, "Recharge", $admin['fullname'])) {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
Package::createInvoice($in);
|
||||
$ui->display('invoice.tpl');
|
||||
_log('[' . $admin['username'] . ']: ' . 'Recharge ' . $c['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', $admin['user_type'], $admin['id']);
|
||||
} else {
|
||||
|
@ -152,19 +151,18 @@ switch ($action) {
|
|||
|
||||
case 'view':
|
||||
$id = $routes['2'];
|
||||
$d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
$ui->assign('in', $d);
|
||||
|
||||
$in = ORM::for_table('tbl_transactions')->where('id', $id)->find_one();
|
||||
$ui->assign('in', $in);
|
||||
if (!empty($routes['3']) && $routes['3'] == 'send') {
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $d['username'])->find_one();
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $in['username'])->find_one();
|
||||
if ($c) {
|
||||
Message::sendInvoice($c, $d);
|
||||
Message::sendInvoice($c, $in);
|
||||
r2(U . 'prepaid/view/' . $id, 's', "Success send to customer");
|
||||
}
|
||||
r2(U . 'prepaid/view/' . $id, 'd', "Customer not found");
|
||||
}
|
||||
Package::createInvoice($in);
|
||||
$ui->assign('_title', 'View Invoice');
|
||||
$ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time']));
|
||||
$ui->display('invoice.tpl');
|
||||
break;
|
||||
|
||||
|
@ -172,9 +170,9 @@ switch ($action) {
|
|||
case 'print':
|
||||
$content = $_POST['content'];
|
||||
if (!empty($content)) {
|
||||
if($_POST['nux']=='print'){
|
||||
if ($_POST['nux'] == 'print') {
|
||||
//header("Location: nux://print?text=".urlencode($content));
|
||||
$ui->assign('nuxprint', "nux://print?text=".urlencode($content));
|
||||
$ui->assign('nuxprint', "nux://print?text=" . urlencode($content));
|
||||
}
|
||||
$ui->assign('content', $content);
|
||||
} else {
|
||||
|
@ -190,7 +188,7 @@ switch ($action) {
|
|||
|
||||
case 'edit':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) {
|
||||
_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 = $routes['2'];
|
||||
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
|
||||
|
@ -208,7 +206,7 @@ switch ($action) {
|
|||
|
||||
case 'delete':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_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 = $routes['2'];
|
||||
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
|
||||
|
@ -237,7 +235,7 @@ switch ($action) {
|
|||
|
||||
case 'edit-post':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_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");
|
||||
}
|
||||
$username = _post('username');
|
||||
$id_plan = _post('id_plan');
|
||||
|
@ -367,8 +365,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'add-voucher':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$ui->assign('_title', Lang::T('Add Vouchers'));
|
||||
$c = ORM::for_table('tbl_customers')->find_many();
|
||||
|
@ -383,7 +381,7 @@ switch ($action) {
|
|||
|
||||
case 'remove-voucher':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_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");
|
||||
}
|
||||
$d = ORM::for_table('tbl_voucher')->where_equal('status', '1')->findMany();
|
||||
if ($d) {
|
||||
|
@ -501,8 +499,8 @@ switch ($action) {
|
|||
$ui->display('print-voucher.tpl');
|
||||
break;
|
||||
case 'voucher-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");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$type = _post('type');
|
||||
$plan = _post('plan');
|
||||
|
@ -612,7 +610,7 @@ switch ($action) {
|
|||
$content .= Lang::pad("", '=') . "\n";
|
||||
$content .= Lang::pad($config['note'], ' ', 2) . "\n";
|
||||
$ui->assign('_title', Lang::T('View'));
|
||||
$ui->assign('wa', urlencode("```$content```"));
|
||||
$ui->assign('whatsapp', urlencode("```$content```"));
|
||||
$ui->display('voucher-view.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/voucher/', 'e', Lang::T('Voucher Not Found'));
|
||||
|
@ -620,7 +618,7 @@ switch ($action) {
|
|||
break;
|
||||
case 'voucher-delete':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_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 = $routes['2'];
|
||||
run_hook('delete_voucher'); #HOOK
|
||||
|
@ -632,8 +630,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'refill':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$ui->assign('xfooter', $select2_customer);
|
||||
$ui->assign('_title', Lang::T('Refill Account'));
|
||||
|
@ -643,8 +641,8 @@ switch ($action) {
|
|||
break;
|
||||
|
||||
case 'refill-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");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$code = _post('code');
|
||||
$user = ORM::for_table('tbl_customers')->where('id', _post('id_customer'))->find_one();
|
||||
|
@ -657,8 +655,7 @@ switch ($action) {
|
|||
$v1->user = $user['username'];
|
||||
$v1->save();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
Package::createInvoice($in);
|
||||
$ui->display('invoice.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/refill', 'e', "Failed to refill account");
|
||||
|
@ -668,8 +665,8 @@ switch ($action) {
|
|||
}
|
||||
break;
|
||||
case 'deposit':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$ui->assign('_title', Lang::T('Refill Balance'));
|
||||
$ui->assign('xfooter', $select2_customer);
|
||||
|
@ -678,8 +675,8 @@ switch ($action) {
|
|||
$ui->display('deposit.tpl');
|
||||
break;
|
||||
case 'deposit-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");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$user = _post('id_customer');
|
||||
$plan = _post('id_plan');
|
||||
|
@ -689,8 +686,7 @@ switch ($action) {
|
|||
if (Package::rechargeUser($user, 'balance', $plan, "Deposit", $admin['fullname'])) {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $user)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$ui->assign('in', $in);
|
||||
$ui->assign('date', date("Y-m-d H:i:s"));
|
||||
Package::createInvoice($in);
|
||||
$ui->display('invoice.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/refill', 'e', "Failed to refill account");
|
||||
|
|
Loading…
Reference in a new issue