Advertisement
jamboljack

Edit Usulan Reviewer

Jan 9th, 2019
419
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. // Usulan Reviewer
  2.     public function editusulan_post()
  3.     {
  4.         $username = trim($this->post('username'));
  5.         $id       = $this->post('id');
  6.  
  7.         if ($username == '') {
  8.             $response = [
  9.                 'resp_error' => true,
  10.                 'resp_msg'   => 'Username Kosong.',
  11.             ];
  12.         } elseif ($id == '') {
  13.             $response = [
  14.                 'resp_error' => true,
  15.                 'resp_msg'   => 'ID Proposal Kosong.',
  16.             ];
  17.         } else {
  18.             $detail = $this->db->get_where('lemlit_reviewer', array('propose_id' => $id, 'user_username' => $username))->row();
  19.  
  20.             if (count($detail) == 0) {
  21.                 $response = [
  22.                     'resp_error' => false,
  23.                     'resp_msg'   => 'Data Reviewer Tidak Di Temukan',
  24.                 ];
  25.             } else {
  26.                 $response = [
  27.                     'resp_error'    => false,
  28.                     'id'            => $detail->propose_id,
  29.                     'user_username' => trim($detail->user_username),
  30.                     'reviewer_id'   => $detail->reviewer_id,
  31.                     'usulan_dana'   => $detail->usulan_dana,
  32.                     'usulan_rupiah' => number_format($detail->usulan_dana, 0, '', ','),
  33.                 ];
  34.             }
  35.         }
  36.  
  37.         $this->response($response, 200);
  38.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement