Customer View show Active package

This commit is contained in:
Ibnu Maksum
2023-08-23 15:00:34 +07:00
parent 8e45ac40c4
commit 74ac7f3eb4
8 changed files with 179 additions and 79 deletions

View File

@ -42,16 +42,16 @@ switch ($action) {
if (empty($s)) {
$c = ORM::for_table('tbl_customers')->limit(30)->find_many();
} else {
$c = ORM::for_table('tbl_customers')->where_raw("(`username` LIKE '%$s%' OR `fullname` LIKE '%$s%' OR `phonenumber` LIKE '%$s%' OR `email` LIKE '%$s%')", [$s,$s,$s,$s])->limit(30)->find_many();
$c = ORM::for_table('tbl_customers')->where_raw("(`username` LIKE '%$s%' OR `fullname` LIKE '%$s%' OR `phonenumber` LIKE '%$s%' OR `email` LIKE '%$s%')", [$s, $s, $s, $s])->limit(30)->find_many();
}
header('Content-Type: application/json');
foreach ($c as $cust){
foreach ($c as $cust) {
$json[] = [
'id' => $cust['id'],
'text' => $cust['username'].' - '.$cust['fullname'].' - '.$cust['email']
'text' => $cust['username'] . ' - ' . $cust['fullname'] . ' - ' . $cust['email']
];
}
echo json_encode(['results'=>$json]);
echo json_encode(['results' => $json]);
die();
break;
default: