<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Login extends CI_Controller {
    
	public function index(){
		$this->load->view('front/login');
    }
    
    public function submitlogin(){

		$data = array(
			'email' => $this->input->post('email'),
			'password' => md5($this->input->post('password'))
        );
        
        // var_dump($data);

		$this->load->model('login_model');
		$res = $this->login_model->verifyLogin($data);

		if($res == TRUE){
			
			redirect('user/Dashboard');
			
		}
		else{
			$this->session->set_flashdata('error', 'Wrong Username and Password!');
			redirect("Login");
		}


    }
    
    public function checkSession(){
        var_dump($_SESSION['login']);
    }
}