EVOLUTION-NINJA
Edit File: Quality_check.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Quality_check 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('outsource_model'); $this->load->model('marketing_model'); $this->load->model('planning_yarn'); $this->load->model('planning_shade'); $this->load->model('request_model'); $this->load->model('vendor_model'); $this->load->model('store_model'); $this->load->database(); 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 access_details_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_main_data($table,$where); } public function access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_where_data($table,$where); } public function 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_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 request_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); $rs=$this->input->post('reference_value'); if($rs == 'indent') { $data['indent_po'] = 'indent_preview'; } else if($rs == 'today_dashboard') { $data['indent_po'] = 'today_preview'; } else if($rs == 'month_dashboard') { $data['indent_po'] = 'monthly_preview'; } else if($rs == 'year_dashboard') { $data['indent_po'] = 'year_preview'; } $data['articles'] = $this->marketing_model->display_article_data(); $data['quality'] = $this->marketing_model->display_article_data(); $data['designdata'] = $this->marketing_model->display_design_data(); $data['product'] = $this->request_model->fetch_data(); $table='sample_request'; $data['outsource'] = $this->request_model->display_product_data(); $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('request/request_form',$data); $this->load->view('templates/footer_inside'); } public function customer_insert() { $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); $customer=$this->input->post("customer"); $date=$this->input->post("date"); $product_type=$this->input->post("product_type"); $description=$this->input->post("description"); $size=$this->input->post("size"); $min_quality=$this->input->post("min_quality"); $customer_id=$this->input->post("customer_id"); $currency=$this->input->post("currency"); $article=$this->input->post("article"); $design=$this->input->post("design"); $price=$this->input->post("price"); $image=$this->input->post("image"); $reference=$this->input->post("reference"); $terms=$this->input->post("terms"); $quality=$this->input->post("quality"); $color=$this->input->post("color"); $composition=$this->input->post("composition"); $note=$this->input->post("note"); $date = new DateTime($date); $date= $date->format('Y-m-d'); if($_FILES) { $path=$_FILES['img_name']['name']; $target='uploads/'; //$type='pdf|png|jpg' $stamp=getdate(); $target.=$stamp[0].basename($_FILES['img_name']['name']); $file=$target; move_uploaded_file($_FILES['img_name']['tmp_name'],$target); } else { $file=" "; } $data=array('customer_name'=>$customer,'date'=>$date,'product_type'=>$product_type,'description'=>$description,'size'=>$size,'min_quality'=>$min_quality, 'customer_id'=>$customer_id,'currency'=>$currency,'article'=>$article,'design'=>$design,'price'=>$price,'image'=>$file,'reference'=>$reference, 'terms'=>$terms,'quality'=>$quality,'color'=>$color,'composition'=>$composition,'note'=>$note,'preview'=>'preview' ); $cusinsert = $this->request_model->customer_insert($data); if ($cusinsert) { redirect(base_url() . 'request/request_details', 'refresh'); } } public function view_all_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $d = $data['fetch_data']->date; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['back_preview']='request'; $data['indent_p']='indent_preview'; $this->load->view('request/view_all_data',$data); } public function sample_view_all_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $d = $data['fetch_data']->date; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $this->load->view('request/view_all_data',$data); } public function sample_view_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $d = $data['fetch_data']->date; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $this->load->view('request/view_all_data',$data); } public function sample_request_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $d = $data['fetch_data']->date; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $this->load->view('request/view_all_data',$data); } public function hangerpreview() { $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='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='indent_preview'; $data['back_preview']='request'; $this->load->view('request/hanger_preview',$data); } public function sample_hangerpreview() { $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='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $this->load->view('request/hanger_preview',$data); } public function sample_hanger_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $this->load->view('request/hanger_preview',$data); } public function hanger_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $w=$data['fetch_data']->article; $table='article_master'; $where=array('articleNo'=>$w); $data['weight']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $this->load->view('request/hanger_preview',$data); } public function cusionpreview() { $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='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='indent_preview'; $data['back_preview']='request'; $this->load->view('request/cusion_previw',$data); } public function sample_cusionpreview() { $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='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $this->load->view('request/cusion_previw',$data); } public function sample_request_cusionpreview() { $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='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $this->load->view('request/cusion_previw',$data); } public function cusion_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); $table='sample_request'; $where=array('id'=>$val); $data['fetch_data']=$this->request_model->fetch_where_data($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $this->load->view('request/cusion_previw',$data); } public function customer_fetch1() { $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]; $det=$this->request_model->get_customer_id($i); //echo $det->customer_id; $customer_id=$det->customer_id; $date=$det->date; $details = $this->request_model->get_customer_details1($customer_id,$date); //print_r($det); echo json_encode($details); } public function customer_fetch() { $get = $this->uri->segment(3); //print_r($get); //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); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $where=array('created_date'=>$d1); $details=$this->vendor_model->today_get_customer_details($where); } else if($get == 'sindent') { $details = $this->request_model->get_customer_details(); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $details=$this->vendor_model->monthly_count_amount_get_customerdata1($table,$m,$y); } else if($get == 'syear_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $details=$this->vendor_model->year_count_amount_get_customerdata1($table,$y); } echo json_encode($details); } public function customer_update() { $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("id"); //$customer=$this->input->post("customer"); //$customer_id=$this->input->post("customer_id"); $date=$this->input->post("date"); $product_type=$this->input->post("product_type"); $article=$this->input->post("article"); $price=$this->input->post("price"); $reference=$this->input->post("reference"); $quality=$this->input->post("quality"); $composition=$this->input->post("composition"); $description=$this->input->post("description"); $date = new DateTime($date); $date= $date->format('Y-m-d'); $where=array('id'=>$id); $data=array('id'=>$id,'date'=>$date,'product_type'=>$product_type, 'article'=>$article,'price'=>$price,'reference'=>$reference,'quality'=>$quality,'composition'=>$composition,'description'=>$description ); $details = $this->request_model->customer_update($data,$where); return true; } public function customer_delete() { $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('id'); $where=array('id'=>$id); $status=array('status'=>1); $this->request_model->customer_update($status,$where); return true; } public function autofill() { $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); $max_id = $this->request_model->fetch(); $where=array('id'=>$max_id->id); $table='sample_request'; $data['max']=$this->request_model->fetch_where_data($table,$where); $d = $data['max']->date ; // Pull your date from the db $date = new DateTime($d); $day = $date->format('d') ; // Creates date number $month = $date->format('m'); // Creates month number $year = $date->format('Y'); $data['d'] = $day.'-'.$month.'-'.$year; echo json_encode($data); } public function auto_sea() { $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->request_model->Getsearch($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->customerName; } echo json_encode($data); } public function search_by_fetch() { $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='customer_master'; $customer=$this->input->post('customer'); $where=array('customerName'=>$customer); $data1=$this->request_model->get_data($table,$where); echo json_encode($data1); //print_r($data1); } public function search_by_customer() { $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='customer_master'; $customer=$this->input->post('customer'); $where=array('customerName'=>$customer); $data=$this->request_model->get_customerdata($table,$where); echo json_encode($data); //print_r($data1); } public function 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); $det=$this->request_model->get_customer_id($val); //echo $det->customer_id; $customer_id=$det->customer_id; $date=$det->date; $table='sample_request'; $where=array('customer_id'=>$customer_id,'date'=>$date,'status'=>0); $data['fetch']=$this->marketing_model->fetch_where_data($table,$where); $data['fetch_xsl']=$this->marketing_model->fetch_where_data($table,$where); $data['fetch_main']=$this->marketing_model->fetch_main_data($table,$where); $d = $data['fetch_main']->date ; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $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'; $this->load->view('request/sample_request_preview',$data); } public function sample_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); $det=$this->request_model->get_customer_id($val); //echo $det->customer_id; $customer_id=$det->customer_id; $date=$det->date; $table='sample_request'; $where=array('customer_id'=>$customer_id,'date'=>$date,'status'=>0); $data['fetch']=$this->marketing_model->fetch_where_data($table,$where); $data['fetch_main']=$this->marketing_model->fetch_main_data($table,$where); $d = $data['fetch_main']->date ; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $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'; $this->load->view('request/sample_request_preview',$data); } public function sample_request_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); $det=$this->request_model->get_customer_id($val); //echo $det->customer_id; $customer_id=$det->customer_id; $date=$det->date; $table='sample_request'; $where=array('customer_id'=>$customer_id,'date'=>$date,'status'=>0); $data['fetch']=$this->marketing_model->fetch_where_data($table,$where); $data['fetch_main']=$this->marketing_model->fetch_main_data($table,$where); $d = $data['fetch_main']->date ; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $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('request/sample_request_preview',$data); } public function sample_request_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); $det=$this->request_model->get_customer_id($val); //echo $det->customer_id; $customer_id=$det->customer_id; $date=$det->date; $table='sample_request'; $where=array('customer_id'=>$customer_id,'date'=>$date,'status'=>0); $data['fetch']=$this->marketing_model->fetch_where_data($table,$where); $data['fetch_main']=$this->marketing_model->fetch_main_data($table,$where); $d = $data['fetch_main']->date ; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $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'; $this->load->view('request/sample_request_preview',$data); } public function sample_data_upload() { $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); $articlein=$this->input->post("artin"); $articleout=$this->input->post("artout"); if($articlein !="") { $article=$articlein; } else { $article=$articleout; } $customer=$this->input->post("name"); $date=$this->input->post("date"); $product_type=$this->input->post("product"); $description=$this->input->post("des"); $size=$this->input->post("size"); $min_quality=$this->input->post("min_quality"); $cust_id=$this->input->post("c"); $currency=$this->input->post("currency"); $design=$this->input->post("design"); $price=$this->input->post("pric"); $c_id=$this->input->post("c_id"); $reference=$this->input->post("res"); $terms=$this->input->post("terms"); $quality=$this->input->post("quality"); $color=$this->input->post("color"); $weight=$this->input->post("weight"); $composition=$this->input->post("compos"); $note=$this->input->post("note"); $article_width=$this->input->post("article_width"); $article_price=$this->input->post("article_price"); $article_type=$this->input->post("planningorder"); $newDate = date("Y-m-d", strtotime($date) ); //$date = new DateTime($date); // $date= $date->format('Y-m-d'); if($_FILES) { $path=$_FILES['img_name']['name']; $target='uploads/'; //$type='pdf|png|jpg' $stamp=getdate(); $target.=$stamp[0].basename($_FILES['img_name']['name']); $file=$target; move_uploaded_file($_FILES['img_name']['tmp_name'],$target); } else { $file=" "; } //$table='sample_request'; $where=array('id'=>$c_id); $c=$this->request_model->fetch_edit_data($where); if(count($c)>0) { $table='sample_request'; $where=array('id'=>$c_id); if($path!=""){ $data=array('customer_name'=>$customer,'date'=>$newDate,'product_type'=>$product_type,'description'=>$description,'size'=>$size,'min_quality'=>$min_quality,'currency'=>$currency,'design'=>$design,'price'=>$price,'image'=>$file,'reference'=>$reference, 'terms'=>$terms,'quality'=>$quality,'color'=>$color,'composition'=>$composition,'note'=>$note,'article_width'=>$article_width,'article_price'=>$article_price,'weight'=>$weight,'preview'=>'preview','hanger'=>'preview','cusion'=>'preview','view'=>'view','edit'=>'edit' ); } else{ $data=array('customer_name'=>$customer,'date'=>$newDate,'product_type'=>$product_type,'description'=>$description,'size'=>$size,'min_quality'=>$min_quality,'currency'=>$currency,'design'=>$design,'price'=>$price,'reference'=>$reference, 'terms'=>$terms,'quality'=>$quality,'color'=>$color,'composition'=>$composition,'note'=>$note,'article_width'=>$article_width,'article_price'=>$article_price,'weight'=>$weight,'preview'=>'preview','hanger'=>'preview','cusion'=>'preview','view'=>'view','edit'=>'edit' ); } //} $this->request_model->update_data($where,$table,$data); } else { $data=array('customer_name'=>$customer,'date'=>$newDate,'product_type'=>$product_type,'description'=>$description,'size'=>$size,'min_quality'=>$min_quality, 'customer_id'=>$cust_id,'currency'=>$currency,'article'=>$article,'design'=>$design,'price'=>$price,'image'=>$file,'reference'=>$reference, 'terms'=>$terms,'quality'=>$quality,'color'=>$color,'composition'=>$composition,'note'=>$note,'article_width'=>$article_width,'article_price'=>$article_price,'weight'=>$weight,'article_type'=>$article_type,'preview'=>'preview','hanger'=>'preview','cusion'=>'preview','view'=>'view','edit'=>'edit','delete'=>'Delete' ); $table='sample_request'; $cusinsert = $this->request_model->inserted($data,$table); } //$this->load->view('templates/header_inside'); $url_ref_val=$this->input->post('url_ref_val'); if($url_ref_val == 'indent_preview') { redirect(base_url() . 'request/sample_request_form?prop_id=1', 'refresh'); } else if($url_ref_val == 'today_preview') { redirect(base_url() . 'request/sample_request_form?prop_id=2', 'refresh'); } else if($url_ref_val == 'monthly_preview') { redirect(base_url() . 'request/sample_request_form?prop_id=3', 'refresh'); } else if($url_ref_val == 'year_preview') { redirect(base_url() . 'request/sample_request_form?prop_id=4', 'refresh'); } } public function quality_edit_form(){ $colorid = $this->db->get('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); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='sample_request'; $where=array('id'=>$val); $data['edit_data']=$this->request_model->fetch_where_data($table,$where); $d = $data['edit_data']->date; // Pull your date from the db $date = new DateTime($d); $data['day'] = $date->format('d') ; // Creates date number $data['month'] = $date->format('m'); // Creates month number $data['year'] = $date->format('Y'); $data['articles'] = $this->marketing_model->display_article_data(); $data['quality'] = $this->marketing_model->display_article_data(); $data['designdata'] = $this->marketing_model->display_design_data(); $data['product'] = $this->request_model->fetch_data(); $data['outsource'] = $this->request_model->display_product_data(); $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_preview']='request'; $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('request/edit_request_form',$data); $this->load->view('templates/footer_inside'); } public function index() { $table='sub_orders'; $where=array('subOrderType'=>'FABRIC','orders_Type'=>' '); $order_typesd=$this->vendor_model->get_where_dataa($table,$where); if(empty($order_typesd)) { } else { foreach($order_typesd as $t) { $table='sub_orders'; $where=array('id'=>$t->id); $update_data=array('orders_Type'=>'FABRIC'); $this->vendor_model->update_data($where,$table,$update_data); } } $table='sub_orders'; $where=array('subOrderType !='=>'FABRIC','orders_Type'=>' '); $order_types_madeups=$this->vendor_model->get_where_dataa($table,$where); if(empty($order_types_madeups)) { } else { foreach($order_types_madeups as $tt) { $table='sub_orders'; $where=array('id'=>$tt->id); $update_data=array('orders_Type'=>'MADEUPS'); $this->vendor_model->update_data($where,$table,$update_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"]; $RT = substr($uri, strpos($uri, "/") + 12);; $data['url_val']='1'; $data['val']='quality_check'; $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; //----------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($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['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']; $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']; $data['usertype']=$id['usertype']; //$data['designation'] = $id['designation']; $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['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/quality_check_grid', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function index_old() { $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); $data['url_val']='1'; $data['val']='request/sample_request_form?prop_id=1'; $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; //----------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['articles'] = $this->marketing_model->display_article_data(); $data['quality'] = $this->marketing_model->display_article_data(); $data['designdata'] = $this->marketing_model->display_design_data(); $data['product'] = $this->request_model->fetch_data(); $table='sample_request'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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('quality_check/quality_check_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function preview1(){ $as=$this->input->get('id'); $table = 'color/quality_approval'; $wh=array('id'=>$as); $pre = $this->marketing_model->getmax_id1($table,$wh); $data['ram']=$pre; $this->load->view('quality_check/preview',$data); } public function insert() { $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); $data['url_val']='1'; $data['val']='request/sample_request_form?prop_id=1'; $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; //----------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['articles'] = $this->marketing_model->display_article_data(); $data['out_article'] = $this->request_model->display_product_data(); $data['oslnos'] = $this->marketing_model->display_oslnos_data(); $data['polist'] = $this->marketing_model->display_po_data(); $data['quality'] = $this->marketing_model->display_article_data(); $data['designdata'] = $this->marketing_model->display_design_data(); $data['product'] = $this->request_model->fetch_data(); $data['users'] = $this->marketing_model->display_user_data(); //print_r($data['users']); //die(); $data['product'] = $this->request_model->fetch_data(); $table='sample_request'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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); $table = 'color/quality_approval'; $maxid = $this->marketing_model->getmax_id($table); $data['insert_id'] = $maxid + 1; //echo $data['insert_id']; //die(); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/insert',$data); $this->load->view('templates/footer_inside'); // } // else // { // $this->session->sess_destroy(); // redirect(base_url()); // } } public function update_quality_data() { $casenum = $this->input->post('casenum'); $product_type = $this->input->post('product_type'); $oslNo = $this->input->post('oslNo'); $poNo = $this->input->post('poNo'); $article = $this->input->post('article'); $shade = $this->input->post('shade'); $from_user = $this->input->post('from_user'); $to_user = $this->input->post('to_user'); $requiredDate = $this->input->post('requiredDate'); $remarks = $this->input->post('remarks'); $newDate = date("Y-m-d", strtotime($requiredDate)); $d = date('d/m/Y'); $table = 'color/quality_approval'; $wh=array('case_no'=>$casenum); $maxid = $this->marketing_model->getmax_id1($table,$wh); if($maxid == substr($casenum,0,1)){ echo json_encode('Something Went wrong... Please try Again...'); }else if(strlen($oslNo)==0){ $data = array('case_no'=>$casenum, 'product'=>$product_type, 'order_no'=>$poNo, 'article'=>$article, 'shade'=>$shade, 'from'=>$from_user, 'to'=>$to_user, 'required_before'=>$newDate, 'remarks'=>$remarks, 'created_at'=>$d ); } else{ $data = array('case_no'=>$casenum, 'product'=>$product_type, 'order_no'=>$oslNo, 'article'=>$article, 'shade'=>$shade, 'from'=>$from_user, 'to'=>$to_user, 'required_before'=>$newDate, 'remarks'=>$remarks, 'created_at'=>$d ); $cusinsert = $this->marketing_model->quality_update($table,$data,$wh); echo json_encode('Updated Successfully'); } } public function insert_quality_data() { $casenum = $this->input->post('casenum'); $product_type = $this->input->post('product_type'); $oslNo = $this->input->post('oslNo'); $poNo = $this->input->post('poNo'); $article = $this->input->post('article'); $shade = $this->input->post('shade'); $from_user = $this->input->post('from_user'); $to_user = $this->input->post('to_user'); $requiredDate = $this->input->post('requiredDate'); $remarks = $this->input->post('remarks'); $newDate = date("Y-m-d", strtotime($requiredDate)); $d = date('d/m/Y'); $table = 'color/quality_approval'; $maxid = $this->marketing_model->getmax_id($table); if($maxid == substr($casenum,0,1)){ echo json_encode('Something Went wrong... Please try Again...'); } else if(strlen($oslNo)==0){ $data = array('case_no'=>$casenum, 'product'=>$product_type, 'order_no'=>$poNo, 'article'=>$article, 'shade'=>$shade, 'from'=>$from_user, 'to'=>$to_user, 'required_before'=>$newDate, 'remarks'=>$remarks, 'created_at'=>$d ); } else{ $data = array('case_no'=>$casenum, 'product'=>$product_type, 'order_no'=>$oslNo, 'article'=>$article, 'shade'=>$shade, 'from'=>$from_user, 'to'=>$to_user, 'required_before'=>$newDate, 'remarks'=>$remarks, 'created_at'=>$d, ); $cusinsert = $this->marketing_model->insert($table,$data); echo json_encode('Added Successfully'); } } public function pending_list_details() { $table='color/quality_approval'; $where = array('status'=>'1'); $pendingDetails = $this->marketing_model->fetch_where_data_edit1($table,$where); echo json_encode($pendingDetails); } public function approve_list_details() { $table='color/quality_approval'; $where=array('status'=>'2'); $pendingDetails = $this->marketing_model->fetch_where_data_edit1($table,$where); echo json_encode($pendingDetails); } public function reject_list_details() { $table='color/quality_approval'; $where=array('status'=>'0'); $pendingDetails = $this->marketing_model->fetch_where_data_edit1($table,$where); echo json_encode($pendingDetails); } public function approve_assignment() { $rowid = $this->input->post('as'); $d=$this->input->post('date'); $table='color/quality_approval'; $where = array('id'=>$rowid); $id=$this->session->userdata('logged_in'); $approved_by =$id['username']; $data = array('status'=>'2','approved_date'=>$d,'approve_by'=>$approved_by); $status_val = $this->marketing_model->update_data($where,$table,$data); echo json_encode($status_val); } public function reject_assignment() { $rowid = $this->input->post('as'); $d=$this->input->post('date'); // print_r($d); // die(); $table='color/quality_approval'; $where = array('id'=>$rowid); $data = array('status'=>'0','rejected_date'=>$d); $status_val = $this->marketing_model->update_data($where,$table,$data); echo json_encode($status_val); } public function delete_customer_product() { $rowid = $this->input->post('as'); $table='product_details'; $where = array('id'=>$rowid); $data = array('delete_status'=>'-1'); $status_val = $this->marketing_model->update_data($where,$table,$data); echo json_encode($status_val); } public function delete_assignment() { $rowid = $this->input->post('as'); $table='color/quality_approval'; $where = array('id'=>$rowid); $data = array('status'=>'-1'); $status_val = $this->marketing_model->update_data($where,$table,$data); echo json_encode($status_val); } public function subgrid() { $id = $this->uri->segment(3); $table='color/quality_approval'; $where=array('id'=>$id); $pendingDetails = $this->marketing_model->fetch_where_data_edit1($table,$where); echo json_encode($pendingDetails); } 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 edit_quality_check() { $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); $data['url_val']='1'; $data['val']='request/sample_request_form?prop_id=1'; $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; //----------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['articles'] = $this->marketing_model->display_article_data(); $data['out_article'] = $this->request_model->display_product_data(); $data['oslnos'] = $this->marketing_model->display_oslnos_data(); $data['polist'] = $this->marketing_model->display_po_data(); $data['quality'] = $this->marketing_model->display_article_data(); $data['designdata'] = $this->marketing_model->display_design_data(); $data['product'] = $this->request_model->fetch_data(); $data['users'] = $this->marketing_model->display_user_data(); //print_r($data['users']); //die(); $data['product'] = $this->request_model->fetch_data(); $table='sample_request'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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); // $table = 'color/quality_approval'; // $maxid = $this->marketing_model->getmax_id($table); // $data['insert_id'] = $maxid + 1; // //echo $data['insert_id']; // //die(); // $this->load->view('templates/header_inside',$data); // $this->load->view('quality_check/insert',$data); // $this->load->view('templates/footer_inside'); $id = $this->input->get('id'); $wh = array('id'=>$id); $table = 'color/quality_approval'; $maxid = $this->marketing_model->getmax_id1($table,$wh); $data['ram'] = $maxid; $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function fetch_dtl() { $query1=$this->marketing_model->fetchdtl(); echo json_encode($query1); } // #2 SubQueries no.2 ------------------------------------------- public function fetch_po_no(){ $type = $this->uri->segment(3); if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } if($type == 'Fabric'){ $product_type = 'Fabrics'; } else{ $product_type = 'Yarn - Dyed'; } $where=array('confirm'=>'Yes','financ_year'=>$financial_year,'product_type'=>$product_type); $this->db->select('po_no,id'); $this->db->from('indent_po'); $this->db->where($where); $this->db->group_by('po_no','indent_no','vendor_name','g_date','currency','confirm','approved_by','remark'); $this->db->order_by('id','DESC'); $query2= $this->db->get()->result(); echo json_encode($query2); } public function product() { $i=$this->input->post('m'); $table = 'workorder_dyeing_material'; $where = array('id'=>$i); $indent = $this->outsource_model->fetch_where_subgrid_data($table,$where); $data1=$indent->work_order_no; // print_r($data1); // die(); $table = 'workorder_dyeing_material'; $where = array('work_order_no'=>$data1,'status'=>'0'); $getalldata = $this->marketing_model->fetch_where_subgrid_data4($table,$where); echo json_encode($getalldata); } public function product_type1(){ $i=$this->input->post('m'); $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $financ_year=$indent->financ_year; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','financ_year'=>$financ_year); $confirm='Yes'; //$getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $getalldata = $this->marketing_model->fetch_where_subgrid_data2($data1,$financ_year,$confirm); echo json_encode($getalldata); } public function product_type2(){ $i=$this->input->post('m'); $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $financ_year=$indent->financ_year; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','financ_year'=>$financ_year); $confirm='Yes'; //$getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $getalldata = $this->marketing_model->fetch_where_subgrid_data2($data1,$financ_year,$confirm); echo json_encode($getalldata); } public function fetch_poNo_yarn(){ // die(); $table = 'indent_po'; $confirm='Yes'; //$getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $getalldata = $this->marketing_model->get_po($confirm); echo json_encode($getalldata); } public function get_shade(){ $i = $this->input->post('m'); $table = 'sub_order_shades'; $where = array('shadeID'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($indent); } public function fetch_dtl_yarn() { $table='workorder_dyeing_material'; $where=array('status'=>0); $detail=$this->marketing_model->get_work_order_data4($table,$where); echo json_encode($detail); } public function fetch_usertype(){ $id=$this->input->post('as'); $mo=$this->marketing_model->fetch_usertype($id); $det=$this->marketing_model->fetch_kids($mo); echo json_encode($det); } public function pending_yarn_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='indent_po'; $where=array('product_type'=>'Yarn - Raw'); $detail = $this->vendor_model->get_purchase_data_raw1($table,$where); $data['yarn_raw']= count($detail); $table='indent_po'; $where=array('product_type'=>'Yarn - Twisted'); $detail1=$this->vendor_model->get_purchase_data_twist1($table,$where); $data['yarn_twisted']= count($detail1); $table='indent_po'; $where=array('product_type'=>'Yarn - Dyed'); $detail2=$this->vendor_model->get_purchase_data_dyed1($table,$where); $data['yarn_dyed']= count($detail2); $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);; $data['url_val']='1'; $data['val']='quality_check/pending_yarn_stock'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); 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('quality_check/yarn_pending'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function pending_dyeing_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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(); $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);; $data['url_val']='1'; $data['val']='quality_check/pending_dyeing_stock'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/dyeing_pending'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function deying_deliveryconfirmation_histroy_grid_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); $detail=$this->marketing_model->history_desc_dyeing_grid_data(); // print_r($detail); // die(); echo json_encode($detail); } public function stat_updt(){ $id=$this->input->post("id"); $status=$this->input->post("status"); $input=array("work_order_dyeing.status"=>$status); // $where=array('id'=>$id); // $hh==$this->marketing_model->updt_isstat($id); $where=$this->marketing_model->fetch_issueno($id); $detail=$this->vendor_model->updt_statwo($input,$where); echo json_encode($detail); } public function pending_fabric_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/pending_fabric_details'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/fabric_pending'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function fabric22() { $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 = 'indent_po'; $where = array('indent_po.confirm'=>'Yes','indent_po.product_type'=>'Fabrics'); $getalldata = $this->marketing_model->get_issue_purchase_table_data_grid_fabric_new($table,$where); //$getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data_fabric($data1,$financ_year); // print_r($getalldata); // die(); echo json_encode($getalldata); } public function stat_updatfab(){ $id=$this->input->post("id"); $status=$this->input->post("status"); $input=array("indent_po.quantity_approval"=>$status); $where=array('id'=>$id); // $where=$this->marketing_model->fetch_issueno($id); $detail=$this->vendor_model->updt_stat($input,$where); echo json_encode($detail); } public function fabric_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $financ_year=$data['po_details']->financ_year; $wheres=array('po_id'=>$val1,'financ_year'=>$financ_year); $tables='indent_po'; $data['po_detailss']=$this->store_model->getproduct_data_fetch($tables,$wheres); $wheress=array('id'=>$val,'financ_year'=>$financ_year); $data_r=$this->store_model->fetch_where_subgrid_data($table,$wheress); //$where=array('po_id'=>$data_r->po_id,'po_no'=>$data_r->po_no,'indent_no'=>$data_r->indent_no); $where=array('po_id'=>$data_r->po_id,'po_no'=>$data_r->po_no); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { echo 'No po_id available'; } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id,'po_no'=>$goods_id->po_no); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $data['goods_details_rec_goods']=$this->store_model->count_get_data_fetch($table,$where); $data['goods_details_rec_wt_goods']=$this->store_model->count_get_rec_data_fetch($table,$where); $where=array('po_id'=>$po_id); $table='indent_goods_details'; //$data['goods_count_details']=$this->store_model->count_get_data_fetch($table,$where); $data['goods_count_details']=$this->store_model->count_get_data_fetch_new($table,$where); $table1='indent_po'; $where1=array('id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); // $data['recwt']=$this->marketing_model->fetch_recwt($val); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->fetch_fabric_new_data($val1,$financ_year); } $data['back_fun']='grn_p'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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('quality_check/goods_recived',$data); $this->load->view('templates/footer_inside'); } public function pending_order_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/pending_order_details'; $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; //----------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(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $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('quality_check/pending_order_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function add_indent_grid(){ $table='indent_add_indent'; $where=array('po_generated'=>0,'confirm'=>'Yes'); $data=$this->marketing_model->get_data_sl_fetch($table,$where); echo json_encode($data); } public function twisting_pending_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/twisting_pending_details'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/twisting_pending'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function deliveryconfirmation_grid_details() { $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'); $table='create_yarntwisting_work_order'; $where=array('status'=>0); $detail=$this->marketing_model->get_des_data_fetch1(); // $detail=$this->outsource_model->get_des_data_fetch($table,$where); echo json_encode($detail); } public function stat_updattwist(){ $id=$this->input->post("id"); $status=$this->input->post("status"); $input=array("quantity_approval"=>$status); $where=array('id'=>$id); // $where=$this->marketing_model->fetch_issueno($id); $detail=$this->marketing_model->updt_stat($input,$where); echo json_encode($detail); } public function pending_weaved_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/pending_weaved_details'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/pending_woven_fabric'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function history_weaving_fabric_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='weaving_panel_planning_order'; // $where=array('status'=>'Waiting for Yarn' || 'Received Yarn'); $detail=$this->marketing_model->get_work_fabric_history_order_data($table); echo json_encode($detail); } public function stat_updatweaven(){ $id=$this->input->post("id"); $status=$this->input->post("status"); $input=array("fabric_details"=>$status); $where=array('id'=>$id); // $where=$this->marketing_model->fetch_issueno($id); $detail=$this->marketing_model->updt_stat22($input,$where); echo json_encode($detail); } public function fabric_size_master() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/fabric_size_master'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/fabric_size_master'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function madeups_size_master() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/madeups_size_master'; $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; //----------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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/madeups_size_master'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function fabric_received_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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); $data['url_val']='1'; $data['val']='quality_check/fabric_received_details'; $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; //----------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($result->reference_url == $data['val']) // { // $check=$data['val']; // } // } // // print_r($check); // // die(); // //-----tiill-------------------- // if($check != "") // { $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); $data['users'] = $this->marketing_model->display_user_data(); $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('quality_check/fabric_received_details'); $this->load->view('templates/footer_inside'); // } // else // { // $this->session->sess_destroy(); // redirect(base_url()); // } } public function get_scale_vaue(){ $product_type = $this->input->post('product_type'); $type = $this->input->post('type'); $table='product_master'; $where=array('type'=>$type,'fabricType'=>$product_type); $p_details = $this->vendor_model->get_customerdata($table,$where); if($p_details->sides){ echo $p_details->sides; } else{ echo '0'; } } public function madeups_received_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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);; $data['url_val']='1'; $data['val']='quality_check/madeups_size_master'; $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; //----------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($result->reference_url == $data['val']) // { // $check=$data['val']; // } // } // // print_r($check); // // die(); // //-----tiill-------------------- // if($check != "") // { $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); $data['users'] = $this->marketing_model->display_user_data(); $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('quality_check/madeups_received_details'); $this->load->view('templates/footer_inside'); // } // else // { // $this->session->sess_destroy(); // redirect(base_url()); // } } public function fab_type(){ $getalldata=$this->marketing_model->from_master(); echo json_encode($getalldata); } public function madeups_type(){ $getalldata=$this->marketing_model->madeups_master(); echo json_encode($getalldata); } public function insert_masterfab_data(){ $product_type = $this->input->post('product_type'); $size = $this->input->post('size'); $scale = $this->input->post('scale'); $sq_mtrs = $this->input->post('sq_mtrs'); $created_by = $this->input->post('created_by'); $created_at = date('d/m/Y'); $table='fabric_size_master'; $data=array('product_type'=>$product_type, 'size'=>$size, 'scale'=>$scale, 'sq_mtrs'=>$sq_mtrs, 'created_by'=>$created_by, 'created_at'=>$created_at ); $cusinsert = $this->marketing_model->insert($table,$data); echo json_encode('Added Successfully'); } public function insert_mastermadeups_data(){ $product_type = $this->input->post('product_type'); $size = $this->input->post('size'); $scale = $this->input->post('scale'); $sq_mtrs = $this->input->post('sq_mtrs'); $created_by = $this->input->post('created_by'); $created_at = date('d/m/Y'); $table='madeups_size_master'; $data=array('product_type'=>$product_type, 'size'=>$size, 'scale'=>$scale, 'sq_mtrs'=>$sq_mtrs, 'created_by'=>$created_by, 'created_at'=>$created_at ); $cusinsert = $this->marketing_model->insert($table,$data); echo json_encode('Added Successfully'); } public function get_fab_mas(){ $getalldata=$this->marketing_model->from_fabmaster(); echo json_encode($getalldata); } public function get_madeups_mas(){ $getalldata=$this->marketing_model->from_madeupsmaster(); echo json_encode($getalldata); } public function update_madeups_data(){ $id=$this->input->post('id'); $product_type=$this->input->post('product_type'); $size=$this->input->post('size'); $scale=$this->input->post('scale'); $sq_mtrs=$this->input->post('sq_mtrs'); $where=array('id'=> $id); $data= array('product_type'=>$product_type, 'size'=>$size, 'scale'=>$scale, 'sq_mtrs'=>$sq_mtrs); $table='madeups_size_master'; $this->outsource_model->update_data($where,$table,$data); } public function update_fab_data(){ $id=$this->input->post('id'); $product_type=$this->input->post('product_type'); $size=$this->input->post('size'); $scale=$this->input->post('scale'); $sq_mtrs = $this->input->post('sq_mtrs'); $where=array('id'=> $id); $data= array('product_type'=>$product_type, 'size'=>$size, 'scale'=>$scale, 'sq_mtrs'=>$sq_mtrs); $table='fabric_size_master'; $this->outsource_model->update_data($where,$table,$data); } public function madeups_delete(){ $id=$this->input->post('as'); $where=array('id'=>$id); $table='madeups_size_master'; $this->marketing_model->delete($table,$where); } public function fab_delete(){ $id=$this->input->post('as'); $where=array('id'=>$id); $table='fabric_size_master'; $this->marketing_model->delete($table,$where); } public function edit_fabric(){ $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; $data['users'] = $this->marketing_model->display_user_data(); //----------tiill-------------------- $data['url_val']='1'; $data['val']='quality_check'; $data['ref']='indent'; $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(); $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(); $id = $this->input->get('id'); $type=$this->uri->segment(3); $where = array('id'=>$id); $table='fabric_size_master'; $data['ram']= $this->marketing_model->fetch($where,$table); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit',$data); $this->load->view('templates/footer_inside'); } public function edit_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"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; $data['users'] = $this->marketing_model->display_user_data(); //----------tiill-------------------- $data['url_val']='1'; $data['val']='quality_check'; $data['ref']='indent'; $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(); $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(); $id = $this->input->get('id'); $type=$this->uri->segment(3); $where = array('id'=>$id); $table='madeups_size_master'; $data['ram']= $this->marketing_model->fetch($where,$table); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit_madeups',$data); $this->load->view('templates/footer_inside'); } public function customer_product_details11($orderID='') { $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); // $orderID=$this->db->get('as'); $where1=array('id'=>$orderID); $table1='customer_master'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; $data['users'] = $this->marketing_model->display_user_data(); //----------tiill-------------------- $data['url_val']='1'; $data['val']='marketing/customer_master_details'; $data['ref']='indent'; $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($result->reference_url == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); //-----tiill-------------------- if($check != "") { $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['access_roww']=$arr; } } } } $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $data['outsource'] = $this->request_model->display_product_data(); $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('quality_check/customer_master_details', $data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function fetch_inserted(){ $id=$this->uri->segment(3); $where=array('customer_id'=>$id,'delete_status'=>'0'); $data=$this->marketing_model->fetch_details66($where); echo json_encode($data); } public function customer_details88(){ $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); $orderID=$this->uri->segment(3); if($orderID=='') { $orderID=$this->input->get('id'); } $where1=array('id'=>$orderID); $table1='customer_master'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); // print_r($data['result']); // die(); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $table3='fabric_product_details'; $where3=array('customer_id'=>$orderID); $data['know'] = $this->marketing_model->tooooto($table3,$where3); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $data['outsource'] = $this->request_model->display_product_data(); $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); $table5='indent_product'; $where5=array('product_type'=>'Consumables'); $data['getalldata1'] = $this->marketing_model->get_data($table5,$where5); $table6='product_category'; $where6=array('product_type'=>'Fabric'); $data['product_category'] = $this->marketing_model->get_data($table6,$where6); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/customer_details88', $data); $this->load->view('templates/footer_inside'); } public function size_type(){ $table='fabric_size_master'; $data=$this->marketing_model->fetch_width($table); echo json_encode($data); } public function madeups_details88(){ $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); $orderID=$this->uri->segment(3); if($orderID=='') { $orderID=$this->input->get('id'); } $where1=array('id'=>$orderID); $table1='customer_master'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $table3='madeups_product_details'; $where3=array('customer_id'=>$orderID); $data['know'] = $this->marketing_model->tooooto($table3,$where3); $data['outsource'] = $this->request_model->display_product_data(); $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); $table2='indent_product'; $where2=array('product_type'=>'Consumables'); $table6='product_category'; $where6=array('id >='=>'1','product_type'=>'Madeups'); $data['product_category'] = $this->marketing_model->get_data($table6,$where6); $data['getalldata1'] = $this->marketing_model->get_data($table2,$where2); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/madeups_details88', $data); $this->load->view('templates/footer_inside'); } public function msize_type(){ $table='madeups_size_master'; $data=$this->marketing_model->fetch_width($table); echo json_encode($data); } public function box_master(){ $table='box_master'; $data=$this->marketing_model->fetch_width($table); echo json_encode($data); } public function update_product_details(){ $rand=$this->input->post("rand"); $id=$this->input->post("id"); $customer_id=$this->input->post('customer_id'); $product=$this->input->post('product'); $subOrderType=$this->input->post('subOrderType'); $unit=$this->input->post('unit'); $articleNo=$this->input->post('articleNo'); $weave=$this->input->post('weave'); $design=$this->input->post('design'); $description=$this->input->post('description'); $custom_description=$this->input->post('custom_description'); $paymentTerms=$this->input->post('paymentTerms'); $contractType=$this->input->post('contractType'); $currencyName=$this->input->post('currencyName'); $width=$this->input->post('width'); $unit_price=$this->input->post('unit_price'); $quality=$this->input->post('quality'); $ourshade=$this->input->post('ourshade'); $from1=$this->input->post('price_valid_from'); $from2=$this->input->post('price_valid_until'); $price_valid_from=date('Y-m-d',strtotime($from1)); $price_valid_until=date('Y-m-d',strtotime($from2)); $hsn_code=$this->input->post('hsn_code'); $composition=$this->input->post('composition'); $customs_declaration=$this->input->post('customs_declaration'); $p_category=$this->input->post('p_category'); $hs_code=$this->input->post('hs_code'); $dbk_si=$this->input->post('dbk_si'); $data=array('orderType'=>$subOrderType,'production'=>$product,'width'=>$width,'articleNo'=>$articleNo,'design'=>$design, 'description'=>$description,'custom_description'=>$custom_description,'unit'=>$unit,'unitPrice'=>$unit_price,'currency'=>$currencyName,'quality'=>$quality, 'contractType'=>$contractType,'paymentTerms'=>$paymentTerms,'price_valid_from'=>$price_valid_from,'price_valid_until'=>$price_valid_until, 'customer_id'=>$customer_id,'weave'=>$weave,'piececase'=>$ourshade,'rand'=>$rand,'hsn_code'=>$hsn_code,'composition'=>$composition, 'customs_declaration'=>$customs_declaration,'p_category'=>$p_category,'hs_code'=>$hs_code,'dbk_si'=>$dbk_si); $table='product_details'; $where3=array('id'=>$id,'rand'=>$rand,'customer_id'=>$customer_id); $detail=$this->marketing_model->updated99($table,$data,$where3); //print_r($this->db->last_query()); $where=array('rand'=>$rand); $id=$this->marketing_model->fetch_id($table,$where); $table2='fabric_product_details'; $where2=array('rand_id'=>$rand); $info=array('product_id'=>$id); $mattu=$this->marketing_model->update_pro($table2,$where2,$info); //print_r($this->db->last_query()); echo json_encode($detail); } public function insert_product_details(){ $rand=$this->input->post("rand"); $customer_id=$this->input->post('customer_id'); $product=$this->input->post('product'); $subOrderType=$this->input->post('subOrderType'); $unit=$this->input->post('unit'); $articleNo=$this->input->post('articleNo'); $weave=$this->input->post('weave'); $design=$this->input->post('design'); $description=$this->input->post('description'); $custom_description = $this->input->post('custom_description'); $paymentTerms=$this->input->post('paymentTerms'); $contractType=$this->input->post('contractType'); $currencyName=$this->input->post('currencyName'); $width=$this->input->post('width'); $unit_price=$this->input->post('unit_price'); $quality=$this->input->post('quality'); $ourshade=$this->input->post('ourshade'); $from1=$this->input->post('price_valid_from'); $from2=$this->input->post('price_valid_until'); $price_valid_from=date('Y-m-d',strtotime($from1)); $price_valid_until=date('Y-m-d',strtotime($from2)); $hsn_code=$this->input->post('hsn_code'); $composition=$this->input->post('composition'); $customs_declaration=$this->input->post('customs_declaration'); $p_category=$this->input->post('p_category'); $hs_code=$this->input->post('hs_code'); $dbk_si=$this->input->post('dbk_si'); $data=array('orderType'=>$subOrderType,'production'=>$product,'width'=>$width,'articleNo'=>$articleNo,'design'=>$design, 'description'=>$description,'custom_description'=>$custom_description,'unit'=>$unit,'unitPrice'=>$unit_price,'currency'=>$currencyName,'quality'=>$quality, 'contractType'=>$contractType,'paymentTerms'=>$paymentTerms,'price_valid_from'=>$price_valid_from,'price_valid_until'=>$price_valid_until, 'customer_id'=>$customer_id,'weave'=>$weave,'piececase'=>$ourshade,'rand'=>$rand,'hsn_code'=>$hsn_code,'composition'=>$composition, 'customs_declaration'=>$customs_declaration,'p_category'=>$p_category,'hs_code'=>$hs_code,'dbk_si'=>$dbk_si); $table='product_details'; $detail=$this->marketing_model->inserted99($table,$data); $where=array('rand'=>$rand); $id=$this->marketing_model->fetch_id($table,$where); $table2='fabric_product_details'; $where2=array('rand_id'=>$rand); $info=array('product_id'=>$id); $mattu=$this->marketing_model->update_pro($table2,$where2,$info); echo json_encode($detail); } public function insert_product_details_madeup(){ $rand=$this->input->post("rand"); $customer_id=$this->input->post('customer_id'); $product=$this->input->post('product'); $subOrderType=$this->input->post('subOrderType'); $unit=$this->input->post('unit'); $articleNo=$this->input->post('articleNo'); $weave=$this->input->post('weave'); $design=$this->input->post('design'); $description=$this->input->post('description'); $custom_description=$this->input->post('custom_description'); $paymentTerms=$this->input->post('paymentTerms'); $contractType=$this->input->post('contractType'); $currencyName=$this->input->post('currencyName'); $width=$this->input->post('width'); $unit_price=$this->input->post('unit_price'); $quality=$this->input->post('quality'); $ourshade=$this->input->post('ourshade'); $from1=$this->input->post('price_valid_from'); $from2=$this->input->post('price_valid_until'); $price_valid_from=date('Y-m-d',strtotime($from1)); $price_valid_until=date('Y-m-d',strtotime($from2)); $net_wt=$this->input->post('net_wt'); $gross_wt=$this->input->post('gross_wt'); $box_dimen=$this->input->post('box_dimen'); $hsn_code=$this->input->post('hsn_code'); $composition=$this->input->post('composition'); $customs_declaration=$this->input->post('customs_declaration'); $p_category=$this->input->post('p_category'); $hs_code=$this->input->post('hs_code'); $dbk_si=$this->input->post('dbk_si'); $data=array('orderType'=>$subOrderType,'production'=>$product,'width'=>$width,'articleNo'=>$articleNo,'design'=>$design, 'description'=>$description,'custom_description'=>$custom_description,'unit'=>$unit,'unitPrice'=>$unit_price,'currency'=>$currencyName,'quality'=>$quality, 'contractType'=>$contractType,'paymentTerms'=>$paymentTerms,'price_valid_from'=>$price_valid_from,'price_valid_until'=>$price_valid_until, 'customer_id'=>$customer_id,'weave'=>$weave,'piececase'=>$ourshade,'rand'=>$rand,'hsn_code'=>$hsn_code,'composition'=>$composition, 'customs_declaration'=>$customs_declaration,'net_wt'=>$net_wt,'gross_wt'=>$gross_wt,'box_dimention'=>$box_dimen,'p_category'=>$p_category,'hs_code'=>$hs_code,'dbk_si'=>$dbk_si); $table='product_details'; $data=$this->marketing_model->inserted99($table,$data); $where=array('rand'=>$rand); $id=$this->marketing_model->fetch_id($table,$where); $table2='madeups_product_details'; $where2=array('rand_id'=>$rand); $info=array('product_id'=>$id); $mattu=$this->marketing_model->update_pro($table2,$where2,$info); echo json_encode($data); } public function update_product_details_madeup(){ $rand=$this->input->post("rand"); $id=$this->input->post("id"); $customer_id=$this->input->post('customer_id'); $product=$this->input->post('product'); $subOrderType=$this->input->post('subOrderType'); $unit=$this->input->post('unit'); $articleNo=$this->input->post('articleNo'); $weave=$this->input->post('weave'); $design=$this->input->post('design'); $description=$this->input->post('description'); $custom_description=$this->input->post('custom_description'); $paymentTerms=$this->input->post('paymentTerms'); $contractType=$this->input->post('contractType'); $currencyName=$this->input->post('currencyName'); $width=$this->input->post('width'); $unit_price=$this->input->post('unit_price'); $quality=$this->input->post('quality'); $ourshade=$this->input->post('ourshade'); $from1=$this->input->post('price_valid_from'); $from2=$this->input->post('price_valid_until'); $price_valid_from=date('Y-m-d',strtotime($from1)); $price_valid_until=date('Y-m-d',strtotime($from2)); $net_wt=$this->input->post('net_wt'); $gross_wt=$this->input->post('gross_wt'); $box_dimen=$this->input->post('box_dimen'); $hsn_code=$this->input->post('hsn_code'); $composition=$this->input->post('composition'); $customs_declaration=$this->input->post('customs_declaration'); $p_category=$this->input->post('p_category'); $hs_code=$this->input->post('hs_code'); $dbk_si=$this->input->post('dbk_si'); $data=array('orderType'=>$subOrderType,'production'=>$product,'width'=>$width,'articleNo'=>$articleNo,'design'=>$design, 'description'=>$description,'custom_description'=>$custom_description,'unit'=>$unit,'unitPrice'=>$unit_price,'currency'=>$currencyName,'quality'=>$quality, 'contractType'=>$contractType,'paymentTerms'=>$paymentTerms,'price_valid_from'=>$price_valid_from,'price_valid_until'=>$price_valid_until, 'customer_id'=>$customer_id,'weave'=>$weave,'piececase'=>$ourshade,'rand'=>$rand,'hsn_code'=>$hsn_code,'composition'=>$composition, 'customs_declaration'=>$customs_declaration,'net_wt'=>$net_wt,'gross_wt'=>$gross_wt,'box_dimention'=>$box_dimen,'p_category'=>$p_category,'hs_code'=>$hs_code,'dbk_si'=>$dbk_si); $table='product_details'; $where3=array('id'=>$id,'customer_id'=>$customer_id,'rand'=>$rand); $this->marketing_model->updated99($table,$data,$where3); $where=array('rand'=>$rand); $id=$this->marketing_model->fetch_id($table,$where); $table2='madeups_product_details'; $where2=array('rand_id'=>$rand); $info=array('product_id'=>$id); $mattu=$this->marketing_model->update_pro($table2,$where2,$info); echo json_encode($mattu); } public function insert_fabpro_details(){ $customer_id=$this->input->post('customer_id'); $rand = $this->input->post('rand'); $product=$this->input->post('product'); $product_type=$this->input->post('product_type'); $production=$this->input->post('production'); $unit=$this->input->post('unit'); $width=$this->input->post('width'); $rate=$this->input->post('rate'); $total=$this->input->post('total'); $weight = $this->input->post('weight'); $consumption=$this->input->post('consumption'); $features=$this->input->post('features'); $data=array('rand_id'=>$rand,'consumption'=>$consumption,'customer_id'=>$customer_id,'features'=>$features,'product_type'=>$product_type, 'production'=>$production,'width'=>$width,'unit'=>$unit,'rate'=>$rate,'product'=>$product,'total'=>$total,'weight'=>$weight); $table='fabric_product_details'; $detail=$this->marketing_model->inserted99($table,$data); $table1='fabric_product_details'; $where=array('rand_id'=>$rand,'customer_id'=>$customer_id); $table_data=$this->marketing_model->fetch_where_data_desc222($table,$where); echo json_encode($table_data); } public function getmaterial_list_details(){ $product_id=$this->input->post('product_id'); $table1='fabric_product_details'; $where=array('product_id'=>$product_id); $table_data=$this->marketing_model->fetch_where_data_desc222($table1,$where); echo json_encode($table_data); } public function getmaterial_madeups_details(){ $product_id=$this->input->post('product_id'); $table1='madeups_product_details'; $where=array('product_id'=>$product_id); $table_data=$this->marketing_model->fetch_where_data_desc22($table1,$where); echo json_encode($table_data); } public function insert_madeupspro_details(){ $customer_id=$this->input->post('customer_id'); $rand = $this->input->post('rand'); $product=$this->input->post('product'); $product_type=$this->input->post('product_type'); $production=$this->input->post('production'); $unit=$this->input->post('unit'); $width=$this->input->post('width'); $rate=$this->input->post('rate'); $total=$this->input->post('total'); $weight = $this->input->post('weight'); $consumption=$this->input->post('consumption'); $features=$this->input->post('features'); $data=array('rand_id'=>$rand,'consumption'=>$consumption,'customer_id'=>$customer_id,'weight'=>$weight,'features'=>$features,'product_type'=>$product_type,'production'=>$production,'width'=>$width, 'unit'=>$unit,'rate'=>$rate,'product'=>$product,'total'=>$total); $table='madeups_product_details'; $data=$this->marketing_model->inserted99($table,$data); $table1='madeups_product_details'; $where=array('rand_id'=>$rand,'customer_id'=>$customer_id); $table_data=$this->marketing_model->fetch_where_data_desc222($table,$where); echo json_encode($table_data); } public function delete_madeupspro_details(){ $row = $this->input->post('row'); $rand_id = $this->input->post('ran'); $where=array('id'=>$row,'rand_id'=>$rand_id); $table='madeups_product_details'; $update_status = $this->marketing_model->delete($table,$where); $table1='madeups_product_details'; $where1=array('rand_id'=>$rand_id); $table_data=$this->marketing_model->fetch_where_data_desc222($table1,$where1); echo json_encode($table_data); } public function delete_fabpro_details(){ $row = $this->input->post('row'); $rand_id = $this->input->post('ran'); $where=array('id'=>$row,'rand_id'=>$rand_id); $table='fabric_product_details'; $this->marketing_model->delete($table,$where); $table1='fabric_product_details'; $where1=array('rand_id'=>$rand_id); $table_data=$this->marketing_model->fetch_where_data_desc222($table1,$where1); echo json_encode($table_data); } public function madeups_box_master_grid_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); $table='madeups_box_master'; $where=array('status'=>0); $detail=$this->marketing_model->fetch_where_data_desc222($table,$where); echo json_encode($detail); } public function product_delete(){ $id=$this->input->post('as'); $where=array('id'=>$id); $table='product_details'; $this->marketing_model->delete($table,$where); } public function shade_delete(){ $id=$this->input->post('as'); //echo $id; //die(); $where = array('id'=>$id); $table='madeups_product_shades'; $this->marketing_model->delete($table,$where); } public function edit_shade_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); $orderID = $this->uri->segment(3); $data['product_id'] = $orderID; $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $data['material']=$this->marketing_model->fetch_materials_madeups($orderID); // print_r($data['material']); // die(); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $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']; $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); $shade_id = $this->uri->segment(3); $table='madeups_product_shades'; $where=array('id'=>$shade_id); $data['detail'] = $this->marketing_model->fetch_where_data_desc222($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit_shade_details', $data); $this->load->view('templates/footer_inside'); } public function edit_product_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); $orderID=$this->uri->segment(3); $data['ram']=$this->uri->segment(4); $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data_pro($orderID); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $data['outsource'] = $this->request_model->display_product_data(); $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); $data['orderID'] = $orderID; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table5='indent_product'; $where5=array('product_type'=>'Consumables'); $data['getalldatas'] = $this->marketing_model->get_data($table5,$where5); $table6='product_category'; $where6=array('id >='=>'1','product_type'=>'Fabric'); $data['product_category'] = $this->marketing_model->get_data($table6,$where6); $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); // print_r($data['getalldata']); // die(); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit_product_details', $data); $this->load->view('templates/footer_inside'); } public function update_product_addshades(){ $shade_id = $this->input->post("shade_id"); $product_id = $this->input->post("product_id"); $customer_id = $this->input->post('customer_id'); $price = $this->input->post('price'); $product = $this->input->post('product'); $our_shade = $this->input->post('our_shade'); $buyer_shade = $this->input->post('buyer_shade'); $buyer_product_name = $this->input->post('buyer_product_name'); $sku = $this->input->post('sku'); $vendor_item = $this->input->post('vendor_item'); $buyer_product_barcode = $this->input->post('buyer_product_barcode'); $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $date = $date->format('Y-m-d'); $data=array('product_id'=>$product_id, 'product' =>$product, 'price'=>$price, 'customer_id'=>$customer_id, 'our_shade'=>$our_shade, 'buyer_shade'=>$buyer_shade, 'buyer_product_name'=>$buyer_product_name, 'sku'=>$sku, 'vendor_item'=>$vendor_item, 'buyer_product_barcode'=>$buyer_product_barcode, 'created_at' =>$date ); $table='madeups_product_shades'; $where=array('id'=>$shade_id); $detail = $this->vendor_model->update_data($where,$table,$data); echo json_encode($detail); } public function subgrid_inserted(){ $id=$this->uri->segment(3); $where=array('id'=>$id); $table='product_details'; //$detail = $this->marketing_model->tooooto($table,$where); $detail = $this->marketing_model->subgrid_inserted_data($id); echo json_encode($detail); } public function yarn_details(){ $table='import_yarn'; $detail=$this->marketing_model->fetch_width($table); echo json_encode($detail); } public function inpro_details(){ $detail=$this->marketing_model->display_article_data(); echo json_encode($detail); } public function productrow() { $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); $type=$_REQUEST['id']; $productlist = $this->vendor_model->getproductrow($type); echo json_encode($productlist); } public function deying_reports() { $h=$this->uri->segment(3); $table4='orders'; $where4=array('id'=>$h); $data['dtl']=$this->marketing_model->getdtl($table4,$where4); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); $w="quality_check/deying_reports/$h"; if($w == $data['val']) { $check=$data['val']; } } // print_r($check); // die(); if($check != "") { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('quality_check/dyeing_report',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function grid_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); $dtl=$this->uri->segment(3); $where1=array('workorder_dyeing.osl_no'=>$dtl); $detail=$this->marketing_model->dyeing_grid_data($where1); echo json_encode($detail); } public function issued_to_loom() { $h=$this->uri->segment(3); $table4='orders'; $where4=array('id'=>$h); $data['dtl']=$this->marketing_model->getdtl($table4,$where4); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); $w="quality_check/issued_to_loom/$h"; if($w == $data['val']) { $check=$data['val']; } } if($check != "") { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('quality_check/issued_to_loom',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function details_fetch_issue_data() { $dtl=$this->uri->segment(3); $where1=array('weaving_panel_planning_order.osl_no'=>$dtl); $details=$this->marketing_model->issue_loom_details($where1); echo json_encode($details); } public function madeups_report() { $h=$this->uri->segment(3); $table4='orders'; $where4=array('id'=>$h); $data['dtl']=$this->marketing_model->getdtl($table4,$where4); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); $w="quality_check/madeups_report/$h"; if($w == $data['val']) { $check=$data['val']; } } if($check != "") { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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('quality_check/madeups_report',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function fetch_madeups() { $dtl=$this->uri->segment(3); $where1=array('o.oslNo'=>$dtl); // print_r($dtl); // die(); $details=$this->marketing_model->fetch_madeups_datahii($where1); echo json_encode($details); } public function inspected_fabric() { $h=$this->uri->segment(3); $table4='orders'; $where4=array('id'=>$h); $data['dtl']=$this->marketing_model->getdtl($table4,$where4); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); $w="quality_check/inspected_fabric/$h"; if($w == $data['val']) { $check=$data['val']; } } // print_r($w); // die(); if($check != "") { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $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); $table1='consumed_at'; $where1=array('status'=>1); $data['loc']=$this->marketing_model->fetch_where_data($table1,$where1); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/inspected_fabric',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function details_fetch_sys_date() { $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); $dtl=$this->uri->segment(3); $where1=array('fabric_inspection_details.po_no'=>$dtl); // print_r($where1); // die(); $details = $this->marketing_model->display_fabric_inspection_order_embroidryinspection_date($where1); echo json_encode($details); } public function edit_product_madeups_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); $orderID=$this->uri->segment(3); $data['ram']=$this->uri->segment(4); $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data_pro($orderID); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $data['outsource'] = $this->request_model->display_product_data(); $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); $data['orderID'] = $orderID; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table5='indent_product'; $where5=array('product_type'=>'Consumables'); $data['getalldatas'] = $this->marketing_model->get_data($table5,$where5); $table6='product_category'; $where6=array('id >='=>'1','product_type'=>'Madeups'); $data['product_category'] = $this->marketing_model->get_data($table6,$where6); $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); // print_r($data['getalldata']); // die(); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/edit_product_madeups', $data); $this->load->view('templates/footer_inside'); } public function fetch_profab_dtls(){ $id=$this->input->post('as'); $where=array('id'=>$id); $table='product_details'; $details=$this->marketing_model->fetch_fabpro_detls($table,$where); echo json_encode($details); } public function fetch_order_dtls(){ $id=$this->input->post('as'); $where=array('o.id'=>$id); $details=$this->marketing_model->orders_stat($where); echo json_encode($details); } public function add_payment_yes_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"); $currency=$this->input->post("currency"); $amount_received=$this->input->post("amount_received"); $bank_charged=$this->input->post("bank_charged"); $bank_realisation_rate=$this->input->post("bank_realisation_rate"); $inr_value=$this->input->post("inr_value"); $pay_ment_remark=$this->input->post("remark"); $customer_id=$this->input->post("customer_id"); // $invoice_date=$this->input->post("invoice_date"); $invoice_no=$this->input->post("invoice_no"); $received_date1=$this->input->post("received_date"); $received_date=date('Y-m-d'); $bank_reference=$this->input->post('bank_reference'); // $invoice_value=$this->input->post("invoice_value"); $invoice_value=number_format((float)$this->input->post("invoice_value"), 2, '.', ''); $remarks=''; $id=$this->session->userdata('logged_in'); $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $updated_at = $date->format('Y-m-d'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $data1=array('orderid'=>$id1,'customerid'=>$customer_id,'invoice_no'=>$invoice_no,'invoice_value'=>$invoice_value,'currency'=>$currency, 'received_date'=>$received_date,'amount_received'=>$amount_received,'bank_charged'=>$bank_charged,'bank_realisation_rate'=>$bank_realisation_rate, 'inr_value'=>$inr_value,'remark'=>$pay_ment_remark,'created_at'=>$updated_at,'bank_reference'=>$bank_reference,'approved_by'=>$approved_by, 'adv_pay_stat'=>1); $table='advance_payment_details'; $details = $this->marketing_model->insert($table,$data1); if($this->db->affected_rows()) { echo json_encode(array('result'=>1,'message'=>'Added successfully')); } else { echo json_encode(array('result'=>0,'message'=>'Something wrong....')); } } public function get_payment_details(){ $id1=$this->input->post("id"); $where=array('orderid'=>$id1); $table='advance_payment_details'; $details = $this->marketing_model->fetch_fabpro_detls($table,$where); if($details) { echo json_encode(array('result'=>1,'message'=>$details)); } else { echo json_encode(array('result'=>0,'message'=>"No data found")); } } public function add_pay_no_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=''; $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('orderid'=>$id1); $table1='advance_payment_details'; $details = $this->marketing_model->delete($table1,$where1); return true; } public function fabric_product_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); $orderID=$this->uri->segment(3); $data['material']=$this->marketing_model->fetch_materials($orderID); if($orderID=='') { $orderID=$this->input->get('id'); } $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $table3='madeups_product_details'; $where3=array('customer_id'=>$orderID); $data['know'] = $this->marketing_model->tooooto($table3,$where3); $data['outsource'] = $this->request_model->display_product_data(); $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); $table2='indent_product'; $where2=array('product_type'=>'Consumables'); $data['getalldata1'] = $this->marketing_model->get_data($table2,$where2); // $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/fabric_preview', $data); // $this->load->view('templates/footer_inside'); } public function madeups_product_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); $orderID=$this->uri->segment(3); if($orderID=='') { $orderID=$this->input->get('id'); } $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $data['material']=$this->marketing_model->fetch_materials_madeups($orderID); // print_r($data['material']); // die(); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $data['designdata'] = $this->marketing_model->display_design_data(); $data['orderTypes'] = $this->marketing_model->getOrderTypes(); $data['articles'] = $this->marketing_model->display_article_data(); $data['getalldata'] = $this->marketing_model->display_customer_data(); $table3='madeups_product_details'; $where3=array('customer_id'=>$orderID); $data['know'] = $this->marketing_model->tooooto($table3,$where3); $data['outsource'] = $this->request_model->display_product_data(); $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); $table2='indent_product'; $where2=array('product_type'=>'Consumables'); $data['getalldata1'] = $this->marketing_model->get_data($table2,$where2); // $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/madeups_preview', $data); // $this->load->view('templates/footer_inside'); } public function add_shades(){ $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); $orderID = $this->uri->segment(3); $data['product_id'] = $orderID; $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $data['material']=$this->marketing_model->fetch_materials_madeups($orderID); // print_r($data['material']); // die(); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $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); $table2='indent_product'; $where2=array('product_type'=>'Consumables'); $data['getalldata1'] = $this->marketing_model->get_data($table2,$where2); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/madeups_add_shades', $data); $this->load->view('templates/footer_inside'); } public function upload_shades(){ $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($_POST){ if($data['emp_details']->designation == ''){ $data['message'] = 'Invalid User'; } else{ $product_id = $this->input->post("product_id"); $customer_id = $this->input->post('customer_id'); $price = $this->input->post('price'); $product = $this->input->post('product'); $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $created_at = $date->format('Y-m-d H:i:s'); $exists = array(); date_default_timezone_set('Asia/Kolkata'); include 'PHPExcel/IOFactory.php'; if(isset($_FILES['excel_format']['name'])) { $file_name = $_FILES['excel_format']['name']; $ext = pathinfo($file_name, PATHINFO_EXTENSION); if($ext == "xlsx" || $ext == "xls") { $file_name = $_FILES['excel_format']['tmp_name']; $inputFileName = $file_name; //print_r($inputFileName);die(); try { $inputFileType = PHPExcel_IOFactory::identify($inputFileName); $objReader = PHPExcel_IOFactory::createReader($inputFileType); $objPHPExcel = $objReader->load($inputFileName); } catch (Exception $e) { die('Error loading file "' . pathinfo($inputFileName, PATHINFO_BASENAME) . '": ' . $e->getMessage()); } $sheet = $objPHPExcel->getSheet(0); $highestRow = $sheet->getHighestRow(); $highestColumn = $sheet->getHighestColumn(); $allDataInSheet = $objPHPExcel->getActiveSheet()->toArray(null,true,true,true); $arrayCount = count($allDataInSheet); if(count($allDataInSheet) > 0){ for($i=2;$i<=$arrayCount;$i++) { $our_shade = trim($allDataInSheet[$i]["A"]); $buyer_shade = trim($allDataInSheet[$i]["B"]); $buyer_product_name = trim($allDataInSheet[$i]["C"]); $sku = trim($allDataInSheet[$i]["D"]); $buyer_product_barcode = trim($allDataInSheet[$i]["E"]); $data=array('product_id'=>$product_id, 'product' =>$product, 'price'=>$price, 'customer_id'=>$customer_id, 'our_shade'=>$our_shade, 'buyer_shade'=>$buyer_shade, 'buyer_product_name'=>$buyer_product_name, 'sku'=>$sku, 'buyer_product_barcode'=>$buyer_product_barcode, 'created_by' =>$emp_row, 'created_at' =>$created_at ); $table='madeups_product_shades'; $detail=$this->marketing_model->inserted99($table,$data); } $data['message'] = 'Shades are Uploaded sucessfully...'; } else{ $data['message'] = 'No Data Found'; } } else{ $data['message'] = 'Please upload file with xls extension only'; } } else { $data['message'] = 'Please upload file with xls extension only'; } } $orderID = $this->input->post("product_id"); } else{ $orderID = $this->uri->segment(3); $data['message'] = 'Please upload file with xls extension only'; } //$orderID = $this->uri->segment(3); $data['product_id'] = $orderID; $where1=array('id'=>$orderID); $table1='product_details'; $data['result']=$this->marketing_model->fetch_main_data($table1,$where1); $data['material']=$this->marketing_model->fetch_materials_madeups($orderID); // print_r($data['material']); // die(); $table2='purchase_master'; $data['product_type']=$this->marketing_model->fetch_width($table2); $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); $table2='indent_product'; $where2=array('product_type'=>'Consumables'); $data['getalldata1'] = $this->marketing_model->get_data($table2,$where2); $this->load->view('templates/header_inside',$data); $this->load->view('quality_check/madeups_upload_shades', $data); $this->load->view('templates/footer_inside'); } public function insert_product_addshades(){ //print_r($_POST); // 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); $product_id = $this->input->post("product_id"); $customer_id = $this->input->post('customer_id'); $price = $this->input->post('price'); $product = $this->input->post('product'); $our_shade = $this->input->post('our_shade'); $buyer_shade = $this->input->post('buyer_shade'); $buyer_product_name = $this->input->post('buyer_product_name'); $vendor_item = $this->input->post('vendor_item'); $sku = $this->input->post('sku'); $buyer_product_barcode = $this->input->post('buyer_product_barcode'); $date = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $date = $date->format('Y-m-d'); $data=array('product_id'=>$product_id, 'product' =>$product, 'price'=>$price, 'customer_id'=>$customer_id, 'our_shade'=>$our_shade, 'buyer_shade'=>$buyer_shade, 'buyer_product_name'=>$buyer_product_name, 'sku'=>$sku, 'buyer_product_barcode'=>$buyer_product_barcode, 'created_by' =>$emp_row, 'vendor_item'=>$vendor_item, 'created_at' =>$date ); $table='madeups_product_shades'; $detail=$this->marketing_model->inserted99($table,$data); echo json_encode($detail); } } ?>