diff --git a/system/controllers/customers.php b/system/controllers/customers.php index 86af7956..baf166cd 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -655,6 +655,8 @@ switch ($action) { 'status' => 7 ]; + $append_url = "&order=" . urlencode($order) . "&filter=" . urlencode($filter) . "&orderby=" . urlencode($orderby); + if ($search != '') { $query = ORM::for_table('tbl_customers') ->whereRaw("username LIKE '%$search%' OR fullname LIKE '%$search%' OR address LIKE '%$search%' " . @@ -668,8 +670,8 @@ switch ($action) { } else { $query->order_by_desc($order); } - $d = $query->findMany(); if (_post('export', '') == 'csv') { + $d = $query->findMany(); $h = false; set_time_limit(-1); header('Pragma: public'); @@ -710,6 +712,7 @@ switch ($action) { fclose($fp); die(); } + $d = Paginator::findMany($query, ['search' => $search], 30, $append_url); $ui->assign('xheader', ''); $ui->assign('d', $d); $ui->assign('statuses', ORM::for_table('tbl_customers')->getEnum("status")); diff --git a/ui/ui/customers.tpl b/ui/ui/customers.tpl index 04ea824c..9eacbce3 100644 --- a/ui/ui/customers.tpl +++ b/ui/ui/customers.tpl @@ -33,16 +33,22 @@