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

	class Mail extends Site_Controller{
	
		function __construct()
		{
			parent::__construct();
			$this->load->model("Mod_mail");
			$this->load->library('email');
		}	
	
		public function index()
		{
			$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
			if ($this->form_validation->run() == TRUE)
			{
				$name = $_POST['email'];
				$old_mail = $this->Mod_mail->getname($name);
			}
			$this->session->set_flashdata('message',$old_mail);
			redirect('Home');	
			exit();
		}
		
		public function activation()
		{
			$code = $this->uri->segment(4);
			$msg = $this->Mod_mail->getcode($code);
			echo $msg;
		}

  }