From 46a4c5f24d9306db6b802b7111c7805719381384 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Mon, 5 Aug 2024 11:45:27 +0700 Subject: [PATCH] Remove Datatables in customer list --- system/controllers/customers.php | 5 ++- ui/ui/customers.tpl | 61 ++++++++++++++------------------ 2 files changed, 30 insertions(+), 36 deletions(-) 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 @@
@@ -53,7 +59,8 @@ Status @@ -66,17 +73,18 @@
- +
- - + +
@@ -100,7 +108,7 @@ {foreach $d as $ds} - + {$ds['username']} {$ds['account_type']} @@ -110,7 +118,8 @@ {if $ds['phonenumber']} + title="{$ds['phonenumber']}"> {/if} {if $ds['email']}   {Lang::T('Edit')}   -   {Lang::T('Sync')}   + {include file="pagination.tpl"} - - - - - -{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file