diff --git a/system/autoload/Message.php b/system/autoload/Message.php index b89deab1..94b5e06f 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -121,7 +121,7 @@ class Message public static function sendPackageNotification($customer, $package, $price, $message, $via) { - global $u; + global $user_recharge; if(empty($message)){ return ""; } @@ -141,8 +141,8 @@ class Message }else{ $msg = str_replace('[[bills]]', '', $msg); } - if ($u) { - $msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg); + if ($user_recharge) { + $msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($user_recharge['expiration'], $user_recharge['time']), $msg); } if ( !empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5 diff --git a/system/cron.php b/system/cron.php index 04c9e0be..f55a79ef 100644 --- a/system/cron.php +++ b/system/cron.php @@ -33,9 +33,9 @@ foreach ($recharges as $recharge) { if ($dateNow >= $expiration) { echo " : EXPIRED \r\n"; - $userRecharge = ORM::for_table('tbl_user_recharges')->where('id', $recharge['id'])->find_one(); + $user_recharge = ORM::for_table('tbl_user_recharges')->where('id', $recharge['id'])->find_one(); $customer = ORM::for_table('tbl_customers')->where('id', $recharge['customer_id'])->find_one(); - $plan = ORM::for_table('tbl_plans')->where('id', $userRecharge['plan_id'])->find_one(); + $plan = ORM::for_table('tbl_plans')->where('id', $user_recharge['plan_id'])->find_one(); $router = ($recharge['type'] == 'Hotspot') ? Mikrotik::info($recharge['routers']) : ORM::for_table('tbl_routers')->where('name', $recharge['routers'])->find_one(); if ($plan['is_radius']) { @@ -65,10 +65,10 @@ foreach ($recharges as $recharge) { } } - echo Message::sendPackageNotification($customer, $userRecharge['namebp'], $plan['price'], $textExpired, $config['user_notification_expired']) . "\n"; + echo Message::sendPackageNotification($customer, $user_recharge['namebp'], $plan['price'], $textExpired, $config['user_notification_expired']) . "\n"; - $userRecharge->status = 'off'; - $userRecharge->save(); + $user_recharge->status = 'off'; + $user_recharge->save(); if ($config['enable_balance'] == 'yes' && $customer['auto_renewal']) { list($bills, $add_cost) = User::getBills($recharge['customer_id']); diff --git a/system/lan/english.json b/system/lan/english.json index f050e1f2..7303ac9a 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -571,5 +571,9 @@ "how_much_balance_have_been_send": "how much balance have been send", "Current_Balance": "Current Balance", "Sender_name": "Sender name", - "how_much_balance_have_been_received": "how much balance have been received" + "how_much_balance_have_been_received": "how much balance have been received", + "Extend_Postpaid_Expiration": "Extend Postpaid Expiration", + "Allow_Extend": "Allow Extend", + "Extend_Days": "Extend Days", + "Confirmation_Message": "Confirmation Message" } \ No newline at end of file