EVOLUTION-NINJA
Edit File: Weaving_panel.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Weaving_panel 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('vendor_model'); $this->load->model('outsource_model'); $this->load->model('store_model'); date_default_timezone_set('asia/kolkata'); } public function log() { echo $_REQUEST['name'];exit; echo "login"; } //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 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; } public function indent_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); //<!------------------------ indent ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin' ) { $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('indented_date'=>$d,'insert_notification_status'=>0); $indent_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_add_indent'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $indent_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_insert_rows=0; $indent_update_rows=0; $indent_approval_rows=0; } //<!------------------------ po ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_po_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_po_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin' ) { $d=date('d-m-Y'); $table='indent_po'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_po_update_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $indent_po_approval_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_po_update_rows1=0; $indent_po_approval_rows1=0; } $r=$indent_insert_rows + $indent_update_rows + $indent_approval_rows + $indent_po_insert_rows1 + $indent_po_update_rows1 + $indent_po_approval_rows1; return $r; } public function issue_loom_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); //<!------------------------ issue_loom ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { $d=date('d-m-Y'); $table='issue_loom'; $where=array('issued_date'=>$d,'insert_notification_status'=>0); $indent_insert_rows=$this->vendor_model->count_of_pcs($table,$where); $d=date('d-m-Y'); $table='issue_loom'; $where=array('rements_approved_date'=>$d,'update_notification_status'=>0); $indent_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_panel_planning_order'; $where=array('issue_approved_date'=>$d,'approval_notification_status'=>0); $indent_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_insert_rows=0; $indent_approval_rows=0; $indent_update_rows=0; } $r=$indent_insert_rows + $indent_approval_rows + $indent_update_rows; return $r; } public function stock_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') { $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['stoct_transfer_rows']=0; $data['stoct_transfer_rows1']=0; $data['stoct_transfer_rows2']=0; } if($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); $where1=array('received_date'=>$ddd1); $data['stock_split_data']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where,$where1); //"(status='live' OR status='dead')" $d=date('d-m-Y'); $table='cs_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['stoct_transfer_rows3']=0; $data['stock_split_data']=0; } $stock=$data['stoct_transfer_rows'] + $data['stoct_transfer_rows1'] + $data['stoct_transfer_rows2'] + $data['stoct_transfer_rows3'] + $data['stock_split_data']; return $stock; } public function rec_stock_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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- received stock ------------------------------> $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows']=0; $data['rec_stoct_transfer_rows1']=0; $data['rec_stoct_transfer_rows2']=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='cs_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows3']=0; } //$data['total_rec_stock_notifications']=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3'] ; $rec_stock=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3']; return $rec_stock; } public function marketing_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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- Marketing Module ------------------------------> $d=date('d-m-Y'); $where=$d; $data['marketing_rows']=$this->vendor_model->marketing_notification_getsuborder($where); $data['marketing_confirm_rows']=$this->vendor_model->marketing_notification_confirm_getsuborder($where); $data['marketing_update_num_rows']=$this->vendor_model->marketing_notification_update_getsuborder($where); $d=date('Y-m-d'); $where=$d; $data['marketing_on_date_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($where); $befdore_ten=date('Y-m-d',strtotime('+10 days')) . PHP_EOL; $data['marketing_ten_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_ten); $befdore_thirty=date('Y-m-d',strtotime('+30 days')) . PHP_EOL; $data['marketing_thirty_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_thirty); } else { $data['marketing_rows'] = 0; $data['marketing_confirm_rows'] = 0; $data['marketing_update_num_rows'] = 0; $data['marketing_on_date_rows'] = 0; $data['marketing_ten_days_rows'] = 0; $data['marketing_thirty_days_rows'] = 0; } $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $mark; } public function issue_fabric_page_notifications() { //<!---------------------- issue fabric Module ------------------------------> $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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='fabric_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $f=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); } else { $f=0; } // $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $f; } public function issue_cs_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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- issue cs Module ------------------------------> $d=date('d-m-Y'); $table='cs_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $cs=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $cs=0; } return $cs; } public function planning_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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing') { // //<!---------------------- Planning Module ------------------------------> $d=date('d-m-Y'); $data['planning_order_rows'] = $this->vendor_model->planning_notification_get_details($d); $dd=date('Y-m-d'); $where=$dd; $data['pallning_outsource_rows']=$this->vendor_model->outsource_planning_notification_get_details($where); $d=date('Y-m-d'); $where=$d; $data['planned_dyeing_on_date_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($where); $data['planned_weaving_on_date_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($where); $befdore_seven=date('Y-m-d',strtotime('+7 days')) . PHP_EOL; $data['planned_dyeing_sevenn_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($befdore_seven); $data['planned_weaving_sevenn_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($befdore_seven); $after_five=date('Y-m-d',strtotime('-5 days')) . PHP_EOL; $data['planned_dyeing_five_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($after_five); $data['planned_weaving_five_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($after_five); } else { $data['planning_order_rows'] =0; $data['pallning_outsource_rows']=0; $data['planned_dyeing_on_date_rows'] =0; $data['planned_dyeing_sevenn_days_rows'] =0; $data['planned_dyeing_five_days_rows']=0; $data['planned_weaving_on_date_rows'] =0; $data['planned_weaving_sevenn_days_rows'] =0; $data['planned_weaving_five_days_rows']=0; } $p=$data['planning_order_rows'] + $data['pallning_outsource_rows'] + $data['planned_dyeing_on_date_rows'] + $data['planned_dyeing_sevenn_days_rows'] + $data['planned_dyeing_five_days_rows'] + $data['planned_weaving_on_date_rows'] + $data['planned_weaving_sevenn_days_rows'] + $data['planned_weaving_five_days_rows'] ; return $p; } public function sample_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); $emp_details=$this->vendor_model->get_customerdata($table,$where); if($emp_details->designation == 'Super Admin' || $emp_details->designation == 'Admin') { //<!------------------------ Sample request ---------------------------------> $d=date('d-m-Y'); $table='sample_request'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $sample_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_insert_rows=0; } if($emp_details->designation == 'Super Admin') { $d=date('d-m-Y'); $table='sample_request'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $sample_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_update_rows=0; } $s= $sample_insert_rows + $sample_update_rows ; return $s; } public function work_order_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); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager') { //<!---------------------- work order ------------------------------> $d=date('d-m-Y'); $table='create_yarntwisting_work_order'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_twisting']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_dyeing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing_material'; $where=array('approved_date'=>$d,'insert_notification_status'=>0); $data['issue_work_order_dyeing_material_rows']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='finishing_embroidry'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_fabric_finishing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_twisting'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_twisting_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_dyeing'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_dyeing_finishing']=$this->vendor_model->count_amount_work_order_delivery_dyed_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_factory_stock'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_weaving_finishing']=$this->vendor_model->count_amount_work_order_delivery_weaving_fabric_get_customerdata($table,$where); $d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_finishing_finishing']=$this->vendor_model->count_amount_work_order_delivery_fabric_finishing_emp_get_customerdata($table,$where); } else { $data['work_order_twisting']=0; $data['work_order_dyeing']=0; $data['work_order_fabric_finishing']=0; $data['work_order_delivery_twisting_finishing']=0; $data['work_order_delivery_dyeing_finishing']=0; $data['work_order_delivery_weaving_finishing']=0; $data['work_order_delivery_finishing_finishing']=0; $data['issue_work_order_dyeing_material_rows']=0; } $w=$data['work_order_twisting'] + $data['work_order_dyeing'] + $data['work_order_fabric_finishing'] + $data['work_order_delivery_twisting_finishing'] + $data['work_order_delivery_dyeing_finishing'] + $data['work_order_delivery_weaving_finishing'] + $data['work_order_delivery_finishing_finishing'] + $data['issue_work_order_dyeing_material_rows']; return $w; } public function packing_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); //<!------------------------ package list ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='packing_list_data'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $package_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='madeups_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_madeups_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $package_insert_rows=0; $package_update_rows=0; $package_madeups_insert_rows=0; } $packing= $package_insert_rows + $package_update_rows + $package_madeups_insert_rows; return $packing; } public function design_weaving_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); //<!------------------------ design weaving list ---------------------------------> if($data['emp_details']->designation == 'Super Admin') { $d=date('d-m-Y'); $table='design_weave'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('finalized_date'=>$d,'finalize_notification_status'=>0); $design_finalize_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $design_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows=0; $design_update_rows=0; $design_finalize_rows=0; $design_approval_rows=0; } $design= $design_insert_rows + $design_update_rows + $design_finalize_rows + $design_approval_rows; return $design; } public function masters_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); //<!----------------------------- Masters Module ---------------------------------------> if($data['emp_details']->designation == 'Super Admin' ) { $d=date('d-m-Y'); $table='import_yarn'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $yarn_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='import_yarn'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $yarn_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='article_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $article_updated_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $fabric_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $fabric_upadted_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $shade_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $shade_updated_row=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $color_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $color_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $customer_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $madeups_box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $product_master_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $yarn_insert_rows=0; $yarn_insert_rows1=0; $article_updated_rows=0; $fabric_insert_rows=0; $fabric_upadted_rows=0; $shade_insert_rows=0; $shade_updated_row=0; $color_insert_rows=0; $color_insert_rows1=0; $customer_insert_rows1=0; $box_insert_rows1=0; $madeups_box_insert_rows1=0; $product_master_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d-m-Y'); $table='article_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $article_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $article_insert_rows=0; $design_insert_rows=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin') { $d=date('d-m-Y'); $table='indent_product'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_product_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_vednor_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_product_insert_rows1=0; $indent_vednor_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='design_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $customer_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $madeups_box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $outsource_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $outsource_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_vednor_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_product'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_product_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $product_master_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows1=0; $customer_insert_rows=0; $box_insert_rows=0; $outsource_insert_rows=0; $outsource_insert_rows1=0; $indent_vednor_insert_rows=0; $indent_product_insert_rows=0; $product_master_insert_rows=0; $madeups_box_insert_rows=0; } $m=$yarn_insert_rows + $yarn_insert_rows1 + $article_insert_rows + $article_updated_rows + $fabric_insert_rows + $fabric_upadted_rows + $shade_updated_row + $design_insert_rows + $design_insert_rows1 + $color_insert_rows + $color_insert_rows1 + $customer_insert_rows + $customer_insert_rows1 + $box_insert_rows + $box_insert_rows1 + $outsource_insert_rows + $outsource_insert_rows1 + $indent_vednor_insert_rows + $indent_vednor_insert_rows1 + $indent_product_insert_rows + $indent_product_insert_rows1 + $product_master_insert_rows + $product_master_insert_rows1 + $madeups_box_insert_rows1 + $madeups_box_insert_rows; return $m; } public function madeups_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); //<!------------------------ madeups list ---------------------------------> if($data['emp_details']->designation == 'HO Madeups') { $d=date('d/m/Y'); $table='fabric_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='consumable_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_madeups_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else { $madeups_list_insert_rows=0; $madeups_list_madeups_insert_rows=0; } if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive') { $input=date('d/m/Y'); $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); if($rr == '0' && $rrr == '0') { $t=$rrr1 . '/' . $rr1 . '/' . $year; //$t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr == '0' && $rrr != '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr == '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$rrr1 . '/' . $month . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr != '0') { $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$input,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } } else { $madeups_list_madeups_delivery_insert_rows=0; } $madeups = $madeups_list_insert_rows + $madeups_list_madeups_insert_rows + $madeups_list_madeups_delivery_insert_rows; return $madeups; } public function inward_purchases_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); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { $table='indent_yarn_goods_details'; $where=array('received_date'=>$d); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery1_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insertt_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insertt_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } else { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } $data['total_res_inward_fabric']=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; $data['page_static']='inward_purchase'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } public function inward_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); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $new=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function new_stores_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); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } $new= $data['fabric_inspection_rows'] ; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function fabric_inspection_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); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspections_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } else { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } $data['total_res_fabric']= $data['fabric_inspection_rows'] ; $data['page_static']='fabric_inspection'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function access_details_id() { $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); $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); $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); $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); $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); $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 vendordetails() { $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); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/vendor'); $this->load->view('templates/footer_inside'); } public function weaving_panel_work_order() { $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); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $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['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $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(!empty($result->reference_url)){ 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(!empty($url->reference_url)){ if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } } //----------tiill-------------------- $detail = $this->outsource_model->get_unplanned_orders(); foreach($detail as $val) { $order_id=$val->sos_id; $table='weaving_panel_planning_order'; $where=array('sos_id'=>$order_id); $planned=$this->outsource_model->fetch_where_row_data($table,$where); $table='shade_master'; $where=array('shadeID'=>$val->sslShade); $sl_name=$this->outsource_model->fetch_where_row_data($table,$where); if(empty($planned)) { $yarn_data=array('order_id'=>$val->id, 'osl_no'=>$val->oslNo, 'article'=>$val->articleNo, 'selWidth'=>$val->selWidth.'CMS', 'width'=>$val->width, 'design'=>$val->design, 'party_ref'=>$val->partyRef, 'delivery_date'=>$val->deliveryDate, 'order_mode'=>$val->orderMode, 'quality'=>$val->quality, 'shade'=>$val->ourShade, 'ordered_mtrs'=>$val->quantity, 'finished_weight'=>$val->finishedWeight, 'reed_width'=>$val->reedWidth, 'reed'=>$val->reed, 'ppc'=>$val->PPC, 'piece_length'=>$val->pieceLength, 'so_id'=>$val->ssid, 'sos_id'=>$val->sos_id, 'sslShade'=>$sl_name->shadeName, //'selWidth'=>$val->selWidth, 'weaving_factory'=>$val->weaving_factory, 'warp_pland_mtr'=>$val->warpPlandMtr, 'weft_pland_mtr'=>$val->weftPlandMtr, 'approved_by' => $val->planned_by, 'subNo'=>$val->subNo, 'status'=>'Waiting for Warp & Weft', 'weaving_date'=>$val->weavingDate, // 'weft_quality'=>$val->Weft_Quality, // 'weft_denier'=>$val->Weft_Denier, // 'weft_specification'=>$val->Weft_Specification, // 'warp_quality'=>$val->Warp_Quality, // 'warp_denier'=>$val->Warp_Denier, // 'warp_specification'=>$val->Warp_Specification, // 'warp_code'=>$val->warpCode, // 'warp_color'=>$val->warpColor, // 'weft_code'=>$val->weftCode, // 'weft_color'=>$val->weftColor, // 'weft_wt'=>$val->weftWt, ); $table='weaving_panel_planning_order'; $this->db->insert($table,$yarn_data); } else { } } $table='weav_planel_status'; $data['status']=$this->outsource_model->get_weaving_order_data($table); $data['statuss']=$this->outsource_model->get_weaving_order_data($table); $table='weaving_panel_planning_order'; $data['osl_number']=$this->outsource_model->fetch_osl_data($table); // print_r($data['osl_number']); // die(); // print_r($data['osl_number']); // die(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/weaving_panel_work_order_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function weaving_panel_status() { $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); $data2=$_REQUEST['ids']; $status=$_REQUEST['status']; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $data1=array(); foreach($exp as $val) { $data=array('status' => $status, 'approved_by' => $approved_by); $table='weaving_panel_planning_order'; $where=array('id'=>$val); $this->outsource_model->update_po_list_confirm_purchase($table,$data,$where); } } public function issued_loom() { $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); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $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['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $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(!empty($result->reference_url)){ 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(!empty($url->reference_url)){ if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } } //----------tiill-------------------- // $detail = $this->outsource_model->get_unplanned_issue_looms(); // $detail = $this->outsource_model->get_unplanned_orders(); // foreach($detail as $val) // { // $order_id=$val->sos_id; // $table='weaving_panel_planning_order'; // $where=array('sos_id'=>$order_id); // $planned=$this->outsource_model->fetch_where_row_data($table,$where); // //$sl_name=$val->sslShade; // $table='shade_master'; // $where=array('shadeID'=>$val->sslShade); // $sl_name=$this->outsource_model->fetch_where_row_data($table,$where); // if(empty($planned)) // { // $yarn_data=array('order_id'=>$val->id, // 'osl_no'=>$val->oslNo, // 'article'=>$val->articleNo, // 'selWidth'=>$val->selWidth.'CMS', // 'width'=>$val->width, // 'design'=>$val->design, // 'party_ref'=>$val->partyRef, // 'delivery_date'=>$val->deliveryDate, // 'order_mode'=>$val->orderMode, // 'quality'=>$val->quality, // 'shade'=>$val->ourShade, // 'ordered_mtrs'=>$val->quantity, // 'finished_weight'=>$val->finishedWeight, // 'reed_width'=>$val->reedWidth, // 'reed'=>$val->reed, // 'ppc'=>$val->PPC, // 'piece_length'=>$val->pieceLength, // 'so_id'=>$val->ssid, // 'sos_id'=>$val->sos_id, // 'sslShade'=>$sl_name->shadeName, // //'selWidth'=>$val->selWidth, // 'weaving_factory'=>$val->weaving_factory, // 'warp_pland_mtr'=>$val->warpPlandMtr, // 'weft_pland_mtr'=>$val->weftPlandMtr, // 'approved_by' => $val->planned_by, // 'subNo'=>$val->subNo, // 'status'=>'Waiting for Warp & Weft', // 'weaving_date'=>$val->weavingDate, // // // 'weft_quality'=>$val->Weft_Quality, // // // 'weft_denier'=>$val->Weft_Denier, // // // 'weft_specification'=>$val->Weft_Specification, // // // 'warp_quality'=>$val->Warp_Quality, // // // 'warp_denier'=>$val->Warp_Denier, // // // 'warp_specification'=>$val->Warp_Specification, // // // 'warp_code'=>$val->warpCode, // // // 'warp_color'=>$val->warpColor, // // // 'weft_code'=>$val->weftCode, // // // 'weft_color'=>$val->weftColor, // // // 'weft_wt'=>$val->weftWt, // ); // $table='weaving_panel_planning_order'; // $this->db->insert($table,$yarn_data); // } // else // { // } // } // $table='weav_planel_status'; // $data['status']=$this->outsource_model->get_weaving_order_data($table); // $data['statuss']=$this->outsource_model->get_weaving_order_data($table); // $table='weaving_panel_planning_order'; // $data['osl_number']=$this->outsource_model->fetch_osl_data($table); // print_r($data['osl_number']); // die(); // print_r($data['osl_number']); // die(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $table='consumed_at'; $data['consumed_at']=$this->outsource_model->get_weaving_order_data($table); $data['consumed_att']=$this->outsource_model->get_weaving_order_data($table); $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $data['user_loc_dept_id_row']=$this->vendor_model->get_where_row($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/weaving_panel_issue_loom_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function issued_to_loom_stock() { $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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='weaving_panel_planning_order'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); // print_r($data['fetch']); // die(); $data['yarn_raw'] = $this->outsource_model->display_yarn_raw_grid_issue_nandi_data(); $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'NANDI'); $data['yarn_twist']= $this->outsource_model->get_embroidery_issue_data($table,$where); $data['yarn_dyed'] = $this->outsource_model->display_yarn_dyed_grid_issue_nandi_data(); $table='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'location'=>'NANDI'); $data['swan_dyed']=$this->outsource_model->get_work_order_grid_issue_data($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['value_id']=$val; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/weaving_addstock',$data); $this->load->view('templates/footer_inside'); } public function outsource_deying_addstock() { $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); $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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='workorder_dyeing_material'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $y=$data['fetch']->yarn_details; $data['twist_yarn'] = $this->outsource_model->display_yarn_twisting_yarn_material_modal_data1($y); $data['raw'] = $this->outsource_model->display_yarn_raw_modal_data1($y); $data['dyed'] = $this->outsource_model->display_yarn_dyed_modal_data1($y); $issue_stock=$data['fetch']->issue_stock; if($issue_stock == 'COMPLETED') { $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; $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 { $data['access_row']=$arr; } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/dyeing_work_order_grid'); $this->load->view('templates/footer_inside'); } else { $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/outsource_deying_addstock',$data); $this->load->view('templates/footer_inside'); } } public function weaving_pending_grid_loom_details() { $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); $table='weaving_panel_planning_order'; // $where=array('status'=>'Waiting for Yarn' || 'Received Yarn'); $detail=$this->outsource_model->get_work_pending_order_loom_data($table); echo json_encode($detail); } public function add_yarn_issue_loom_details() { $yarn_ids = $this->input->post('ids'); preg_match('/[^\d]+/', $yarn_ids, $textMatch); preg_match('/\d+/', $yarn_ids, $numMatch); // print_r($textMatch[0]); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $recieved_by=$id['username']; $d=date("d-m-Y"); $data = array( 'weaving_panel_id'=> $this->input->post('var_id'), 'osl_no'=> $this->input->post('osl_no'), 'planned_width'=> $this->input->post('planned_width'), 'article'=> $this->input->post('article'), 'design'=> $this->input->post('design'), 'ssl_shade_w'=> $this->input->post('ssl_shade_w'), 'planned_warp'=> $this->input->post('planned_warp'), 'planned_weft'=> $this->input->post('planned_weft'), 'yarn_name'=> $this->input->post('yarn_name'), 'yarn_den'=> $this->input->post('yarn_den'), 'yarn_spec'=> $this->input->post('yarn_spec'), 'yarn_ssl_shade'=> $this->input->post('ssl_shade'), 'dtl_shade'=> $this->input->post('dtl_shade'), 'color_code'=> $this->input->post('w_color_code'), 'yarn_lot'=> $this->input->post('yarn_lot'), 'yarn_bale'=> $this->input->post('yarn_bale'), 'stock_net_wt'=> $this->input->post('bal_net_wt'), 'issue_net_wt'=> $this->input->post('issue_net_wt'), 'balanced_stock_wt'=> $this->input->post('var_kgs'), 'yarn_ids'=> $this->input->post('ids'), 'remarks'=> $this->input->post('remark'), 'issued_date'=> $this->input->post('issued_date'), 'created_at'=>$d, 'approved_by'=> $recieved_by, 'status'=>'1', 'issue_stock'=>'COMPLETED', ); //print_r($data); //die(); $table='issue_loom'; $this->db->insert($table,$data); $table='weaving_panel_planning_order'; $weaving_panel_id = $this->input->post('var_id'); $where=array('id'=>$weaving_panel_id); $data=array('status_val'=>'PARTLY'); $this->store_model->update_data($where,$table,$data); // echo $textMatch[0]; // echo $numMatch[0]; // die(); echo $textMatch[0]; if($textMatch[0] == 'r') { $table='indent_yarn_goods_details'; $where=array('id'=>$numMatch[0]); $v=$this->input->post('var_kgs'); $data=array('issue_net_weight'=>$v); $this->store_model->update_data($where,$table,$data); } else if($textMatch[0] == 't') { $table='delivery_yarn_twisting'; $where=array('id'=>$numMatch[0]); $reult=$this->outsource_model->get_customerdata($table,$where); if($reult->reference_table == 'indent_yarn_goods_details') { $where=array('id'=>$reult->reference_id); $table='indent_yarn_goods_details'; //$table='work_order_twisting'; $v=$this->input->post('var_kgs'); $data=array('issue_net_weight'=>$v); $this->store_model->update_data($where,$table,$data); } else if($reult->reference_table == 'work_order_twisting') { $where=array('id'=>$reult->reference_id); //$table='indent_yarn_goods_details'; $table='work_order_twisting'; $v=$this->input->post('var_kgs'); $data=array('net_weight'=>$v); $this->store_model->update_data($where,$table,$data); } } else if($textMatch[0] == 'd') { $table='indent_yarn_goods_details'; $where=array('po_list_id'=>$numMatch[0]); $v=$this->input->post('var_kgs'); //$data=array('issue_net_weight'=>$v); $data=array('issue_net_weight'=>$v); $this->store_model->update_data($where,$table,$data); //print_r($this->db->last_query()); // die(); } else if($textMatch[0] == 's') { $table='work_order_dyeing'; $where=array('id'=>$numMatch[0]); $v=$this->input->post('var_kgs'); $data=array('rec_dyed_qua'=>$v); $this->store_model->update_data($where,$table,$data); } else if($textMatch[0] == 'rem') { $table='remnants'; $where=array('id'=>$numMatch[0]); $v=$this->input->post('var_kgs'); $data=array('rements_stock'=>$v); $this->store_model->update_data($where,$table,$data); } } public function issue_get_planned_warping_details() { $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); $subNumber = $_REQUEST['subNumber']; $plannedShadeDetails = $this->planning_shade->get_planned_shade_details($subNumber); $articleID=$plannedShadeDetails['articleID']; $shadeid=$plannedShadeDetails['sslShade']; //$data['shadeName']=$plannedShadeDetails['shadeName']; $data['resultWarp'] = $this->planning_yarn->getWarpDetails($articleID,$subNumber); $data['resultWeft'] = $this->planning_yarn->getWeftDetails($articleID,$subNumber); //$data['planned_mtrs']=$res=$this->planning_shade->planned_mtrs($subNo); $data['sm_weft']=$this->planning_shade->display_smweft($shadeid); $data['sm_warp']=$this->planning_shade->display_smwarp($shadeid); $data['planned_warp_wt'] = $this->planning_shade->get_planned_warp_wt($subNumber); $data['planned_weft_wt'] = $this->planning_shade->get_planned_weft_wt($subNumber); //print_r($data['planned_warp_wt']); echo json_encode($data); } public function issue_loom_preview() { $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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='weaving_panel_planning_order'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $osl_no=$data['fetch']->osl_no; $subNo=$data['fetch']->subNo; // $data['fetch_data']=$this->outsource_model->get_unplanned_issue_looms_osl($osl_no,$subNo); // $data['fetch_weft_data']=$this->outsource_model->get_unplanned_issue_looms_osl($osl_no,$subNo); // $subNumber = $subNo=$data['fetch']->subNo; // $plannedShadeDetails = $this->planning_shade->get_planned_shade_details($subNumber); // $articleID=$plannedShadeDetails['articleID']; // $shadeid=$plannedShadeDetails['sslShade']; // $data['resultWarp'] = $this->planning_yarn->getWarpDetails($articleID,$subNumber); // $data['sm_warp']=$this->planning_shade->display_smwarp($shadeid); // $data['planned_warp_wt'] = $this->planning_shade->get_planned_warp_wt($subNumber); // // print_r($data['sm_warp']); // // die(); // $data['resultWeft'] = $this->planning_yarn->getWeftDetails($articleID,$subNumber); // $data['sm_weft']=$this->planning_shade->display_smweft($shadeid); // $data['planned_weft_wt'] = $this->planning_shade->get_planned_weft_wt($subNumber); $data1=$data['fetch']->id; $table = 'issue_loom'; $where = array('weaving_panel_id'=>$data1,'status'=>'1'); // $data['getalldata'] = $this->outsource_model->fetch_where_subgrid_data1($table,$where); $data['getalldata'] = $this->outsource_model->fetch_where_subgrid_data1_update($table,$where); $data['getalldata_net'] = $this->outsource_model->fetch_where_net_goods_total($table,$where); $data['getalldata_rem'] = $this->outsource_model->fetch_where_rem_goods_total($table,$where); $data['getalldata_reprocess'] = $this->outsource_model->fetch_where_subgrid_data1($table,$where); $data['check_reprocess'] = $this->outsource_model->fetch_where_subgrid_data($table,$where); $data1=$data['fetch']->id; $table = 'issue_loom'; $where = array('weaving_panel_id'=>$data1,'status'=>'1'); $data['getyarndata'] = $this->outsource_model->get_customerdata($table,$where); // print_r(); // die(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/issue_loom_preview',$data); $this->load->view('templates/footer_inside'); } public function add_no_loom_confirmation() { $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); $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'=>'No','remark'=>$remarks,'issue_approved_by'=>'','issue_approved_date'=>''); $table= 'weaving_panel_planning_order'; // $details = $this->vendor_model->update_confirm_indent($data1,$where1); $this->store_model->update_data($where1,$table,$data1); return true; } public function add_yes_loom_confirmation() { $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); $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','remark'=>$remarks,'issue_approved_by'=>$approved_by,'issue_approved_date'=>$current_date); $table= 'weaving_panel_planning_order'; // $details = $this->vendor_model->update_confirm_indent($data1,$where1); $this->store_model->update_data($where1,$table,$data1); return true; } public function add_status_confirmation() { $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); $id1=$this->input->post("id"); $where=array('id'=>$id1); $table= 'weaving_panel_planning_order'; $data=$this->vendor_model->get_customerdata($table,$where); echo json_encode($data); } public function issued_to_weaving_addstock() { $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); $data2=$this->input->post('checked_ids'); $valu=$this->input->post('id_val'); $data['value']=$this->input->post('id_val'); $check_val=$this->input->post('check_cal'); echo $check_val; // die(); $data['check_value']=$this->input->post('check_cal'); $data['value_id']=$valu; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $r=array(); $ret=array(); if($check_val == 'raw') { foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->outsource_model->issue_display_yarn_raw_grid_issue_nandi_data($val); array_push($r,$arr); } } // print_r($r); //die(); } else if($check_val == 'twist') { foreach($exp as $val) { if($val == 'undefined') { } else { $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'NANDI','id'=>$val); $arr= $this->outsource_model->get_embroidery_issue_data($table,$where); array_push($r,$arr); } } } else if($check_val == 'dyed') { foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->outsource_model->issue_display_yarn_dyed_grid_issue_d_data($val); array_push($r,$arr); } } //print_r($r); //die(); } else if($check_val == 'swan') { foreach($exp as $val) { if($val == 'undefined') { } else { $table='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'location'=>'NANDI','id'=>$val); $arr=$this->outsource_model->get_work_order_grid_issue_data($table,$where); array_push($r,$arr); } } // print_r($r); // die(); } else if($check_val == 'rem') { foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->outsource_model->history_rements_desc_order_dyeing_grid_data($val); if(empty($arr)) { $arr=$this->outsource_model->history_rements_desc_order_weaving_grid_data($val); $tt='create_weaving_work_order'; } else { $arr=$this->outsource_model->history_rements_desc_order_dyeing_grid_data($val); $tt='issue_loom'; } // print_R($arr); array_push($r,$arr); array_push($ret,$tt); } } } $data['result']=$r; $data['rems']=$ret; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$valu); $table='weaving_panel_planning_order'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['value_id']=$val; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/weaving_selected_addstock',$data); $this->load->view('templates/footer_inside'); } public function weaving_issue_data() { $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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $this->db->truncate('delivery_yarn_twisting'); $this->db->empty_table('delivery_yarn_twisting'); $data = $this->outsource_model->display_yarn_twisting_grid_detailed_data(); foreach($data as $d) { $r=array('purpose'=>$d->purpose, 'yarnname' => $d->yarnname, 'reference_table' => 'indent_yarn_goods_details', 'reference_id' => $d->id, 'yarndenier' => $d->yarndenier, 'yarnspecification' => $d->yarnspecification, 'rec_date' => $d->rec_date, 'lot' => $d->lot, 'bale'=> $d-> bale, 'issue_gross_weight'=>$d->issue_gross_weight, 'issue_net_weight'=>$d->issue_net_weight, 'consumed_at'=>$d->consumed_at, 'shades'=>$d->shades); $table='delivery_yarn_twisting'; $this->db->insert($table,$r); } //$table='create_yarntwisting_work_order' //$where=array('quantity_approval'=>'Completed'); $f=$this->outsource_model->display_yarn_twisting_delivery_grid_detailed_data(); foreach($f as $dd) { $r=array('purpose'=>'', 'yarnname' => $dd->yarn_name, 'reference_table' => 'work_order_twisting', 'reference_id' => $dd->id, 'yarndenier' => $dd->yarn_denier, 'yarnspecification' => $dd->yarn_specification, 'rec_date' => $dd->rec_date, 'lot' => $dd->lot, 'bale'=> $dd-> bale, 'issue_gross_weight'=>$dd->gross_weight, 'issue_net_weight'=>$dd->net_weight, 'consumed_at'=>$dd->location, 'shades'=>''); $table='delivery_yarn_twisting'; $this->db->insert($table,$r); } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $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); $data['access'] = $this->access_details(); $data['value_id']=$val; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/weaving_issue_to_loom',$data); $this->load->view('templates/footer_inside'); } public function issued_to_loom_raw_stock() { $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); $yarn_raw = $this->outsource_model->display_yarn_raw_grid_issue_nandi_data(); //$yarn_raw = $this->outsource_model->display_yarn_raw_grid_data_group(); echo json_encode($yarn_raw); } public function issued_to_loom_twist_stock() { $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); $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'NANDI'); $yarn_twist= $this->outsource_model->get_embroidery_issue_data($table,$where); echo json_encode($yarn_twist); } public function issued_to_loom_dyed_stock() { $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); $yarn_dyed = $this->outsource_model->display_yarn_dyed_grid_issue_nandi_data(); echo json_encode($yarn_dyed); } public function issued_to_loom_swan_stock() { $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); $table='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'location'=>'NANDI'); $swan_dyed=$this->outsource_model->get_work_order_grid_issue_data($table,$where); echo json_encode($swan_dyed); } public function rements_weaving() { //$uri = $_SERVER["REQUEST_URI"]; $val = $this->input->post('as'); $where=array('id'=>$val); $table='issue_loom'; $data=$this->vendor_model->fetch_where_subgrid_data($table,$where); echo json_encode($data); } public function insert_rements_data() { $stock_id = $this->input->post('stock_id'); $rec_rements = $this->input->post('rec_rements'); $bl_net_weight = $this->input->post('bl_net_weight'); $final_issue_net_wt = $this->input->post('final_issue_net_wt'); $bag= $this->input->post('bag'); $where=array('id'=>$stock_id); $table='issue_loom'; $table_val_fetch=$this->vendor_model->fetch_where_subgrid_data($table,$where); $table_id=$table_val_fetch->yarn_ids; $arr = preg_match_all('/([0-9]+|[a-zA-Z]+)/',$table_id,$matches); $first_input_field = $matches[0]; $second_input_field = $matches[1]; // if($second_input_field[0] == 'r') // { // $table='indent_yarn_goods_details'; // $where=array('id'=>$second_input_field[1]); // $data=array('issue_net_weight'=>$bl_net_weight); // $data=$this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); // } // else if($second_input_field[0] == 't') // { // $table='delivery_yarn_twisting'; // $where=array('id'=>$second_input_field[1]); // $data=array('issue_net_weight'=>$bl_net_weight); // $data=$this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); // } // else if($second_input_field[0] == 'd') // { // $table='indent_yarn_goods_details'; // $where=array('id'=>$second_input_field[1]); // $data=array('issue_net_weight'=>$bl_net_weight); // $data=$this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); // } // else if($second_input_field[0] == 's') // { // $table='work_order_dyeing'; // $where=array('id'=>$second_input_field[1]); // $data=array('rec_dyed_qua'=>$bl_net_weight); // $data=$this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); // } $stock_id = $this->input->post('stock_id'); $location= $this->input->post('location'); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $recieved_by=$id['username']; $d = date("d-m-Y"); $rr=array('issue_loom_id'=>$stock_id, 'rements'=>$rec_rements, 'rements_stock'=>$rec_rements, 'rements_approval_by'=>$recieved_by, 'rements_approved_date'=>$d, 'bag'=>$bag, 'remnants_location'=>$location, 'ref_table'=>'issue loom'); $table='remnants'; $this->db->insert($table,$rr); $where1=array('id'=>$stock_id); $table='issue_loom'; $datas=array('rements'=>$rec_rements, 'rements_stock'=>$rec_rements, 'issue_net_wt'=>$final_issue_net_wt, 'balanced_stock_wt'=> $bl_net_weight, 'rements_approval_by'=>$recieved_by, 'rements_approved_date'=>$d, 'bag'=>$bag, 'remnants_location'=>$location); $details=$this->vendor_model->update_po_list_confirm_purchase($table,$datas,$where1); echo json_encode($detailse); } public function outsource_osl_preview() { $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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // $where=array('osl_no'=> $val); // $table='weaving_panel_planning_order'; // $data['fetchh']=$this->vendor_model->get_customerdata($table,$where); $data['p_osl_num']=$val; $where=array('osl_no'=> $val); $table='weaving_panel_planning_order'; $data['fetch']=$this->vendor_model->get_data($table,$where); // $v_address=$data['fetchh']->vendor_name; // $where=array('name'=>$v_address); // $table='indent_vendor_master'; // $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); // $data1=$data['fetch']->work_order; // $table = 'create_materialissue_work_order'; // $where = array('work_order'=>$data1,'status'=>'0'); // $data['getalldata'] = $this->outsource_model->fetch_where_subgrid_data1($table,$where); // $data['getotalval'] = $this->outsource_model->fetch_where_subgrid_work_order($table,$where); // $table = 'create_yarntwisting_work_order'; // $where = array('work_order'=>$data1,'status'=>'0'); // $data['getyarndata'] = $this->outsource_model->fetch_where_subgrid_data1($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/twisting_osl_preview',$data); $this->load->view('templates/footer_inside'); } public function insert_weaving_rements_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $recieved_by=$id['username']; $d = date("d-m-Y"); $ref_outsource_id= $this->input->post('ref_outsource_id'); $rec_rements = $this->input->post('rec_rements'); $bal_mtrs= $this->input->post('bal_mtrs'); $location= $this->input->post('location'); $bag= $this->input->post('bag'); $where1=array('id'=>$ref_outsource_id); $table='weaving_factory_stock'; $datas=array('rements'=>$rec_rements, 'balanced_rec_mtrs'=>$bal_mtrs, 'bag'=>$bag, 'remnants_location'=> $location, 'rements_approval_by'=>$recieved_by, 'rements_approved_date'=>$d, 'bag'=>$bag, 'remnants_location'=>$location); $detailse=$this->vendor_model->update_po_list_confirm_purchase($table,$datas,$where1); echo json_encode($detailse); } public function stock_insert_rements_data() { $stock_id = $this->input->post('stock_id'); $add_stock_val = $this->input->post('add_stock_val'); // $bl_net_weight = $this->input->post('bl_net_weight'); // $final_issue_net_wt = $this->input->post('final_issue_net_wt'); // $bag= $this->input->post('bag'); $lot = $this->input->post('lot'); $bale = $this->input->post('bale'); $yarn_denier = $this->input->post('yarn_denier'); $yarn_specification = $this->input->post('yarn_specification'); $yarn_name = $this->input->post('yarn_name'); //$location = $this->input->post('location'); $where=array('id'=>$stock_id); $table='issue_loom'; $table_val_fetch=$this->vendor_model->fetch_where_subgrid_data($table,$where); $table_id=$table_val_fetch->yarn_ids; $arr = preg_match_all('/([0-9]+|[a-zA-Z]+)/',$table_id,$matches); $first_input_field = $matches[0]; $second_input_field = $matches[1]; //print_r($_POST); //print_r($second_input_field[1]); if($second_input_field[0] == 'r') { $table='indent_yarn_goods_details'; $where=array('id'=>$second_input_field[1]); $vals_res=$this->vendor_model->fetch_where_subgrid_data($table,$where); $r_val = $vals_res->issue_net_weight + $add_stock_val; $data=array('issue_net_weight'=>$r_val); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } else if($second_input_field[0] == 't') { $table='delivery_yarn_twisting'; $where=array('id'=>$second_input_field[1]); $vals_res=$this->vendor_model->fetch_where_subgrid_data($table,$where); $r_val = $vals_res->issue_net_weight + $add_stock_val; $data=array('issue_net_weight'=>$r_val); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } else if($second_input_field[0] == 'd') { $table='indent_yarn_goods_details'; $where=array('id'=>$second_input_field[1],'lot'=>$lot,'bale'=>$bale,'yarndenier'=>$yarn_denier,'yarnspecification'=>$yarn_specification,'yarnname'=>$yarn_name); $vals_res=$this->vendor_model->fetch_where_subgrid_data($table,$where); //print_r($vals_res); //echo count($vals_res); $d = date("d-m-Y"); if(count($vals_res) == 1){ //echo 'old_id'; //die(); $r_val = $vals_res->issue_net_weight + $add_stock_val; $data=array('issue_net_weight'=>$r_val,'updated_date'=>$d); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } else{ //echo 'po_list_id'; //die(); $where3 = array('po_list_id'=>$second_input_field[1],'lot'=>$lot,'bale'=>$bale,'yarndenier'=>$yarn_denier,'yarnspecification'=>$yarn_specification,'yarnname'=>$yarn_name); $vals_res3 = $this->vendor_model->fetch_where_subgrid_data($table,$where3); $r_val = $vals_res3->issue_net_weight + $add_stock_val; //$data3 = array('issue_net_weight'=>$r_val); $data3 = array('issue_net_weight'=>$r_val,'updated_date'=>$d); $this->vendor_model->update_po_list_confirm_purchase($table,$data3,$where3); } } else if($second_input_field[0] == 's') { $table='work_order_dyeing'; $where=array('id'=>$second_input_field[1]); $vals_res=$this->vendor_model->fetch_where_subgrid_data($table,$where); $r_val = $vals_res->rec_dyed_qua + $add_stock_val; $data=array('rec_dyed_qua'=>$r_val); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } $stock_id = $this->input->post('stock_id'); $location= $this->input->post('location'); $re_process= $this->input->post('re_process'); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $recieved_by=$id['username']; $d = date("d-m-Y"); $where1=array('id'=>$stock_id); $table='issue_loom'; $table_val_fetch = $this->vendor_model->fetch_where_subgrid_data($table,$where1); $add_stock = $table_val_fetch->add_stock_val; $updated_stock = $add_stock + $add_stock_val; $datas=array( 'add_stock_val'=>$updated_stock, 'add_stock_by'=>$recieved_by, 'add_stock_date'=>$d, 'add_stock_location'=>$location, 're_process'=>$re_process, 'add_stock_status'=>1); $detailse=$this->vendor_model->update_po_list_confirm_purchase($table,$datas,$where1); //print_r($datas); //die(); echo json_encode($detailse); } } ?>