Advertisement
jamboljack

Hapus Proposal

Jan 6th, 2019
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. // Hapus Data Proposal Admin
  2.     public function hapusdataproposal_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.             $this->db->where('propose_id', $id);
  19.             $this->db->delete('lemlit_propose');
  20.  
  21.             $response = [
  22.                 'resp_error' => false,
  23.                 'resp_msg'   => 'Hapus Proposal Berhasil.',
  24.             ];
  25.         }
  26.  
  27.         $this->response($response, 200);
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement