fix extend 3 dyas
This commit is contained in:
parent
e5605e2d6b
commit
b807581d8c
@ -836,21 +836,33 @@ switch ($action) {
|
|||||||
//expired
|
//expired
|
||||||
$expiration = date('Y-m-d', strtotime(" +$days day"));
|
$expiration = date('Y-m-d', strtotime(" +$days day"));
|
||||||
}
|
}
|
||||||
$tur->expiration = $expiration;
|
|
||||||
$tur->status = "on";
|
|
||||||
$tur->save();
|
|
||||||
App::setToken($stoken, $id);
|
App::setToken($stoken, $id);
|
||||||
$c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']);
|
$c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']);
|
||||||
$p = ORM::for_table('tbl_plans')->find_one($d['plan_id']);
|
if ($c) {
|
||||||
$dvc = Package::getDevice($p);
|
$p = ORM::for_table('tbl_plans')->find_one($tur['plan_id']);
|
||||||
if ($_app_stage != 'demo') {
|
if ($p) {
|
||||||
if (file_exists($dvc)) {
|
$dvc = Package::getDevice($p);
|
||||||
require_once $dvc;
|
if ($_app_stage != 'demo') {
|
||||||
(new $p['device'])->add_customer($c, $p);
|
if (file_exists($dvc)) {
|
||||||
|
require_once $dvc;
|
||||||
|
(new $p['device'])->add_customer($c, $p);
|
||||||
|
} else {
|
||||||
|
new Exception(Lang::T("Devices Not Found"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$tur->expiration = $expiration;
|
||||||
|
$tur->status = "on";
|
||||||
|
$tur->save();
|
||||||
} else {
|
} else {
|
||||||
new Exception(Lang::T("Devices Not Found"));
|
r2(U . 'plan', 's', "Plan not found");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
r2(U . 'plan', 's', "Customer not found");
|
||||||
}
|
}
|
||||||
|
Message::sendTelegram("#u$tur[username] #extend #" . $p['type'] . " \n" . $p['name_plan'] .
|
||||||
|
"\nLocation: " . $p['routers'] .
|
||||||
|
"\nCustomer: " . $c['fullname'] .
|
||||||
|
"\nNew Expired: " . Lang::dateAndTimeFormat($expiration, $tur['time']));
|
||||||
_log("$admin[fullname] extend Customer $tur[customer_id] $tur[username] for $days days", $admin['user_type'], $admin['id']);
|
_log("$admin[fullname] extend Customer $tur[customer_id] $tur[username] for $days days", $admin['user_type'], $admin['id']);
|
||||||
r2(U . 'plan', 's', "Extend until $expiration");
|
r2(U . 'plan', 's', "Extend until $expiration");
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user