Additional Cost Customer side

This commit is contained in:
Ibnu Maksum
2024-03-14 14:42:20 +07:00
parent 68d3c9181c
commit cc8d810d45
6 changed files with 99 additions and 25 deletions

View File

@ -51,9 +51,17 @@ switch ($action) {
break;
case 'invoice':
$id = $routes[2];
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one();
Package::createInvoice($in);
$ui->display('invoice-customer.tpl');
if(empty($id)){
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one();
}else{
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one();
}
if($in){
Package::createInvoice($in);
$ui->display('invoice-customer.tpl');
}else{
r2(U . 'voucher/list-activated', 'e', Lang::T('Not Found'));
}
default:
$ui->display('a404.tpl');
}