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

class Home extends CI_Controller {	 
	public function __construct() {
        parent::__construct();
		$this->load->model('mapmycareer/Home_model','home');
		         
    }
	
	public function index(){	

		 
		/* $this->load->view('mapmycareer/includes/mapmycareer_header');
		$this->load->view('mapmycareer/home_view');
		$this->load->view('mapmycareer/includes/mapmycareer_footer'); */
		$this->load->view('mapmycareer/new_home_view');
		
	}
	
	public function signIn(){		
		$adminEmail=trim($this->input->post('email'));
		$adminPassword=trim($this->input->post('password'));
		if($adminEmail=="" && $adminPassword==""){
			echo json_encode(array("success"=>false,"field_name"=>'both', "text"=>'<span style="color:red">Both fields are Required!</span>'));
		}else if($adminEmail=="" ){
			echo json_encode(array("success"=>false,"field_name"=>'a_email', "text"=>'<span style="color:red">Please Enter valid Username!</span>'));
		}else if($adminPassword=="" ){
			echo json_encode(array("success"=>false,"field_name"=>'a_password', "text"=>'<span style="color:red">Please Enter valid Password!</span>'));
		}else{
			
			$exit=$this->home->is_email_exists($adminEmail);
			if($exit){
				$this->home->get_login_details($adminEmail,$adminPassword);
			}else{
				echo json_encode(array("success"=>false,"field_name"=>'a_email', "text"=>'<span style="color:red">Please Enter valid Username!</span>'));
			}			
		}	
	}
	
	function logout(){
		$this->session->unset_userdata('students');
		redirect(BASE_URL);
	}
	
	public function SendEmail() {		
        /*$from="no-reply@FreshDailies.com";
		 $to="deepakverma05445@gmail.com";
		$subject="sdsd sds";
		$msg="dhdsjddf dfdf ddsdsdd";
        $this->email->from($from, 'FRESH Dailies');
        $this->email->to($to);
        
        $this->email->subject($subject);
        $this->email->message($msg);
        $this->email->send();
        var_dump($this->email->print_debugger());die;*/
    }
	
	
	function read_docx(){
		$this->load->helper('text_helper');
		 $filename =HTTP_UPLOAD_PATH .'css.docx';
		 var_dump(ascii_to_entities($filename));die;
		 		  
	
		 //echo $striped_content;
	}
}