EVOLUTION-NINJA
Edit File: Design_weaving_model.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class design_weaving_model extends CI_Model { public function __construct() { parent::__construct(); } public function insert($table,$data) { $this->db->insert($table,$data); } public function insert_data($table,$data) { $this->db->insert($table,$data); return $this->db->insert_id(); } public function fetch_where_data($table) { $this->db->select("*"); $this->db->from($table); $query = $this->db->get(); return $query->result(); } public function fetch_where_design_details_data($table) { $this->db->select("*"); $this->db->order_by('designmp','asc'); $this->db->from($table); $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(); return $query->result(); } public function get_asc_data($table,$where) { $this->db->select('*'); $this->db->order_by('id','asc'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function max_select_maximum_id($table) { $this->db->select_max('id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function get_purchase_data($table,$where) { $this->db->select('*'); $this->db->group_by('po_no','indent_no','vendor_name','g_date','currency','confirm','approved_by','remark'); $this->db->order_by('po_id'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_data1($table,$where) { $this->db->select('*'); $this->db->group_by('sl_indent_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function Get($keyword) { $this->db->distinct(); $this->db->select('product'); $this->db->order_by('id', 'DESC'); $this->db->like("product", $keyword); $this->db->from('indent_product'); $query= $this->db->get(); return $query->result(); } 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 getsuborder1($id) { $this->db->select('*'); $this->db->from('indent_add_indent'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_indent_no', $id); $this->db->where('confirm', 'No'); $query = $this->db->get(); return $query->result(); } public function get_where_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 Getsearch($keyword) { $this->db->distinct(); $this->db->select('product'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("product", $keyword); $this->db->from('indent_product'); $query= $this->db->get(); return $query->result(); } public function Getsearch_pono($keyword) { $this->db->distinct(); $this->db->select('po_no'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->where('confirm', 'Yes'); $this->db->where('product_type', 'Fabrics'); $query= $this->db->get(); return $query->result(); } public function yarn_raw_Getsearch_pono($keyword,$status) { $this->db->distinct(); $this->db->select('po_no'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->or_where_in('product_type', $status); $query= $this->db->get(); return $query->result(); } public function cs_received_Getsearch_pono($keyword,$status) { $this->db->distinct(); $this->db->select('po_no'); $this->db->like("po_no", $keyword); $this->db->from('indent_po'); $this->db->or_where_in('product_type', $status); $query= $this->db->get(); return $query->result(); } public function multi_select_design_weave_warp_id($ids,$table) { $this->db->select('*'); $this->db->order_by('design_weaving_warp.id','asc'); $this->db->from('design_weaving_warp'); $this->db->join('import_yarn', 'import_yarn.id = design_weaving_warp.warp_yarn'); $this->db->where('design_weaving_warp.design_weaving_id', $ids); $query = $this->db->get(); return $query->result(); } public function multi_select_design_weave_weft_id($ids,$table) { $this->db->select('*'); $this->db->order_by('design_weaving_weft.id','asc'); $this->db->from('design_weaving_weft'); $this->db->join('import_yarn', 'import_yarn.id = design_weaving_weft.weft_yarn'); $this->db->where('design_weaving_weft.design_weaving_id', $ids); $query = $this->db->get(); return $query->result(); } public function Get_search($keyword) { $this->db->distinct(); $this->db->select('name'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("name", $keyword); $this->db->from('indent_vendor_master'); $query= $this->db->get(); return $query->result(); } public function max_select_indent_no($table) { $this->db->select_max('sl_indent_no'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function max_select_indent_no_id($table) { $this->db->select_max('id'); $this->db->from($table); $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 delete_product_vendor($where){ $this->db->where($where); $this->db->delete('indent_product'); return; } public function delete_vendor($table,$where){ $this->db->where($where); $this->db->delete($table); return; } public function max_select_purchase_no($table) { $this->db->select_max('po_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function max_select_goods($table) { $this->db->select_max('invoice_no_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function Getsearch_auto($keyword,$where) { $this->db->distinct(); $this->db->select('indent_no'); $this->db->like("indent_no", $keyword); $this->db->from('indent_add_indent'); $this->db->where($where); $query= $this->db->get(); return $query->result(); } public function Getsearch_vendorname_auto($keyword) { $this->db->distinct(); $this->db->select('name'); $this->db->like("name", $keyword); $this->db->from('indent_vendor_master'); $query= $this->db->get(); return $query->result(); } public function Getsearch_shade_auto($keyword) { $this->db->distinct(); $this->db->select('color'); $this->db->like('color', $keyword); $this->db->from('color_master'); $query= $this->db->get(); return $query->result(); } public function update_new($data,$where) { $this->db->where($where); $this->db->update('indent_add_indent',$data); } public function update_confirm_purchase($data,$where) { $this->db->where($where); $this->db->update('indent_purchase_order',$data); } public function get_where_dataa($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_where_id_dataa($table,$where) { $this->db->select('*'); $this->db->order_by('uni_id','desc'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function getsuborder($id) { $this->db->select('*'); $this->db->from('indent_add_indent'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_indent_no', $id); $query = $this->db->get(); return $query->result(); } public function getproduct_details($po_id) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_product', 'indent_product.product = indent_po.product_name'); $this->db->where('indent_po.po_id', $po_id); //$this->db->where('indent_product.product','indent_po.product_name'); //$this->db->where('indent_product.product_type','indent_po.product_type'); $query = $this->db->get(); return $query->result(); } public function getpurchaseorder($id) { $this->db->select('*'); $this->db->from('indent_purchase_order'); //$this->db->join('sub_order_shades', 'sub_order_shades.subOrderID = sub_orders.subCode'); $this->db->where('sl_no', $id); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_subgrid_data1($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_data11($table,$where) { $this->db->select("*"); $this->db->order_by('id','asc'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_work_order($table,$where) { $this->db->select('material_yarnname as name,sum(issued_gross_Weight) as gross,sum(issued_net_weight) as net'); $this->db->from($table); $this->db->where($where); $this->db->group_by('material_yarnname'); $query = $this->db->get(); return $query->result(); } public function update_confirm_indent($data,$where) { $this->db->where($where); $this->db->update('indent_add_indent',$data); } public function fetch_where_subgrid_data2($where,$id1) { $this->db->select('indent_purchase_order.rate_inr,indent_purchase_order.value_inr,indent_add_indent.add_product,indent_add_indent.quantity,indent_add_indent.indent_no'); $this->db->from('indent_add_indent'); $this->db->where('indent_add_indent.sl_indent_no', $where); $this->db->where('indent_purchase_order.id', $id1); $this->db->join('indent_purchase_order', 'indent_purchase_order.sl_indent_no = indent_add_indent.sl_indent_no'); $query = $this->db->get(); return $query->result(); } public function getproducts($type) { $query = $this->db->query('SELECT DISTINCT(product) FROM indent_product where product_type="' . $type .'"'); return $query->result(); } public function getunit($type) { $query = $this->db->query('SELECT * FROM indent_product where product="' . $type .'"'); return $query->row(); } public function get_wish_list_data($ids) { $this->db->select('*'); $this->db->from('indent_add_indent'); $this->db->where('id', $ids); $query=$this->db->get(); return $query->row(); } public function get_data_fetch($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function update_po_list_confirm_purchase($table,$data,$where) { $this->db->where($where); $this->db->update($table,$data); } public function update_fetch_data($val) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->where('id', $val); $query=$this->db->get(); return $query->row(); } public function fetch_where_ot_charges_subgrid_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); $this->db->where('department !=', ' '); $query = $this->db->get(); return $query->result(); } public function fetch_where_quantity_total($table,$where) { $this->db->select_sum('rec_goods'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function history_data_fetch($table) { $this->db->select('*'); $this->db->from($table); $this->db->where('department !=', ' '); $query=$this->db->get(); return $query->result(); } public function fetch_where_cs_quantity_total($table,$where) { $this->db->select_sum('gross_weight'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function getgoods_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db->where('department !=', ' '); $query=$this->db->get(); return $query->result(); } public function get_wish_list_dataa($ids) { $this->db->select('*'); $this->db->from('indent_add_indent'); $this->db->join('indent_product', 'indent_product.product = indent_add_indent.add_product'); $this->db->where('indent_add_indent.id', $ids); $query = $this->db->get(); return $query->row(); } public function fetch_where_consum_spares_quantity_total($table,$where) { $this->db->select_sum('received_quality'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function fetch_where_row_data($table,$where) { $this->db->select('*'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function display_warp_yarnqty_data() { // $this->db->select('*'); // $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); // $this->db->where('yarnType', 'Warp'); // $query=$this->db->get(); // return $query->result(); $this->db->select('*'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Warp'); $query=$this->db->get(); return $query->result(); } public function display_weft_yarnqty_data() { // $this->db->select('*'); // $this->db->from('import_yarn'); // $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); // $this->db->where('yarnType', 'Weft'); // $query=$this->db->get(); // return $query->result(); $this->db->select('*'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Weft'); $query=$this->db->get(); return $query->result(); } public function display_yarnqty_data($where) { $this->db->select('yarn_secondary.direction as sd,yarn_secondary.count as sc,yarn_primary.direction as pd,yarn_primary.count as pc,import_yarn.*'); $this->db->from('import_yarn'); $this->db->join('yarn_stage', 'yarn_stage.yarnID = import_yarn.id'); $this->db->join('yarn_primary', 'yarn_primary.yarnID = import_yarn.id'); $this->db->join('yarn_secondary', 'yarn_secondary.yarnID = import_yarn.id'); $this->db->where('import_yarn.id', $where); $query=$this->db->get(); return $query->row(); } public function display_weaving_data($where) { $this->db->select('*'); $this->db->from('work_order_dyeing'); $this->db->where('id', $where); $query=$this->db->get(); return $query->row(); } public function display_yarn_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); //$this->db->where('indent_po.product_type', 'Yarn - Twisted'); $query=$this->db->get(); return $query->result(); } public function max_select_workorer_id($table) { $this->db->select_max('work_order'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function select_max_vendor_id() { $this->db->select('import_fileno'); $this->db->order_by('id',"desc"); $this->db->limit(1); $query = $this->db->get('outsource_vendor_master'); return $query->row(); } public function display_yarn_twisting_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarn_status', 'Not Completed'); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarn_status', 'Not Completed'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data1() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarn_status', 'Not Completed'); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $query=$this->db->get(); return $query->result(); } public function display_yarn_raw_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_data() { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $query=$this->db->get(); return $query->result(); } // public function get_planned_order_detailsrow($subNumber) // { // $this->db->select('so.id,so.articleNo,sos.ourShade, // we.Weft_Quality,we.Weft_Specification,we.Weft_Denier,we.Kora_Wt as weftWt,wa.Warp_Quality,wa.Warp_Specification,wa.Warp_Denier,wa.Kora_Wt as warpWt, // smwa.warpCode,smwe.weftCode'); // $this->db->from('sub_orders so'); // $this->db->where('so.orderID', $subNumber); // $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); // $this->db->join('sm_warp smwa', 'smwa.shadeID = sos.shadeID'); // $this->db->join('sm_weft smwe', 'smwe.shadeID = sos.shadeID'); // $this->db->join('article_master am', 'so.articleNo = am.articleNo'); // $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); // $this->db->join('weft_data we', 'we.article_id = am.articleID'); // $query=$this->db->get(); // return $query->result(); // } public function get_planned_warp_order_detailsrow($subNumber) { //$this->db->distinct('smwa.warpCode'); $this->db->select('so.id, wa.Warp_Quality,wa.Warp_Specification,wa.Warp_Denier,wa.Kora_Wt as warpWt,am.articleNo,sm.shadeName,sm.shadeID '); $this->db->from('planned_order po'); $this->db->where('o.id', $subNumber); //$this->db->where('po.sslShade', $shade); $this->db->where('sos.planningStatus','planned'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->join('sub_orders so', 'so.id = sos.subOrderID'); $this->db->join('orders o', 'o.id = so.orderID'); $this->db->join('article_master am', 'so.articleNo = am.articleNo'); $this->db->join('shade_master sm', 'po.sslShade = sm.shadeID'); $this->db->join('warp_data wa', 'wa.article_id = am.articleID'); $query=$this->db->get(); return $query->result(); } public function get_planned_weft_order_detailsrow($subNumber) { //$this->db->distinct('smwe.weftCode'); $this->db->select('so.id, we.Weft_Quality,we.Weft_Specification,we.Weft_Denier,we.Kora_Wt as weftWt,am.articleNo,sm.shadeName,sm.shadeID '); $this->db->from('planned_order po'); $this->db->where('o.id', $subNumber); //$this->db->where('po.sslShade', $shade); $this->db->where('sos.planningStatus','planned'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->join('sub_orders so', 'so.id = sos.subOrderID'); $this->db->join('orders o', 'o.id = so.orderID'); $this->db->join('article_master am', 'so.articleNo = am.articleNo'); $this->db->join('shade_master sm', 'po.sslShade = sm.shadeID'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $query=$this->db->get(); return $query->result(); } public function get_planned_weft_detailsrow($subNumber) { $this->db->select('so.id,so.articleNo,sos.ourShade,'); $this->db->from('sub_orders so'); $this->db->where('so.orderID', $subNumber); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $query=$this->db->get(); return $query->row(); } public function Get_search_oslNo($keyword) { $this->db->distinct(); $this->db->select('oslNo'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("oslNo", $keyword); $this->db->from('orders'); $query= $this->db->get(); return $query->result(); } public function get_wish_list_data_oslno($ids) { $this->db->distinct('orders.oslNo'); $this->db->select('orders.oslNo'); $this->db->where('sub_orders.id', $ids); $this->db->order_by('oslNo', "asc"); $this->db->from('orders'); $this->db->join('sub_orders', 'sub_orders.orderID = orders.id'); $query = $this->db->get(); return $query->row(); } public function get_data_fetch_id($table,$where) { $query=$this->db->query('SELECT distinct(subOrderID) FROM sub_order_shades WHERE planningStatus="Planned"'); return $query->result(); } public function yarn_raw_Getsearch_wono($keyword,$status) { $this->db->distinct(); $this->db->select('work_order_no'); $this->db->like("work_order_no", $keyword); $this->db->from('create_materialissue_work_order'); //$this->db->where('confirm','Yes'); //$this->db->or_where_in('product_type', $status); //$this->db->where('confirm','Yes'); $query= $this->db->get(); return $query->result(); } public function deying_yarn_raw_Getsearch_wono($keyword,$status) { $this->db->distinct(); $this->db->select('work_order_no'); $this->db->like("work_order_no", $keyword); $this->db->from('workorder_dyeing_material'); //$this->db->where('confirm','Yes'); //$this->db->or_where_in('product_type', $status); //$this->db->where('confirm','Yes'); $query= $this->db->get(); return $query->result(); } //////////////////////////////////////////////////////////////////////////////////////////////// public function get_work_order_data($table,$where) { $this->db->select('*'); $this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_work_order_weaving_data($table,$where) { $this->db->select('*'); $this->db->group_by('work_order_num','vendor','date','comment'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_work_order_grid_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function get_data_where_fetch($table,$where) { $this->db->select('*'); $this->db->group_by('work_order_no','vendor_name','date','delivery_date'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function fetch_where_gross_quantity_total($table,$where) { $this->db->select_sum('gross_weight'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function get_plannedwarpwt($subNo){ $this->db->select('pow.*'); $this->db->from('po_warp pow'); $this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->where('sos.planningStatus','planned'); $this->db->where('po.oslNo', $subNo); $query = $this->db->get(); //echo $this->db->last_query();exit; $result = $query->result_array(); return $result; } public function get_planned_weft_wt($subNo){ $this->db->select('pow.*'); $this->db->from('po_weft pow'); $this->db->join('planned_order po', 'po.id=pow.planningOrderID'); $this->db->join('sub_order_shades sos', 'sos.shadeID = po.subNo'); $this->db->where('sos.planningStatus','planned'); $this->db->where('po.oslNo', $subNo); $query = $this->db->get(); $result = $query->result_array(); return $result; } public function display_yarn_raw_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Raw'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_dyed_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Dyed'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function display_yarn_twisting_yarn_material_modal_data($where) { $this->db->select('*'); $this->db->from('indent_po'); $this->db->join('indent_yarn_goods_details', 'indent_po.id = indent_yarn_goods_details.po_list_id'); $this->db->where('indent_po.product_type', 'Yarn - Twisted'); $this->db->where('indent_yarn_goods_details.yarnname', $where); $query=$this->db->get(); return $query->result(); } public function fetch_where_subgrid_deying_work_order($table,$where) { $this->db->select('yarn_details as name,sum(issue_net_weight) as net'); $this->db->from($table); $this->db->where($where); $this->db->group_by('yarn_details'); $query = $this->db->get(); return $query->result(); } public function fetch_where_subgrid_result_data($table,$where) { $this->db->select("*"); $this->db->from($table); $this->db->where($where); // $this->db->where('warp_qua !=',""); $query = $this->db->get(); return $query->result(); } public function update_osl_data($data,$where) { $this->db->where($where); $this->db->update('osl_warp_details',$data); } public function update_osl_weft_data($data,$where) { $this->db->where($where); $this->db->update('osl_weft_details',$data); } public function max_select_weaving_id($table) { $this->db->select_max('work_order'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function get_work_dyeing_order_data($table,$where) { $this->db->select('*'); //$this->db->group_by('work_order_no','vendor_name','date','delivery_date'); // $this->db->order_by('work_order_no'); $this->db->from($table); $this->db->where($where); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data($table) { $this->db->select('*'); $this->db->from($table); //$this->db->where($where); $this->db ->where('status','Waiting for Yarn'); $this->db ->or_where('status','Received Yarn'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_fabric_order_data($table) { $this->db->select('*'); $this->db->from($table); //$this->db->where($where); // $this->db ->where('status','Waiting for Yarn'); // $this->db ->or_where('status','Received Yarn'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data1($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Waiting for Yarn'); $this->db ->or_where('status','Received Yarn'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data2($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Completed'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_pending_order_data3($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); $this->db ->where('status','Winding & Warping '); $this->db ->or_where('status','Weaving'); $this->db->group_by('sos_id'); $query=$this->db->get(); return $query->result(); } public function get_work_inprocess_order_data($table) { $this->db->select('*'); $this->db->from($table); $this->db ->where('status','Winding & Warping '); $this->db ->or_where('status','Weaving'); $this->db->order_by('osl_no'); $query=$this->db->get(); return $query->result(); } public function get_weaving_order_data($table) { $this->db->select('*'); $this->db->from($table); $query=$this->db->get(); return $query->result(); } public function get_unplanned_orders() { $this->db->select('o.id,o.oslNo,so.articleNo,so.width,so.design,so.id as ssid,sos.shadeID as sos_id,so.quality,sos.ourShade,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC,po.pieceLength,po.plannedDate,po.weaving_factory,po.warpPlandMtr,po.weftPlandMtr,o.partyRef,o.deliveryDate,o.orderMode'); $this->db->distinct('sos.shadeID as sos_id'); $this->db->from('orders o'); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', 'planned'); $this->db->where('so.article_type', 'inhouse'); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); //$this->db->order_by("o.id", "desc"); //$this->db->group_by('oslNo'); $query = $this->db->get(); return $query->result(); } public function get_in_house_shadeNo($orderID, $status) { $this->db->select('o.id,o.oslNo,so.articleNo,so.width,so.design,so.quality,sos.ourShade,sos.quantity,am.finishedWeight,am.reedWidth,am.reed,we.PPC,po.pieceLength'); $this->db->from('orders o'); $this->db->where(' so.article_type', 'inhouse'); $this->db->where('so.orderID', $orderID); $this->db->where('so.orderConfirm', 'Yes'); $this->db->where('sos.planningStatus', $status); $this->db->join('sub_orders so', 'so.orderID = o.id'); $this->db->join('sub_order_shades sos', 'sos.subOrderID = so.id'); $this->db->join('planned_order po', 'po.subNo = sos.shadeID'); $this->db->join('article_master am', 'am.articleNo = so.articleNo'); $this->db->join('weft_data we', 'we.article_id = am.articleID'); $query = $this->db->get(); return $query->result(); } public function Getsearch_oslno($keyword) { $this->db->distinct(); $this->db->select('osl_no'); //$this->db->order_by('customer_name', 'DESC'); $this->db->like("osl_no", $keyword); $this->db->from('weaving_panel_planning_order'); // $this->db->where('status', 'Completed'); $this->db->order_by('osl_no'); $query= $this->db->get(); return $query->result(); } public function getweaving_data($table,$where) { $this->db->select('*'); $this->db->from($table); $this->db->where($where); //$this->db->where('fabric_details','Not Yet'); //$this->db->or_where('fabric_details','Partly'); $this->db->where('fabric_details !=', 'Completed'); $query=$this->db->get(); return $query->result(); } public function fetch_weave_quantity_total($table,$where) { $this->db->select_sum('received_mtrs'); //$this->db->select('quantity'); $this->db->from($table); $this->db->where($where); $query = $this->db->get(); return $query->row(); } public function get_transfer_data($table,$where) { $this->db->select('*'); $this->db->group_by('transfer_id'); $this->db->order_by('transfer_id','desc'); $this->db->from($table); $this->db->where($where); $query=$this->db->get(); return $query->result(); } public function update_confirm_fabric($data,$where) { $this->db->where($where); $this->db->update('fabric_transfer',$data); } public function update_confirm_cs($data,$where) { $this->db->where($where); $this->db->update('cs_transfer',$data); } public function update_confirm_yarn($data,$where) { $this->db->where($where); $this->db->update('yarn_transfer',$data); } public function update_confirm_swan_yarn($data,$where) { $this->db->where($where); $this->db->update('swan_yarn_transfer',$data); } public function max_select_maximum_design_id($table) { $this->db->select_max('design'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function max_select_maximum_uni_id($table) { $this->db->select_max('uni_id'); $this->db->from($table); $query = $this->db->get(); return $query->row(); } public function display_yarndenier_weaving_warp() { $this->db->select('*'); $this->db->order_by('yarnName','asc'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Warp'); $query = $this->db->get(); return $query->result(); // $query=$this->db->query('SELECT * FROM import_yarn where yarnType="yarnType"'); // return $query->result(); } public function display_yarndenier_weaving_weft() { $this->db->select('*'); $this->db->order_by('yarnName','asc'); $this->db->from('import_yarn'); $this->db->where('yarnType', 'Weft'); $query = $this->db->get(); return $query->result(); // $query=$this->db->query('SELECT * FROM import_yarn where yarnType="Weft" ORDER BY "yarnName"'); // return $query->result(); } public function multi_select_id($ids) { $this->db->select('*'); $this->db->from('design_weave'); $this->db->where('id', $ids); $query = $this->db->get(); return $query->result(); } public function multi_select_design_weave_id($ids,$table) { $this->db->select('*'); $this->db->from($table); $this->db->where('design_weaving_id', $ids); $query = $this->db->get(); return $query->result(); } public function fetch_where_design_prefix_details_data($table) { $this->db->select("*"); $this->db->distinct('prefixes'); $this->db->from($table); $query = $this->db->get(); return $query->result(); } public function fetch_where_design_distinct_prefix_details_data($table) { $this->db->select('prefixes'); $this->db->distinct('prefixes'); $this->db->from($table); $query = $this->db->get(); return $query->result(); } public function multi_select_design_weave_sum_id($ids,$table) { $this->db->select_sum('ppc'); $this->db->from($table); $this->db->where('design_weaving_id', $ids); $this->db->where('cram', 'No Cramming'); $query = $this->db->get(); return $query->row(); } public function single_select_design_weave_warp_id($table,$ids) { $this->db->select('design_weaving_warp.*,import_yarn.id as i_id,import_yarn.yarnType,import_yarn.yarnQuality,import_yarn.yarnName,import_yarn.yarnSpecification,import_yarn.yarnDenier,import_yarn.hankLength,import_yarn.hankWt,import_yarn.supplier,import_yarn.rate'); $this->db->order_by('design_weaving_warp.id','asc'); $this->db->from('design_weaving_warp'); $this->db->join('import_yarn', 'import_yarn.id = design_weaving_warp.warp_yarn'); $this->db->where('design_weaving_warp.design_weaving_id', $ids); $query = $this->db->get(); return $query->result(); } public function single_select_design_weave_weft_id($table,$ids) { $this->db->select('*'); $this->db->order_by('design_weaving_weft.id','asc'); $this->db->from('design_weaving_weft'); $this->db->join('import_yarn', 'import_yarn.id = design_weaving_weft.weft_yarn'); $this->db->where('design_weaving_weft.design_weaving_id', $ids); $query = $this->db->get(); return $query->result(); } // public function fetch_where_subgrid_data_base($table,$where) // { // $this->db->select("*"); // $this->db->from($table); // $this->db->where($where); // $query = $this->db->get(); // return $query->result(); // } } ?>