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