Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function jumlahticket_post()
- {
- $username = trim($this->post('username'));
- $level = trim($this->post('level'));
- if ($username == '') {
- $response = [
- 'resp_error' => true,
- 'resp_msg' => 'Username kosong.',
- ];
- } else {
- if ($level == 'Member') {
- $this->db->select('count(ticket_id) as jumlah');
- $this->db->from('lemlit_ticket');
- $this->db->where('user_member', $username);
- } else {
- $this->db->select('count(ticket_id) as jumlah');
- $this->db->from('lemlit_ticket');
- $this->db->where('ticket_level', 'Lembaga Penelitian');
- }
- $total = $this->db->get()->row();
- $response = [
- 'resp_error' => false,
- 'resp_msg' => 'success',
- 'total' => number_format($total->jumlah, 0, '', ','),
- ];
- }
- $this->response($response, 200);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement