Payment info

This commit is contained in:
Ibnu Maksum 2024-08-19 16:13:51 +07:00
parent e908ade918
commit d83c2ec037
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
4 changed files with 63 additions and 58 deletions

View File

@ -403,7 +403,7 @@ switch ($action) {
_log(Lang::T("Payment Gateway not set, please set it in Settings")); _log(Lang::T("Payment Gateway not set, please set it in Settings"));
r2(U . "home", 'e', Lang::T("Failed to create Transaction..")); r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
} }
if (count($pgs) > 1) { if (count($pgs) > 0) {
$ui->assign('pgs', $pgs); $ui->assign('pgs', $pgs);
if ($tax_enable === 'yes') { if ($tax_enable === 'yes') {
$ui->assign('tax', $tax); $ui->assign('tax', $tax);
@ -416,13 +416,9 @@ switch ($action) {
$ui->display('user-ui/selectGateway.tpl'); $ui->display('user-ui/selectGateway.tpl');
break; break;
} else { } else {
if (empty($pgs[0])) {
sendTelegram("Payment Gateway not set, please set it in Settings"); sendTelegram("Payment Gateway not set, please set it in Settings");
_log(Lang::T("Payment Gateway not set, please set it in Settings")); _log(Lang::T("Payment Gateway not set, please set it in Settings"));
r2(U . "home", 'e', Lang::T("Failed to create Transaction..")); r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
} else {
$_POST['gateway'] = $pgs[0];
}
} }
case 'buy': case 'buy':
$gateway = _post('gateway'); $gateway = _post('gateway');

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/) * PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* by https://t.me/ibnux * by https://t.me/ibnux
@ -16,7 +17,7 @@ if(strpos($action,"-reset")!==false){
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
} }
$action = str_replace("-reset", "", $action); $action = str_replace("-reset", "", $action);
$path = "pages/".str_replace(".","",$action).".html"; $path = "$PAGES_PATH/" . str_replace(".", "", $action) . ".html";
$temp = "pages_template/" . str_replace(".", "", $action) . ".html"; $temp = "pages_template/" . str_replace(".", "", $action) . ".html";
if (file_exists($temp)) { if (file_exists($temp)) {
if (!copy($temp, $path)) { if (!copy($temp, $path)) {
@ -30,7 +31,7 @@ if(strpos($action,"-reset")!==false){
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
} }
$path = "pages/".str_replace(".","",$action).".html"; $path = "$PAGES_PATH/" . str_replace(".", "", $action) . ".html";
$ui->assign("action", $action); $ui->assign("action", $action);
//echo $path; //echo $path;
run_hook('view_edit_pages'); #HOOK run_hook('view_edit_pages'); #HOOK
@ -46,13 +47,13 @@ if(strpos($action,"-reset")!==false){
} }
if (file_exists($path)) { if (file_exists($path)) {
if ($action == 'Voucher') { if ($action == 'Voucher') {
if(!file_exists("pages/vouchers/")){ if (!file_exists("$PAGES_PATH/vouchers/")) {
mkdir("pages/vouchers/"); mkdir("$PAGES_PATH/vouchers/");
if (file_exists("pages_template/vouchers/")) { if (file_exists("pages_template/vouchers/")) {
File::copyFolder("pages_template/vouchers/", "pages/vouchers/"); File::copyFolder("pages_template/vouchers/", "$PAGES_PATH/vouchers/");
} }
} }
$ui->assign("vouchers", scandir("pages/vouchers/")); $ui->assign("vouchers", scandir("$PAGES_PATH/vouchers/"));
} }
$html = file_get_contents($path); $html = file_get_contents($path);
$ui->assign("htmls", str_replace(["<div", "</div>"], "", $html)); $ui->assign("htmls", str_replace(["<div", "</div>"], "", $html));
@ -67,7 +68,7 @@ if(strpos($action,"-reset")!==false){
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
} }
$action = str_replace("-post", "", $action); $action = str_replace("-post", "", $action);
$path = "pages/".str_replace(".","",$action).".html"; $path = "$PAGES_PATH/" . str_replace(".", "", $action) . ".html";
if (file_exists($path)) { if (file_exists($path)) {
$html = _post("html"); $html = _post("html");
run_hook('save_pages'); #HOOK run_hook('save_pages'); #HOOK

View File

@ -31,7 +31,7 @@
<br> <br>
<p class="help-block">{Lang::T('Sometimes you need to refresh 3 times until content change')}</p> <p class="help-block">{Lang::T('Sometimes you need to refresh 3 times until content change')}</p>
<input type="text" class="form-control" onclick="this.select()" readonly <input type="text" class="form-control" onclick="this.select()" readonly
value="{$app_url}/pages/{$PageFile}.html"> value="{$app_url}/{$PAGES_PATH}/{$PageFile}.html">
</div> </div>
{else} {else}
<div class="panel-footer"> <div class="panel-footer">
@ -54,10 +54,10 @@
{if $action=='Voucher'} {if $action=='Voucher'}
<div class="col-md-4"> <div class="col-md-4">
{foreach $vouchers as $v} {foreach $vouchers as $v}
{if is_file("pages/vouchers/$v")} {if is_file("$PAGES_PATH/vouchers/$v")}
<div class="panel mb20 panel-primary panel-hovered" style="cursor: pointer;" onclick="selectTemplate(this)"> <div class="panel mb20 panel-primary panel-hovered" style="cursor: pointer;" onclick="selectTemplate(this)">
<div class="panel-heading">{str_replace(".html", '', $v)}</div> <div class="panel-heading">{str_replace(".html", '', $v)}</div>
<div class="panel-body">{include file="pages/vouchers/$v"}</div> <div class="panel-body">{include file="$PAGES_PATH/vouchers/$v"}</div>
</div> </div>
{/if} {/if}
{/foreach} {/foreach}

View File

@ -1,7 +1,15 @@
{include file="user-ui/header.tpl"} {include file="user-ui/header.tpl"}
<div class="row"> <div class="row">
<div class="col-md-6 col-md-offset-3"> {if file_exists("$PAGES_PATH/Payment_Info.html")}
<div class="col-md-6">
<div class="panel panel-info panel-hovered">
<div class="panel-heading">{Lang::T('Payment Info')}</div>
<div class="panel-body">{include file="$PAGES_PATH/Payment_Info.html"}</div>
</div>
</div>
{/if}
<div class="{if file_exists("$PAGES_PATH/Payment_Info.html")}col-md-6{else}col-md-6 col-md-offset-3{/if}">
<div class="panel panel-info panel-hovered"> <div class="panel panel-info panel-hovered">
<div class="panel-heading">{Lang::T('Available Payment Gateway')}</div> <div class="panel-heading">{Lang::T('Available Payment Gateway')}</div>
<div class="panel-footer"> <div class="panel-footer">