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


class Front extends CI_Controller {
    public function reset_pass()
    {
        $this->load->view('reset_pass');
    }
    public function admin_email($name)
    {
        $name=$this->db->select('*')
                       ->from('admin')
                       ->where('email',$name)
                       ->where('is_delete',0)
                       ->get()->row_array();
         if(!empty($name))
         {
             echo 1;
         }else
         {
             echo 0;
         }
    }
    public function update_pass()
    {
        $email=$this->input->post('u_email');
        $new_pass=$this->input->post('new_pass');
        $pass=md5($new_pass);
        $data=array(
            'password'=>$pass
            );
        $this->db->where('email',$email)
                 ->update('admin',$data);
        $this->session->set_flashdata('msg','Password Successfully Update'); 
        redirect('Front/reset_pass');
    }
}?>