Advertisement
jamboljack

Jumlah Proposal Baru (Admin)

Jan 26th, 2019
429
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.75 KB | None | 0 0
  1. public function jumlahproposalbaru_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', 1);
  14.             $total = $this->db->get()->row();
  15.  
  16.             $response = [
  17.                 'resp_error' => false,
  18.                 'resp_msg'   => 'success',
  19.                 'total'      => number_format($total->jumlah, 0, '', ','),
  20.             ];
  21.         }
  22.  
  23.         $this->response($response, 200);
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement