Advertisement
jamboljack

Jumlah Proposal per Dosen

Jan 26th, 2019
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.80 KB | None | 0 0
  1. public function jumlahproposal_post()
  2.     {
  3.         $username = trim($this->post('username'));
  4.  
  5.         if ($username == '') {
  6.             $response = [
  7.                 'resp_error' => true,
  8.                 'resp_msg'   => 'Username kosong.',
  9.             ];
  10.         } else {
  11.             $this->db->select('count(propose_id) as jumlah');
  12.             $this->db->from('lemlit_propose');
  13.             $this->db->where('propose_status <=', 2);
  14.             $this->db->where('user_username', $username);
  15.             $total = $this->db->get()->row();
  16.  
  17.             $response = [
  18.                 'resp_error' => false,
  19.                 'resp_msg'   => 'success',
  20.                 'total'      => number_format($total->jumlah, 0, '', ','),
  21.             ];
  22.         }
  23.  
  24.         $this->response($response, 200);
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement