Edit file File name : Enquiries.php Content :<?php class Enquiries extends CI_Controller{ public function Enquiry(){ $this->load->model('Enquiries_model'); $data=$this->Enquiries_model->get_enquiries(); $this->load->view('header'); $this->load->view('Enquiries_list',["test"=>$data]); $this->load->view('footer'); } public function Enquiries_form(){ $this->load->model('Properties_model'); $data['properties']=$this->Properties_model->get_properties(); $this->load->view('header'); $this->load->view('Enquiries_form',$data); $this->load->view('footer'); } public function Add_enquiries(){ $name=$this->input->post('name'); $agent=$this->input->post('agent_id'); $agent_pr=explode(",",$agent); $agent_id=$agent_pr[0]; $project_id=$agent_pr[1]; $email=$this->input->post('email'); $phone=$this->input->post('phone'); $comment=$this->input->post('comment'); $date=$this->input->post('date'); $this->load->model('Enquiries_model'); $id=$this->Enquiries_model->get_enquiries_data($phone,$name,$email,$comment,$date,$agent_id,$project_id); redirect('Enquiries/Enquiry'); } public function Add_follow_up(){ $id=$this->input->post('enquiry_id'); $status=$this->input->post('status'); $comment=$this->input->post('comment'); $date=$this->input->post('date'); $this->load->model('Enquiries_model'); $id=$this->Enquiries_model->add_follow_up($id,$status,$comment,$date); redirect('Enquiries/Enquiry'); } public function Make_conversion(){ $id=$this->input->get('enquiry_id'); $status="CONVERSION"; $comment="Lead Converted"; $date=$this->input->post('date'); $this->load->model('Enquiries_model'); $id=$this->Enquiries_model->add_follow_up($id,$status,$comment,$date); redirect('Enquiries/Enquiry'); } public function Make_cancel(){ $id=$this->input->get('enquiry_id'); $status="CANCELLED"; $comment="Lead Converted"; $date=$this->input->post('date'); $this->load->model('Enquiries_model'); $id=$this->Enquiries_model->add_follow_up($id,$status,$comment,$date); redirect('Enquiries/Enquiry'); } public function Make_delete(){ $id=$this->input->get('enquiry_id'); $status="DELETE"; $comment="Lead Deleted"; $date=$this->input->post('date'); $this->load->model('Enquiries_model'); $id=$this->Enquiries_model->del_enquires_id($id,$status,$comment,$date); redirect('Enquiries/Enquiry'); } public function logs(){ $enquiry_id = $this->uri->segment(3, 0); $this->load->model('Enquiries_model'); $enq=$this->Enquiries_model->get_enquiry_id($enquiry_id); $enq_logs=$this->Enquiries_model->get_enquiries_logs_id($enquiry_id); $this->load->view('header'); $this->load->view('Enquiries_logs',["enq"=>$enq,"enq_logs"=>$enq_logs]); $this->load->view('footer'); } public function signout(){ session_destroy(); redirect('/User_login'); } public function logout(){ session_destroy(); redirect('/User_login'); } } ?> Save