%PDF- %PDF-
Direktori : /home/ugotscom/.trash/ |
Current File : /home/ugotscom/.trash/Performance_model.php |
<?php class Performance_model extends CI_Model{ //get all categories method function get_category(){ $result=$this->db->get('categories'); 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() { $this->datatables->select('user_id,name,username,password,status'); $this->datatables->from('users'); return $this->datatables->generate(); } //insert data method function insert_product(){ $data=array( 'name' => $this->input->post('name'), 'email' => $this->input->post('email'), 'phone' => $this->input->post('phone'), 'username' => $this->input->post('username'), 'password' => md5($this->input->post('password')), 'status' => $this->input->post('status'), 'added_user' => $this->input->post('added_user'), 'user_type_id' => $this->input->post('user_type_id') ); $result=$this->db->insert('users', $data); return $result; } //update data method function update_product(){ $user_id=$this->input->post('user_id'); $data=array( 'product_name' => $this->input->post('product_name'), 'product_price' => $this->input->post('price'), 'product_category_id' => $this->input->post('category') ); $this->db->where('user_id',$user_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('users'); $this->db->where('user_id',$id); $query = $this->db->get(); $row = $query->row_array(); return $row; } public function closed_leads($id) { $this->db->select('*'); $this->db->from('leads'); $this->db->where('added_by',$id); $this->db->where('lead_type_id',4); $query = $this->db->get(); return $query->num_rows(); } public function leads($id) { $this->db->select('*'); $this->db->from('leads'); $this->db->where('added_by',$id); $query = $this->db->get(); return $query->num_rows(); } }