Formatting

This commit is contained in:
Ibnu Maksum 2024-02-26 11:10:52 +07:00
parent a7502aa8fb
commit 8824489704
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -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;
@ -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'));
@ -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");
@ -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");