fix variable when move customer to expired plan
This commit is contained in:
parent
4323e2b879
commit
98e3304f17
@ -546,6 +546,12 @@ class Package
|
|||||||
public static function getDevice($plan)
|
public static function getDevice($plan)
|
||||||
{
|
{
|
||||||
global $DEVICE_PATH;
|
global $DEVICE_PATH;
|
||||||
|
if($plan === false){
|
||||||
|
return "none";
|
||||||
|
}
|
||||||
|
if(!isset($plan['device'])){
|
||||||
|
return "none";
|
||||||
|
}
|
||||||
if (!empty($plan['device'])) {
|
if (!empty($plan['device'])) {
|
||||||
return $DEVICE_PATH . DIRECTORY_SEPARATOR . $plan['device'] . '.php';
|
return $DEVICE_PATH . DIRECTORY_SEPARATOR . $plan['device'] . '.php';
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,8 @@ class MikrotikHotspot
|
|||||||
$mikrotik = $this->info($plan['routers']);
|
$mikrotik = $this->info($plan['routers']);
|
||||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||||
if (!empty($plan['plan_expired'])) {
|
if (!empty($plan['plan_expired'])) {
|
||||||
$p = ORM::for_table("tbl_plans")->select("name_plan")->find_one($plan['plan_expired']);
|
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||||
$this->setHotspotUserPackage($client, $customer['username'], $p['name_plan']);
|
$this->add_customer($customer, $p);
|
||||||
} else {
|
} else {
|
||||||
$this->removeHotspotUser($client, $customer['username']);
|
$this->removeHotspotUser($client, $customer['username']);
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ class MikrotikHotspot
|
|||||||
$client->sendSync($setRequest);
|
$client->sendSync($setRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setHotspotUserPackage($client, $user, $plan_name)
|
function setHotspotUserPackage($client, $username, $plan_name)
|
||||||
{
|
{
|
||||||
global $_app_stage;
|
global $_app_stage;
|
||||||
if ($_app_stage == 'demo') {
|
if ($_app_stage == 'demo') {
|
||||||
@ -288,7 +288,7 @@ class MikrotikHotspot
|
|||||||
}
|
}
|
||||||
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
|
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
|
||||||
$printRequest->setArgument('.proplist', '.id');
|
$printRequest->setArgument('.proplist', '.id');
|
||||||
$printRequest->setQuery(RouterOS\Query::where('name', $user));
|
$printRequest->setQuery(RouterOS\Query::where('name', $username));
|
||||||
$id = $client->sendSync($printRequest)->getProperty('.id');
|
$id = $client->sendSync($printRequest)->getProperty('.id');
|
||||||
|
|
||||||
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
|
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
|
||||||
|
@ -27,8 +27,8 @@ class MikrotikPppoe
|
|||||||
$mikrotik = $this->info($plan['routers']);
|
$mikrotik = $this->info($plan['routers']);
|
||||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||||
if (!empty($plan['plan_expired'])) {
|
if (!empty($plan['plan_expired'])) {
|
||||||
$p = ORM::for_table("tbl_plans")->select("name_plan")->find_one($plan['plan_expired']);
|
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||||
$this->setPpoeUserPlan($client, $customer['username'], $p['plan_expired']);
|
$this->add_customer($customer, $p);
|
||||||
} else {
|
} else {
|
||||||
$this->removePpoeUser($client, $customer['username']);
|
$this->removePpoeUser($client, $customer['username']);
|
||||||
}
|
}
|
||||||
|
@ -18,9 +18,9 @@ class Radius {
|
|||||||
|
|
||||||
function remove_customer($customer, $plan)
|
function remove_customer($customer, $plan)
|
||||||
{
|
{
|
||||||
if (empty($plan['plan_expired'])) {
|
if (!empty($plan['plan_expired'])) {
|
||||||
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
|
||||||
$this->customerAddPlan($customer, $plan);
|
$this->customerAddPlan($customer, $p);
|
||||||
} else {
|
} else {
|
||||||
$this->customerDeactivate($customer['username'], true);
|
$this->customerDeactivate($customer['username'], true);
|
||||||
}
|
}
|
||||||
|
@ -522,5 +522,10 @@
|
|||||||
"Ascending": "Naik",
|
"Ascending": "Naik",
|
||||||
"Descending": "Menurun",
|
"Descending": "Menurun",
|
||||||
"Query": "Query",
|
"Query": "Query",
|
||||||
"Add": "Menambahkan"
|
"Add": "Menambahkan",
|
||||||
|
"Logout_Successful": "Logout Berhasil",
|
||||||
|
"warning": "peringatan",
|
||||||
|
"Created___Expired": "Dibuat \/ Kedaluwarsa",
|
||||||
|
"Login___Activate_Voucher": "Masuk \/ Aktifkan Voucher",
|
||||||
|
"Voucher_activation_success__now_you_can_login": "Aktivasi voucher berhasil, sekarang Anda dapat login"
|
||||||
}
|
}
|
@ -86,7 +86,11 @@
|
|||||||
{foreach $d as $ds}
|
{foreach $d as $ds}
|
||||||
<tr {if $ds['status']=='off'}class="danger" {/if}>
|
<tr {if $ds['status']=='off'}class="danger" {/if}>
|
||||||
<td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
|
<td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
|
||||||
<td>{$ds['namebp']}</td>
|
{if $ds['type'] == 'Hotspot'}
|
||||||
|
<td><a href="{$_url}services/edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
|
||||||
|
{else}
|
||||||
|
<td><a href="{$_url}services/pppoe-edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
|
||||||
|
{/if}
|
||||||
<td>{$ds['type']}</td>
|
<td>{$ds['type']}</td>
|
||||||
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
|
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
|
||||||
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user