delete payment gateway
This commit is contained in:
parent
3412ecc7de
commit
81572a61a4
@ -8,9 +8,17 @@
|
|||||||
_admin();
|
_admin();
|
||||||
$ui->assign('_system_menu', 'paymentgateway');
|
$ui->assign('_system_menu', 'paymentgateway');
|
||||||
|
|
||||||
$action = alphanumeric($routes['1']);
|
$action = alphanumeric($routes[1]);
|
||||||
$ui->assign('_admin', $admin);
|
$ui->assign('_admin', $admin);
|
||||||
|
|
||||||
|
if ($action == 'delete') {
|
||||||
|
$pg = alphanumeric($routes[2]);
|
||||||
|
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $pg . '.php')) {
|
||||||
|
deleteFile($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR, $pg);
|
||||||
|
}
|
||||||
|
r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway Deleted'));
|
||||||
|
}
|
||||||
|
|
||||||
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php')) {
|
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php')) {
|
||||||
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php';
|
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php';
|
||||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
@ -55,3 +63,16 @@ if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php'))
|
|||||||
$ui->display('paymentgateway.tpl');
|
$ui->display('paymentgateway.tpl');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function deleteFile($path, $name)
|
||||||
|
{
|
||||||
|
$files = scandir($path);
|
||||||
|
foreach ($files as $file) {
|
||||||
|
if (is_file($path . $file) && strpos($file, $name) !== false) {
|
||||||
|
unlink($path . $file);
|
||||||
|
} else if (is_dir($path . $file) && !in_array($file, ['.', '..'])) {
|
||||||
|
deleteFile($path . $file . DIRECTORY_SEPARATOR, $name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,33 +1,22 @@
|
|||||||
{include file="sections/header.tpl"}
|
{include file="sections/header.tpl"}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-md-6 col-md-offset-3">
|
||||||
<div class="panel panel-info panel-hovered">
|
<div class="panel panel-info panel-hovered">
|
||||||
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
|
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
|
||||||
<div class="panel-body row">
|
<div class="table-responsive">
|
||||||
{foreach $pgs as $pg}
|
<table class="table table-striped table-condensed">
|
||||||
<div class="col-sm-4 mb20">
|
<tbody>
|
||||||
<a href="{$_url}paymentgateway/{$pg}" class="btn btn-block btn-default">{ucwords($pg)}</a>
|
{foreach $pgs as $pg}
|
||||||
</div>
|
<tr>
|
||||||
{/foreach}
|
<td><a href="{$_url}paymentgateway/{$pg}"
|
||||||
|
class="btn btn-block btn-default text-left">{ucwords($pg)}</a></td>
|
||||||
|
<td width="10"><a href="{$_url}paymentgateway/delete/{$pg}" onclick="return confirm('{Lang::T('Delete')} {$pg}?')" class="btn btn-danger"><i
|
||||||
|
class="glyphicon glyphicon-trash"></i></a></td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<!-- <div class="panel-footer">
|
|
||||||
<form method="post">
|
|
||||||
<div class="form-group row">
|
|
||||||
<label class="col-md-2 control-label">Payment Gateway</label>
|
|
||||||
<div class="col-md-8">
|
|
||||||
<select name="payment_gateway" id="payment_gateway" class="form-control">
|
|
||||||
<option value="none">None</option>
|
|
||||||
{foreach $pgs as $pg}
|
|
||||||
<option value="{$pg}" {if $_c['payment_gateway'] eq {$pg}}selected="selected" {/if}>{ucwords($pg)}</option>
|
|
||||||
{/foreach}
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-2">
|
|
||||||
<button class="btn btn-block btn-primary" type="submit">{Lang::T('Save Changes')}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
Loading…
x
Reference in New Issue
Block a user