%PDF- %PDF-
Direktori : /home/ugotscom/public_html/dg/application/modules/emp/models/ |
Current File : /home/ugotscom/public_html/dg/application/modules/emp/models/Emp_model.php |
<?php class Emp_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_lead_type(){ $result=$this->db->get('lead_type'); return $result; } function get_location(){ $result=$this->db->get('locations'); return $result; } //generate dataTable serverside method function get_all_product() { $user_id =$_SESSION['user_id']; $this->datatables->select('lead_id,customer_name,enquiry_source,mobile_no,passport_no'); $this->datatables->where('added_by',$user_id); $this->datatables->from('leads'); return $this->datatables->generate(); } //insert data method function insert_product(){ $today = date("Y-m-d"); $data=array( 'customer_name' => $this->input->post('customer_name'), 'enquiry_source' => $this->input->post('enquiry_source'), 'passport_no ' => $this->input->post('passport_no'), 'passport_validity ' => $this->input->post('passport_validity'), 'address' => $this->input->post('address'), 'mobile_no' => $this->input->post('mobile_no'), 'vessel ' => $this->input->post('vessel'), 'email' => $this->input->post('email'), 'gender' => $this->input->post('gender'), 'dob' => $this->input->post('dob'), 'rank ' => $this->input->post('rank'), 'height' => $this->input->post('height'), 'weight ' => $this->input->post('weight'), 'identification_notes ' => $this->input->post('identification_notes'), 'bp ' => $this->input->post('bp'), 'pulse ' => $this->input->post('pulse'), 'rr ' => $this->input->post('rr'), 'chest ' => $this->input->post('chest'), 'hemoglobin' => $this->input->post('hemoglobin'), 'wbc' => $this->input->post('wbc'), 'sgpt' => $this->input->post('sgpt'), 'esr' => $this->input->post('esr'), 'sugar' => $this->input->post('sugar'), 'cholestrol' => $this->input->post('cholestrol'), 'blood_group' => $this->input->post('blood_group'), 'xray' => $this->input->post('xray'), 'ecg' => $this->input->post('ecg'), 'type' => $this->input->post('type'), 'drec' => $this->input->post('drec'), 'dlec' => $this->input->post('dlec'), 'dreuc' => $this->input->post('dreuc'), 'dleuc' => $this->input->post('dleuc'), 'added_by' => $this->input->post('added_by'), 'branch_id' => $this->input->post('branch_id'), 'added_date'=> $this->input->post('added_date'), ); $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'), 'passport_no ' => $this->input->post('passport_no'), 'passport_validity ' => $this->input->post('passport_validity'), 'address' => $this->input->post('address'), 'mobile_no' => $this->input->post('mobile_no'), 'vessel ' => $this->input->post('vessel'), 'email' => $this->input->post('email'), 'gender' => $this->input->post('gender'), 'dob' => $this->input->post('dob'), 'rank ' => $this->input->post('rank'), 'height' => $this->input->post('height'), 'weight ' => $this->input->post('weight'), 'identification_notes ' => $this->input->post('identification_notes'), 'bp ' => $this->input->post('bp'), 'pulse ' => $this->input->post('pulse'), 'rr ' => $this->input->post('rr'), 'chest ' => $this->input->post('chest'), 'hemoglobin' => $this->input->post('hemoglobin'), 'wbc' => $this->input->post('wbc'), 'sgpt' => $this->input->post('sgpt'), 'esr' => $this->input->post('esr'), 'sugar' => $this->input->post('sugar'), 'cholestrol' => $this->input->post('cholestrol'), 'blood_group' => $this->input->post('blood_group'), 'xray' => $this->input->post('xray'), 'ecg' => $this->input->post('ecg'), 'type' => $this->input->post('type'), 'drec' => $this->input->post('drec'), 'dlec' => $this->input->post('dlec'), 'dreuc' => $this->input->post('dreuc'), 'dleuc' => $this->input->post('dleuc'), 'added_by' => $this->input->post('added_by'), 'branch_id' => $this->input->post('branch_id'), 'added_date'=> $this->input->post('added_date'), ); $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; } function add_remark(){ $data=array( 'lead_id' => $this->input->post('lead_id'), 'remarks' => $this->input->post('remarks') ); $result=$this->db->insert('remarks', $data); $lead_id=$this->input->post('lead_id'); $datas=array( 'lead_id' => $this->input->post('lead_id'), 'followup_date' => $this->input->post('followup_date'), 'lead_type_id' => $this->input->post('lead_type_id') ); $this->db->where('lead_id',$lead_id); $results=$this->db->update('leads', $datas); return $result; } public function rlisting($id){ $this->db->select('*'); $this->db->from('remarks'); $this->db->where('lead_id',$id); $this->db->order_by("date", "desc"); $query = $this->db->get(); $row = $query->result_array(); return $row; } }