%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/followup/models/ |
Current File : /home/ugotscom/public_html/dg/application/modules/followup/models/Followup_model.php |
<?php class Followup_model extends CI_Model{ //get all categories method function get_category(){ $result=$this->db->get('enquiry_source'); return $result; } function get_source(){ $result=$this->db->get('enquiry_source'); return $result; } function get_location(){ $result=$this->db->get('locations'); return $result; } //generate dataTable serverside method function get_all_product() { $today = date("Y-m-d"); $user_id=$_SESSION['user_id']; $this->datatables->select('lead_id,customer_name,mobile_no,enquiry_source,product_price,remarks,followup_date,added_by,lead_type_id'); $this->datatables->from('leads'); $this->datatables->where('followup_date',$today); $this->datatables->where('added_by',$user_id); return $this->datatables->generate(); } //insert data method function insert_product(){ $data=array( 'customer_name' => $this->input->post('customer_name'), 'enquiry_source' => $this->input->post('enquiry_source'), 'product_price' => $this->input->post('price'), 'product_category_id' => $this->input->post('category'), 'mobile_no' => $this->input->post('mobile_no'), 'alt_mobile_no' => $this->input->post('alt_mobile_no'), 'landline_no' => $this->input->post('landline_no'), 'email' => $this->input->post('email'), 'location' => $this->input->post('location'), 'gender' => $this->input->post('gender'), 'dob' => $this->input->post('dob'), 'aadhar_no' => $this->input->post('aadhar_no'), 'added_by' => $this->input->post('added_by') ); $result=$this->db->insert('leads', $data); return $result; } //update data method function update_product(){ $lead_id=$this->input->post('lead_id'); $data=array( 'customer_name' => $this->input->post('customer_name'), 'enquiry_source' => $this->input->post('enquiry_source'), 'product_price' => $this->input->post('price'), 'product_category_id' => $this->input->post('category'), 'mobile_no' => $this->input->post('mobile_no'), 'alt_mobile_no' => $this->input->post('alt_mobile_no'), 'landline_no' => $this->input->post('landline_no'), 'email' => $this->input->post('email'), 'location' => $this->input->post('location'), 'gender' => $this->input->post('gender'), 'dob' => $this->input->post('dob'), 'aadhar_no' => $this->input->post('aadhar_no'), 'model_name' => $this->input->post('model_name'), 'lead_type_id' => $this->input->post('lead_type_id'), 'followup_date' => $this->input->post('followup_date'), 'payment_type' => $this->input->post('payment_type'), 'test_ride_taken' => $this->input->post('test_ride_taken'), 'customer_type' => $this->input->post('customer_type'), 'cus_int_exe' => $this->input->post('cus_int_exe'), 'remarks' => $this->input->post('remarks'), 'enquiry_status' => $this->input->post('enquiry_status'), 'added_by' => $this->input->post('added_by') ); $this->db->where('lead_id',$lead_id); $result=$this->db->update('leads', $data); return $result; } //delete data method function delete_product(){ $user_id=$this->input->post('user_id'); $this->db->where('user_id',$user_id); $result=$this->db->delete('leads'); return $result; } public function get_customer($id) { $this->db->select('*'); $this->db->from('leads'); $this->db->where('lead_id',$id); $query = $this->db->get(); $row = $query->row_array(); return $row; } }