From 47c6e906240b3a122616dd4571d9c343f1b0e113 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Wed, 1 May 2024 10:21:32 +0700 Subject: [PATCH 1/2] delete die() debug, forgot to delete it --- system/autoload/Message.php | 1 - system/controllers/autoload.php | 1 - system/controllers/plan.php | 1 - version.json | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/system/autoload/Message.php b/system/autoload/Message.php index 3e938233..4f72dcb7 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -115,7 +115,6 @@ class Message $mail->Subject = $subject; $mail->Body = $body; $mail->send(); - die(); } } diff --git a/system/controllers/autoload.php b/system/controllers/autoload.php index 546473ac..e24af345 100644 --- a/system/controllers/autoload.php +++ b/system/controllers/autoload.php @@ -84,7 +84,6 @@ switch ($action) { } echo json_encode(['results' => $json]); die(); - break; default: $ui->display('a404.tpl'); } diff --git a/system/controllers/plan.php b/system/controllers/plan.php index 68adcffd..71dec1f0 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -570,7 +570,6 @@ switch ($action) { } else if ($voucher_format == 'rand') { $code = Lang::randomUpLowCase($code); } - die($code); $d = ORM::for_table('tbl_voucher')->create(); $d->type = $type; $d->routers = $server; diff --git a/version.json b/version.json index daf815f0..a3b0c348 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.4.30" + "version": "2024.5.1" } \ No newline at end of file From 0bd587522a5841dadf3498f3de35c777af73dd5a Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Thu, 2 May 2024 16:31:25 +0700 Subject: [PATCH 2/2] Search all field --- system/controllers/customers.php | 13 +++++++++++-- system/controllers/plan.php | 4 +++- ui/ui/customers.tpl | 13 ++++++++++++- ui/ui/plan.tpl | 2 -- 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/system/controllers/customers.php b/system/controllers/customers.php index e3e69bad..d6a86c0f 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -600,11 +600,20 @@ switch ($action) { default: run_hook('list_customers'); #HOOK - - $query = ORM::for_table('tbl_customers')->order_by_asc('username'); + $search = _post('search'); + if ($search != '') { + $query = ORM::for_table('tbl_customers') + ->whereRaw("username LIKE '%$search%' OR fullname LIKE '%$search%' OR address LIKE '%$search%' ". + "OR phonenumber LIKE '%$search%' OR email LIKE '%$search%' ") + ->order_by_asc('username'); + $d = $query->findMany(); + } else { + $query = ORM::for_table('tbl_customers')->order_by_asc('username'); + } $d = $query->findMany(); $ui->assign('xheader', ''); $ui->assign('d', $d); + $ui->assign('search', $search); $ui->display('customers.tpl'); break; } diff --git a/system/controllers/plan.php b/system/controllers/plan.php index 71dec1f0..1bb6e583 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -787,7 +787,9 @@ switch ($action) { $ui->assign('_title', Lang::T('Customer')); $search = _post('search'); if ($search != '') { - $query = ORM::for_table('tbl_user_recharges')->where_like('username', '%' . $search . '%')->order_by_desc('id'); + $query = ORM::for_table('tbl_user_recharges') + ->whereRaw("username LIKE '%$search%' OR namebp LIKE '%$search%' OR method LIKE '%$search%' OR routers LIKE '%$search%' OR type LIKE '%$search%'") + ->order_by_desc('id'); $d = Paginator::findMany($query, ['search' => $search]); } else { $query = ORM::for_table('tbl_user_recharges')->order_by_desc('id'); diff --git a/ui/ui/customers.tpl b/ui/ui/customers.tpl index fd4d6c76..3c255bc0 100644 --- a/ui/ui/customers.tpl +++ b/ui/ui/customers.tpl @@ -27,7 +27,18 @@
- +