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('xfooter', '<script type="text/javascript" src="ui/lib/c/plan.js"></script>');
|
||||||
$ui->assign('_title', Lang::T('Customer'));
|
$ui->assign('_title', Lang::T('Customer'));
|
||||||
$search = _post('search');
|
$search = _post('search');
|
||||||
if ($search != '') {
|
$status = _req('status');
|
||||||
$query = ORM::for_table('tbl_user_recharges')
|
$router = _req('router');
|
||||||
->whereRaw("username LIKE '%$search%' OR namebp LIKE '%$search%' OR method LIKE '%$search%' OR routers LIKE '%$search%' OR type LIKE '%$search%'")
|
$plan = _req('plan');
|
||||||
->order_by_desc('id');
|
$append_url = "&search=" . urlencode($search)
|
||||||
$d = Paginator::findMany($query, ['search' => $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{
|
}else{
|
||||||
$query = ORM::for_table('tbl_user_recharges')->order_by_desc('id');
|
$ui->assign('plans', []);
|
||||||
$d = Paginator::findMany($query);
|
|
||||||
}
|
}
|
||||||
|
$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
|
run_hook('view_list_billing'); #HOOK
|
||||||
$ui->assign('d', $d);
|
$ui->assign('d', $d);
|
||||||
$ui->assign('search', $search);
|
|
||||||
$ui->display('plan.tpl');
|
$ui->display('plan.tpl');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -514,8 +514,13 @@
|
|||||||
"Router_Name___Location": "Nama\/Lokasi Router",
|
"Router_Name___Location": "Nama\/Lokasi Router",
|
||||||
"Extend": "Memperpanjang",
|
"Extend": "Memperpanjang",
|
||||||
"City": "Kota",
|
"City": "Kota",
|
||||||
"": "",
|
|
||||||
"District": "Daerah",
|
"District": "Daerah",
|
||||||
"State": "Negara",
|
"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"
|
<input type="text" name="search" class="form-control"
|
||||||
placeholder="{Lang::T('Search')}..." value="{$search}">
|
placeholder="{Lang::T('Search')}..." value="{$search}">
|
||||||
<div class="input-group-btn">
|
<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">
|
<button class="btn btn-primary" type="submit" name="export" value="csv">
|
||||||
<span class="glyphicon glyphicon-download"
|
<span class="glyphicon glyphicon-download"
|
||||||
aria-hidden="true"></span> CSV
|
aria-hidden="true"></span> CSV
|
||||||
@ -75,9 +75,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1">
|
<div class="col-lg-1">
|
||||||
<a href="{$_url}customers/add" class="btn btn-success text-black btn-block"><i
|
<a href="{$_url}customers/add" class="btn btn-success text-black btn-block" title="{Lang::T('Add')}">
|
||||||
class="ion ion-android-add">
|
<i class="ion ion-android-add"></i><i class="glyphicon glyphicon-user"></i>
|
||||||
</i> {Lang::T('Add')}</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-xs-4">
|
<div class="col-lg-1 col-xs-4">
|
||||||
<select class="form-control" id="router" name="router">
|
<select class="form-control" id="router" name="router">
|
||||||
<option value="">{Lang::T('Routers')}</option>
|
<option value="">{Lang::T('Location')}</option>
|
||||||
{foreach $routers as $r}
|
{foreach $routers as $r}
|
||||||
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@ -118,13 +118,13 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Name')}</th>
|
<th>{Lang::T('Name')}</th>
|
||||||
<th>{Lang::T('Type')}</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('Category')}</th>
|
||||||
<th>{Lang::T('Price')}</th>
|
<th>{Lang::T('Price')}</th>
|
||||||
<th>{Lang::T('Validity')}</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('Time')}</th>
|
||||||
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Data')}</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>{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('Internet Plan')}</th>
|
||||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
|
||||||
|
@ -10,35 +10,64 @@
|
|||||||
onclick="return confirm('This will sync/send Caustomer active plan to Mikrotik?')"><span
|
onclick="return confirm('This will sync/send Caustomer active plan to Mikrotik?')"><span
|
||||||
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
|
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group pull-right">
|
{* <div class="btn-group pull-right">
|
||||||
<a class="btn btn-info btn-xs" title="save" href="{$_url}customers/csv-prepaid"
|
<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"
|
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
|
||||||
aria-hidden="true"></span> CSV</a>
|
aria-hidden="true"></span> CSV</a>
|
||||||
</div>
|
</div> *}
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
</div>
|
</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">
|
||||||
<div class="input-group-addon">
|
<div class="input-group-btn">
|
||||||
<span class="fa fa-search"></span>
|
<a class="btn btn-danger" title="Clear Search Query" href="{$_url}plan/list"><span
|
||||||
|
class="glyphicon glyphicon-remove-circle"></span></a>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" name="search" class="form-control"
|
<input type="text" name="search" class="form-control"
|
||||||
placeholder="{Lang::T('Search by Username')}..." value="{$search}">
|
placeholder="{Lang::T('Search')}..." value="{$search}">
|
||||||
<div class="input-group-btn">
|
</div>
|
||||||
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</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">
|
<div class="table-responsive">
|
||||||
<table id="datatable" class="table table-bordered table-striped table-condensed">
|
<table id="datatable" class="table table-bordered table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
@ -49,7 +78,7 @@
|
|||||||
<th>{Lang::T('Created On')}</th>
|
<th>{Lang::T('Created On')}</th>
|
||||||
<th>{Lang::T('Expires On')}</th>
|
<th>{Lang::T('Expires On')}</th>
|
||||||
<th>{Lang::T('Method')}</th>
|
<th>{Lang::T('Method')}</th>
|
||||||
<th>{Lang::T('Routers')}</th>
|
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -64,12 +93,12 @@
|
|||||||
<td>{$ds['method']}</td>
|
<td>{$ds['method']}</td>
|
||||||
<td>{$ds['routers']}</td>
|
<td>{$ds['routers']}</td>
|
||||||
<td>
|
<td>
|
||||||
<a href="{$_url}plan/edit/{$ds['id']}"
|
<a href="{$_url}plan/edit/{$ds['id']}" class="btn btn-warning btn-xs"
|
||||||
class="btn btn-warning btn-xs" style="color: black;">{Lang::T('Edit')}</a>
|
style="color: black;">{Lang::T('Edit')}</a>
|
||||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||||
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
|
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
|
||||||
onclick="return confirm('{Lang::T('Delete')}?')"
|
onclick="return confirm('{Lang::T('Delete')}?')" class="btn btn-danger btn-xs"><i
|
||||||
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
|
class="glyphicon glyphicon-trash"></i></a>
|
||||||
{/if}
|
{/if}
|
||||||
{if $ds['status']=='off' && $_c['extend_expired']}
|
{if $ds['status']=='off' && $_c['extend_expired']}
|
||||||
<a href="javascript:extend('{$ds['id']}')"
|
<a href="javascript:extend('{$ds['id']}')"
|
||||||
@ -85,7 +114,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function extend(idP) {
|
function extend(idP) {
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-lg-1 col-xs-4">
|
<div class="col-lg-1 col-xs-4">
|
||||||
<select class="form-control" id="router" name="router">
|
<select class="form-control" id="router" name="router">
|
||||||
<option value="">{Lang::T('Routers')}</option>
|
<option value="">{Lang::T('Location')}</option>
|
||||||
{foreach $routers as $r}
|
{foreach $routers as $r}
|
||||||
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@ -115,15 +115,15 @@
|
|||||||
<th colspan="4"></th>
|
<th colspan="4"></th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th>{Lang::T('Name')}</th>
|
||||||
<th>{Lang::T('Plan Type')}</th>
|
<th>{Lang::T('Type')}</th>
|
||||||
<th>{Lang::T('Bandwidth Plans')}</th>
|
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
|
||||||
<th>{Lang::T('Plan Price')}</th>
|
<th>{Lang::T('Price')}</th>
|
||||||
<th>{Lang::T('Plan Validity')}</th>
|
<th>{Lang::T('Validity')}</th>
|
||||||
<th>{Lang::T('IP Pool')}</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('Internet Plan')}</th>
|
||||||
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</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('Device')}</th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
<th>ID</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