getSqlLimitAndOffset(); if (!($sth = $dbh->prepare($sql))) { throw new Exception("sql prepare statement failure: $sql"); } $sth->setFetchMode(PDO::FETCH_ASSOC); if (!$sth->execute($parameters)) { throw new Exception("sql execute statement failure: $sql"); } $jobs = $sth->fetchAll(); $sql = "SELECT * FROM v_cm_customer_support V_CM_CUSTOMER_SUPPORT ORDER BY company_name"; if (!($sth = $dbh->prepare($sql))) { throw new Exception("sql prepare statement failure: $sql"); } $sth->setFetchMode(PDO::FETCH_ASSOC); if (!$sth->execute()) { throw new Exception("sql execute statement failure: $sql"); } $customers = $sth->fetchAll(); $sql = "SELECT * FROM sys_login WHERE deleted = ? ORDER BY username"; $parameters = array(0); if (!($sth = $dbh->prepare($sql))) { throw new Exception("sql prepare statement failure: $sql"); } $sth->setFetchMode(PDO::FETCH_ASSOC); if (!$sth->execute($parameters)) { throw new Exception("sql execute statement failure: $sql"); } $staffs = $sth->fetchAll(); $tmp_customer_map = array(); foreach ($customers as &$tmp_customer) { $tmp_customer_id = $tmp_customer['cust_id']; $tmp_customer_map[$tmp_customer_id] = $tmp_customer; } $tmp_staff_map = array(); foreach ($staffs as &$tmp_staff) { $tmp_staff_id = $tmp_staff['id']; $tmp_staff_map[$tmp_staff_id] = $tmp_staff; } foreach ($jobs as $tmp_key => &$tmp_job) { $tmp_customer_id = $tmp_job['customer_id']; $tmp_job['customer'] = $tmp_customer_map[$tmp_customer_id]; $tmp_staff_id = $tmp_job['staff_id']; $tmp_job['staff'] = $tmp_staff_map[$tmp_staff_id]; } return array_merge($get, array( 'jobs' => $jobs, 'message' => $_GET['message'], 'customers' => $customers, 'staffs' => $staffs, 'statusOptions' => Job::statusOptions(), 'typeOptions' => Job::typeOptions(), 'pagination' => $pagination->toString(), )); } extract(index()); ?>
=$message?>
Number | Customer | Date | Staff | Type | Status | |
---|---|---|---|---|---|---|
=$job['id']?> | =h($job['customer']['company_name'])?> | =$job['date']?> | =h($job['staff']['username'])?> | =h($typeOptions[$job['type']])?> |
Open: =$job['detail_open_count']?>
Completed: =$job['detail_completed_count']?> Follow up: =$job['detail_follow_up_count']?> Cancel: =$job['detail_cancel_count']?> =h($statusOptions[$job['status']])?> |