You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							60 lines
						
					
					
						
							1.1 KiB
						
					
					
				
			
		
		
	
	
							60 lines
						
					
					
						
							1.1 KiB
						
					
					
				| <?php | |
| defined('BASEPATH') OR exit('No direct script access allowed'); | |
|  | |
| /** | |
| * Login Class | |
| */ | |
| class Login extends CI_Controller | |
| { | |
| 	 | |
| 	public function __construct() | |
| 	{ | |
| 		parent::__construct(); | |
| 	} | |
| 	 | |
| 	public function	index() | |
| 	{ | |
| 		// Load model | |
| 		$this->load->model('Regio_model'); | |
| 		$regios = $this->Regio_model->get_regio_list(); | |
| 		 | |
| 		// Arrange data | |
| 		foreach ($regios as $regio) { | |
| 			$data['regio'][$regio['id']] = $regio['naam']; | |
| 		} | |
| 		 | |
| 		// Header | |
| 		$this->load->view('header'); | |
| 		 | |
| 		$this->form_validation->set_rules('username', 'Username', 'required'); | |
| 		$this->form_validation->set_rules('password', 'Password', 'required'); | |
| 		 | |
| 		if ($this->form_validation->run() == FALSE) | |
| 		{ | |
| 			// login page | |
| 			$this->load->view('login', $data); | |
| 		} else { | |
| 			// check login | |
| 			$this->_checklogin(); | |
| 		} | |
| 		 | |
| 		// Footer | |
| 		$this->load->view('footer'); | |
| 	} | |
| 	 | |
| 	private function _checklogin() | |
| 	{ | |
| 		// Load model | |
| 		$this->load->model('Login_model'); | |
| 		$logincheck = $this->Login_model->check_user(); | |
| 		 | |
| 		if ($logincheck == FALSE) { | |
| 			echo "No user "; | |
| 		} else { | |
| 			echo "Ok"; | |
| 		} | |
| 		 | |
| 	} | |
| } | |
| 	 | |
| ?>
 |