pretty url stage 5
This commit is contained in:
parent
4d71c1d48e
commit
2469aa6b99
@ -45,7 +45,7 @@
|
||||
{if isset($notify)}
|
||||
{$notify}
|
||||
{/if}
|
||||
<form action="{$_url}admin/post" method="post">
|
||||
<form action="{Text::url('admin/post')}" method="post">
|
||||
<input type="hidden" name="csrf_token" value="{$csrf_token}">
|
||||
<div class="form-group has-feedback">
|
||||
<input type="text" required class="form-control" name="username" placeholder="{Lang::T('Username')}">
|
||||
@ -56,7 +56,7 @@
|
||||
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block btn-flat">{Lang::T('Login')}</button>
|
||||
<a href="{$_url}login" class="back-link">{Lang::T('Go Back')}</a>
|
||||
<a href="{Text::url('login')}" class="back-link">{Lang::T('Go Back')}</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -39,9 +39,9 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<center><a href="{$_url}settings/users-edit/{$d['id']}"
|
||||
<center><a href="{Text::url('settings/users-edit/', $d['id'])}"
|
||||
class="btn btn-info btn-block">{Lang::T('Edit')}</a>
|
||||
<a href="{$_url}settings/users" class="btn btn-link btn-block">{Lang::T('Cancel')}</a>
|
||||
<a href="{Text::url('settings/users')}" class="btn btn-link btn-block">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Add Service Package')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}services/balance-add-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('services/balance-add-post')}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
||||
<div class="col-md-10">
|
||||
@ -47,7 +47,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-success" onclick="return ask(this, '{Lang::T("Continue the balance top-up process?")}')" type="submit">{Lang::T('Save Changes')}</button>
|
||||
Or <a href="{$_url}services/balance">{Lang::T('Cancel')}</a>
|
||||
Or <a href="{Text::url('services/balance')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Edit Service Package')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}services/balance-edit-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('services/balance-edit-post')}">
|
||||
<input type="hidden" name="id" value="{$d['id']}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
||||
@ -56,7 +56,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-success" onclick="return ask(this, '{Lang::T("Continue the process of changing the balance contents?")}')" type="submit">{Lang::T('Save Changes')}</button>
|
||||
Or <a href="{$_url}services/balance">{Lang::T('Cancel')}</a>
|
||||
Or <a href="{Text::url('services/balance')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -1,58 +1,65 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-hovered mb20 panel-primary">
|
||||
<div class="panel-heading">{Lang::T('Balance Package')}</div>
|
||||
<div class="panel-body">
|
||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||
<div class="col-md-8">
|
||||
<form id="site-search" method="post" action="{$_url}services/balance/">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span class="fa fa-search"></span>
|
||||
</div>
|
||||
<input type="text" name="name" class="form-control" placeholder="{Lang::T('Search by Name')}...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="{$_url}services/balance-add" class="btn btn-primary btn-block"><i class="ion ion-android-add"> </i> {Lang::T('New Service Package')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{Lang::T('Package Name')}</th>
|
||||
<th>{Lang::T('Package Price')}</th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"{/if}>
|
||||
<td>{$ds['name_plan']}</td>
|
||||
<td>{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
|
||||
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
|
||||
{/if}</td>
|
||||
<td>
|
||||
<a href="{$_url}services/balance-edit/{$ds['id']}" class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
|
||||
<a href="{$_url}services/balance-delete/{$ds['id']}" onclick="return ask(this, '{Lang::T('Delete')}?')" id="{$ds['id']}" class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-hovered mb20 panel-primary">
|
||||
<div class="panel-heading">{Lang::T('Balance Package')}</div>
|
||||
<div class="panel-body">
|
||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||
<div class="col-md-8">
|
||||
<form id="site-search" method="post" action="{Text::url('services/balance/')}">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span class="fa fa-search"></span>
|
||||
</div>
|
||||
<input type="text" name="name" class="form-control"
|
||||
placeholder="{Lang::T('Search by Name')}...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="{Text::url('services/balance-add')}" class="btn btn-primary btn-block"><i
|
||||
class="ion ion-android-add"> </i> {Lang::T('New Service Package')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{Lang::T('Package Name')}</th>
|
||||
<th>{Lang::T('Package Price')}</th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['enabled'] != 1}class="danger" title="disabled" {/if}>
|
||||
<td>{$ds['name_plan']}</td>
|
||||
<td>{Lang::moneyFormat($ds['price'])}{if !empty($ds['price_old'])}
|
||||
<sup
|
||||
style="text-decoration: line-through; color: red">{Lang::moneyFormat($ds['price_old'])}</sup>
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="{Text::url('services/balance-edit/',$ds['id'])}"
|
||||
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
|
||||
<a href="{Text::url('services/balance-delete/',$ds['id'])}"
|
||||
onclick="return ask(this, '{Lang::T('Delete')}?')" id="{$ds['id']}"
|
||||
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -5,7 +5,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Add New Bandwidth')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}bandwidth/add-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('bandwidth/add-post')}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('Bandwidth Name')}</label>
|
||||
<div class="col-md-9">
|
||||
@ -70,7 +70,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-primary" onclick="return ask(this, '{Lang::T("Continue the Bandwidth addition process?")}')" type="submit">{Lang::T('Save')}</button>
|
||||
Or <a href="{$_url}bandwidth/list">{Lang::T('Cancel')}</a>
|
||||
Or <a href="{Text::url('bandwidth/list')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<div class="panel-heading">{Lang::T('Edit Bandwidth')}</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}bandwidth/edit-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('bandwidth/edit-post')}">
|
||||
<input type="hidden" name="id" value="{$d['id']}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('Bandwidth Name')}</label>
|
||||
@ -87,7 +87,7 @@
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-primary" onclick="return ask(this, '{Lang::T("Continue the Bandwidth change process?")}')" type="submit">{Lang::T('Save Change')}</button>
|
||||
{Lang::T("Or")} <a href="{$_url}bandwidth/list">{Lang::T('Cancel')}</a>
|
||||
{Lang::T("Or")} <a href="{Text::url('bandwidth/list')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -7,7 +7,7 @@
|
||||
<div class="panel-body">
|
||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||
<div class="col-md-8">
|
||||
<form id="site-search" method="post" action="{$_url}bandwidth/list/">
|
||||
<form id="site-search" method="post" action="{Text::url('bandwidth/list/')}">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span class="fa fa-search"></span>
|
||||
@ -21,7 +21,8 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="{$_url}bandwidth/add" class="btn btn-primary btn-block"><i class="ion ion-android-add">
|
||||
<a href="{Text::url('bandwidth/add')}" class="btn btn-primary btn-block"><i
|
||||
class="ion ion-android-add">
|
||||
</i> {Lang::T('New Bandwidth')}</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -43,9 +44,9 @@
|
||||
</td>
|
||||
<td>{$ds['burst']}</td>
|
||||
<td>
|
||||
<a href="{$_url}bandwidth/edit/{$ds['id']}"
|
||||
<a href="{Text::url('bandwidth/edit/', $ds['id'])}"
|
||||
class="btn btn-sm btn-warning">{Lang::T('Edit')}</a>
|
||||
<a href="{$_url}bandwidth/delete/{$ds['id']}" id="{$ds['id']}"
|
||||
<a href="{Text::url('bandwidth/delete/', $ds['id'])}" id="{$ds['id']}"
|
||||
class="btn btn-danger btn-sm"
|
||||
onclick="return ask(this, '{Lang::T('Delete')}?')"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
@ -66,4 +67,4 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -6,7 +6,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Add Coupon')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}coupons/add-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('coupons/add-post')}">
|
||||
<input type="hidden" name="csrf_token" value="{$csrf_token}">
|
||||
|
||||
<!-- Coupon Code -->
|
||||
@ -16,7 +16,8 @@
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="code" id="code" maxlength="50" required>
|
||||
<span class="input-group-btn">
|
||||
<button type="button" class="btn btn-info btn-flat" onclick="generateRandomCode()">{Lang::T('Random')}</button>
|
||||
<button type="button" class="btn btn-info btn-flat"
|
||||
onclick="generateRandomCode()">{Lang::T('Random')}</button>
|
||||
</span>
|
||||
</div>
|
||||
<p class="help-block"><small>{Lang::T('Unique code for the coupon')}</small></p>
|
||||
@ -38,8 +39,11 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Discount Value')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" class="form-control" name="value" id="value" step="0.01" placeholder="{Lang::T("Enter amoun")}" required>
|
||||
<p class="help-block"><small id="value-help">{Lang::T('Value of the discount (amount or percentage)')}</small></p>
|
||||
<input type="number" class="form-control" name="value" id="value" step="0.01"
|
||||
placeholder="{Lang::T("Enter amoun")}" required>
|
||||
<p class="help-block"><small
|
||||
id="value-help">{Lang::T('Value of the discount (amount or percentage)')}</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -56,8 +60,11 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Max Usage')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" class="form-control" name="max_usage" value="0" required placeholder="0 is Unlimited">
|
||||
<p class="help-block"><small>{Lang::T('Maximum number of times this coupon can be used 0 is Unlimited')}</small></p>
|
||||
<input type="number" class="form-control" name="max_usage" value="0" required
|
||||
placeholder="0 is Unlimited">
|
||||
<p class="help-block">
|
||||
<small>{Lang::T('Maximum number of times this coupon can be used 0 is Unlimited')}</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -66,7 +73,8 @@
|
||||
<label class="col-md-2 control-label">{Lang::T('Minimum Order Amount')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" class="form-control" name="min_order_amount" step="0.01" required>
|
||||
<p class="help-block"><small>{Lang::T('Minimum cart total required to use this coupon')}</small></p>
|
||||
<p class="help-block">
|
||||
<small>{Lang::T('Minimum cart total required to use this coupon')}</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -75,7 +83,8 @@
|
||||
<label class="col-md-2 control-label">{Lang::T('Max Discount Amount')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="number" class="form-control" name="max_discount_amount" step="0.01">
|
||||
<p class="help-block"><small>{Lang::T('Maximum discount amount applicable (for percent type)')}</small></p>
|
||||
<p class="help-block">
|
||||
<small>{Lang::T('Maximum discount amount applicable (for percent type)')}</small></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -114,7 +123,7 @@
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save')}
|
||||
</button>
|
||||
Or <a href="{$_url}coupons/list">{Lang::T('Cancel')}</a>
|
||||
Or <a href="{Text::url('coupons/list')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -150,4 +159,4 @@
|
||||
|
||||
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -8,7 +8,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Edit Coupon')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}coupons/edit-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{Text::url('coupons/edit-post')}">
|
||||
<input type="hidden" name="csrf_token" value="{$csrf_token}">
|
||||
|
||||
<!-- Coupon Code -->
|
||||
@ -116,7 +116,7 @@
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save')}
|
||||
</button>
|
||||
Or <a href="{$_url}coupons/list">{Lang::T('Cancel')}</a>
|
||||
Or <a href="{Text::url('coupons/list')}">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -120,7 +120,7 @@
|
||||
<div class="col-lg-3 col-lg-offset-9">
|
||||
<div class="btn-group btn-group-justified" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
<a href="{$_url}coupons/add" class="btn btn-primary">
|
||||
<a href="{Text::url('coupons/add')}" class="btn btn-primary">
|
||||
{Lang::T('Add Coupon')}</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -153,66 +153,66 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{if $coupons}
|
||||
{foreach $coupons as $coupon}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="coupon_ids[]" value="{$coupon['id']}"></td>
|
||||
<td style="background-color: black; color: black;"
|
||||
onmouseleave="this.style.backgroundColor = 'black';"
|
||||
onmouseenter="this.style.backgroundColor = 'white';">
|
||||
{$coupon['code']}
|
||||
</td>
|
||||
<td>{$coupon['type']}</td>
|
||||
<td>{$coupon['value']}</td>
|
||||
<td>{$coupon['description']}</td>
|
||||
<td>{$coupon['max_usage']}</td>
|
||||
<td>{$coupon['usage_count']}</td>
|
||||
<td>
|
||||
{if $coupon['status'] == 'inactive'}
|
||||
<span class="label label-danger">{Lang::T('Inactive')}</span>
|
||||
{elseif $coupon['status'] == 'active'}
|
||||
<span class="label label-success">{Lang::T('Active')}</span>
|
||||
{else}
|
||||
<span class="label label-primary">{Lang::T('Unknown')}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$coupon['min_order_amount']}</td>
|
||||
<td>{$coupon['max_discount_amount']}</td>
|
||||
<td>{$coupon['start_date']}</td>
|
||||
<td>{$coupon['end_date']}</td>
|
||||
<td>{$coupon['created_at']}</td>
|
||||
<td>{$coupon['updated_at']}</td>
|
||||
<!-- <td>{if $coupon['admin_name']}
|
||||
<a href="{$_url}settings/users-view/{$coupon['generated_by']}">{$coupon['admin_name']}</a>
|
||||
{foreach $coupons as $coupon}
|
||||
<tr>
|
||||
<td><input type="checkbox" name="coupon_ids[]" value="{$coupon['id']}"></td>
|
||||
<td style="background-color: black; color: black;"
|
||||
onmouseleave="this.style.backgroundColor = 'black';"
|
||||
onmouseenter="this.style.backgroundColor = 'white';">
|
||||
{$coupon['code']}
|
||||
</td>
|
||||
<td>{$coupon['type']}</td>
|
||||
<td>{$coupon['value']}</td>
|
||||
<td>{$coupon['description']}</td>
|
||||
<td>{$coupon['max_usage']}</td>
|
||||
<td>{$coupon['usage_count']}</td>
|
||||
<td>
|
||||
{if $coupon['status'] == 'inactive'}
|
||||
<span class="label label-danger">{Lang::T('Inactive')}</span>
|
||||
{elseif $coupon['status'] == 'active'}
|
||||
<span class="label label-success">{Lang::T('Active')}</span>
|
||||
{else}
|
||||
<span class="label label-primary">{Lang::T('Unknown')}</span>
|
||||
{/if}
|
||||
</td>
|
||||
<td>{$coupon['min_order_amount']}</td>
|
||||
<td>{$coupon['max_discount_amount']}</td>
|
||||
<td>{$coupon['start_date']}</td>
|
||||
<td>{$coupon['end_date']}</td>
|
||||
<td>{$coupon['created_at']}</td>
|
||||
<td>{$coupon['updated_at']}</td>
|
||||
<!-- <td>{if $coupon['admin_name']}
|
||||
<a href="{Text::url('settings/users-view/', $coupon['generated_by'])}">{$coupon['admin_name']}</a>
|
||||
{else} -
|
||||
{/if}
|
||||
</td> -->
|
||||
<td colspan="10" style="text-align: center;">
|
||||
<div style="display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;">
|
||||
<a href="{$_url}coupons/edit/{$coupon['id']}&token={$csrf_token}" id="{$coupon['id']}"
|
||||
class="btn btn-success btn-xs">{Lang::T('Edit')}</a>
|
||||
{if $coupon['status'] neq 'inactive'}
|
||||
<a href="javascript:void(0);"
|
||||
onclick="confirmAction('{$_url}coupons/status/&coupon_id={$coupon['id']}&status=inactive&csrf_token={$csrf_token}', '{Lang::T('Block')}')"
|
||||
id="{$coupon['id']}" class="btn btn-danger btn-xs">
|
||||
{Lang::T('Block')}
|
||||
</a>
|
||||
{else}
|
||||
<a href="javascript:void(0);"
|
||||
onclick="confirmAction('{$_url}coupons/status/&coupon_id={$coupon['id']}&status=active&csrf_token={$csrf_token}', '{Lang::T('Unblock')}')"
|
||||
id="{$coupon['id']}" class="btn btn-warning btn-xs">
|
||||
{Lang::T('Unblock')}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<td colspan="10" style="text-align: center;">
|
||||
<div style="display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;">
|
||||
<a href="{Text::url('coupons/edit/', $coupon['id'], '&token=', $csrf_token)}"
|
||||
id="{$coupon['id']}" class="btn btn-success btn-xs">{Lang::T('Edit')}</a>
|
||||
{if $coupon['status'] neq 'inactive'}
|
||||
<a href="javascript:void(0);"
|
||||
onclick="confirmAction('{Text::url('coupons/status/&coupon_id=',$coupon['id'], '&status=inactive&csrf_token=', $csrf_token)}', '{Lang::T('Block')}')"
|
||||
id="{$coupon['id']}" class="btn btn-danger btn-xs">
|
||||
{Lang::T('Block')}
|
||||
</a>
|
||||
{else}
|
||||
<a href="javascript:void(0);"
|
||||
onclick="confirmAction('{Text::url('coupons/status/&coupon_id=', $coupon['id'], '&status=active&csrf_token=', $csrf_token)}', '{Lang::T('Unblock')}')"
|
||||
id="{$coupon['id']}" class="btn btn-warning btn-xs">
|
||||
{Lang::T('Unblock')}
|
||||
</a>
|
||||
{/if}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<tr>
|
||||
<td colspan="11" style="text-align: center;">
|
||||
{Lang::T('No coupons found.')}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="11" style="text-align: center;">
|
||||
{Lang::T('No coupons found.')}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
</table>
|
||||
@ -222,7 +222,7 @@
|
||||
<div class="btn-group btn-group-justified" role="group">
|
||||
<div class="btn-group" role="group">
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<button id="deleteSelectedCoupons" class="btn btn-danger">{Lang::T('Delete
|
||||
<button id="deleteSelectedCoupons" class="btn btn-danger">{Lang::T('Delete
|
||||
Selected')}</button>
|
||||
{/if}
|
||||
</div>
|
||||
@ -247,9 +247,9 @@
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '{$_url}coupons/delete', true);
|
||||
xhr.open('POST', '{Text::url('coupons/delete')}', true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
|
||||
xhr.onload = function () {
|
||||
xhr.onload = function() {
|
||||
if (xhr.status === 200) {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
|
||||
@ -293,9 +293,9 @@
|
||||
}
|
||||
|
||||
// Example usage for selected coupons
|
||||
document.getElementById('deleteSelectedCoupons').addEventListener('click', function () {
|
||||
document.getElementById('deleteSelectedCoupons').addEventListener('click', function() {
|
||||
var selectedCoupons = [];
|
||||
document.querySelectorAll('input[name="coupon_ids[]"]:checked').forEach(function (checkbox) {
|
||||
document.querySelectorAll('input[name="coupon_ids[]"]:checked').forEach(function(checkbox) {
|
||||
selectedCoupons.push(checkbox.value);
|
||||
});
|
||||
|
||||
@ -312,8 +312,8 @@
|
||||
});
|
||||
|
||||
// Example usage for single coupon deletion
|
||||
document.querySelectorAll('.delete-coupon').forEach(function (button) {
|
||||
button.addEventListener('click', function () {
|
||||
document.querySelectorAll('.delete-coupon').forEach(function(button) {
|
||||
button.addEventListener('click', function() {
|
||||
var couponId = this.getAttribute('data-id');
|
||||
deleteCoupons([couponId]);
|
||||
});
|
||||
@ -321,7 +321,7 @@
|
||||
|
||||
|
||||
// Select or deselect all checkboxes
|
||||
document.getElementById('select-all').addEventListener('change', function () {
|
||||
document.getElementById('select-all').addEventListener('change', function() {
|
||||
var checkboxes = document.querySelectorAll('input[name="coupon_ids[]"]');
|
||||
for (var checkbox of checkboxes) {
|
||||
checkbox.checked = this.checked;
|
||||
@ -329,29 +329,29 @@
|
||||
});
|
||||
</script>
|
||||
{literal}
|
||||
<script>
|
||||
function confirmAction(url, action) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: `Do you really want to ${action.toLowerCase()} this coupon?`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, proceed!',
|
||||
cancelButtonText: 'No, cancel!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function confirmAction(url, action) {
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: `Do you really want to ${action.toLowerCase()} this coupon?`,
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, proceed!',
|
||||
cancelButtonText: 'No, cancel!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
window.location.href = url;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
<script>
|
||||
const $j = jQuery.noConflict();
|
||||
|
||||
$j(document).ready(function () {
|
||||
$j(document).ready(function() {
|
||||
$j('#datatable').DataTable({
|
||||
"pagingType": "full_numbers",
|
||||
"order": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user