Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. public function aksi_login(){
  2. if (isset($_POST['login'])) {
  3. $username = $this->input->post('username',true);
  4. $password = $this->input->post('password',true);
  5. $cek = $this->mymodel->proseslogin($username,$password)->num_rows();
  6. if ($cek >0) {
  7. $pelogin = $this->db->get_where('user',array('username'=>$username, 'password'=>$password));
  8.  
  9. // print_r($pelogin->kd_kategori);
  10.  
  11. if ($pelogin->kd_kategori='1') {
  12. // $data_session = array(
  13. // 'nama' => $username,
  14. // 'status' => "login"
  15. // );
  16.  
  17. // $this->session->set_userdata($data_session);
  18.  
  19. redirect(base_url("index.php/admindinas/index/"));
  20. }else if($pelogin->kd_kategori='2'){
  21. // $data_session = array(
  22. // 'nama' => $username,
  23. // 'status' => "login"
  24. // );
  25.  
  26. $this->session->set_userdata($data_session);
  27. redirect(base_url("index.php/protocol/index/"));
  28. }
  29. }else{
  30. echo "gagal";
  31. }
  32.  
  33. echo "<pre>";
  34. print_r($_POST);
  35. echo "</pre>";
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement