EVOLUTION-NINJA
Edit File: Madeups.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Madeups 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'); $this->load->model('design_weaving_model'); $this->load->model('madeups_model'); $this->load->model('vendor_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 access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_where_data($table,$where); } public function 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_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 issue_stock_grid() { $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"]; $RT = substr($uri, strpos($uri, "/") + 12); if($RT == 'madeups/issue_stock_grid?prop_id=1') { $data['url_val']='1'; $data['val']='madeups/issue_stock_grid?prop_id=1'; $data['ref']='indent'; } else if($RT == 'madeups/issue_stock_grid?prop_id=2') { $data['val']='madeups/issue_stock_grid?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $table = 'fabric_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['pen_list']= $this->vendor_model->fabric_madeups_dashboard_po_list_id($table,$where); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['app_list']= $this->vendor_model->fabric_no_madeups_plan_madeups_no_planned_details($d1); } else if($RT == 'madeups/issue_stock_grid?prop_id=3') { $data['url_val']='3'; $data['val']='madeups/issue_stock_grid?prop_id=1'; $data['ref']='month_dashboard'; $table = 'fabric_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['pen_list']= $this->vendor_model->monthly_fabric_madeups_res_created_po_generate($table,$m,$y); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['app_list']= $this->vendor_model->monthly_madeups_res_res_dashboard_po_list_id($table,$m,$y,$f); } else if($RT == 'madeups/issue_stock_grid?prop_id=4') { $data['url_val']='4'; $data['val']='madeups/issue_stock_grid?prop_id=1'; $data['ref']='year_dashboard'; $table = 'fabric_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['pen_list']= $this->vendor_model->year_fabric_madeups_res_created_po_generate($table,$y); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $data['app_list']= $this->vendor_model->yearly_madeups_res_res_dashboard_po_list_id($table,$y,$f); } $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-------------------- $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('madeups/madeups_issue_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function consumable_madeups_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); $uri = $_SERVER["REQUEST_URI"]; $RT = substr($uri, strpos($uri, "/") + 12); if($RT == 'madeups/consumable_madeups_details?prop_id=1') { $data['url_val']='1'; $data['val']='madeups/consumable_madeups_details?prop_id=1'; $data['ref']='indent'; } else if($RT == 'madeups/consumable_madeups_details?prop_id=2') { $data['val']='madeups/consumable_madeups_details?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $table = 'consumable_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['fab_madeups11']= $this->vendor_model->fabric_madeups_dashboard_po_list_id($table,$where); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['fab_madeups22']= $this->vendor_model->fabric_no_con_madeups_plan_madeups_no_planned_details($d1); $data['pen_list']=$data['fab_madeups11']; $data['app_list']=$data['fab_madeups22']; } else if($RT == 'madeups/consumable_madeups_details?prop_id=3') { $data['url_val']='3'; $data['val']='madeups/consumable_madeups_details?prop_id=1'; $data['ref']='month_dashboard'; $table = 'consumable_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['month_fab_madeups11']= $this->vendor_model->monthly_fabric_madeups_res_created_po_generate($table,$m,$y); $data['pen_list']=$data['month_fab_madeups11']; $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['month_fab_madeups22']= $this->vendor_model->monthly_con_madeups_res_res_dashboard_po_list_id($table,$m,$y,$f); $data['app_list']=$data['month_fab_madeups22']; } else if($RT == 'madeups/consumable_madeups_details?prop_id=4') { $data['url_val']='4'; $data['val']='madeups/consumable_madeups_details?prop_id=1'; $data['ref']='year_dashboard'; $table = 'consumable_madeups'; $d1=date('d/m/Y'); $where = array('created_at'=>$d1); $data['year_fab_madeups11']= $this->vendor_model->year_fabric_madeups_res_created_po_generate($table,$y); $table = 'planned_order'; $d1=date('d-m-Y'); $f='Yes'; $where = array('confirm'=>'yes','issue_approved_date'=>$d1); $data['year_fab_madeups22']= $this->vendor_model->yearly_con_madeups_res_res_dashboard_po_list_id($table,$y,$f); $data['pen_list']=$data['year_fab_madeups11']; $data['app_list']=$data['year_fab_madeups22']; } $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-------------------- $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('madeups/madeups_consumable_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function planned_data() { $get = $this->uri->segment(3); $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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d=date('d/m/Y'); $t='No'; $detail=$this->vendor_model->fabric_planned_madeups_no_res_planned_details($d,$t); } else if($get == 'sindent') { $detail=$this->madeups_model->no_planned_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $f='No'; $detail=$this->vendor_model->mponthly_madeups_result_fetch_dashboard_po_list_id($table,$m,$y,$f); } else if($get == 'syear_dashboard') { $table='indent_po'; $f='No'; $detail=$this->vendor_model->yearly_madeups_result_fetch_dashboard_po_list_id($table,$y,$f); } echo json_encode($detail); } public function confirm_planned_data() { $get = $this->uri->segment(3); $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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d=date('d-m-Y'); $t='Yes'; $detail=$this->vendor_model->fabric_planned_madeups_no_red_res_planned_details($d,$t); } else if($get == 'sindent') { $detail=$this->madeups_model->yes_planned_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $f='Yes'; $detail=$this->vendor_model->mponthly_madeups_result_red_fetch_dashboard_po_list_id($table,$m,$y,$f); } else if($get == 'syear_dashboard') { $table='indent_po'; $f='Yes'; $detail=$this->vendor_model->yearly_madeups_result_red_fetch_dashboard_po_list_id($table,$y,$f); } echo json_encode($detail); } public function issued_to_madeups_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); $data['fetch']=$this->madeups_model->get_customerdata($val); $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']; $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); $data['value_id']=$val; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/issue_to_madeups_new',$data); // $this->load->view('madeups/issue_to_madeups',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups() { $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); $val = $this->uri->segment(3); $location = $this->uri->segment(4); $data['location'] = $location; $data['value_id']=$val; $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('madeups/fabric_madeups_grid',$data); $this->load->view('templates/footer_inside'); } public function consumables_madeups() { $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); $data['value_id']=$val; $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('madeups/consumable_location_grid',$data); $this->load->view('templates/footer_inside'); } public function selected_fabric_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); $data2=$this->input->post('checked_ids'); $val=$this->input->post('id_val'); $data['fetch']=$this->madeups_model->get_customerdata($val); $data['value_id']=$val; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $r=array(); $d=array(); $osl_details=array(); foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->marketing_model->display_fabric_packing_id_embroidryinspection($val); array_push($r,$arr); } } $data['result']=$r; $f=$r; //print_r($data['result']); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $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('madeups/madeups_fabric_selected_data',$data); $this->load->view('madeups/madeups_fabric_selected_data_new',$data); $this->load->view('templates/footer_inside'); } public function insert_madeups_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); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $created_At=date('d/m/Y'); $data=array( 'osl' => $this->input->post('osl_no'), 'plan_id' => $this->input->post('var_id'), 'order_type' => $this->input->post('order_type'), 'size' => $this->input->post('size'), 'article' => $this->input->post('article'), 'description' => $this->input->post('description'), 'design' => $this->input->post('design'), 'shades' =>$this->input->post('shades'), 'ssl_shade' => $this->input->post('ssl_shade'), 'order_qty' => $this->input->post('order_qty'), 'f_osl' => $this->input->post('osl_po_no'), 'fabric_id' => $this->input->post('fabric_id'), 'f_ssl_piece' => $this->input->post('ssl_piece'), 'f_width' =>$this->input->post('width'), 'f_article' => $this->input->post('po_article'), 'f_design' => $this->input->post('po_design'), 'f_shade' => $this->input->post('po_shade'), 'f_issue_mtrs' => $this->input->post('issue_mtrs'), 'f_stock_mtrs' => $this->input->post('stock_mtrs'), 'f_bal_mtrs' =>$this->input->post('bal_mtrs'), 'est_pcs' => $this->input->post('est_pcs'), 'issue_date' => $this->input->post('issue_date'), 'location' => $this->input->post('location'), 'issued_by' => $this->input->post('issue_by'), 'remarks' => $this->input->post('remarks'), 'created_by'=>$approved_by, 'created_at'=>$created_At, 'issued_for'=>$this->input->post('issued_for'), ); $table='fabric_madeups'; $this->db->insert($table,$data); //$return_id=$this->db->insert_id(); $f_id=$this->input->post('fabric_id'); $b_m=$this->input->post('bal_mtrs'); $table='fabric_inspection'; $where=array('goods_id'=>$f_id); $data=array('balanced_mtrs'=>$b_m); $this->store_model->update_data($where,$table,$data); $table='planned_order '; $plan_id = $this->input->post('var_id'); $where=array('id'=>$plan_id); $data=array('issue_status'=>'PARTLY','issued_for'=>$this->input->post('issued_for')); $this->store_model->update_data($where,$table,$data); } public function madeups_subgrid() { $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); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'fabric_madeups'; $where = array('plan_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function madeups_consumable_subgrid() { $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); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'consumable_madeups'; $where = array('plan_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); //$getalldata = $this->vendor_model->fetch_where_subgrid_news_data1($i); echo json_encode($getalldata); } public function fabric_madeups_grn_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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $data['getalldata_qty'] = $this->vendor_model->sum_get_rec_qty_weaving_sum_customerdata($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($table,$where); $data['fetch_fabric_issue_mtrs']=$this->vendor_model->sum_get_receive_mtrs_weaving_sum_customerdata($table,$where); $data['fetch_fabric_est_pcs']=$this->vendor_model->sum_get_est_pcs_weaving_sum_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['indent_p']='indent_preview'; $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('madeups/fabric_madeups_preview_grn_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_grn_view() { $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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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(); $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); $data['indent_p']='today_preview'; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/fabric_madeups_preview_grn_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_grn_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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='monthly_preview'; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/fabric_madeups_preview_grn_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_grn_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); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='year_preview'; $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('madeups/fabric_madeups_preview_grn_page',$data); $this->load->view('templates/footer_inside'); } public function consumable_madeups_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); $data['fetch']=$this->madeups_model->get_customerdata($val); $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']; $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('madeups/consumable_madeups',$data); $this->load->view('templates/footer_inside'); } public function selected_consumable_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); $data2=$this->input->post('checked_ids'); $val=$this->input->post('id_val'); $data['fetch']=$this->madeups_model->get_customerdata($val); $data['value_id']=$val; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $osl_details=array(); foreach($exp as $val) { $arr=$this->madeups_model->get_issue_purchase_table_madeups_consum_selected_data($val); array_push($osl_details,$arr); } $data['result']=$osl_details; //$f=$r; //print_r($data['result']); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $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('madeups/madeups_consumable_selected_data',$data); $this->load->view('templates/footer_inside'); } ///////////////////////////////////// delivery confirmation ////////////////////////////////// public function fabric_delivery_conformation() { $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"]; $RT = substr($uri, strpos($uri, "/") + 12); if($RT == 'madeups/fabric_delivery_conformation?prop_id=1') { $data['url_val']='1'; $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $data['ref']='indent'; } else if($RT == 'madeups/fabric_delivery_conformation?prop_id=2') { $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; } else if($RT == 'madeups/fabric_delivery_conformation?prop_id=3') { $data['url_val']='3'; $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $data['ref']='month_dashboard'; } else if($RT == 'madeups/fabric_delivery_conformation?prop_id=4') { $data['url_val']='4'; $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $data['ref']='year_dashboard'; } $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-------------------- $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('madeups/fabric_add_stock_data'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function delivery_planned_data() { $get = $this->uri->segment(3); $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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d=date('d/m/Y'); $t='No'; $detail=$this->vendor_model->fabric_delivery_planned_madeups_no_res_planned_details($d,$t); } else if($get == 'sindent') { $detail=$this->madeups_model->no_planned_planned_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $f='No'; $detail=$this->vendor_model->mponthly_madeups_result_fetch_delievry_dashboard_po_list_id($table,$m,$y,$f); } else if($get == 'syear_dashboard') { $table='indent_po'; $f='No'; $detail=$this->vendor_model->yearly_madeups_result_fetch_delievry_dashboard_po_list_id($table,$y,$f); } echo json_encode($detail); } public function received_finised_madeups() { $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['delete_id']=$this->input->post('delete_id'); $id=$this->session->userdata('logged_in'); // $userid=$this->session->userdata('userid'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); // print_r($id['userid']); // die(); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $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); $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $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); $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; } } } } } $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('madeups/recived_details',$data); $this->load->view('templates/footer_inside'); } public function insert_madeups_consuamble_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); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $created_At=date('d/m/Y'); $consumable_id = $this->input->post('consuma_id'); $purpose = $this->input->post('purpose'); $unit = $this->input->post('unit'); $product =$this->input->post('product'); $total_quantity = $this->input->post('t_quantity'); $issued_quantity = $this->input->post('issue_quantity'); $bal_quantity = $this->input->post('bal_quantity'); $location = $this->input->post('location'); $created_by=$approved_by; $created_at=$created_At; foreach($consumable_id as $key=>$val) { $data=array('consumable_id'=>$consumable_id[$key], 'purpose'=>$purpose[$key], 'unit'=>$unit[$key], 'product'=>$product[$key], 'total_quantity'=>$total_quantity[$key], 'issued_quantity'=>$issued_quantity[$key], 'bal_quantity'=>$bal_quantity[$key], 'location'=>$location[$key], 'created_by'=>$created_by, 'created_at'=>$created_at, 'osl' => $this->input->post('osl_no'), 'plan_id' => $this->input->post('var_id'), 'order_type' => $this->input->post('order_type'), 'size' => $this->input->post('size'), 'article' => $this->input->post('article'), 'description' => $this->input->post('description'), 'design' => $this->input->post('design'), 'shades' =>$this->input->post('shades'), 'ssl_shade' => $this->input->post('ssl_shade'), 'order_qty' => $this->input->post('order_qty'), 'issue_date' => $this->input->post('issue_date'), 'issued_by' => $this->input->post('issue_by'), 'remarks' => $this->input->post('remarks'), ); $table='consumable_madeups'; $this->db->insert($table,$data); //$return_id=$this->db->insert_id(); } $f_id=$consumable_id[$key]; $b_m=$bal_quantity[$key]; $table='indent_po'; $where=array('id'=>$f_id); $data=array('total_quantity'=>$b_m); $this->store_model->update_data($where,$table,$data); $table='planned_order '; $plan_id = $this->input->post('var_id'); $where=array('id'=>$plan_id); $data=array('consumable_issue_status'=>'PARTLY'); $this->store_model->update_data($where,$table,$data); } public function consumable_madeups_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('plan_id'=>$val); $table='consumable_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); // print_r($data['fetch_other']); // die(); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='consumable_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $where=array('plan_id'=>$val); $table='consumable_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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(); $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('madeups/consumable_madeups_preview',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($table,$where); $data['fetch_fabric_issue_mtrs']=$this->vendor_model->sum_get_receive_mtrs_weaving_sum_customerdata($table,$where); $data['fetch_fabric_est_pcs']=$this->vendor_model->sum_get_est_pcs_weaving_sum_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['madeups_trought']='m'; $data['indent_p']='indent_preview'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_view() { $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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='today_preview'; $data['madeups_trought']='m'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='monthly_preview'; $data['madeups_trought']='m'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_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); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='year_preview'; $data['madeups_trought']='m'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function auto_sea_pono() { $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); $keyword=$this->input->get('term'); $data1=$this->madeups_model->Getsearch_pono($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->oslNo; } echo json_encode($data); } public function auto_sea_pono_partly() { $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); $keyword=$this->input->get('term'); $data1=$this->madeups_model->Getsearch_pono_partly($keyword); //print_r($data1); foreach($data1 as $row) { $details[]=$row->oslNo; } echo json_encode($details); } public function fetch_recived_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); $po_no1 = $_REQUEST['po_no1']; $data['po_no']=$this->madeups_model->get_search_customerdata($po_no1); $table='fabric_madeups'; $where=array('osl'=>$po_no1); $data['fabric_plan_id']=$this->vendor_model->get_where_row($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; // print_r($data); // die(); echo json_encode($data); } public function vendor_goods_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); $get = $this->uri->segment(3); $po = $this->uri->segment(4); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; //table='fabric_madeups'; //$where=array('plan_id'=>$i); // $details=$this->vendor_model->get_customerdata($table,$where); $osl=$i; $details1=$this->madeups_model->add_stock_planned_planned_details1($osl,$po); echo json_encode($details1); } public function madeups_receive_quantity() { $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='fabric_madeups'; $id=$this->input->post("id"); $where=$id; //$data['quantity'] = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data['quantity'] = $this->madeups_model->add_stock_value_planned_details($where); $table='fabric_madeups_delivery_confirmation'; $id=$this->input->post("id"); $where=array('ref_id'=>$id); $r= $this->madeups_model->delivery_rec_qua($table,$where); $row= $this->madeups_model->delivery_batch_no($table); $d=$row->batch_id; $data['batch']= $d+1; if(empty($r)) { $rr=0; } else { $rr=$r; } $data['delievry_quantity']=$rr; // print_r($data['delievry_quantity']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); echo json_encode($data); } public function add_fabric_goods_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); $l=$this->input->post('location'); if($l == '') { $c=$this->input->post('consumed_at'); } else { $c=$l; } $data = array( 'osl'=> $this->input->post('osl_num'), 'ref_id'=> $this->input->post('ref_id'), 'order_type'=> $this->input->post('order_type'), 'size'=> $this->input->post('size'), 'design'=> $this->input->post('design'), 'article'=> $this->input->post('article'), 'shade'=> $this->input->post('shade'), 'description'=> $this->input->post('description'), 'ssl_shade'=> $this->input->post('ssl_shade'), 'order_qty'=> $this->input->post('order_qty'), 'received_qty'=> $this->input->post('issue_mtrs'), 'received_qty_ref'=> $this->input->post('issue_mtrs'), 'in_dc_no'=> $this->input->post('in_dc_no'), 'in_dc_val'=> $this->input->post('in_dc_val'), 'batch_no'=> $this->input->post('batch_no'), 'batch_id'=> $this->input->post('batch_id'), 'location'=> $c, 'remarks'=> $this->input->post('remarks'), 'received_wt'=> $this->input->post('issue_w'), 'rec_date'=> $this->input->post('received_date'), 'rec_by'=> $this->input->post('received_by'), ); $table='fabric_madeups_delivery_confirmation'; $this->db->insert($table,$data); $ref_id = $this->input->post('ref_id'); $table='fabric_madeups_delivery_confirmation'; $where=array('ref_id'=>$ref_id); $sum_val=$this->madeups_model->delivery_rec_qua($table,$where); $rec_qty_sum= $sum_val->received_qty; $order_qty= $this->input->post('order_qty'); if($rec_qty_sum == $order_qty) { $ref_id = $this->input->post('ref_id'); $table='planned_order'; $where=array('id'=>$ref_id); $data=array('add_stock_status'=>'COMPLETED'); $this->store_model->update_data($where,$table,$data); } else if($rec_qty_sum < $order_qty) { $ref_id = $this->input->post('ref_id'); $table='planned_order'; $where=array('id'=>$ref_id); $data=array('add_stock_status'=>'PARTLY'); $this->store_model->update_data($where,$table,$data); } } public function madeups_add_indent_approved_subgrid() { $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); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } 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= 'planned_order'; $data=$this->vendor_model->get_customerdata($table,$where); echo json_encode($data); } 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= 'planned_order'; // $details = $this->vendor_model->update_confirm_indent($data1,$where1); $this->store_model->update_data($where1,$table,$data1); return true; } public function consumeable_planned_data() { $get = $this->uri->segment(3); $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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d=date('d/m/Y'); $t='No'; $detail=$this->vendor_model->consuam_planned_madeups_no_res_planned_details($d,$t); } else if($get == 'sindent') { $detail=$this->madeups_model->cons_no_planned_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $f='No'; $detail=$this->vendor_model->mponthly_madeups_consuma_result_fetch_dashboard_po_list_id($table,$m,$y,$f); } else if($get == 'syear_dashboard') { $table='indent_po'; $f='No'; $detail=$this->vendor_model->yearly_madeups_consuma_result_fetch_dashboard_po_list_id($table,$y,$f); } echo json_encode($detail); } public function consumeable_yes_planned_data() { $get = $this->uri->segment(3); $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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d=date('d-m-Y'); $t='Yes'; $detail=$this->vendor_model->fabric_con_planned_madeups_no_red_res_planned_details($d,$t); } else if($get == 'sindent') { $detail=$this->madeups_model->cons_yes_planned_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $f='Yes'; $detail=$this->vendor_model->mponthlycon__madeups_result_red_fetch_dashboard_po_list_id($table,$m,$y,$f); } else if($get == 'syear_dashboard') { $table='indent_po'; $f='Yes'; $detail=$this->vendor_model->yearly_con_madeups_result_red_fetch_dashboard_po_list_id($table,$y,$f); } echo json_encode($detail); } public function cons_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('cons_confirm'=>'Yes','cons_remarks'=>$remarks,'cons_approved_by'=>$approved_by,'cons_approved_date'=>$current_date); $table= 'planned_order'; // $details = $this->vendor_model->update_confirm_indent($data1,$where1); $this->store_model->update_data($where1,$table,$data1); return true; } public function fabric_delivery_madeups_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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $table = 'fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata_received_qty'] = $this->vendor_model->sum_get_receive_customerdata_qty($table,$where); $data['getalldata_received_wt'] = $this->vendor_model->sum_get_receive_wt_customerdata($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($table,$where); $data['fetch_fabric_issue_mtrs']=$this->vendor_model->sum_get_receive_mtrs_weaving_sum_customerdata($table,$where); $data['fetch_fabric_est_pcs']=$this->vendor_model->sum_get_est_pcs_weaving_sum_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['indent_p']='indent_preview'; $data['madeups_trought']='mm'; $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('madeups/fabric_madeups_preview',$data); $this->load->view('templates/footer_inside'); } public function fabric_delivery_madeups_view() { $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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['madeups_trought']='mm'; $data['indent_p']='today_preview'; $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('madeups/fabric_madeups_preview',$data); $this->load->view('templates/footer_inside'); } public function fabric_delivery_madeups_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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['madeups_trought']='mm'; $data['indent_p']='monthly_preview'; $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('madeups/fabric_madeups_preview',$data); $this->load->view('templates/footer_inside'); } public function fabric_delivery_madeups_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); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='year_preview'; $data['madeups_trought']='mm'; $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('madeups/fabric_madeups_preview',$data); $this->load->view('templates/footer_inside'); } public function madeups_delete_fun() { $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->input->post('as'); $where=array('id'=>$id); $table='fabric_madeups_delivery_confirmation'; $this->vendor_model->delete_vendor($table,$where); return true; } public function cs_madeups_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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($table,$where); $data['fetch_fabric_issue_mtrs']=$this->vendor_model->sum_get_receive_mtrs_weaving_sum_customerdata($table,$where); $data['fetch_fabric_est_pcs']=$this->vendor_model->sum_get_est_pcs_weaving_sum_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['madeups_trought']='c'; $data['indent_p']='indent_preview'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function cs_madeups_view() { $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('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='today_preview'; $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); $data['madeups_trought']='c'; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function cs_madeups_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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='monthly_preview'; $data['madeups_trought']='c'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function cs_madeups_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); $where=array('plan_id'=>$val); $table='fabric_madeups'; //$data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); $d=$this->vendor_model->get_customerdata($table,$where); if(empty($d)) { $id=$val; $data['fetch_other_data']=$this->madeups_model->serch_planned_details($id); $data['fetch_other']=''; } else { $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_other']=$this->vendor_model->get_customerdata($table,$where); } $table = ' fabric_madeups_delivery_confirmation'; $where = array('ref_id'=>$val); $data['getalldata'] = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $where=array('plan_id'=>$val); $table='fabric_madeups'; $data['fetch_fabric']=$this->vendor_model->get_where_dataa($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['indent_p']='year_preview'; $data['madeups_trought']='c'; $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('madeups/fabric_madeups_preview_page',$data); $this->load->view('templates/footer_inside'); } public function madeups_delete_all_indent_approved_subgrid() { $id=$this->input->post("as"); $table='fabric_madeups_delivery_confirmation'; $where=array('ref_id'=>$id); $getalldata = $this->vendor_model->delete_vendor($table,$where); } public function workorder_list() { $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"]; $RT = substr($uri, strpos($uri, "/") + 12); if($RT == 'madeups/workorder_list') { $data['url_val']='1'; $data['val']='madeups/workorder_list'; $data['ref']='indent'; } $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; $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; // print_r($arr); // die(); } } } } //----------tiill-------------------- $data['getalldata'] = $this->marketing_model->display_transaction_data(); //echo '<pre>';print_R($data['getalldata']);exit; $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('madeups/madeups_workorder', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function selected_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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $data['f1']=$this->input->post('f1'); $data['f0']=$this->input->post('f0'); $data['f2']=$this->input->post('f2'); $data['f3']=$this->input->post('f3'); $data['f4']=$this->input->post('f4'); $data2=$this->input->post('checked_ids'); $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $id = $path[0]; $data['details'] = $this->marketing_model->getsuborder_data($id); $data['getresult']=$this->planning_yarn->fabricmasterdata(); //echo $id; //print_r($data['details']); //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(); $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('madeups/insert_madeups_workorder',$data); $this->load->view('templates/footer_inside'); } public function insert_wo_form() { $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); $month = date("m"); if ($month == "01" || $month == "02" || $month == "03") { $year = date("Y") - 1; } else { $year = date("Y"); } $max_id = $this->marketing_model->getmax_id('madeups_work_order'); $table='madeups_work_order'; $where=array('id'=>$max_id); $data['madeups_work_order'] = $this->madeups_model->fetch_where_data_row($table,$where); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $delete_status = $madeups_work_order->delete_status; if($delete_status == 1){ $max_id = $max_id; } else{ $max_id = $max_id+1; } $data['f1'] = 'DTL'.substr(($year-1),2).'-'.substr($year,2).'-WO'.'-M'.$max_id; $data['getresult']=$this->planning_yarn->fabricmasterdata(); $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('madeups/insert_madeups_workorder',$data); $this->load->view('templates/footer_inside'); } public function edit_wo_form() { $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='madeups_work_order'; $data['wo_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['wo_data']); $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); $month = date("m"); if ($month == "01" || $month == "02" || $month == "03") { $year = date("Y") - 1; } else { $year = date("Y"); } $max_id = $this->marketing_model->getmax_id('madeups_work_order'); $table='madeups_work_order'; $where=array('id'=>$max_id); $data['madeups_work_order'] = $this->madeups_model->fetch_where_data_row($table,$where); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $delete_status = $madeups_work_order->delete_status; if($delete_status == 1){ $max_id = $max_id; } else{ $max_id = $max_id+1; } $data['f1'] = 'DTL'.substr(($year-1),2).'-'.substr($year,2).'-WO'.'-M'.$max_id; $data['getresult']=$this->planning_yarn->fabricmasterdata(); $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('madeups/edit_madeups_workorder',$data); $this->load->view('templates/footer_inside'); } public function madeups_workorder_grid() { $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, "=") + 1); $data['f0']=explode('/', $data['val'], 6)[0]; $data['f1']=explode('/', $data['val'], 6)[1]; $data['f2']=explode('/', $data['val'], 6)[2]; $data['f3']=explode('/', $data['val'], 6)[3]; $data['f4']=explode('/', $data['val'], 6)[4]; $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['back_val'] = 'grn_back'; $this->db->empty_table('issue_fabric_check_val'); $this->db->truncate('issue_fabric_check_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('madeups/issue_madeups_location_data',$data); $this->load->view('templates/footer_inside'); } public function issue_finishing_location_data() { $uri = $_SERVER["REQUEST_URI"]; $data['f0'] = explode('/', $uri)[4]; //echo $data['f0']; //die(); $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 = $this->marketing_model->getsuborder_all($data['f0']); $data = $this->marketing_model->input_preview_input_suborder_workorder($data['f0']); //echo $data['f0']; //print_r($data); //die(); echo json_encode($data); } public function insert_cs_data() { $oslNo = $this->input->post('oslNo'); $orderType = $this->input->post('orderType'); $width = $this->input->post('width'); $articleNo = $this->input->post('articleNo'); $design = $this->input->post('design'); $description = $this->input->post('description'); $wo_type = $this->input->post('wo_type'); $ourShade = $this->input->post('ourShade'); $buyerShade = $this->input->post('buyerShade'); $qty = $this->input->post('qty'); $unit = $this->input->post('unit'); $wo_no = $this->input->post('wo_no'); $e_date = $this->input->post('e_date'); $vendor_name = $this->input->post('vendor_name'); $d_date = $this->input->post('d_date'); $wo_type = $this->input->post('wo_type'); $rate = $this->input->post('rate'); $as_per = $this->input->post('as_per'); $cgst = $this->input->post('cgst'); $sgst = $this->input->post('sgst'); $igst = $this->input->post('igst'); $req_qty = $this->input->post('req_qty'); $remarks = $this->input->post('remarks'); $madeups_data=array('DTL'=> $oslNo, 'orderType'=> $orderType, 'size'=> $width, 'article'=> $articleNo, 'design'=> $design, 'shade'=> $ourShade, 'buyerShade'=> $buyerShade, 'qty' =>$qty, 'units' =>$unit, 'wo_number'=>$wo_no, 'description'=>$description, 'wo_date'=> $e_date, 'vendor_name' => $vendor_name, 'd_date'=> $d_date, 'wo_type'=> $wo_type, 'rate'=> $rate, 'as_per'=> $as_per, 'cgst'=> $cgst, 'sgst' =>$sgst, 'igst' =>$igst, 'req_qty'=>$req_qty, 'remarks'=>$remarks ); $table='madeups_work_order'; $id = $this->db->insert($table,$madeups_data); } public function update_cs_data() { $oslNo = $this->input->post('oslNo'); $orderType = $this->input->post('orderType'); $width = $this->input->post('width'); $articleNo = $this->input->post('articleNo'); $design = $this->input->post('design'); $description = $this->input->post('description'); $wo_type = $this->input->post('wo_type'); $ourShade = $this->input->post('ourShade'); $buyerShade = $this->input->post('buyerShade'); $qty = $this->input->post('qty'); $unit = $this->input->post('unit'); $wo_no = $this->input->post('wo_no'); $e_date = $this->input->post('e_date'); $vendor_name = $this->input->post('vendor_name'); $d_date = $this->input->post('d_date'); $wo_type = $this->input->post('wo_type'); $rate = $this->input->post('rate'); $as_per = $this->input->post('as_per'); $cgst = $this->input->post('cgst'); $sgst = $this->input->post('sgst'); $igst = $this->input->post('igst'); $req_qty = $this->input->post('req_qty'); $remarks = $this->input->post('remarks'); $madeups_data=array('DTL'=> $oslNo, 'orderType'=> $orderType, 'size'=> $width, 'article'=> $articleNo, 'design'=> $design, 'shade'=> $ourShade, 'buyerShade'=> $buyerShade, 'qty' =>$qty, 'units' =>$unit, 'wo_number'=>$wo_no, 'description'=>$description, 'wo_date'=> $e_date, 'vendor_name' => $vendor_name, 'd_date'=> $d_date, 'wo_type'=> $wo_type, 'rate'=> $rate, 'as_per'=> $as_per, 'cgst'=> $cgst, 'sgst' =>$sgst, 'igst' =>$igst, 'req_qty'=>$req_qty, 'remarks'=>$remarks ); $table='madeups_work_order'; $where=array('wo_number'=>$wo_no); $this->marketing_model->update_data($where,$table,$madeups_data); } public function get_workorder_data() { $table='madeups_work_order'; $getalldata = $this->madeups_model->get_workorder_data(); //print_r($getalldata); //die(); echo json_encode($getalldata); } public function preview_wo() { $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); $table='madeups_work_order'; $where=array('id'=>$val); $data['madeups_work_order'] = $this->madeups_model->fetch_where_data_row($table,$where); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $vendor_name = $madeups_work_order->vendor_name; $table='outsource_vendor_master'; $where=array('name'=>$vendor_name); $detail = $this->madeups_model->fetch_where_data_row($table,$where); $data['fetch_address'] = $this->madeups_model->fetch_where_data_row($table,$where); $table = 'fabric_madeups_workorder'; $where = array('plan_id'=>$val); $data['fabric_madeups_workorder'] = $this->madeups_model->get_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(); $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); $data['value_id']=$val; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/madeups_workorder_preview',$data); // $this->load->view('madeups/issue_to_madeups',$data); $this->load->view('templates/footer_inside'); } public function preview_wo_grn() { $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); $table='madeups_work_order'; $where=array('id'=>$val); $data['madeups_work_order'] = $this->madeups_model->fetch_where_data_row($table,$where); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $vendor_name = $madeups_work_order->vendor_name; $table='outsource_vendor_master'; $where=array('name'=>$vendor_name); $detail = $this->madeups_model->fetch_where_data_row($table,$where); $data['fetch_address'] = $this->madeups_model->fetch_where_data_row($table,$where); $table = 'fabric_madeups_workorder'; $where = array('plan_id'=>$val); //$data['fabric_madeups_workorder'] = $this->madeups_model->get_data($table,$where); //$table = 'fabric_madeups_workorder'; //$where = array('plan_id'=>$madeups_work_order->id); //$getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $data['fabric_madeups_workorder'] = $this->madeups_model->get_workorder_data_subgrid($madeups_work_order->id); $data['inward_madeups_workorder'] = $this->madeups_model->get_workorder_data_subgrid_inword($madeups_work_order->id); //print_r($data['inward_madeups_workorder']); // 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(); $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); $data['value_id']=$val; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/madeups_workorder_preview_grn',$data); // $this->load->view('madeups/issue_to_madeups',$data); $this->load->view('templates/footer_inside'); } public function complete_workorder() { $id = $this->input->post('as'); $table = 'madeups_work_order'; $where = array('id'=>$id); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); if($madeups_work_order->complete == '1'){ $table='madeups_work_order'; $where=array('id'=>$id); $data=array('complete'=>'0'); $this->store_model->update_data($where,$table,$data); echo json_encode('In-Completed'); } else if($madeups_work_order->approve == '0'){ echo json_encode('Please Approve Before You Click Complete..'); } else { $table='madeups_work_order'; $where=array('id'=>$id); $data=array('complete'=>'1'); $this->store_model->update_data($where,$table,$data); $this->load->library('email'); $this->email->set_mailtype('html'); $actual_qty=$this->input->post('actual_qty'); $table='madeups_work_order'; $where=array('id'=>$id); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $table = 'fabric_madeups_workorder'; $fabric_madeups_workorder = $this->madeups_model->get_workorder_data_subgrid($madeups_work_order->id); $sum_issue_mtrs = 0; $sum_issue_est_pcs = 0; $sum_variance_mtrs = 0; $sum_variance_pcs = 0; $sum_est = 0; $sum_rec_goods = 0; $sum_processed_mtrst = 0; foreach($fabric_madeups_workorder as $f) { $sum_issue_mtrs += floatval($f->f_issue_mtrs); $sum_issue_est_pcs += floatval($f->est_pcs); $sum_variance_mtrs += (floatval($f->f_issue_mtrs) - floatval($f->sum_rec_mtrs)); $sum_variance_pcs += (floatval($f->est_pcs) - floatval($f->sum_est_pcs)); $sum_est += floatval($f->sum_est_pcs); $sum_rec_goods += floatval($f->sum_rec_mtrs); $sum_processed_mtrst += floatval($f->sum_processed_mtrs); } $vendor_name = $madeups_work_order->vendor_name; $table='outsource_vendor_master'; $where=array('name'=>$vendor_name); $detail = $this->madeups_model->fetch_where_data_row($table,$where); $fetch_address = $this->madeups_model->fetch_where_data_row($table,$where); $msgs=""; $msgs .= "Dear Sir / Madam,".'<br/><br/>'; $msgs .= "The following Workorder has been Approved,".'<br/>'; $msgs .= '<table class="table" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">'; $msgs .= '<tr><td>'."Vendor Name".'</td>'; $msgs .= '<td>'.$madeups_work_order->vendor_name.'</td></tr>'; $msgs .= '<tr><td>'."Address".'</td>'; $msgs .= '<td>'.$fetch_address->address.'</td></tr>'; $msgs .= '<tr><td>'."WO #".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_number.'</td></tr>'; $msgs .= '<tr><td>'."WO Date".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_date.'</td></tr>'; $msgs .= '<tr><td>'."Wo Type".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_type.'</td></tr>'; $msgs .= '<tr><td>'."Wo Del Date".'</td>'; $msgs .= '<td>' .$madeups_work_order->d_date.'</td></tr>'; $msgs .= '<tr><td>'."Issues As".'</td>'; $msgs .= '<td>'.$madeups_work_order->as_per.'</td></tr>'; $msgs .= '<tr><td>'."Rate INR".'</td>'; $msgs .= '<td>'.$madeups_work_order->rate.'</td></tr>'; $msgs .= '<tr><td>'."Design".'</td>'; $msgs .= '<td>'.$madeups_work_order->design.'</td></tr>'; $msgs .= '<tr><td>'."Total issued Mtrs".'</td>'; $msgs .= '<td>'.$sum_issue_mtrs.'</td></tr>'; $msgs .= '<tr><td>'."Total Estimated Pcs".'</td>'; $msgs .= '<td>'.$sum_issue_est_pcs.'</td></tr>'; $msgs .= '<tr><td>'."Total Rcd Pcs".'</td>'; $msgs .= '<td>'.$sum_est.'</td></tr>'; $msgs .= '<tr><td>'."Total Rcd Mtr".'</td>'; $msgs .= '<td>'.$sum_rec_goods.' Mtrs'.'</td></tr>'; $msgs .= '<tr><td>'."Processed Mtr".'</td>'; $msgs .= '<td>'.$sum_processed_mtrst.' Mtrs'.'</td></tr>'; $msgs .= '<tr><td>'."Var Mtr".'</td>'; $msgs .= '<td>'.$sum_variance_mtrs.'Mtrs'.'</td></tr>'; $msgs .= '<tr><td>'."Var Pcs".'</td>'; $msgs .= '<td>'.$sum_variance_pcs.'</td></tr>'; $msgs .= '</table><br/>'; $msgs .= "Thank you,".'<br/>'; $msgs .= "Regards,".'<br/>'; $msgs .= "Swan Silk / Deco Textil.".'<br/><br/>'; $msgs .= '<p>'."Note: Please do not reply to this mail as this is as automated mail service.".'</p>'; // $this->email->from('swansilkhouse@gmail.com', 'swansilk123'); $this->email->from('ERP@swansilk.com', 'Swan Silk (P) Ltd'); $this->email->to('navin@swansilk.com'); $this->email->cc('madeups@swansilk.com'); $this->email->subject('Swan / Deco Work Order Approve Details '); $data['message'] = $msgs; $this->email->message($msgs); $this->email->send(); echo json_encode('Completed'); } } public function approve_workorder() { $id = $this->input->post('as'); $table = 'madeups_work_order'; $where = array('id'=>$id); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); if($madeups_work_order->complete == '1' && $madeups_work_order->approve == '1'){ echo json_encode('All Ready Approved.. You cant change..'); } else if($madeups_work_order->approve == '1'){ $table='madeups_work_order'; $where=array('id'=>$id); $data=array('approve'=>'0'); $this->store_model->update_data($where,$table,$data); echo json_encode('Un-approved Successfully...'); } else{ $table='madeups_work_order'; $where=array('id'=>$id); $data=array('approve'=>'1'); $this->store_model->update_data($where,$table,$data); $this->load->library('email'); $this->email->set_mailtype('html'); $actual_qty=$this->input->post('actual_qty'); $table='madeups_work_order'; $where=array('id'=>$id); $madeups_work_order = $this->madeups_model->fetch_where_data_row($table,$where); $table = 'fabric_madeups_workorder'; $where = array('plan_id'=>$id); $fabric_madeups_workorder = $this->madeups_model->get_data($table,$where); $sum_issue_mtrs = 0; $sum_issue_est_pcs = 0; foreach($fabric_madeups_workorder as $f) { $sum_issue_mtrs += floatval($f->f_issue_mtrs); $sum_issue_est_pcs += floatval($f->est_pcs); } $vendor_name = $madeups_work_order->vendor_name; $table='outsource_vendor_master'; $where=array('name'=>$vendor_name); $detail = $this->madeups_model->fetch_where_data_row($table,$where); $fetch_address = $this->madeups_model->fetch_where_data_row($table,$where); $msgs=""; $msgs .= "Dear Sir / Madam,".'<br/><br/>'; $msgs .= "The following Workorder has been Approved,".'<br/>'; $msgs .= '<table class="table" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">'; $msgs .= '<tr><td>'."Vendor Name".'</td>'; $msgs .= '<td>'.$madeups_work_order->vendor_name.'</td></tr>'; $msgs .= '<tr><td>'."Address".'</td>'; $msgs .= '<td>'.$fetch_address->address.'</td></tr>'; $msgs .= '<tr><td>'."WO #".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_number.'</td></tr>'; $msgs .= '<tr><td>'."WO Date".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_date.'</td></tr>'; $msgs .= '<tr><td>'."Wo Type".'</td>'; $msgs .= '<td>'.$madeups_work_order->wo_type.'</td></tr>'; $msgs .= '<tr><td>'."Wo Del Date".'</td>'; $msgs .= '<td>' .$madeups_work_order->d_date.'</td></tr>'; $msgs .= '<tr><td>'."Issues As".'</td>'; $msgs .= '<td>'.$madeups_work_order->as_per.'</td></tr>'; $msgs .= '<tr><td>'."Rate INR".'</td>'; $msgs .= '<td>'.$madeups_work_order->rate.'</td></tr>'; $msgs .= '<tr><td>'."Design".'</td>'; $msgs .= '<td>'.$madeups_work_order->design.'</td></tr>'; $msgs .= '<tr><td>'."Total issued Mtrs".'</td>'; $msgs .= '<td>'.$sum_issue_mtrs.'</td></tr>'; $msgs .= '<tr><td>'."Total Estimated Pcs".'</td>'; $msgs .= '<td>'.$sum_issue_est_pcs.'</td></tr>'; $msgs .= '</table><br/>'; $msgs .= "Thank you,".'<br/>'; $msgs .= "Regards,".'<br/>'; $msgs .= "Swan Silk / Deco Textil.".'<br/><br/>'; $msgs .= '<p>'."Note: Please do not reply to this mail as this is as automated mail service.".'</p>'; // $this->email->from('swansilkhouse@gmail.com', 'swansilk123'); $this->email->from('ERP@swansilk.com', 'Swan Silk (P) Ltd'); $this->email->to('navin@swansilk.com'); $this->email->cc('madeups@swansilk.com'); $this->email->subject('Swan / Deco Work Order Approve Details '); $data['message'] = $msgs; $this->email->message($msgs); $this->email->send(); echo json_encode('Approved Successfully...'); } } public function issued_to_madeups_workorder() { $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); $table='madeups_work_order'; $where=array('id'=>$val); $data['fetch'] = $this->madeups_model->fetch_where_data_row($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(); $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); $data['value_id']=$val; $this->load->view('templates/header_inside',$data); $this->load->view('madeups/issue_to_madeups_workorder',$data); // $this->load->view('madeups/issue_to_madeups',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_workorder() { $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); $val = $this->uri->segment(3); $location = $this->uri->segment(4); $data['location'] = $location; $data['value_id']=$val; $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('madeups/fabric_madeups_workorder_grid',$data); $this->load->view('templates/footer_inside'); } public function fabric_madeups_workorder_multiple() { $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); $val = $this->uri->segment(3); $location = $this->uri->segment(4); $data['location'] = $location; $data['value_id']=$val; $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('madeups/fabric_madeups_workorder_grid_multiple',$data); $this->load->view('templates/footer_inside'); } public function selected_fabric_workorder_data_multiple() { $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'); $val=$this->input->post('id_val'); $table='madeups_work_order'; $where=array('id'=>$val); $data['fetch'] = $this->madeups_model->fetch_where_data_row($table,$where); $data['value_id']=$val; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $r=array(); $d=array(); $osl_details=array(); foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->marketing_model->display_fabric_packing_id_embroidryinspection($val); array_push($r,$arr); } } $data['result']=$r; $f=$r; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $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('madeups/madeups_fabric_selected_data',$data); $this->load->view('madeups/madeups_fabric_workpoder_selected_data_multiple',$data); $this->load->view('templates/footer_inside'); } public function selected_fabric_workorder_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); $data2=$this->input->post('checked_ids'); $val=$this->input->post('id_val'); $table='madeups_work_order'; $where=array('id'=>$val); $data['fetch'] = $this->madeups_model->fetch_where_data_row($table,$where); $data['value_id']=$val; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $r=array(); $d=array(); $osl_details=array(); foreach($exp as $val) { if($val == 'undefined') { } else { $arr=$this->marketing_model->display_fabric_packing_id_embroidryinspection($val); array_push($r,$arr); } } $data['result']=$r; $f=$r; //print_r($data['result']); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $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('madeups/madeups_fabric_selected_data',$data); $this->load->view('madeups/madeups_fabric_workpoder_selected_data_new',$data); $this->load->view('templates/footer_inside'); } public function insert_madeups_workorder_data_multiple() { $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['username']; $created_At=date('d/m/Y'); foreach($this->input->post('osl_po_no') as $key=>$val) { $data=array( 'osl' => $this->input->post('osl_no'), 'plan_id' => $this->input->post('var_id'), 'order_type' => $this->input->post('order_type'), 'size' => $this->input->post('size'), 'article' => $this->input->post('article'), 'description' => $this->input->post('description'), 'design' => $this->input->post('design'), 'shades' =>$this->input->post('shades'), 'ssl_shade' => $this->input->post('ssl_shade'), 'order_qty' => $this->input->post('order_qty'), 'f_osl' => $this->input->post('osl_po_no')[$key], 'fabric_id' => $this->input->post('fabric_id')[$key], 'f_ssl_piece' => $this->input->post('ssl_piece')[$key], 'f_width' =>$this->input->post('width')[$key], 'f_article' => $this->input->post('po_article')[$key], 'f_design' => $this->input->post('po_design')[$key], 'f_shade' => $this->input->post('po_shade')[$key], 'f_issue_mtrs' => $this->input->post('issue_mtrs')[$key], 'f_stock_mtrs' => $this->input->post('stock_mtrs')[$key], 'f_bal_mtrs' =>$this->input->post('bal_mtrs')[$key], 'est_pcs' => $this->input->post('est_pcs')[$key], 'issue_date' => $this->input->post('issue_date')[$key], 'location' => $this->input->post('location'), 'issued_by' => $this->input->post('issue_by')[$key], 'remarks' => $this->input->post('remarks')[$key], 'goods_id' => $this->input->post('fabric_id')[$key], 'created_by'=>$approved_by, 'created_at'=>$created_At, 'issued_for'=>$this->input->post('issued_for'), ); $table='fabric_madeups_workorder'; $this->db->insert($table,$data); //$return_id=$this->db->insert_id(); $f_id = $this->input->post('fabric_id')[$key]; $b_m = $this->input->post('bal_mtrs')[$key]; $table='fabric_inspection'; $where=array('goods_id'=>$f_id); $data=array('balanced_mtrs'=>$b_m); $this->store_model->update_data($where,$table,$data); // $table='planned_order '; // $plan_id = $this->input->post('var_id'); // $where=array('id'=>$plan_id); // $data=array('issue_status'=>'PARTLY','issued_for'=>$this->input->post('issued_for')); // $this->store_model->update_data($where,$table,$data); } } public function insert_madeups_workorder_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); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $created_At=date('d/m/Y'); $data=array( 'osl' => $this->input->post('osl_no'), 'plan_id' => $this->input->post('var_id'), 'order_type' => $this->input->post('order_type'), 'size' => $this->input->post('size'), 'article' => $this->input->post('article'), 'description' => $this->input->post('description'), 'design' => $this->input->post('design'), 'shades' =>$this->input->post('shades'), 'ssl_shade' => $this->input->post('ssl_shade'), 'order_qty' => $this->input->post('order_qty'), 'f_osl' => $this->input->post('osl_po_no'), 'fabric_id' => $this->input->post('fabric_id'), 'f_ssl_piece' => $this->input->post('ssl_piece'), 'f_width' =>$this->input->post('width'), 'f_article' => $this->input->post('po_article'), 'f_design' => $this->input->post('po_design'), 'f_shade' => $this->input->post('po_shade'), 'f_issue_mtrs' => $this->input->post('issue_mtrs'), 'f_stock_mtrs' => $this->input->post('stock_mtrs'), 'f_bal_mtrs' =>$this->input->post('bal_mtrs'), 'est_pcs' => $this->input->post('est_pcs'), 'issue_date' => $this->input->post('issue_date'), 'location' => $this->input->post('location'), 'issued_by' => $this->input->post('issue_by'), 'remarks' => $this->input->post('remarks'), 'goods_id' => $this->input->post('fabric_id'), 'created_by'=>$approved_by, 'created_at'=>$created_At, 'issued_for'=>$this->input->post('issued_for'), ); $table='fabric_madeups_workorder'; $this->db->insert($table,$data); //$return_id=$this->db->insert_id(); $f_id=$this->input->post('fabric_id'); $b_m=$this->input->post('bal_mtrs'); $table='fabric_inspection'; $where=array('goods_id'=>$f_id); $data=array('balanced_mtrs'=>$b_m); $this->store_model->update_data($where,$table,$data); $table='planned_order '; $plan_id = $this->input->post('var_id'); $where=array('id'=>$plan_id); $data=array('issue_status'=>'PARTLY','issued_for'=>$this->input->post('issued_for')); $this->store_model->update_data($where,$table,$data); } public function madeups_workorder_subgrid1() { $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); $get = $this->uri->segment(3); //echo $get; preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } //$i= $id[0]; $table = 'fabric_madeups_workorder'; $where = array('plan_id'=>$get); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function madeups_workorder_subgrid() { $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); $get = $this->uri->segment(3); //echo $get; preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } //$i= $id[0]; $table='madeups_work_order'; $where=array('wo_number'=>$get); $data['po_no'] = $this->vendor_model->get_where_row($table,$where); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); //$table='fabric_madeups_workorder'; //$where=array('plan_id'=>$madeups_work_order->id); // $data['fabric_plan_id']=$this->vendor_model->get_where_row($table,$where); $table = 'fabric_madeups_workorder'; $where = array('plan_id'=>$madeups_work_order->id); //$getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $getalldata = $this->madeups_model->get_workorder_data_subgrid($madeups_work_order->id); //print_r($getalldata); //die(); echo json_encode($getalldata); } public function inward_wo_form() { $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['delete_id']=$this->input->post('delete_id'); $id=$this->session->userdata('logged_in'); // $userid=$this->session->userdata('userid'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); // print_r($id['userid']); // die(); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $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); $data['val']='madeups/fabric_delivery_conformation?prop_id=1'; $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); $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; } } } } } $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('madeups/workorder_recived_details',$data); $this->load->view('templates/footer_inside'); } public function workorder_fetch_recived_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); $po_no1 = $_REQUEST['po_no1']; $data['po_no']=$this->madeups_model->get_search_customerdata($po_no1); $table='madeups_work_order'; $where=array('wo_number'=>$po_no1); $data['po_no'] = $this->vendor_model->get_where_row($table,$where); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); $table='fabric_madeups_workorder'; $where=array('plan_id'=>$madeups_work_order->id); $data['fabric_plan_id']=$this->vendor_model->get_where_row($table,$where); //echo $madeups_work_order->id; //print_r($this->db->last_query()); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; echo json_encode($data); } public function workorder_fetch_recived_data_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); $po_no1 = $_REQUEST['po_no1']; $data['po_no']=$this->madeups_model->get_search_customerdata($po_no1); $table='madeups_work_order'; $where=array('id'=>$po_no1); $data['po_no'] = $this->vendor_model->get_where_row($table,$where); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); $table='fabric_madeups_workorder'; $where=array('plan_id'=>$madeups_work_order->id); $data['fabric_plan_id']=$this->vendor_model->get_where_row($table,$where); //echo $madeups_work_order->id; //print_r($this->db->last_query()); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; echo json_encode($data); } public function madeups_workorder_receive_quantity() { $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); $w_id = $this->input->post("id"); $table='fabric_madeups_workorder'; $where=array('id'=>$w_id); $data['fabric_plan_id']=$this->vendor_model->get_where_row($table,$where); $fabric_plan_id = $this->vendor_model->get_where_row($table,$where); $table='madeups_work_order'; $where=array('id'=>$fabric_plan_id->plan_id); $data['madeups_work_order']=$this->vendor_model->get_where_row($table,$where); //$data['sum_issued']=$this->madeups_model->get_sum_issued($fabric_plan_id->plan_id); //echo $madeups_work_order->id; //print_r($this->db->last_query()); //die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; echo json_encode($data); } function add_workorder_goods_details(){ $work_order_issue_id = $this->input->post('id'); $table='fabric_madeups_workorder'; $where=array('id'=>$work_order_issue_id); $fabric_plan_id = $this->vendor_model->get_where_row($table,$where); $table='madeups_work_order'; $where=array('id'=>$fabric_plan_id->plan_id); $madeups_work_order = $this->vendor_model->get_where_row($table,$where); $v_name = $madeups_work_order->vendor_name; $table='orders'; $where=array('oslNo'=>$this->input->post('osl_num')); $order = $this->vendor_model->get_where_row($table,$where); $customer_id = $order->fileNo; $location = $fabric_plan_id->location; $data=array( 'piece_no' => $this->input->post('f_ssl_piece'), 'customer_id'=>$customer_id, 'consumed_at'=>$location, 'vendor_name' =>$v_name, 'po_no' => $this->input->post('osl_num'), 'shades'=> $this->input->post('byershade'), 'width' => $this->input->post('recieved_width').'CMS', 'rec_width' => $this->input->post('recieved_width').'CMS', 'rec_weight' => $this->input->post('r_weight'), 'rec_mtrs' => $this->input->post('recieved_mtrs'), 'rec_goods'=> $this->input->post('recieved_mtrs'), 'rec_pcs'=> $this->input->post('recieved_estimate_pcs'), 'design' => $this->input->post('designs'), 'rec_by' => $this->input->post('received_by'), 'work_order_id' =>$this->input->post('id'), 'received_date' =>$this->input->post('received_date'), 'product_name'=>$this->input->post('article1'), 'vari_e_width'=>$this->input->post('vari_e_width'), 'processed_mtrs'=>$this->input->post('processed_mtrs'), 'type_recieved'=>$this->input->post('type_recieved'), 'invoice'=>$this->input->post('invoice'), 'status' =>'1', 'refernce_table'=>'Work_Order', ); $table='fabric_inspection_details'; $this->db->insert($table,$data); $table='wo_inspection_details'; $this->db->insert($table,$data); print_r($this->db->last_query()); } public function madeups_workorder_subgrid_indivisual() { $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); $get = $this->uri->segment(3); $table = 'wo_inspection_details'; $where = array('work_order_id'=>$get); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function auto_dtl() { $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); $keyword=$this->input->get('term'); $data1=$this->madeups_model->Get_search_dtl($keyword); foreach($data1 as $row) { $data[]=$row->oslNo; } echo json_encode($data); } public function auto_workorder() { $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); $keyword=$this->input->get('term'); $data1=$this->madeups_model->Get_search_workorder($keyword); foreach($data1 as $row) { $data[]=$row->wo_number; } echo json_encode($data); } public function delete_workorder_recieved_subgrid() { $id=$this->input->post("as"); $table='wo_inspection_details'; $where=array('id'=>$id); $getalldata = $this->vendor_model->delete_vendor($table,$where); } public function delete_workorder() { $id=$this->input->post("as"); $table='madeups_work_order'; $where=array('id'=>$id); // $datas=array('delete_status'=>'1'); // $this->store_model->update_data($where,$table,$datas); $getalldata = $this->vendor_model->delete_vendor($table,$where); //print_r($where); } public function delete_workorder_issued() { $id=$this->input->post("as"); $table='fabric_madeups_workorder'; $where=array('id'=>$id); $getalldata = $this->vendor_model->get_where_row($table,$where); $goods_id = $getalldata->goods_id; $issue_mtr = $getalldata->f_issue_mtrs; $table1='fabric_inspection'; $where1=array('goods_id'=>$goods_id); $fabric_inspection = $this->vendor_model->get_where_row($table1,$where1); $balanced_mtrs = $fabric_inspection->balanced_mtrs; $b_mtrs = $issue_mtr + $balanced_mtrs; $wheres=array('goods_id'=>$goods_id); $datas=array('balanced_mtrs'=>$b_mtrs); $this->store_model->update_data($wheres,$table1,$datas); $table='fabric_madeups_workorder'; $where=array('id'=>$id); $getalldata = $this->vendor_model->delete_vendor($table,$where); } } ?>