Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function listnotifikasipetugas_post()
- {
- $username = trim($this->post('username'));
- $level = trim($this->post('level'));
- if ($username == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Username Kosong.',
- ];
- } else if ($level == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Level Kosong.',
- ];
- } else {
- $listNotifikasi = $this->db->get_where('bpmppt_notifikasi', array('notifikasi_level' => $level))->result();
- if (count($listNotifikasi) > 0) {
- foreach ($listNotifikasi as $r) {
- $response['items'][] = [
- 'resp_error' => false,
- 'notifikasi_id' => $r->notifikasi_id,
- 'notifikasi_no_register' => trim($r->notifikasi_no_register),
- 'notifikasi_date' => date('d-m-Y', strtotime($r->notifikasi_date)),
- 'notifikasi_level' => trim($r->notifikasi_level),
- 'notifikasi_desc' => trim($r->notifikasi_desc),
- 'notifikasi_status' => ($r->notifikasi_status == 1 ? 'Unread' : 'Read'),
- ];
- }
- } else {
- $response = [
- 'resp_error' => false,
- 'resp_msg' => 'Tidak Ada Notifikasi.',
- ];
- }
- }
- $this->response($response, 200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement