diff --git a/system/controllers/customers.php b/system/controllers/customers.php index 21ea411f..3aabc72b 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -23,16 +23,26 @@ if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { switch ($action) { case 'list': $ui->assign('xfooter', ''); - $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'); diff --git a/system/controllers/order.php b/system/controllers/order.php index 3cc1622c..c2c9a09a 100644 --- a/system/controllers/order.php +++ b/system/controllers/order.php @@ -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') { diff --git a/system/controllers/register.php b/system/controllers/register.php index 27cab2f0..f554be4d 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -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(); diff --git a/ui/ui/bandwidth.tpl b/ui/ui/bandwidth.tpl index 25ec3fe6..4a09b630 100644 --- a/ui/ui/bandwidth.tpl +++ b/ui/ui/bandwidth.tpl @@ -14,7 +14,7 @@
- +
diff --git a/ui/ui/customers.tpl b/ui/ui/customers.tpl index c3d1ae07..22fd1191 100644 --- a/ui/ui/customers.tpl +++ b/ui/ui/customers.tpl @@ -1,61 +1,74 @@ {include file="sections/header.tpl"} -
-
-
-
{$_L['Manage_Accounts']}
-
-
-
- -
-   -
-
- - - - - - - - - - - - - {foreach $d as $ds} - - - - - - - - - {/foreach} - -
{$_L['Username']}{$_L['Full_Name']}{$_L['Phone_Number']}{$_L['Created_On']}{$_L['Recharge']}{$_L['Manage']}
{$ds['username']}{$ds['fullname']}{$ds['phonenumber']}{$ds['created_at']}{$_L['Recharge']} - {$_L['Edit']} - {$_L['Delete']} -
+
+
+
+
{$_L['Manage_Accounts']}
+
+
+
+
-
-
+
+ +
+   +
+
+ + + + + + + + + + + + + + {foreach $d as $ds} + + + + + + + + + + {/foreach} + +
{$_L['Username']}{$_L['Full_Name']}{$_L['Phone_Number']}{$_L['Email']}{$_L['Created_On']}{$_L['Recharge']}{$_L['Manage']}
{$ds['username']}{$ds['fullname']}{$ds['phonenumber']}{$ds['email']}{$ds['created_at']}{$_L['Recharge']} + {$_L['Edit']} + {$_L['Delete']} +
+
+ {$paginator['contents']} +
+
+
+
-{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/hotspot.tpl b/ui/ui/hotspot.tpl index 1c466ce1..371f0dcb 100644 --- a/ui/ui/hotspot.tpl +++ b/ui/ui/hotspot.tpl @@ -14,7 +14,7 @@
- +
diff --git a/ui/ui/pool.tpl b/ui/ui/pool.tpl index 0a83e141..6bf39add 100644 --- a/ui/ui/pool.tpl +++ b/ui/ui/pool.tpl @@ -15,7 +15,7 @@
- +
diff --git a/ui/ui/pppoe.tpl b/ui/ui/pppoe.tpl index f71be73e..090c9a76 100644 --- a/ui/ui/pppoe.tpl +++ b/ui/ui/pppoe.tpl @@ -14,7 +14,7 @@
- +
diff --git a/ui/ui/prepaid.tpl b/ui/ui/prepaid.tpl index dce05ac5..e2225464 100644 --- a/ui/ui/prepaid.tpl +++ b/ui/ui/prepaid.tpl @@ -14,7 +14,7 @@
- +
diff --git a/ui/ui/routers.tpl b/ui/ui/routers.tpl index 13345c74..5d9fa3d5 100644 --- a/ui/ui/routers.tpl +++ b/ui/ui/routers.tpl @@ -17,7 +17,7 @@
- +
diff --git a/ui/ui/users.tpl b/ui/ui/users.tpl index 4f42fd32..80f3f11d 100644 --- a/ui/ui/users.tpl +++ b/ui/ui/users.tpl @@ -16,7 +16,7 @@
- +
diff --git a/ui/ui/voucher.tpl b/ui/ui/voucher.tpl index c1b91684..a607be45 100644 --- a/ui/ui/voucher.tpl +++ b/ui/ui/voucher.tpl @@ -15,7 +15,7 @@
- +