daily pastebin goal
63%
SHARE
TWEET

Untitled

a guest Oct 3rd, 2017 44 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function home(){
  2.        
  3.         $username = $_POST['user_login'];
  4.         $password = $_POST['user_pass'];
  5.    
  6.         $sessionId = $this->session->userdata('userid');
  7.         //echo $sessionId;
  8.         $data['sessionId']=$sessionId;
  9.         //Returns userid is successful, false is unsuccessful
  10.    
  11.         $result=$this->users->Adminlogin($username,$password);
  12.        
  13.        
  14.         if ($result==false) { $data['msg']='fail'; redirect('admin',$data); }
  15.         else
  16.         {  
  17.             $query="select * from admin where admin_id='$result'";//$this->db->get_where('register',array('REGISTER_CD'=>$result));
  18.             $result2=mysql_query($query);
  19.             $row = mysql_fetch_array($result2);
  20.            
  21.             //$status = $row['status'];
  22.             $username = $row['username'];
  23.             $lastlogin = $row['date'];
  24.             //$admin_type = $row['admin_type'];
  25.            
  26.            
  27.                
  28.                 $this->session->set_userdata(array('userid'=>$result));
  29.                 $this->session->set_userdata(array('username'=>$username));
  30.                 $this->session->set_userdata(array('lastlogin'=>$lastlogin));
  31.              $this->load->view('templates/application', $data);
  32.            
  33.         }
  34.        
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top