sendPackageNotification with customer variable
This commit is contained in:
parent
4ee3743cf3
commit
403de91fba
@ -66,10 +66,11 @@ class Message
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function sendPackageNotification($phone, $name, $package, $price, $message, $via)
|
public static function sendPackageNotification($customer, $package, $price, $message, $via)
|
||||||
{
|
{
|
||||||
global $u;
|
global $u;
|
||||||
$msg = str_replace('[[name]]', $name, $message);
|
$msg = str_replace('[[name]]', $customer['fullname'], $message);
|
||||||
|
$msg = str_replace('[[username]]', $customer['username'], $message);
|
||||||
$msg = str_replace('[[package]]', $package, $msg);
|
$msg = str_replace('[[package]]', $package, $msg);
|
||||||
$msg = str_replace('[[price]]', $price, $msg);
|
$msg = str_replace('[[price]]', $price, $msg);
|
||||||
if($u){
|
if($u){
|
||||||
|
@ -54,7 +54,7 @@ foreach ($d as $ds) {
|
|||||||
}
|
}
|
||||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||||
}
|
}
|
||||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||||
//update database user dengan status off
|
//update database user dengan status off
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
$u->save();
|
$u->save();
|
||||||
@ -109,7 +109,7 @@ foreach ($d as $ds) {
|
|||||||
}
|
}
|
||||||
Mikrotik::removePpoeActive($client, $c['username']);
|
Mikrotik::removePpoeActive($client, $c['username']);
|
||||||
}
|
}
|
||||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||||
|
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
$u->save();
|
$u->save();
|
||||||
|
@ -40,11 +40,11 @@ foreach ($d as $ds) {
|
|||||||
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
|
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
|
||||||
$price = Lang::moneyFormat($p['price']);
|
$price = Lang::moneyFormat($p['price']);
|
||||||
if ($ds['expiration'] == $day7) {
|
if ($ds['expiration'] == $day7) {
|
||||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
||||||
} else if ($ds['expiration'] == $day3) {
|
} else if ($ds['expiration'] == $day3) {
|
||||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
||||||
} else if ($ds['expiration'] == $day1) {
|
} else if ($ds['expiration'] == $day1) {
|
||||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user