EVOLUTION-NINJA
Edit File: Stock_old.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Stock_old extends CI_Controller { public function __construct() { parent::__construct(); $this->check_islogin(); //check user login session exist or not $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $this->load->model('yarn_model'); $this->load->model('marketing_model'); $this->load->model('planning_yarn'); $this->load->model('planning_shade'); $this->load->model('request_model'); $this->load->model('vendor_model'); $this->load->model('outsource_model'); $this->load->model('store_model'); $this->load->model('stock_model'); date_default_timezone_set('asia/kolkata'); } public function log() { echo $_REQUEST['name'];exit; echo "login"; } public function split_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ stock ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' || $data['emp_details']->designation == 'ACCOUNTS' || $data['emp_details']->designation == 'Accounts' || $data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $ttt1=date('d/m/Y'); $ddd1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$ttt1,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); $ttt=date('d/m/Y'); $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$ttt,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_madeups_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); } else { $data['stock_split_data_res_count']=0; $data['stock_madeups_split_data_res_count']=0; } $stock=$data['stock_split_data_res_count'] + $data['stock_madeups_split_data_res_count']; return $stock; } //Checking the Login or not private function check_islogin() { if (!$this->session->userdata('logged_in')) { redirect(base_url(), 'refresh'); } } public function session_data_pass() { if ($this->session->userdata('logged_in')) { return $this->yarn_model->get_userdata(); } } public function access_details_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_main_data($table,$where); } public function access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_where_data($table,$where); } public function access_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); return $d->user_type_id; } public function stock_transfer() { $data['y_type']=$this->input->post('yarn_type_val'); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $table='consumed_at'; $data['consumed_at']=$this->outsource_model->fetch_where_data($table); $data['location']=$this->outsource_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_transfer',$data); $this->load->view('templates/footer_inside'); } public function fetch_stock_transfer_model_data() { $data2=$this->input->post('product_type'); $locationn=$this->input->post('product_location'); $table='consumed_at'; $where=$locationn; $consum = $this->store_model->get_stock_transfer_loca_swandyed_row_data($table,$where); $location=$consum->consumed_at; if($data2 == 'Fabrics') { $table='fabric_inspection_details'; $details = $this->store_model->display_stock_transfer_data($location); echo json_encode($details); } else if($data2 == 'Yarn - Raw') { $details = $this->store_model->get_stock_transfer_loca_raw_data($location); echo json_encode($details); } else if($data2 == 'Yarn - Twisted') { $table='delivery_yarn_twisting'; $where=array('status'=>1); $details= $this->store_model->get_stock_transfer_loca_twisting_data($table,$where,$location); echo json_encode($details); } else if($data2 == 'Yarn - Dyed') { $details = $this->store_model->get_stock_transfer_loca_dyed_data($location); echo json_encode($details); } else if($data2 == 'Consumables') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $detail=$this->store_model->get_stock_transfer_loca_data($location); echo json_encode($detail); } else if($data2 == 'Spares') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $detail=$this->store_model->get_stock_transfer_loca_spares_data($location); echo json_encode($detail); } else if($data2 == 'swan_yarn_dyed') { $table='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0); $detail=$this->store_model->get_stock_transfer_loca_swan_dyed_data($table,$where,$location); echo json_encode($detail); } } ///////////////////////////////////////////// 26-12-2017 //////////////////////////////////////////////////////////////// public function fabric_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='fabric'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_transfer_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_raw_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='raw'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_raw',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_twisting_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='twist'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_twist',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_dyed_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='dyed'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_dyed',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function swan_dyed_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='swan'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stcok_swan_dyed',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function cosumable_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='consumable'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_consumable',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function spares_stock_grid() { $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['yarn_type']='spares'; $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_spares',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function stock_transfer_details() { $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stock_transfer_grid',$data); $this->load->view('templates/footer_inside'); } public function stock_received_details() { $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $this->load->view('templates/header_inside',$data); $this->load->view('stock/stcok_received_grid',$data); $this->load->view('templates/footer_inside'); } public function fetch_stock_data() { $data3=$this->input->post('ids'); //$data2=$this->input->post('product_type'); $data1=substr($data3, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $data11=array(); foreach($exp as $val) { $data2=$this->input->post('product_type'); if($data2 == 'Fabrics') { $table='fabric_inspection_details'; $where=$val; $details=$this->store_model->fetch_where_fabric_row_data($where); array_push($data11,$details); } else if($data2 == 'Yarn - Raw') { $where=$val; $details = $this->store_model->get_stock_transfer_yarnraw_row_data($where); array_push($data11,$details); } else if($data2 == 'Yarn - Twisted') { $table='delivery_yarn_twisting'; $where=$val; $details= $this->store_model->get_stock_transfer_yarntwisting_row_data($table,$where); array_push($data11,$details); } else if($data2 == 'Yarn - Dyed') { $where=$val; $details = $this->store_model->get_stock_transfer_yarndyed_row_data($where); array_push($data11,$details); } else if($data2 == 'Consumables') { $table='indent_po'; $where=$val; $details=$this->store_model->get_stock_transfer_consumable_row_data($where); array_push($data11,$details); } else if($data2 == 'Spares') { $table='indent_po'; $where=$val; $details=$this->store_model->get_stock_transfer_spares_row_data($where); array_push($data11,$details); } else if($data2 == 'swan_yarn_dyed') { $table='work_order_dyeing'; $where=$val; $details=$this->store_model->get_stock_transfer_loca_swandyed_row_data($table,$where); array_push($data11,$details); } } $result=$data11; // print_r($result); // die(); echo json_encode($result); } public function add_transfer_application_form() { $plocation=$this->input->post('product_location'); $locationn=$this->input->post('transfer_location'); $table='consumed_at'; $where=$plocation; $consum = $this->store_model->get_stock_transfer_loca_swandyed_row_data($table,$where); $product_location=$consum->consumed_at; $table='consumed_at'; $where=$locationn; $consum = $this->store_model->get_stock_transfer_loca_swandyed_row_data($table,$where); $transfer_location=$consum->consumed_at; $data2=$this->input->post('product_type'); $transfer_date=$this->input->post('transfer_date'); $transfer_by=$this->input->post('transfer_by'); $remarks=$this->input->post('remarks'); $transfer_id=$this->input->post('transfer_id'); if($data2 == 'Fabrics') { $fabric_id=$this->input->post('fabric_id'); $fabric_po=$this->input->post('fabric_po'); $fabric_ssl=$this->input->post('fabric_ssl'); $fabric_product=$this->input->post('fabric_product'); $fabric_width=$this->input->post('fabric_width'); $fabric_design=$this->input->post('fabric_design'); $fabric_shades=$this->input->post('fabric_shades'); $fabric_rec_weight=$this->input->post('fabric_rec_weight'); $fabric_balanced_mtrs=$this->input->post('fabric_balanced_mtrs'); $fabric_issue_weight=$this->input->post('fabric_issue_weight'); $fabric_issue_mtrs=$this->input->post('fabric_issue_mtrs'); $fabric_remaining_weight=$this->input->post('fabric_remaining_weight'); $fabric_remaining_mtrs=$this->input->post('fabric_remaining_mtrs'); foreach($fabric_id as $key=>$val) { $data=array('fabric_id'=>$fabric_id[$key], 'po'=>$fabric_po[$key], 'ssl_piece_no'=>$fabric_ssl[$key], 'product'=>$fabric_product[$key], 'width'=>$fabric_width[$key], 'design'=>$fabric_design[$key], 'shades'=>$fabric_shades[$key], 'rec_weight'=>$fabric_rec_weight[$key], 'actual_qua'=>$fabric_balanced_mtrs[$key], 'issue_weight'=>$fabric_issue_weight[$key], 'issue_mtrs'=>$fabric_issue_mtrs[$key], 'bal_wight'=>$fabric_remaining_weight[$key], 'bal_qua'=>$fabric_remaining_mtrs[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'status'=>'1', ); $table='fabric_transfer'; $this->db->insert($table,$data); $table='fabric_inspection_details'; $where=array('id'=>$fabric_id[$key]); $data=array('rec_weight'=>$fabric_remaining_weight[$key]); $this->vendor_model->update_access($where,$table,$data); $table='fabric_inspection'; $where=array('goods_id'=>$fabric_id[$key]); $data=array('balanced_mtrs'=>$fabric_remaining_mtrs[$key]); $this->vendor_model->update_access($where,$table,$data); } } else if($data2 == 'Yarn - Raw') { $raw_id=$this->input->post('raw_id'); $raw_purpose=$this->input->post('raw_purpose'); $raw_yarnname=$this->input->post('raw_yarnname'); $raw_yarndenier=$this->input->post('raw_yarndenier'); $raw_yarnspec=$this->input->post('raw_yarnspec'); $raw_lot=$this->input->post('raw_lot'); $raw_bale=$this->input->post('raw_bale'); $raw_gross=$this->input->post('raw_gross'); $raw_net=$this->input->post('raw_net'); $raw_issue_net=$this->input->post('raw_issue_net'); $raw_bal_net=$this->input->post('raw_bal_net'); foreach($raw_id as $key=>$val) { $data=array('refrence_id'=>$raw_id[$key], 'purpose'=>$raw_purpose[$key], 'yarnname'=>$raw_yarnname[$key], 'yarndenier'=>$raw_yarndenier[$key], 'yarnspec'=>$raw_yarnspec[$key], 'lot'=>$raw_lot[$key], 'bale'=>$raw_bale[$key], 'gross'=>$raw_gross[$key], 'net_weight'=>$raw_net[$key], 'issue_net_weight'=>$raw_issue_net[$key], 'bal_net_weight'=>$raw_bal_net[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'status'=>'1', 'yarn_type'=>'raw', ); $table='yarn_transfer'; $this->db->insert($table,$data); $table='indent_yarn_goods_details'; $where=array('id'=>$raw_id[$key]); $data=array('issue_net_weight'=>$raw_bal_net[$key]); $this->vendor_model->update_access($where,$table,$data); } } else if($data2 == 'Yarn - Twisted') { $t_id=$this->input->post('t_id'); $t_purpose=$this->input->post('t_purpose'); $t_name=$this->input->post('t_name'); $t_den=$this->input->post('t_den'); $t_spec=$this->input->post('t_spec'); $t_shades=$this->input->post('t_shade'); $t_lot=$this->input->post('t_lot'); $t_bale=$this->input->post('t_bale'); $t_gross=$this->input->post('t_gross'); $t_net=$this->input->post('t_net'); $t_issue_net=$this->input->post('t_issue_net'); $t_bal_net=$this->input->post('t_bal_net'); foreach($t_id as $key=>$val) { $data=array('refrence_id'=>$t_id[$key], 'purpose'=>$t_purpose[$key], 'yarnname'=>$t_name[$key], 'yarndenier'=>$t_den[$key], 'yarnspec'=>$t_spec[$key], 'shade'=>$t_shades[$key], 'lot'=>$t_lot[$key], 'bale'=>$t_bale[$key], 'gross'=>$t_gross[$key], 'net_weight'=>$t_net[$key], 'issue_net_weight'=>$t_issue_net[$key], 'bal_net_weight'=>$t_bal_net[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'status'=>'1', 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'yarn_type'=>'twisting', ); $table='yarn_transfer'; $this->db->insert($table,$data); // print_r($t_id[$key]); // print_r($t_bal_net[$key]); // die(); $table='delivery_yarn_twisting'; $where=array('id'=>$t_id[$key]); $data=array('issue_net_weight'=>$t_bal_net[$key]); $this->vendor_model->update_access($where,$table,$data); $table='delivery_yarn_twisting'; $where=array('id'=>$t_id[$key]); $delivery_yarn_details=$this->vendor_model->get_where_row($table,$where); $ref_id=$delivery_yarn_details->reference_id; $ref_table=$delivery_yarn_details->reference_table; if($ref_table == 'indent_yarn_goods_details') { $table='indent_yarn_goods_details'; $where=array('id'=>$ref_id); $data=array('issue_net_weight'=>$t_bal_net[$key]); $this->vendor_model->update_access($where,$table,$data); } else if($ref_table == 'work_order_twisting') { $table='work_order_twisting'; $where=array('id'=>$ref_id); $data=array('net_weight'=>$t_bal_net[$key]); $this->vendor_model->update_access($where,$table,$data); } } } else if($data2 == 'Yarn - Dyed') { $d_id=$this->input->post('d_id'); $d_purpose=$this->input->post('d_purpose'); $d_name=$this->input->post('d_name'); $d_den=$this->input->post('d_den'); $d_spec=$this->input->post('d_spec'); $d_shade=$this->input->post('d_shade'); $d_code=$this->input->post('d_code'); $d_lot=$this->input->post('d_lot'); $d_bale=$this->input->post('d_bale'); $d_gross=$this->input->post('d_gross'); $d_net=$this->input->post('d_net'); $d_issue_net=$this->input->post('d_issue_net'); $d_bal_net=$this->input->post('d_bal_net'); foreach($d_id as $key=>$val) { $data=array('refrence_id'=>$d_id[$key], 'purpose'=>$d_purpose[$key], 'yarnname'=>$d_name[$key], 'yarndenier'=>$d_den[$key], 'yarnspec'=>$d_spec[$key], 'shade'=>$d_shade[$key], 'color_code'=>$d_code[$key], 'lot'=>$d_lot[$key], 'bale'=>$d_bale[$key], 'gross'=>$d_gross[$key], 'net_weight'=>$d_net[$key], 'issue_net_weight'=>$d_issue_net[$key], 'bal_net_weight'=>$d_bal_net[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'status'=>'1', 'yarn_type'=>'dyed', ); $table='yarn_transfer'; $this->db->insert($table,$data); $table='indent_yarn_goods_details'; $where=array('id'=>$d_id[$key]); $data=array('issue_net_weight'=>$d_bal_net[$key]); $this->vendor_model->update_access($where,$table,$data); } } else if($data2 == 'Consumables') { $cs_id=$this->input->post('cs_id'); $cs_po=$this->input->post('cs_po'); $cs_product=$this->input->post('cs_product'); $cs_indent=$this->input->post('cs_indent'); $cs_dept=$this->input->post('cs_dept'); $cs_quantity=$this->input->post('cs_quantity'); $cs_total_quantity=$this->input->post('cs_total_quantity'); $cs_issue_quantity=$this->input->post('cs_issue_quantity'); $cs_remaining_quantity=$this->input->post('cs_remaining_quantity'); foreach($cs_id as $key=>$val) { $data=array('refrence_id'=>$cs_id[$key], 'po_no'=>$cs_po[$key], 'product'=>$cs_product[$key], 'indent_no'=>$cs_indent[$key], 'dept'=>$cs_dept[$key], 'ordered_qua'=>$cs_quantity[$key], 'total_qua'=>$cs_total_quantity[$key], 'issue_qua'=>$cs_issue_quantity[$key], 'bal_qua'=>$cs_remaining_quantity[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'ref_type'=>'consumable', 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'status'=>'1', ); $table='cs_transfer'; $this->db->insert($table,$data); $table='indent_po'; $where=array('id'=>$cs_id[$key]); $data=array('total_quantity'=>$cs_remaining_quantity[$key]); $this->vendor_model->update_access($where,$table,$data); } } else if($data2 == 'Spares') { $cs_id=$this->input->post('cs_id'); $cs_po=$this->input->post('cs_po'); $cs_product=$this->input->post('cs_product'); $cs_indent=$this->input->post('cs_indent'); $cs_dept=$this->input->post('cs_dept'); $cs_quantity=$this->input->post('cs_quantity'); $cs_total_quantity=$this->input->post('cs_total_quantity'); $cs_issue_quantity=$this->input->post('cs_issue_quantity'); $cs_remaining_quantity=$this->input->post('cs_remaining_quantity'); foreach($cs_id as $key=>$val) { $data=array('refrence_id'=>$cs_id[$key], 'po_no'=>$cs_po[$key], 'product'=>$cs_product[$key], 'indent_no'=>$cs_indent[$key], 'dept'=>$cs_dept[$key], 'ordered_qua'=>$cs_quantity[$key], 'total_qua'=>$cs_total_quantity[$key], 'issue_qua'=>$cs_issue_quantity[$key], 'bal_qua'=>$cs_remaining_quantity[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'status'=>'1', 'transfer_id'=>$this->input->post('transfer_id'), 'ref_type'=>'spares', 'transfer_id_val'=>$this->input->post('transfer_id_val'), ); $table='cs_transfer'; $this->db->insert($table,$data); $table='indent_po'; $where=array('id'=>$cs_id[$key]); $data=array('total_quantity'=>$cs_remaining_quantity[$key]); $this->vendor_model->update_access($where,$table,$data); } } else if($data2 == 'swan_yarn_dyed') { $s_id=$this->input->post('s_id'); $s_purpose=$this->input->post('s_purpose'); $s_issue_no=$this->input->post('s_issue_no'); $s_quantity=$this->input->post('s_quantity'); $s_spec=$this->input->post('s_spec'); $s_den=$this->input->post('s_den'); $s_shade=$this->input->post('s_shade'); $s_code=$this->input->post('s_code'); $s_dyed_q=$this->input->post('s_dyed_q'); $s_issue_dyed_q=$this->input->post('s_issue_dyed_q'); $s_bal_dyed_q=$this->input->post('s_bal_dyed_q'); foreach($s_id as $key=>$val) { $data=array('refrence_id'=>$s_id[$key], 'purpose'=>$s_purpose[$key], 'issue_no'=>$s_issue_no[$key], 'yarnname'=>$s_quantity[$key], 'yarndenier'=>$s_spec[$key], 'yarnspec'=>$s_den[$key], 'shade'=>$s_shade[$key], 'color_code'=>$s_code[$key], 'dyed_weight'=>$s_dyed_q[$key], 'issue_dyed_weight'=>$s_issue_dyed_q[$key], 'bal_dyed_weight'=>$s_bal_dyed_q[$key], 'product_type' => $this->input->post('product_type'), 'product_location' => $product_location, 'transfer_location' => $transfer_location, 'transfer_date' => $this->input->post('transfer_date'), 'transfer_by' => $this->input->post('transfer_by'), 'remarks'=>$this->input->post('remarks'), 'transfer_id'=>$this->input->post('transfer_id'), 'transfer_id_val'=>$this->input->post('transfer_id_val'), 'status'=>'1', ); $table='swan_yarn_transfer'; $this->db->insert($table,$data); $table='work_order_dyeing'; $where=array('id'=>$s_id[$key]); $data=array('rec_dyed_qua'=>$s_bal_dyed_q[$key]); $this->vendor_model->update_access($where,$table,$data); } } } public function fabric_details() { $table='fabric_transfer'; $where=array('status'=>1); $detailll=$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='fabric_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='fabric_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='fabric_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='fabric_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='fabric_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='fabric_transfer'; $where=array('status'=>1); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function swan_yarn_details() { $table='swan_yarn_transfer'; $where=array('status'=>1); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function cs_details() { $table='cs_transfer'; $where=array('status'=>1,'product_type'=>'Consumables'); $detailll =$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='cs_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='cs_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='cs_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='cs_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='cs_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='cs_transfer'; $where=array('status'=>1,'product_type'=>'Consumables'); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function spares_details() { $table='cs_transfer'; $where=array('status'=>1,'product_type'=>'Spares'); $detailll =$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='cs_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='cs_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='cs_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='cs_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='cs_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='cs_transfer'; $where=array('status'=>1,'product_type'=>'Spares'); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function yarn_raw_details() { $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'raw'); $detailll=$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='yarn_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='yarn_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='yarn_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'raw'); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function yarn_twisting_details() { $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'twisting'); $detailll =$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='yarn_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='yarn_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='yarn_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'twisting'); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function yarn_dyed_details() { $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'dyed'); $detailll =$this->stock_model->get_transfer_data($table,$where); foreach($detailll as $d) { $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'Yes'); $det=$this->stock_model->get_data($table,$where); $table='yarn_transfer'; $t_id=$d->transfer_id_val; $where=array('transfer_id_val'=>$t_id,'confirm'=>'No'); $det_no=$this->stock_model->get_data($table,$where); if(empty($det)) { $table='yarn_transfer'; $data=array('grid_status'=>'NOT YET'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else if(empty($det_no)) { $table='yarn_transfer'; $data=array('grid_status'=>'COMPLETED'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } else { $table='yarn_transfer'; $data=array('grid_status'=>'PARTLY'); $where=array('transfer_id_val'=>$t_id); $det=$this->stock_model->update_data($where,$table,$data); } } $table='yarn_transfer'; $where=array('status'=>1,'yarn_type'=>'dyed'); $detail=$this->stock_model->get_transfer_data($table,$where); echo json_encode($detail); } public function max_transfer_id() { $data2=$this->input->post('str'); if($data2 == 'Fabrics') { $table='fabric_transfer'; $details = $this->store_model->max_select_transfer_no($table); if(empty($details)) { $data['type']='F'; $data['id']=1; echo json_encode($data); } else { $data['type']='F'; $data['id']=$details->transfer_id_val + 1; echo json_encode($data); } } else if($data2 == 'Yarn - Raw' || $data2 == 'Yarn - Twisted' || $data2 == 'Yarn - Dyed') { $table='yarn_transfer'; $details = $this->store_model->max_select_transfer_no($table); if(empty($details)) { $data['type']='Y'; $data['id']=1; echo json_encode($data); } else { $data['type']='Y'; $data['id']=$details->transfer_id_val + 1; echo json_encode($data); } } else if($data2 == 'Consumables' || $data2 == 'Spares') { $table='cs_transfer'; $details = $this->store_model->max_select_transfer_no($table); if(empty($details)) { $data['type']='C'; $data['id']=1; echo json_encode($data); } else { $data['type']='C'; $data['id']=$details->transfer_id_val + 1; echo json_encode($data); } } else if($data2 == 'swan_yarn_dyed') { $table='swan_yarn_transfer'; $details = $this->store_model->max_select_transfer_no($table); if(empty($details)) { $data['type']='S'; $data['id']=1; echo json_encode($data); } else { $data['type']='S'; $data['id']=$details->transfer_id_val + 1; echo json_encode($data); } } } public function transfer_subgrid() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'fabric_transfer'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->transfer_id; // print_r($data1); // die(); $table = 'fabric_transfer'; $where = array('transfer_id'=>$data1,'status'=>1); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function transfer_swan_yarn_subgrid() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'swan_yarn_transfer'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->transfer_id; // print_r($data1); // die(); $table = 'swan_yarn_transfer'; $where = array('transfer_id'=>$data1,'status'=>1); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function transfer_yarn_raw_subgrid() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'yarn_transfer'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->transfer_id; $table = 'yarn_transfer'; $where = array('transfer_id'=>$data1,'status'=>1); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function transfer_cs_subgrid() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'cs_transfer'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->transfer_id; // print_r($data1); // die(); $table = 'cs_transfer'; $where = array('transfer_id'=>$data1,'status'=>1); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function add_fabric_yes_confirmation() { $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','rec_by'=>$approved_by,'rec_date'=>$current_date); $table= 'fabric_transfer'; $details = $this->stock_model->update_confirm_fabric($data1,$where1); return true; } public function add_cs_yes_confirmation() { $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','rec_by'=>$approved_by,'rec_date'=>$current_date); $table= 'fabric_transfer'; $details = $this->stock_model->update_confirm_cs($data1,$where1); return true; } public function add_yarn_yes_confirmation() { $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','rec_by'=>$approved_by,'rec_date'=>$current_date); $table= 'fabric_transfer'; $details = $this->stock_model->update_confirm_yarn($data1,$where1); return true; } public function add_swan_yarn_yes_confirmation() { $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','rec_by'=>$approved_by,'rec_date'=>$current_date); $table= 'fabric_transfer'; $details = $this->stock_model->update_confirm_swan_yarn($data1,$where1); return true; } public function fabric_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='fabric_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='fabric_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/fabric_preview',$data); $this->load->view('templates/footer_inside'); } public function cs_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='cs_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='cs_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/cs_preview',$data); $this->load->view('templates/footer_inside'); } public function raw_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/raw_preview',$data); $this->load->view('templates/footer_inside'); } public function twisting_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/twisting_preview',$data); $this->load->view('templates/footer_inside'); } public function dyed_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/dyed_preview',$data); $this->load->view('templates/footer_inside'); } public function swan_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='swan_yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id); $table='swan_yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='0'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/swan_preview',$data); $this->load->view('templates/footer_inside'); } public function fabric_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='fabric_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='fabric_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/fabric_preview',$data); $this->load->view('templates/footer_inside'); } public function cs_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='cs_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='cs_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/cs_preview',$data); $this->load->view('templates/footer_inside'); } public function raw_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/raw_preview',$data); $this->load->view('templates/footer_inside'); } public function twisting_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/twisting_preview',$data); $this->load->view('templates/footer_inside'); } public function dyed_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/dyed_preview',$data); $this->load->view('templates/footer_inside'); } public function swan_rec_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='swan_yarn_transfer'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $transfer_id=$data['fetch']->transfer_id; $where=array('transfer_id'=>$transfer_id,'confirm'=>'Yes'); $table='swan_yarn_transfer'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $data['rec']='1'; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('stock/swan_preview',$data); $this->load->view('templates/footer_inside'); } } ?>