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

@ -156,7 +156,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
if ($tur['status'] != 'on') {
$p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']);
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
(new $p['device'])->add_customer($user, $p);
} else {
@ -188,7 +188,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
if ($bill) {
$p = ORM::for_table('tbl_plans')->where('id', $bill['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'])->remove_customer($user, $p);
} else {
@ -212,7 +212,7 @@ if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
$bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['id'])->where('username', $user['username'])->findOne();
$p = ORM::for_table('tbl_plans')->where('id', $bill['plan_id'])->find_one();
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
if (file_exists($dvc) && $_app_stage != 'demo') {
require_once $dvc;
if ($_GET['mikrotik'] == 'login') {
(new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $bill['routers']);