Path Configuration

This commit is contained in:
Ibnu Maksum
2024-02-26 14:38:04 +07:00
parent 617e628b04
commit d2fa9be8d1
18 changed files with 270 additions and 242 deletions

View File

@ -1,4 +1,5 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* by https://t.me/ibnux
@ -10,38 +11,38 @@ $ui->assign('_system_menu', 'paymentgateway');
$action = alphanumeric($routes['1']);
$ui->assign('_admin', $admin);
if(file_exists('system/paymentgateway/'.$action.'.php')){
include 'system/paymentgateway/'.$action.'.php';
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php')) {
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(function_exists($action.'_save_config')){
call_user_func($action.'_save_config');
}else{
if (function_exists($action . '_save_config')) {
call_user_func($action . '_save_config');
} else {
$ui->display('a404.tpl');
}
}else{
if(function_exists($action.'_show_config')){
call_user_func($action.'_show_config');
}else{
} else {
if (function_exists($action . '_show_config')) {
call_user_func($action . '_show_config');
} else {
$ui->display('a404.tpl');
}
}
}else{
if(!empty($action)){
} else {
if (!empty($action)) {
r2(U . 'paymentgateway', 'w', Lang::T('Payment Gateway Not Found'));
}else{
$files = scandir('system/paymentgateway/');
foreach($files as $file){
if(pathinfo($file, PATHINFO_EXTENSION)=='php'){
$pgs[] = str_replace('.php','',$file);
} else {
$files = scandir($PAYMENTGATEWAY_PATH);
foreach ($files as $file) {
if (pathinfo($file, PATHINFO_EXTENSION) == 'php') {
$pgs[] = str_replace('.php', '', $file);
}
}
if(isset($_POST['payment_gateway'])){
if (isset($_POST['payment_gateway'])) {
$payment_gateway = _post('payment_gateway');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one();
if($d){
if ($d) {
$d->value = $payment_gateway;
$d->save();
}else{
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'payment_gateway';
$d->value = $payment_gateway;
@ -53,4 +54,4 @@ if(file_exists('system/paymentgateway/'.$action.'.php')){
$ui->assign('pgs', $pgs);
$ui->display('paymentgateway.tpl');
}
}
}