diff --git a/CHANGELOG.md b/CHANGELOG.md
index fd8ea0cd..ccbdff79 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,14 @@
# CHANGELOG
+## 2024.8.19
+
+- New Page, Payment Info, To Inform Customer, which payment gateway is good
+- Move Customer UI to user-ui folder
+- Voucher Template
+- Change editor to summernote
+- Customer can change language
+
## 2024.8.6
- Fix QRCode Scanner
diff --git a/init.php b/init.php
index d3da03d8..0a875ba9 100644
--- a/init.php
+++ b/init.php
@@ -136,6 +136,11 @@ if (!empty($_SESSION['user_language'])) {
$config['language'] = $_SESSION['user_language'];
}else if (!empty($_COOKIE['user_language'])) {
$config['language'] = $_COOKIE['user_language'];
+}else if(User::getID()>0){
+ $lang = User::getAttribute("Language");
+ if(!empty($lang)){
+ $config['language'] = $lang;
+ }
}
if (empty($_SESSION['Lang'])) {
diff --git a/system/autoload/Message.php b/system/autoload/Message.php
index ce0806c6..a7fbae9b 100644
--- a/system/autoload/Message.php
+++ b/system/autoload/Message.php
@@ -96,7 +96,7 @@ class Message
public static function sendEmail($to, $subject, $body)
{
- global $config, $PAGES_PATH, $_app_stage;
+ global $config, $PAGES_PATH, $debug_mail;
if (empty($body)) {
return "";
}
@@ -116,7 +116,7 @@ class Message
} else {
$mail = new PHPMailer();
$mail->isSMTP();
- if ($_app_stage == 'Dev') {
+ if (isset($debug_mail) && $debug_mail == 'Dev') {
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
}
$mail->Host = $config['smtp_host'];
diff --git a/system/autoload/User.php b/system/autoload/User.php
index e9358620..e8e6e65f 100644
--- a/system/autoload/User.php
+++ b/system/autoload/User.php
@@ -123,7 +123,7 @@ class User
return 0;
}
- public static function getAttribute($name, $id = 0)
+ public static function getAttribute($name, $id = 0, $default = '')
{
if (!$id) {
$id = User::getID();
@@ -135,7 +135,7 @@ class User
if ($f) {
return $f['field_value'];
}
- return '';
+ return $default;
}
public static function getAttributes($endWith, $id = 0)
diff --git a/system/controllers/accounts.php b/system/controllers/accounts.php
index 06ec95ae..5a1e4726 100644
--- a/system/controllers/accounts.php
+++ b/system/controllers/accounts.php
@@ -18,7 +18,7 @@ switch ($action) {
case 'change-password':
run_hook('customer_view_change_password'); #HOOK
- $ui->display('user-change-password.tpl');
+ $ui->display('user-ui/change-password.tpl');
break;
case 'change-password-post':
@@ -67,16 +67,9 @@ switch ($action) {
break;
case 'profile':
- $d = ORM::for_table('tbl_customers')->find_one($user['id']);
- if ($d) {
- run_hook('customer_view_edit_profile'); #HOOK
- $ui->assign('d', $d);
- $ui->display('user-profile.tpl');
- } else {
- r2(U . 'home', 'e', Lang::T('Account Not Found'));
- }
+ run_hook('customer_view_edit_profile'); #HOOK
+ $ui->display('user-ui/profile.tpl');
break;
-
case 'edit-profile-post':
$fullname = _post('fullname');
$address = _post('address');
@@ -84,45 +77,32 @@ switch ($action) {
$phonenumber = _post('phonenumber');
run_hook('customer_edit_profile'); #HOOK
$msg = '';
- if (Validator::Length($fullname, 31, 2) == false) {
- $msg .= 'Full Name should be between 3 to 30 characters' . '
';
+ if (Validator::Length($fullname, 31, 1) == false) {
+ $msg .= 'Full Name should be between 1 to 30 characters' . '
';
}
if (Validator::UnsignedNumber($phonenumber) == false) {
$msg .= 'Phone Number must be a number' . '
';
}
- $d = ORM::for_table('tbl_customers')->find_one($user['id']);
- if ($d) {
- } else {
- $msg .= Lang::T('Data Not Found') . '
';
+ $user->fullname = $fullname;
+ $user->address = $address;
+ if ($_c['allow_phone_otp'] != 'yes') {
+ $user->phonenumber = $phonenumber;
+ }
+ if ($_c['allow_email_otp'] != 'yes') {
+ $user->email = $email;
}
- if ($msg == '') {
- $d->fullname = $fullname;
- $d->address = $address;
- $d->email = $email;
- $d->phonenumber = $phonenumber;
- $d->save();
+ $user->save();
- _log('[' . $user['username'] . ']: ' . Lang::T('User Updated Successfully'), 'User', $user['id']);
- r2(U . 'accounts/profile', 's', Lang::T('User Updated Successfully'));
- } else {
- r2(U . 'accounts/profile', 'e', $msg);
- }
+ _log('[' . $user['username'] . ']: ' . Lang::T('User Updated Successfully'), 'User', $user['id']);
+ r2(U . 'accounts/profile', 's', Lang::T('User Updated Successfully'));
break;
case 'phone-update':
-
- $d = ORM::for_table('tbl_customers')->find_one($user['id']);
- if ($d) {
- //run_hook('customer_view_edit_profile'); #HOOK
- $ui->assign('d', $d);
- $ui->assign('new_phone', $_SESSION['new_phone']);
- $ui->display('user-phone-update.tpl');
- } else {
- r2(U . 'home', 'e', Lang::T('Account Not Found'));
- }
+ $ui->assign('new_phone', $_SESSION['new_phone']);
+ $ui->display('user-ui/phone-update.tpl');
break;
case 'phone-update-otp':
@@ -131,7 +111,7 @@ switch ($action) {
$otpPath = $CACHE_PATH . '/sms/';
$_SESSION['new_phone'] = $phone;
// Validate the phone number format
- if (!preg_match('/^[0-9]{10,}$/', $phone)) {
+ if (!preg_match('/^[0-9]{10,}$/', $phone) || empty($phone)) {
r2(U . 'accounts/phone-update', 'e', Lang::T('Invalid phone number format'));
}
@@ -139,39 +119,35 @@ switch ($action) {
r2(U . 'accounts/phone-update', 'e', Lang::T('SMS server not Available, Please try again later'));
}
- if (!empty($config['sms_url'])) {
- if (!empty($phone)) {
- $d = ORM::for_table('tbl_customers')->where('username', $username)->where('phonenumber', $phone)->find_one();
- if ($d) {
- r2(U . 'accounts/phone-update', 'e', Lang::T('You cannot use your current phone number'));
- }
- if (!file_exists($otpPath)) {
- mkdir($otpPath);
- touch($otpPath . 'index.html');
- }
- $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
- $phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt";
+ $d = ORM::for_table('tbl_customers')->whereNotEqual('username', $username)->where('phonenumber', $phone)->find_one();
+ if ($d) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Phone number already registered by another customer'));
+ }
+ if (!file_exists($otpPath)) {
+ mkdir($otpPath);
+ touch($otpPath . 'index.html');
+ }
+ $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
+ $phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt";
- // expired 10 minutes
- if (file_exists($otpFile) && time() - filemtime($otpFile) < 600) {
- r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ' . (600 - (time() - filemtime($otpFile))) . ' seconds before sending another SMS'));
- } else {
- $otp = rand(100000, 999999);
- file_put_contents($otpFile, $otp);
- file_put_contents($phoneFile, $phone);
- // send send OTP to user
- if ($config['phone_otp_type'] === 'sms') {
- Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
- } elseif ($config['phone_otp_type'] === 'whatsapp') {
- Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
- } elseif ($config['phone_otp_type'] === 'both') {
- Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
- Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
- }
- //redirect after sending OTP
- r2(U . 'accounts/phone-update', 'e', Lang::T('Verification code has been sent to your phone'));
- }
+ // expired 10 minutes
+ if (file_exists($otpFile) && time() - filemtime($otpFile) < 600) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Please wait ') . (600 - (time() - filemtime($otpFile))) . Lang::T(' seconds before sending another SMS'));
+ } else {
+ $otp = rand(100000, 999999);
+ file_put_contents($otpFile, $otp);
+ file_put_contents($phoneFile, $phone);
+ // send send OTP to user
+ if ($config['phone_otp_type'] === 'sms') {
+ Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
+ } elseif ($config['phone_otp_type'] === 'whatsapp') {
+ Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
+ } elseif ($config['phone_otp_type'] === 'both') {
+ Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
+ Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
}
+ //redirect after sending OTP
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Verification code has been sent to your phone'));
}
break;
@@ -185,60 +161,157 @@ switch ($action) {
// Validate the phone number format
if (!preg_match('/^[0-9]{10,}$/', $phone)) {
r2(U . 'accounts/phone-update', 'e', Lang::T('Invalid phone number format'));
+ }
+
+ if (empty($config['sms_url'])) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('SMS server not Available, Please try again later'));
+ }
+
+ $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
+ $phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt";
+
+ // Check if OTP file exists
+ if (!file_exists($otpFile)) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Please request OTP first'));
exit();
}
- if (!empty($config['sms_url'])) {
- $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
- $phoneFile = $otpPath . sha1($username . $db_pass) . "_phone.txt";
-
- // Check if OTP file exists
- if (!file_exists($otpFile)) {
- r2(U . 'accounts/phone-update', 'e', Lang::T('Please request OTP first'));
- exit();
- }
-
- // expired 10 minutes
- if (time() - filemtime($otpFile) > 1200) {
- unlink($otpFile);
- unlink($phoneFile);
- r2(U . 'accounts/phone-update', 'e', Lang::T('Verification code expired'));
- exit();
- } else {
- $code = file_get_contents($otpFile);
-
- // Check if OTP code matches
- if ($code != $otp_code) {
- r2(U . 'accounts/phone-update', 'e', Lang::T('Wrong Verification code'));
- exit();
- }
-
- // Check if the phone number matches the one that requested the OTP
- $savedPhone = file_get_contents($phoneFile);
- if ($savedPhone !== $phone) {
- r2(U . 'accounts/phone-update', 'e', Lang::T('The phone number does not match the one that requested the OTP'));
- exit();
- }
-
- // OTP verification successful, delete OTP and phone number files
- unlink($otpFile);
- unlink($phoneFile);
- }
- } else {
- r2(U . 'accounts/phone-update', 'e', Lang::T('SMS server not available'));
+ // expired 10 minutes
+ if (time() - filemtime($otpFile) > 1200) {
+ unlink($otpFile);
+ unlink($phoneFile);
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Verification code expired'));
exit();
+ } else {
+ $code = file_get_contents($otpFile);
+
+ // Check if OTP code matches
+ if ($code != $otp_code) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('Wrong Verification code'));
+ exit();
+ }
+
+ // Check if the phone number matches the one that requested the OTP
+ $savedPhone = file_get_contents($phoneFile);
+ if ($savedPhone !== $phone) {
+ r2(U . 'accounts/phone-update', 'e', Lang::T('The phone number does not match the one that requested the OTP'));
+ exit();
+ }
+
+ // OTP verification successful, delete OTP and phone number files
+ unlink($otpFile);
+ unlink($phoneFile);
}
// Update the phone number in the database
- $d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
- if ($d) {
- $d->phonenumber = Lang::phoneFormat($phone);
- $d->save();
- }
+ $user->phonenumber = Lang::phoneFormat($phone);
+ $user->save();
r2(U . 'accounts/profile', 's', Lang::T('Phone number updated successfully'));
break;
+ case 'email-update':
+ $ui->assign('new_email', $_SESSION['new_email']);
+ $ui->display('user-ui/email-update.tpl');
+ break;
+ case 'email-update-otp':
+ $email = trim(_post('email'));
+ $username = $user['username'];
+ $otpPath = $CACHE_PATH . '/email/';
+ $_SESSION['new_email'] = $email;
+ // Validate the phone number format
+ if (!Validator::Email($email)) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Invalid Email address format'));
+ }
+
+ if (empty($config['smtp_host'])) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Email server not Available, Please ask admin to configure it'));
+ }
+
+ $d = ORM::for_table('tbl_customers')->whereNotEqual('username', $username)->where('email', $email)->find_one();
+ if ($d) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Email already used by another Customer'));
+ }
+ if (!file_exists($otpPath)) {
+ mkdir($otpPath);
+ touch($otpPath . 'index.html');
+ }
+ $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
+ $emailFile = $otpPath . sha1($username . $db_pass) . "_email.txt";
+
+ // expired 10 minutes
+ if (file_exists($otpFile) && time() - filemtime($otpFile) < 600) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Please wait ') . (600 - (time() - filemtime($otpFile))) . Lang::T(' seconds before sending another Email'));
+ } else {
+ $otp = rand(100000, 999999);
+ file_put_contents($otpFile, $otp);
+ file_put_contents($emailFile, $email);
+ // send OTP to user
+ $body = Lang::T("Hello") . ' ' . $user['fullname'] . ",\n\n" . Lang::T("Your Email Verification Code is:") . " $otp";
+ Message::sendEmail($email, Lang::T('Change Email Verification Code'), $body);
+ //redirect after sending OTP
+ r2(U . 'accounts/email-update', 'e', Lang::T('Verification code has been sent to your email. Check Spam folder if not found.'));
+ }
+
+ break;
+
+ case 'email-update-post':
+ $email = trim(_post('email'));
+ $otp_code = _post('otp');
+ $username = $user['username'];
+ $otpPath = $CACHE_PATH . '/email/';
+ // Validate the phone number format
+ if (!Validator::Email($email)) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Invalid Email address format'));
+ exit();
+ }
+
+ if (empty($config['smtp_host'])) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Email server not Available, Please ask admin to configure it'));
+ }
+
+ $otpFile = $otpPath . sha1($username . $db_pass) . ".txt";
+ $emailFile = $otpPath . sha1($username . $db_pass) . "_email.txt";
+
+ // Check if OTP file exists
+ if (!file_exists($otpFile)) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Please request OTP first'));
+ exit();
+ }
+
+ // expired 10 minutes
+ if (time() - filemtime($otpFile) > 1200) {
+ unlink($otpFile);
+ unlink($emailFile);
+ r2(U . 'accounts/email-update', 'e', Lang::T('Verification code expired'));
+ exit();
+ } else {
+ $code = file_get_contents($otpFile);
+
+ // Check if OTP code matches
+ if ($code != $otp_code) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('Wrong Verification code'));
+ exit();
+ }
+
+ // Check if the phone number matches the one that requested the OTP
+ $savedEmail = file_get_contents($emailFile);
+ if ($savedEmail !== $email) {
+ r2(U . 'accounts/email-update', 'e', Lang::T('The Email Address does not match the one that requested the OTP'));
+ exit();
+ }
+
+ // OTP verification successful, delete OTP and phone number files
+ unlink($otpFile);
+ unlink($emailFile);
+ }
+
+ $user->email = $email;
+ $user->save();
+
+ r2(U . 'accounts/profile', 's', Lang::T('Email Address updated successfully'));
+ break;
+
case 'language-update-post':
global $root_path;
$selected_language = _req('lang', 'english');
@@ -255,7 +328,7 @@ switch ($action) {
$_SESSION['Lang'] = $_L;
file_put_contents($lan_file, json_encode($_L));
}
-
+ User::setAttribute("Language", $selected_language);
r2($_SERVER['HTTP_REFERER'], 's', ucwords($selected_language));
diff --git a/system/controllers/customers.php b/system/controllers/customers.php
index f486b2c2..379db52e 100644
--- a/system/controllers/customers.php
+++ b/system/controllers/customers.php
@@ -440,7 +440,7 @@ switch ($action) {
// Send welcome message
if (isset($_POST['send_welcome_message']) && $_POST['send_welcome_message'] == true) {
$welcomeMessage = Lang::getNotifText('welcome_message');
- $welcomeMessage = str_replace('[[company_name]]', $config['CompanyName'], $welcomeMessage);
+ $welcomeMessage = str_replace('[[company]]', $config['CompanyName'], $welcomeMessage);
$welcomeMessage = str_replace('[[name]]', $d['fullname'], $welcomeMessage);
$welcomeMessage = str_replace('[[username]]', $d['username'], $welcomeMessage);
$welcomeMessage = str_replace('[[password]]', $d['password'], $welcomeMessage);
diff --git a/system/controllers/home.php b/system/controllers/home.php
index 3e99d443..7c51018a 100644
--- a/system/controllers/home.php
+++ b/system/controllers/home.php
@@ -325,4 +325,4 @@ $abills = User::getAttributes("Bill");
$ui->assign('abills', $abills);
run_hook('view_customer_dashboard'); #HOOK
-$ui->display('user-dashboard.tpl');
+$ui->display('user-ui/dashboard.tpl');
diff --git a/system/controllers/login.php b/system/controllers/login.php
index e44da6d1..75bf4a35 100644
--- a/system/controllers/login.php
+++ b/system/controllers/login.php
@@ -291,9 +291,9 @@ switch ($do) {
run_hook('customer_view_login'); #HOOK
if ($config['disable_registration'] == 'yes') {
$ui->assign('code', alphanumeric(_get('code'), "-"));
- $ui->display('user-login-noreg.tpl');
+ $ui->display('user-ui/login-noreg.tpl');
} else {
- $ui->display('user-login.tpl');
+ $ui->display('user-ui/login.tpl');
}
break;
}
diff --git a/system/controllers/mail.php b/system/controllers/mail.php
index c54318fd..6549adac 100644
--- a/system/controllers/mail.php
+++ b/system/controllers/mail.php
@@ -29,7 +29,7 @@ switch ($action) {
$ui->assign('tipe', 'view');
$ui->assign('_system_menu', 'inbox');
$ui->assign('_title', Lang::T('Inbox'));
- $ui->display('user-inbox.tpl');
+ $ui->display('user-ui/inbox.tpl');
break;
case 'delete':
if($routes['2']){
@@ -57,5 +57,5 @@ switch ($action) {
$ui->assign('mails', $mails);
$ui->assign('_system_menu', 'inbox');
$ui->assign('_title', Lang::T('Inbox'));
- $ui->display('user-inbox.tpl');
+ $ui->display('user-ui/inbox.tpl');
}
\ No newline at end of file
diff --git a/system/controllers/order.php b/system/controllers/order.php
index ce778e30..19aae154 100644
--- a/system/controllers/order.php
+++ b/system/controllers/order.php
@@ -15,7 +15,7 @@ switch ($action) {
$ui->assign('_system_menu', 'voucher');
$ui->assign('_title', Lang::T('Order Voucher'));
run_hook('customer_view_order'); #HOOK
- $ui->display('user-order.tpl');
+ $ui->display('user-ui/order.tpl');
break;
case 'history':
$ui->assign('_system_menu', 'history');
@@ -24,7 +24,7 @@ switch ($action) {
$ui->assign('d', $d);
$ui->assign('_title', Lang::T('Order History'));
run_hook('customer_view_order_history'); #HOOK
- $ui->display('user-orderHistory.tpl');
+ $ui->display('user-ui/orderHistory.tpl');
break;
case 'balance':
if (strpos($user['email'], '@') === false) {
@@ -34,7 +34,7 @@ switch ($action) {
$ui->assign('_system_menu', 'balance');
$plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->where('prepaid', 'yes')->find_many();
$ui->assign('plans_balance', $plans_balance);
- $ui->display('user-orderBalance.tpl');
+ $ui->display('user-ui/orderBalance.tpl');
break;
case 'package':
if (strpos($user['email'], '@') === false) {
@@ -48,24 +48,71 @@ switch ($action) {
}
if (!empty($_SESSION['nux-router'])) {
if ($_SESSION['nux-router'] == 'radius') {
- $radius_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
- $radius_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
+ $radius_pppoe = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where('is_radius', 1)
+ ->where('type', 'PPPOE')
+ ->where('prepaid', 'yes')->find_many();
+ $radius_hotspot = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where('is_radius', 1)
+ ->where('type', 'Hotspot')
+ ->where('prepaid', 'yes')->find_many();
} else {
$routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many();
$rs = [];
foreach ($routers as $r) {
$rs[] = $r['name'];
}
- $plans_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
- $plans_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
+ $plans_pppoe = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where_in('routers', $rs)
+ ->where('is_radius', 0)
+ ->where('type', 'PPPOE')
+ ->where('prepaid', 'yes')
+ ->find_many();
+ $plans_hotspot = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where_in('routers', $rs)
+ ->where('is_radius', 0)
+ ->where('type', 'Hotspot')
+ ->where('prepaid', 'yes')
+ ->find_many();
}
} else {
- $radius_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
- $radius_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
+ $radius_pppoe = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where('is_radius', 1)
+ ->where('type', 'PPPOE')
+ ->where('prepaid', 'yes')
+ ->find_many();
+ $radius_hotspot = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where('is_radius', 1)
+ ->where('type', 'Hotspot')
+ ->where('prepaid', 'yes')
+ ->find_many();
$routers = ORM::for_table('tbl_routers')->find_many();
- $plans_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
- $plans_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
+ $plans_pppoe = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')
+ ->where('is_radius', 0)
+ ->where('type', 'PPPOE')
+ ->where('prepaid', 'yes')
+ ->find_many();
+ $plans_hotspot = ORM::for_table('tbl_plans')
+ ->where('plan_type', $account_type)
+ ->where('enabled', '1')->where('is_radius', 0)
+ ->where('type', 'Hotspot')
+ ->where('prepaid', 'yes')
+ ->find_many();
}
$ui->assign('routers', $routers);
$ui->assign('radius_pppoe', $radius_pppoe);
@@ -73,7 +120,7 @@ switch ($action) {
$ui->assign('plans_pppoe', $plans_pppoe);
$ui->assign('plans_hotspot', $plans_hotspot);
run_hook('customer_view_order_plan'); #HOOK
- $ui->display('user-orderPlan.tpl');
+ $ui->display('user-ui/orderPlan.tpl');
break;
case 'unpaid':
$d = ORM::for_table('tbl_payment_gateway')
@@ -138,7 +185,7 @@ switch ($action) {
$ui->assign('plan', $plan);
$ui->assign('bandw', $bandw);
$ui->assign('_title', 'TRX #' . $trxid);
- $ui->display('user-orderView.tpl');
+ $ui->display('user-ui/orderView.tpl');
break;
case 'pay':
if ($config['enable_balance'] != 'yes') {
@@ -328,7 +375,7 @@ switch ($action) {
$ui->assign('router', $router_name);
$ui->assign('plan', $plan);
$ui->assign('tax', $tax);
- $ui->display('user-sendPlan.tpl');
+ $ui->display('user-ui/sendPlan.tpl');
break;
case 'gateway':
$ui->assign('_title', Lang::T('Select Payment Gateway'));
@@ -366,7 +413,7 @@ switch ($action) {
$ui->assign('add_cost', $add_cost);
$ui->assign('bills', $bills);
$ui->assign('plan', $plan);
- $ui->display('user-selectGateway.tpl');
+ $ui->display('user-ui/selectGateway.tpl');
break;
} else {
sendTelegram("Payment Gateway not set, please set it in Settings");
diff --git a/system/controllers/page.php b/system/controllers/page.php
index d1bd9ad9..dcf9663d 100644
--- a/system/controllers/page.php
+++ b/system/controllers/page.php
@@ -16,6 +16,6 @@ if(file_exists(__DIR__."/../../pages/".str_replace(".","",$action).".html")){
$ui->assign("PageFile",$action);
$ui->assign("pageHeader",$action);
run_hook('customer_view_page'); #HOOK
- $ui->display('user-pages.tpl');
+ $ui->display('user-ui/pages.tpl');
}else
- $ui->display('404.tpl');
\ No newline at end of file
+ $ui->display('user-ui/404.tpl');
\ No newline at end of file
diff --git a/system/controllers/pages.php b/system/controllers/pages.php
index 4e082c4f..0260238d 100644
--- a/system/controllers/pages.php
+++ b/system/controllers/pages.php
@@ -17,7 +17,7 @@ if (strpos($action, "-reset") !== false) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
}
$action = str_replace("-reset", "", $action);
- $path = $PAGES_PATH . "/" . str_replace(".", "", $action) . ".html";
+ $path = "$PAGES_PATH/" . str_replace(".", "", $action) . ".html";
$temp = "pages_template/" . str_replace(".", "", $action) . ".html";
if (file_exists($temp)) {
if (!copy($temp, $path)) {
@@ -31,7 +31,7 @@ if (strpos($action, "-reset") !== false) {
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
}
- $path = $PAGES_PATH . "/" . str_replace(".", "", $action) . ".html";
+ $path = "$PAGES_PATH/" . str_replace(".", "", $action) . ".html";
$ui->assign("action", $action);
//echo $path;
run_hook('view_edit_pages'); #HOOK
@@ -47,13 +47,13 @@ if (strpos($action, "-reset") !== false) {
}
if (file_exists($path)) {
if ($action == 'Voucher') {
- if (!file_exists($PAGES_PATH . "/vouchers/")) {
- mkdir($PAGES_PATH . "/vouchers/");
+ if (!file_exists("$PAGES_PATH/vouchers/")) {
+ mkdir("$PAGES_PATH/vouchers/");
if (file_exists("pages_template/vouchers/")) {
- File::copyFolder("pages_template/vouchers/", $PAGES_PATH . "/vouchers/");
+ File::copyFolder("pages_template/vouchers/", "$PAGES_PATH/vouchers/");
}
}
- $ui->assign("vouchers", scandir($PAGES_PATH . "/vouchers/"));
+ $ui->assign("vouchers", scandir("$PAGES_PATH/vouchers/"));
}
$html = file_get_contents($path);
$ui->assign("htmls", str_replace(["
- {Lang::T('OTP is required when user want to change phone number')} + {Lang::T('OTP is required when user want to change phone number and registration')}
{Lang::T('The method which OTP will be sent to user')}
++ {Lang::T('OTP is required when user want to change Email Address')} +
+