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) {
|
||||
case 'list':
|
||||
$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
|
||||
if ($username != '') {
|
||||
$paginator = Paginator::bootstrap('tbl_customers', 'username', '%' . $username . '%');
|
||||
$d = ORM::for_table('tbl_customers')->where_like('username', '%' . $username . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
|
||||
if ($search != '') {
|
||||
$paginator = Paginator::bootstrap('tbl_customers', 'username', '%' . $search . '%');
|
||||
$d = ORM::for_table('tbl_customers')
|
||||
->where_like($what, '%' . $search . '%')
|
||||
->offset($paginator['startpoint'])
|
||||
->limit($paginator['limit'])
|
||||
->order_by_desc('id')->find_many();
|
||||
} else {
|
||||
$paginator = Paginator::bootstrap('tbl_customers');
|
||||
$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('paginator', $paginator);
|
||||
$ui->display('customers.tpl');
|
||||
|
@ -29,7 +29,7 @@ switch ($action) {
|
||||
$ui->display('user-orderHistory.tpl');
|
||||
break;
|
||||
case 'package':
|
||||
if(empty($user['email'])){
|
||||
if (strpos($user['email'], '@') === false) {
|
||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||
}
|
||||
$ui->assign('_title', 'Order Plan');
|
||||
@ -78,7 +78,6 @@ switch ($action) {
|
||||
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
|
||||
call_user_func($trx['gateway'] . '_validate_config');
|
||||
call_user_func($config['payment_gateway'] . '_get_status', $trx, $user);
|
||||
|
||||
} else if ($routes['3'] == 'cancel') {
|
||||
run_hook('customer_cancel_payment'); #HOOK
|
||||
$trx->pg_paid_response = '{}';
|
||||
@ -106,7 +105,7 @@ switch ($action) {
|
||||
$ui->display('user-orderView.tpl');
|
||||
break;
|
||||
case 'buy':
|
||||
if(empty($user['email'])){
|
||||
if (strpos($user['email'], '@') === false) {
|
||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||
}
|
||||
if ($config['payment_gateway'] == 'none') {
|
||||
|
@ -79,6 +79,7 @@ switch ($do) {
|
||||
$d->password = $password;
|
||||
$d->fullname = $fullname;
|
||||
$d->address = $address;
|
||||
$d->email = '';
|
||||
$d->phonenumber = $phonenumber;
|
||||
if ($d->save()) {
|
||||
$user = $d->id();
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -9,18 +9,25 @@
|
||||
<div class="col-md-8">
|
||||
<form id="site-search" method="post" action="{$_url}customers/list/">
|
||||
<div class="input-group">
|
||||
<div class="input-group-addon">
|
||||
<span class="fa fa-search"></span>
|
||||
<div class="input-group-addon no-border">
|
||||
<select name="what">
|
||||
<option value="username" {if $what=='username'}selected{/if}>Username</option>
|
||||
<option value="fullname" {if $what=='fullname'}selected{/if}>Name</option>
|
||||
<option value="phonenumber" {if $what=='phonenumber'}selected{/if}>Phone</option>
|
||||
<option value="email" {if $what=='email'}selected{/if}>Email</option>
|
||||
</select>
|
||||
</div>
|
||||
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}...">
|
||||
<input type="text" name="search" value="{$search}" class="form-control"
|
||||
placeholder="{$_L['Search_by_Username']}...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-success">{$_L['Search']}</button>
|
||||
<button class="btn btn-success" type="submit"><span class="fa fa-search"></span></button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<a href="{$_url}customers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Add_Contact']}</a>
|
||||
<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">
|
||||
@ -30,6 +37,7 @@
|
||||
<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>
|
||||
@ -41,11 +49,16 @@
|
||||
<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}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>
|
||||
<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}
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<input type="text" name="name" class="form-control"
|
||||
placeholder="{$_L['Search_by_Name']}...">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -14,7 +14,7 @@
|
||||
</div>
|
||||
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}..." value="{$cari}">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<input type="text" name="name" class="form-control"
|
||||
placeholder="{$_L['Search_by_Name']}...">
|
||||
<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>
|
||||
</form>
|
||||
|
@ -16,7 +16,7 @@
|
||||
<input type="text" name="username" class="form-control"
|
||||
placeholder="Search by Username...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-success">Search</button>
|
||||
<button class="btn btn-success" type="submit">{$_L['Search']}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
@ -15,7 +15,7 @@
|
||||
<input type="text" name="code" class="form-control"
|
||||
placeholder="{$_L['Search_by_Code']}..." value="{$_code}">
|
||||
<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>
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user