forked from kevinowino869/mitrobill
fix search
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user