[eluser]Yash[/eluser]
Controller Code
Code:
function do_search()
{
$rules['blog_search'] = "required";
$this->validation->set_rules($rules);
$fields['blog_search'] = "Search";
$this->validation->set_fields($fields);
if ($this->validation->run())
{
$keyword=$this->input->post('blog_search');
$place=$this->input->post('search_area');
//redirect(,'refresh',,1);
$data['title']="Information Page";
$data['header']="Information";
$data['url']='/blog/search/'.$place.'/'.$keyword;
$data['time']="2";
$data['message']="<p>Thank You!</p>
<p>Stand by while we direct you to your search results</p>
<p>".anchor('/blog/search/'.$place.'/'.$keyword,"Click here")."if you are not redirected automatically</p>";
$this->load->view('info',$data);
}
else
{
$data['title']="MyBlog";
$data['allposts']="ss";//$this->load->view('searchform',$data,TRUE);
$data['SearchForm']=$this->load->view('searchform',$data,TRUE);
$data['pages']=$this->Homemodel->PageLinks();
$data['Categories']=$this->Categoriesmodel->CreateSimpleLiCategories();
$data['TagClouds']=$this->Homemodel->TagClouds();
$data['RecentPosts']=$this->Homemodel->RecentPosts(10);
$data['RecentComments']=$this->Commentsmodel->RecentComments(10);
$data['Archives']=$this->Homemodel->ArchivesList();
$this->load->view('main',$data);
}
}
function ForgetPassword()
{
$data['title']="Forget Password";
$this->load->library('validation');
$this->load->helper('security');
$this->load->library('table');
$rules['username'] = "trim|min_length[4]|max_length[20]";
$rules['email'] = "trim|required|valid_email|max_length[100]";
$this->validation->set_rules($rules);
$fields['username'] = 'Username';
$fields['email'] = 'Email ID';
$this->validation->set_fields($fields);
if ($this->validation->run())
{
//all details are ok.Now save these.
//$this->load->model('Usersmodel','',TRUE);
$this->Usersmodel->ForgetPassword();
}
else
{
//load it first till user fill all details correctly.
$data['title']="MyBlog";
$data['allposts']=$this->load->view('users/forgetpassword',$data,TRUE);
$data['pages']=$this->Homemodel->PageLinks();
$data['Categories']=$this->Categoriesmodel->CreateSimpleLiCategories();
$data['TagClouds']=$this->Homemodel->TagClouds();
$data['RecentPosts']=$this->Homemodel->RecentPosts(10);
$data['RecentComments']=$this->Commentsmodel->RecentComments(10);
$data['Archives']=$this->Homemodel->ArchivesList();
$this->load->view('main',$data);
}
}