<?php 
class M_login extends CI_Model
{	    
    function cek_login() {
		$username = $this->session->userdata('username');
		$password = $this->session->userdata('passwd');
		$cek = $this->db->query("select * from user where username='$username' and password='$password'")->row_array();
		if(!$cek){			
			header("location: ".base_url('login'));
		}else{
			return true;
		}
							
	}	
    
	
	
}