Filter in Active Customer
This commit is contained in:
parent
7636234371
commit
fa5c3389f6
@ -850,18 +850,44 @@ switch ($action) {
|
||||
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/plan.js"></script>');
|
||||
$ui->assign('_title', Lang::T('Customer'));
|
||||
$search = _post('search');
|
||||
if ($search != '') {
|
||||
$query = ORM::for_table('tbl_user_recharges')
|
||||
->whereRaw("username LIKE '%$search%' OR namebp LIKE '%$search%' OR method LIKE '%$search%' OR routers LIKE '%$search%' OR type LIKE '%$search%'")
|
||||
->order_by_desc('id');
|
||||
$d = Paginator::findMany($query, ['search' => $search]);
|
||||
} else {
|
||||
$query = ORM::for_table('tbl_user_recharges')->order_by_desc('id');
|
||||
$d = Paginator::findMany($query);
|
||||
$status = _req('status');
|
||||
$router = _req('router');
|
||||
$plan = _req('plan');
|
||||
$append_url = "&search=" . urlencode($search)
|
||||
. "&status=" . urlencode($status)
|
||||
. "&router=" . urlencode($type3)
|
||||
. "&plan=" . urlencode($plan);
|
||||
$ui->assign('append_url', $append_url);
|
||||
$ui->assign('plan', $plan);
|
||||
$ui->assign('status', $status);
|
||||
$ui->assign('router', $router);
|
||||
$ui->assign('search', $search);
|
||||
$ui->assign('routers', array_column(ORM::for_table('tbl_user_recharges')->distinct()->select("routers")->whereNotEqual('routers', '')->findArray(), 'routers'));
|
||||
|
||||
$plns = ORM::for_table('tbl_user_recharges')->distinct()->select("plan_id")->findArray();
|
||||
$ids = array_column($plns, 'plan_id');
|
||||
if(count($ids)){
|
||||
$ui->assign('plans', ORM::for_table('tbl_plans')->select("id")->select('name_plan')->where_id_in($ids)->findArray());
|
||||
}else{
|
||||
$ui->assign('plans', []);
|
||||
}
|
||||
$query = ORM::for_table('tbl_user_recharges')->order_by_desc('id');
|
||||
|
||||
if ($search != '') {
|
||||
$query->where_like("username","%$search%");
|
||||
}
|
||||
if (!empty($router)) {
|
||||
$query->where('routers', $router);
|
||||
}
|
||||
if (!empty($plan)) {
|
||||
$query->where('plan_id', $plan);
|
||||
}
|
||||
if (!empty($status) && $status != '-') {
|
||||
$query->where('status', $status);
|
||||
}
|
||||
$d = Paginator::findMany($query, ['search' => $search], 25, $append_url);
|
||||
run_hook('view_list_billing'); #HOOK
|
||||
$ui->assign('d', $d);
|
||||
$ui->assign('search', $search);
|
||||
$ui->display('plan.tpl');
|
||||
break;
|
||||
}
|
||||
|
@ -514,8 +514,13 @@
|
||||
"Router_Name___Location": "Nama\/Lokasi Router",
|
||||
"Extend": "Memperpanjang",
|
||||
"City": "Kota",
|
||||
"": "",
|
||||
"District": "Daerah",
|
||||
"State": "Negara",
|
||||
"Zip": "Ritsleting"
|
||||
"Zip": "Kode Pos",
|
||||
"ago": "yang lalu",
|
||||
"Created_Date": "Tanggal Dibuat",
|
||||
"Ascending": "Naik",
|
||||
"Descending": "Menurun",
|
||||
"Query": "Query",
|
||||
"Add": "Menambahkan"
|
||||
}
|
@ -66,7 +66,7 @@
|
||||
<input type="text" name="search" class="form-control"
|
||||
placeholder="{Lang::T('Search')}..." value="{$search}">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-primary" type="submit">{Lang::T('Query')}</button>
|
||||
<button class="btn btn-primary" type="submit"><span class="fa fa-search"></span></button>
|
||||
<button class="btn btn-primary" type="submit" name="export" value="csv">
|
||||
<span class="glyphicon glyphicon-download"
|
||||
aria-hidden="true"></span> CSV
|
||||
@ -75,9 +75,9 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1">
|
||||
<a href="{$_url}customers/add" class="btn btn-success text-black btn-block"><i
|
||||
class="ion ion-android-add">
|
||||
</i> {Lang::T('Add')}</a>
|
||||
<a href="{$_url}customers/add" class="btn btn-success text-black btn-block" title="{Lang::T('Add')}">
|
||||
<i class="ion ion-android-add"></i><i class="glyphicon glyphicon-user"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-4">
|
||||
<select class="form-control" id="router" name="router">
|
||||
<option value="">{Lang::T('Routers')}</option>
|
||||
<option value="">{Lang::T('Location')}</option>
|
||||
{foreach $routers as $r}
|
||||
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
||||
{/foreach}
|
||||
@ -118,13 +118,13 @@
|
||||
<tr>
|
||||
<th>{Lang::T('Name')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
<th>{Lang::T('Bandwidth')}</th>
|
||||
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
|
||||
<th>{Lang::T('Category')}</th>
|
||||
<th>{Lang::T('Price')}</th>
|
||||
<th>{Lang::T('Validity')}</th>
|
||||
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Time')}</th>
|
||||
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Data')}</th>
|
||||
<th>{Lang::T('Routers')}</th>
|
||||
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
|
||||
<th>{Lang::T('Device')}</th>
|
||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
|
||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
||||
|
162
ui/ui/plan.tpl
162
ui/ui/plan.tpl
@ -10,92 +10,120 @@
|
||||
onclick="return confirm('This will sync/send Caustomer active plan to Mikrotik?')"><span
|
||||
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
|
||||
</div>
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn btn-info btn-xs" title="save" href="{$_url}customers/csv-prepaid"
|
||||
{* <div class="btn-group pull-right">
|
||||
<a class="btn btn-info btn-xs" title="save" href="{$_url}plan/csv{$append_url}"
|
||||
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
|
||||
aria-hidden="true"></span> CSV</a>
|
||||
</div>
|
||||
</div> *}
|
||||
{/if}
|
||||
|
||||
</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}plan/list/">
|
||||
<form id="site-search" method="post" action="{$_url}plan/list/">
|
||||
<div class="panel-body">
|
||||
<div class="row row-no-gutters" style="padding: 5px">
|
||||
<div class="col-lg-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span class="fa fa-search"></span>
|
||||
<div class="input-group-btn">
|
||||
<a class="btn btn-danger" title="Clear Search Query" href="{$_url}plan/list"><span
|
||||
class="glyphicon glyphicon-remove-circle"></span></a>
|
||||
</div>
|
||||
<input type="text" name="search" class="form-control"
|
||||
placeholder="{Lang::T('Search by Username')}..." value="{$search}">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
||||
</div>
|
||||
placeholder="{Lang::T('Search')}..." value="{$search}">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-2 col-xs-4">
|
||||
<select class="form-control" id="router" name="router">
|
||||
<option value="">{Lang::T('Location')}</option>
|
||||
{foreach $routers as $r}
|
||||
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-xs-4">
|
||||
<select class="form-control" id="plan" name="plan">
|
||||
<option value="">{Lang::T('Plan Name')}</option>
|
||||
{foreach $plans as $p}
|
||||
<option value="{$p['id']}" {if $plan eq $p['id'] }selected{/if}>{$p['name_plan']}
|
||||
</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-lg-2 col-xs-4">
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="-">{Lang::T('Status')}</option>
|
||||
<option value="on" {if $status eq 'on' }selected{/if}>{Lang::T('Active')}</option>
|
||||
<option value="off" {if $status eq 'off' }selected{/if}>{Lang::T('Expired')}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<button class="btn btn-success btn-block" type="submit"><span
|
||||
class="fa fa-search"></span></button>
|
||||
</div>
|
||||
<div class="col-md-2 col-xs-6">
|
||||
<a href="{$_url}plan/recharge" class="btn btn-primary btn-block"><i
|
||||
class="ion ion-android-add">
|
||||
</i> {Lang::T('Recharge Account')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="{$_url}plan/recharge" class="btn btn-primary btn-block"><i
|
||||
class="ion ion-android-add"> </i> {Lang::T('Recharge Account')}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table id="datatable" class="table table-bordered table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{Lang::T('Username')}</th>
|
||||
<th>{Lang::T('Plan Name')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
<th>{Lang::T('Created On')}</th>
|
||||
<th>{Lang::T('Expires On')}</th>
|
||||
<th>{Lang::T('Method')}</th>
|
||||
<th>{Lang::T('Routers')}</th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
</form>
|
||||
<div class="table-responsive">
|
||||
<table id="datatable" class="table table-bordered table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{Lang::T('Username')}</th>
|
||||
<th>{Lang::T('Plan Name')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
<th>{Lang::T('Created On')}</th>
|
||||
<th>{Lang::T('Expires On')}</th>
|
||||
<th>{Lang::T('Method')}</th>
|
||||
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['status']=='off'}class="danger" {/if}>
|
||||
<td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
|
||||
<td>{$ds['namebp']}</td>
|
||||
<td>{$ds['type']}</td>
|
||||
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
|
||||
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
||||
<td>{$ds['method']}</td>
|
||||
<td>{$ds['routers']}</td>
|
||||
<td>
|
||||
<a href="{$_url}plan/edit/{$ds['id']}" class="btn btn-warning btn-xs"
|
||||
style="color: black;">{Lang::T('Edit')}</a>
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
|
||||
onclick="return confirm('{Lang::T('Delete')}?')" class="btn btn-danger btn-xs"><i
|
||||
class="glyphicon glyphicon-trash"></i></a>
|
||||
{/if}
|
||||
{if $ds['status']=='off' && $_c['extend_expired']}
|
||||
<a href="javascript:extend('{$ds['id']}')"
|
||||
class="btn btn-info btn-xs">{Lang::T('Extend')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['status']=='off'}class="danger" {/if}>
|
||||
<td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
|
||||
<td>{$ds['namebp']}</td>
|
||||
<td>{$ds['type']}</td>
|
||||
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
|
||||
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
||||
<td>{$ds['method']}</td>
|
||||
<td>{$ds['routers']}</td>
|
||||
<td>
|
||||
<a href="{$_url}plan/edit/{$ds['id']}"
|
||||
class="btn btn-warning btn-xs" style="color: black;">{Lang::T('Edit')}</a>
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
|
||||
onclick="return confirm('{Lang::T('Delete')}?')"
|
||||
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/if}
|
||||
{if $ds['status']=='off' && $_c['extend_expired']}
|
||||
<a href="javascript:extend('{$ds['id']}')"
|
||||
class="btn btn-info btn-xs">{Lang::T('Extend')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
{/foreach}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function extend(idP){
|
||||
var res = prompt("Extend for many days?", "3");
|
||||
if(res){
|
||||
if(confirm("Extend for "+res+" days?")){
|
||||
window.location.href = "{$_url}plan/extend/"+idP+"/"+res+"&stoken={App::getToken()}";
|
||||
function extend(idP) {
|
||||
var res = prompt("Extend for many days?", "3");
|
||||
if (res) {
|
||||
if (confirm("Extend for " + res + " days?")) {
|
||||
window.location.href = "{$_url}plan/extend/"+idP+"/"+res+"&stoken={App::getToken()}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -70,7 +70,7 @@
|
||||
</div>
|
||||
<div class="col-lg-1 col-xs-4">
|
||||
<select class="form-control" id="router" name="router">
|
||||
<option value="">{Lang::T('Routers')}</option>
|
||||
<option value="">{Lang::T('Location')}</option>
|
||||
{foreach $routers as $r}
|
||||
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
||||
{/foreach}
|
||||
@ -115,15 +115,15 @@
|
||||
<th colspan="4"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{Lang::T('Plan Name')}</th>
|
||||
<th>{Lang::T('Plan Type')}</th>
|
||||
<th>{Lang::T('Bandwidth Plans')}</th>
|
||||
<th>{Lang::T('Plan Price')}</th>
|
||||
<th>{Lang::T('Plan Validity')}</th>
|
||||
<th>{Lang::T('IP Pool')}</th>
|
||||
<th>{Lang::T('Name')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
|
||||
<th>{Lang::T('Price')}</th>
|
||||
<th>{Lang::T('Validity')}</th>
|
||||
<th><a href="{$_url}pool/list">{Lang::T('IP Pool')}</a></th>
|
||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
|
||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
||||
<th>{Lang::T('Routers')}</th>
|
||||
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
|
||||
<th>{Lang::T('Device')}</th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
<th>ID</th>
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.6.21.3"
|
||||
"version": "2024.6.22"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user