fix search
This commit is contained in:
parent
dfbd7df367
commit
a660ec5ddb
@ -23,16 +23,26 @@ if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
|
|||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'list':
|
case 'list':
|
||||||
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/customers.js"></script>');
|
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/customers.js"></script>');
|
||||||
$username = _post('username');
|
$search = _post('search');
|
||||||
|
$what = _post('what');
|
||||||
|
if(!in_array($what,['username','fullname','phonenumber','email'])){
|
||||||
|
$what = 'username';
|
||||||
|
}
|
||||||
run_hook('list_customers'); #HOOK
|
run_hook('list_customers'); #HOOK
|
||||||
if ($username != '') {
|
if ($search != '') {
|
||||||
$paginator = Paginator::bootstrap('tbl_customers', 'username', '%' . $username . '%');
|
$paginator = Paginator::bootstrap('tbl_customers', 'username', '%' . $search . '%');
|
||||||
$d = ORM::for_table('tbl_customers')->where_like('username', '%' . $username . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
|
$d = ORM::for_table('tbl_customers')
|
||||||
|
->where_like($what, '%' . $search . '%')
|
||||||
|
->offset($paginator['startpoint'])
|
||||||
|
->limit($paginator['limit'])
|
||||||
|
->order_by_desc('id')->find_many();
|
||||||
} else {
|
} else {
|
||||||
$paginator = Paginator::bootstrap('tbl_customers');
|
$paginator = Paginator::bootstrap('tbl_customers');
|
||||||
$d = ORM::for_table('tbl_customers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
|
$d = ORM::for_table('tbl_customers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$ui->assign('search', htmlspecialchars($search));
|
||||||
|
$ui->assign('what', $what);
|
||||||
$ui->assign('d', $d);
|
$ui->assign('d', $d);
|
||||||
$ui->assign('paginator', $paginator);
|
$ui->assign('paginator', $paginator);
|
||||||
$ui->display('customers.tpl');
|
$ui->display('customers.tpl');
|
||||||
|
@ -29,7 +29,7 @@ switch ($action) {
|
|||||||
$ui->display('user-orderHistory.tpl');
|
$ui->display('user-orderHistory.tpl');
|
||||||
break;
|
break;
|
||||||
case 'package':
|
case 'package':
|
||||||
if(empty($user['email'])){
|
if (strpos($user['email'], '@') === false) {
|
||||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||||
}
|
}
|
||||||
$ui->assign('_title', 'Order Plan');
|
$ui->assign('_title', 'Order Plan');
|
||||||
@ -78,7 +78,6 @@ switch ($action) {
|
|||||||
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
|
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
|
||||||
call_user_func($trx['gateway'] . '_validate_config');
|
call_user_func($trx['gateway'] . '_validate_config');
|
||||||
call_user_func($config['payment_gateway'] . '_get_status', $trx, $user);
|
call_user_func($config['payment_gateway'] . '_get_status', $trx, $user);
|
||||||
|
|
||||||
} else if ($routes['3'] == 'cancel') {
|
} else if ($routes['3'] == 'cancel') {
|
||||||
run_hook('customer_cancel_payment'); #HOOK
|
run_hook('customer_cancel_payment'); #HOOK
|
||||||
$trx->pg_paid_response = '{}';
|
$trx->pg_paid_response = '{}';
|
||||||
@ -106,7 +105,7 @@ switch ($action) {
|
|||||||
$ui->display('user-orderView.tpl');
|
$ui->display('user-orderView.tpl');
|
||||||
break;
|
break;
|
||||||
case 'buy':
|
case 'buy':
|
||||||
if(empty($user['email'])){
|
if (strpos($user['email'], '@') === false) {
|
||||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||||
}
|
}
|
||||||
if ($config['payment_gateway'] == 'none') {
|
if ($config['payment_gateway'] == 'none') {
|
||||||
|
@ -79,6 +79,7 @@ switch ($do) {
|
|||||||
$d->password = $password;
|
$d->password = $password;
|
||||||
$d->fullname = $fullname;
|
$d->fullname = $fullname;
|
||||||
$d->address = $address;
|
$d->address = $address;
|
||||||
|
$d->email = '';
|
||||||
$d->phonenumber = $phonenumber;
|
$d->phonenumber = $phonenumber;
|
||||||
if ($d->save()) {
|
if ($d->save()) {
|
||||||
$user = $d->id();
|
$user = $d->id();
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -1,61 +1,74 @@
|
|||||||
{include file="sections/header.tpl"}
|
{include file="sections/header.tpl"}
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<div class="panel panel-hovered mb20 panel-primary">
|
<div class="panel panel-hovered mb20 panel-primary">
|
||||||
<div class="panel-heading">{$_L['Manage_Accounts']}</div>
|
<div class="panel-heading">{$_L['Manage_Accounts']}</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<form id="site-search" method="post" action="{$_url}customers/list/">
|
<form id="site-search" method="post" action="{$_url}customers/list/">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-addon">
|
<div class="input-group-addon no-border">
|
||||||
<span class="fa fa-search"></span>
|
<select name="what">
|
||||||
</div>
|
<option value="username" {if $what=='username'}selected{/if}>Username</option>
|
||||||
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}...">
|
<option value="fullname" {if $what=='fullname'}selected{/if}>Name</option>
|
||||||
<div class="input-group-btn">
|
<option value="phonenumber" {if $what=='phonenumber'}selected{/if}>Phone</option>
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<option value="email" {if $what=='email'}selected{/if}>Email</option>
|
||||||
</div>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
<input type="text" name="search" value="{$search}" class="form-control"
|
||||||
</div>
|
placeholder="{$_L['Search_by_Username']}...">
|
||||||
<div class="col-md-4">
|
<div class="input-group-btn">
|
||||||
<a href="{$_url}customers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Add_Contact']}</a>
|
<button class="btn btn-success" type="submit"><span class="fa fa-search"></span></button>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table class="table table-bordered table-striped">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th>{$_L['Username']}</th>
|
|
||||||
<th>{$_L['Full_Name']}</th>
|
|
||||||
<th>{$_L['Phone_Number']}</th>
|
|
||||||
<th>{$_L['Created_On']}</th>
|
|
||||||
<th>{$_L['Recharge']}</th>
|
|
||||||
<th>{$_L['Manage']}</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{foreach $d as $ds}
|
|
||||||
<tr>
|
|
||||||
<td>{$ds['username']}</td>
|
|
||||||
<td>{$ds['fullname']}</td>
|
|
||||||
<td>{$ds['phonenumber']}</td>
|
|
||||||
<td>{$ds['created_at']}</td>
|
|
||||||
<td align="center"><a href="{$_url}prepaid/recharge-user/{$ds['id']}" id="{$ds['id']}" class="btn btn-primary btn-sm">{$_L['Recharge']}</a></td>
|
|
||||||
<td align="center">
|
|
||||||
<a href="{$_url}customers/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
|
|
||||||
<a href="{$_url}customers/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm" onclick="confirm('{$_L['Delete']}?')">{$_L['Delete']}</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{/foreach}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
{$paginator['contents']}
|
</div>
|
||||||
</div>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="col-md-4">
|
||||||
</div>
|
<a href="{$_url}customers/add" class="btn btn-primary btn-block waves-effect"><i
|
||||||
|
class="ion ion-android-add"> </i> {$_L['Add_Contact']}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="table-responsive">
|
||||||
|
<table class="table table-bordered table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>{$_L['Username']}</th>
|
||||||
|
<th>{$_L['Full_Name']}</th>
|
||||||
|
<th>{$_L['Phone_Number']}</th>
|
||||||
|
<th>{$_L['Email']}</th>
|
||||||
|
<th>{$_L['Created_On']}</th>
|
||||||
|
<th>{$_L['Recharge']}</th>
|
||||||
|
<th>{$_L['Manage']}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{foreach $d as $ds}
|
||||||
|
<tr>
|
||||||
|
<td>{$ds['username']}</td>
|
||||||
|
<td>{$ds['fullname']}</td>
|
||||||
|
<td>{$ds['phonenumber']}</td>
|
||||||
|
<td>{$ds['email']}</td>
|
||||||
|
<td>{$ds['created_at']}</td>
|
||||||
|
<td align="center"><a href="{$_url}prepaid/recharge-user/{$ds['id']}" id="{$ds['id']}"
|
||||||
|
class="btn btn-primary btn-sm">{$_L['Recharge']}</a></td>
|
||||||
|
<td align="center">
|
||||||
|
<a href="{$_url}customers/edit/{$ds['id']}"
|
||||||
|
class="btn btn-warning btn-sm">{$_L['Edit']}</a>
|
||||||
|
<a href="{$_url}customers/delete/{$ds['id']}" id="{$ds['id']}"
|
||||||
|
class="btn btn-danger btn-sm"
|
||||||
|
onclick="confirm('{$_L['Delete']}?')">{$_L['Delete']}</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
{$paginator['contents']}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<input type="text" name="name" class="form-control"
|
<input type="text" name="name" class="form-control"
|
||||||
placeholder="{$_L['Search_by_Name']}...">
|
placeholder="{$_L['Search_by_Name']}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}..." value="{$cari}">
|
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}..." value="{$cari}">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
<input type="text" name="name" class="form-control"
|
<input type="text" name="name" class="form-control"
|
||||||
placeholder="{$_L['Search_by_Name']}...">
|
placeholder="{$_L['Search_by_Name']}...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<input type="text" name="username" class="form-control"
|
<input type="text" name="username" class="form-control"
|
||||||
placeholder="Search by Username...">
|
placeholder="Search by Username...">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">Search</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<input type="text" name="code" class="form-control"
|
<input type="text" name="code" class="form-control"
|
||||||
placeholder="{$_L['Search_by_Code']}..." value="{$_code}">
|
placeholder="{$_L['Search_by_Code']}..." value="{$_code}">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-success">{$_L['Search']}</button>
|
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user