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

class Forgot extends CI_Controller {

	public function __construct() 
	{
		parent::__construct();
		
		$this->lang->load('account_general', get_language());
		$this->load->model('member_model');
	}
	
	public function index()
	{
		save_current_url(base_url() . 'forgot/');
		
		if( ! $this->session->userdata('user_type')) {
			$this->lang->load('account_general', get_language());
				
			$data['page_title'] = $this->lang->line('website_name') . ' | ' . $this->lang->line('hf_forgot_password');
			
			$this->load->view('forgot_password', $data);
		}
		else {
			redirect('home', 'refresh');
		}
	}
	
	public function submit()
	{
		if( ! $this->session->userdata('user_type')) {
			$this->lang->load('account_general', get_language());
				
			$data['page_title'] = $this->lang->line('website_name') . ' | ' . $this->lang->line('hf_forgot_password');
			
			$rs = $this->member_model->reset_password();
				
			echo $rs;
		}
		else {
			redirect('home', 'refresh');
		}
	}
}

/* End of file forgot.php */
/* Location: ./application/controllers/forgot.php */