diff --git a/system/controllers/customers.php b/system/controllers/customers.php index b5f3491c..12d57000 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -655,28 +655,12 @@ switch ($action) { $query = ORM::for_table('tbl_customers'); $query->where("status", $filter); } - if ($orderby == 'asc') { $query->order_by_asc($order); } else { $query->order_by_desc($order); } - - $customers = $query->findMany(); - - foreach ($customers as $customer) { - $d = ORM::for_table('tbl_user_recharges')->where('customer_id', $customer->id)->findOne(); - if ($d) { - if ($d['status'] == 'on') { - $customer->recharge_status = '' . $d['namebp'] . ''; - } else { - $customer->recharge_status = '' . $d['namebp'] . ''; - } - } else { - $customer->recharge_status = '•'; - } - } - + $d = $query->findMany(); if (_post('export', '') == 'csv') { $h = false; set_time_limit(-1); @@ -696,14 +680,13 @@ switch ($action) { 'email', 'balance', 'service_type', - 'recharge_status' ]; $fp = fopen('php://output', 'wb'); if (!$h) { fputcsv($fp, $headers, ";"); $h = true; } - foreach ($customers as $c) { + foreach ($d as $c) { $row = [ $c['id'], $c['username'], @@ -713,16 +696,14 @@ switch ($action) { $c['email'], $c['balance'], $c['service_type'], - $c->recharge_status ]; fputcsv($fp, $row, ";"); } fclose($fp); die(); } - $ui->assign('xheader', ''); - $ui->assign('customers', $customers); + $ui->assign('d', $d); $ui->assign('statuses', ORM::for_table('tbl_customers')->getEnum("status")); $ui->assign('filter', $filter); $ui->assign('search', $search); diff --git a/ui/ui/customers.tpl b/ui/ui/customers.tpl index bbbefa6f..b7e84da4 100644 --- a/ui/ui/customers.tpl +++ b/ui/ui/customers.tpl @@ -99,7 +99,7 @@
- {foreach $customers as $ds} + {foreach $d as $ds}