check expired payments
This commit is contained in:
parent
b15fdf1d6a
commit
0cf5483353
@ -326,10 +326,24 @@ $vpn = ORM::for_table('tbl_port_pool')
|
|||||||
$ui->assign('cf', $tcf);
|
$ui->assign('cf', $tcf);
|
||||||
$ui->assign('vpn', $vpn);
|
$ui->assign('vpn', $vpn);
|
||||||
|
|
||||||
$ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
|
$unpaids = [];
|
||||||
|
$unpaid = ORM::for_table('tbl_payment_gateway')
|
||||||
->where('username', $user['username'])
|
->where('username', $user['username'])
|
||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->find_one());
|
->find_one();
|
||||||
|
|
||||||
|
// check expired payments
|
||||||
|
foreach($unpaid as $up) {
|
||||||
|
if(strtotime($up['expired_date']) < time() || strtotime($up['created_date'], "+24 HOUR") < time()){
|
||||||
|
$up->status = 4;
|
||||||
|
$up->save();
|
||||||
|
}else{
|
||||||
|
$unpaids[] = $up;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$ui->assign('unpaid', $unpaids);
|
||||||
$ui->assign('code', alphanumeric(_get('code'), "-"));
|
$ui->assign('code', alphanumeric(_get('code'), "-"));
|
||||||
|
|
||||||
$abills = User::getAttributes("Bill");
|
$abills = User::getAttributes("Bill");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user