check if demo or not

This commit is contained in:
Ibnu Maksum
2024-06-12 15:39:43 +07:00
parent 987e21b3ce
commit 6a4ac274d1
13 changed files with 28 additions and 152 deletions

View File

@ -214,7 +214,7 @@ switch ($action) {
if ($p) {
$p = ORM::for_table('tbl_plans')->where('id', $c['plan_id'])->find_one();
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->change_customer($c, $p);
} else {
@ -242,7 +242,7 @@ switch ($action) {
if ($p) {
$routers[] = $b['routers'];
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_customer($c, $p);
} else {
@ -330,7 +330,7 @@ switch ($action) {
$p = ORM::for_table('tbl_plans')->find_one($c['plan_id']);
if($p){
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->remove_customer($d, $p);
} else {
@ -569,7 +569,7 @@ switch ($action) {
$c->save();
$p = ORM::for_table('tbl_plans')->find_one($c['plan_id']);
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->remove_customer($d, $p);
(new $p['device'])->add_customer($d, $p);