diff --git a/app/Config/Routes.php b/app/Config/Routes.php index dde3142..32d9969 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -52,6 +52,7 @@ $routes->get('api/request/validate/(:any)', 'Request::show/$1'); $routes->post('api/request/validate/(:any)', 'Request::val/$1'); $routes->delete('api/request/validate/(:any)', 'Request::unval/$1'); +$routes->get('api/request', 'Request::index'); $routes->get('api/specimen/(:any)', 'Specimen::show/$1'); $routes->post('api/specimen/collect/(:any)', 'Specimen::collect/$1'); diff --git a/app/Controllers/Request.php b/app/Controllers/Request.php index 0049af7..607a801 100644 --- a/app/Controllers/Request.php +++ b/app/Controllers/Request.php @@ -15,6 +15,11 @@ class Request extends BaseController { COLLECTIONDATE between '$date1 00:00' and '$date2 23:59' and ODR_DDATE between '$date1 00:00' and '$date2 23:59'"; $rows = $db->query($sql)->getResultArray(); + foreach ($rows as &$row) { + $row['COLLECTIONDATE'] = date('Y-m-d H:i', strtotime($row['COLLECTIONDATE'])); + $row['ODR_DDATE'] = date('Y-m-d H:i', strtotime($row['ODR_DDATE'])); + $row['REQDATE'] = date('Y-m-d H:i', strtotime($row['REQDATE'])); + } $data['data'] = $rows; return $this->response->setJSON($data); } diff --git a/app/Views/v2/index.php b/app/Views/v2/index.php index c8efe86..0b653e2 100644 --- a/app/Views/v2/index.php +++ b/app/Views/v2/index.php @@ -7,6 +7,7 @@ + - -