EVOLUTION-NINJA
Edit File: Request_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Request_model extends CI_Model { public function __construct() { parent::__construct(); } public function customer_insert($color_data) { $qualityinsert=$this->db->insert('sample_request',$color_data); if($qualityinsert) { return true; } else { return false; } } public function get_customer_details(){ $this->db->select('id,customer_name,customer_id,reference,date,product_type,article,quality,price,composition,description,preview'); $this->db->order_by('date','desc'); $this->db->from('sample_request'); //$this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->where('status',0); $this->db->group_by('customer_id,customer_name,date'); $this->db->order_by('date', 'DESC'); $query= $this->db->get(); return $query->result(); } public function fetch_data() { $this->db->select('*'); $this->db->from('product_master'); //$this->db->join('planned_order po', 'po.id=pow.planningOrderID'); //$this->db->where('status',0); $query= $this->db->get(); return $query->result(); } public function fetch_datas() { $this->db->select('*'); $this->db->from('warping_wearing'); //$this->db->join('planned_order po', 'po.id=pow.planningOrderID'); //$this->db->where('status',0); $query= $this->db->get(); return $query->row(); } public function customer_update($data,$where) { $this->db->where($where); $this->db->update('sample_request',$data); } public function get_customer_details1($id,$date){ $this->db->select('*'); $this->db->from('sample_request'); //$this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->where('customer_id',$id); $this->db->where('date',$date); $this->db->where('status',0); $query= $this->db->get(); return $query->result(); } public function get_customer_id($id){ $this->db->select('id,customer_name,customer_id,date'); $this->db->from('sample_request'); //$this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->where('id',$id); $query= $this->db->get(); return $query->row(); } public function Getsearch($keyword) { $this->db->distinct(); $this->db->select('customerName'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("customerName", $keyword); $this->db->from('customer_master'); $query= $this->db->get(); return $query->result(); } public function get_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); $arr=array(); foreach($query->result() as $row) { $arr[]=$row; } $json=json_encode($arr); return $json; } public function get_customerdata($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function insertt($data = array()){ $insert = $this->db->insert_batch('sample_request',$data); return $insert?true:false; } function inserted($data,$table) { $this->db->insert($table,$data); $id = $this->db->insert_id(); $condition=array('id' => $id); $q = $this->db->get_where($table,$condition ); return $q->row(); } function get_where($table,$condition) { $this->db->select('*')->from($table)->where($condition); $result=$this->db->get(); $row=$result->row(); return $row; } public function fetch() { $this->db->select_max('id'); $this->db->from('sample_request'); $query=$this->db->get(); return $query->row(); } public function update_data($where,$table,$data) { $this->db->where($where); $this->db->update($table,$data); } public function fetch_edit_data($where) { $this->db->select('*'); $this -> db ->from ('sample_request'); //$this -> db->join ( 'jb_role r ', 'l.role=r.id'); $this->db->where($where); $query=$this->db->get(); return $query->row(); } public function display_product_data() { $this->db->order_by("product", "asc"); $this->db->where('product_type','Fabrics'); $query = $this->db->get('indent_product'); return $query->result(); } } ?>