EVOLUTION-NINJA
Edit File: Billing.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Billing extends CI_Controller { public function __construct() { parent::__construct(); $this->check_islogin(); //check user login session exist or not $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $this->load->model('yarn_model'); $this->load->model('marketing_model'); //$this->load->library('user_agent'); $this->load->model('planning_yarn'); $this->load->model('planning_shade'); $this->load->model('vendor_model'); $this->load->model('outsource_model'); $this->load->model('store_model'); date_default_timezone_set('asia/kolkata'); } public function log() { echo $_REQUEST['name'];exit; echo "login"; } //Checking the Login or not private function check_islogin() { if (!$this->session->userdata('logged_in')) { redirect(base_url(), 'refresh'); } } public function 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 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') { $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; } $stock=$data['stoct_transfer_rows'] + $data['stoct_transfer_rows1'] + $data['stoct_transfer_rows2'] + $data['stoct_transfer_rows3']; 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') { $d=date('d-m-Y'); $table='packing_list_data'; $where=array('created_at'=>$d); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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; $product_master_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing') { $d=date('d-m-Y'); $table='article_master'; $where=array('created_date'=>$d); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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); $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; } $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; 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 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); //<!------------------------ 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=array('created_date'=>$d,'insert_notification_status'=>0); $fabric_inpection_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $fabric_inpection_insert_rows=0; } 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); $yarn_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $d1=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $cs_delivery_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $table='indent_cs_goods_details'; $where=array('received_date'=>$d1,'insert_notification_status'=>0); $cs_delivery_insert_rows2=$this->vendor_model->count_amount_get_customerdata($table,$where); $cs_delivery_insert_rows = $cs_delivery_insert_rows1 + $cs_delivery_insert_rows2; $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; $table='indent_goods_details'; $where=array('received_date'=>$t,'insert_notification_status'=>0); $fabric_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); // if(empty($fabric_delivery_insert_rows1)) // { // $fabric_delivery_insert_rows1=0; // } // else // { // } } else if($rr == '0' && $rrr != '0') { $t=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=array('received_date'=>$t,'insert_notification_status'=>0); $fabric_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); // if(empty($fabric_delivery_insert_rows2)) // { // $fabric_delivery_insert_rows2=0; // } // else // { // } } else if($rr != '0' && $rrr == '0') { $t=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=array('received_date'=>$t,'insert_notification_status'=>0); $fabric_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); // if(empty($fabric_delivery_insert_rows3)) // { // $fabric_delivery_insert_rows3=0; // } // else // { // } } else if($rr != '0' && $rrr != '0') { $table='indent_goods_details'; $where=array('received_date'=>$input,'insert_notification_status'=>0); $fabric_delivery_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); // if(empty($fabric_delivery_insert_rows4)) // { // $fabric_delivery_insert_rows4=0; // } // else // { // } } } else { $fabric_inpection_insert_rows=0; $fabric_delivery_insert_rows=0; $yarn_delivery_insert_rows=0; $cs_delivery_insert_rows=0; } $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; return $new; } public function session_data_pass() { $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 ($this->session->userdata('logged_in')) { return $this->yarn_model->get_userdata(); } } public function access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_where_data($table,$where); } public function access_details_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); $data['user_type_id']=$d->user_type_id; $table='swansilk_access_controls'; $where=array('department_id'=>$data['user_type_id']); return $this->marketing_model->fetch_main_data($table,$where); } public function access_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_by); $d=$this->marketing_model->fetch_main_data($table,$where); return $d->user_type_id; } /////////////////////////////////// yarn raw /////////////////////////////////////////////////////////////////////////////// public function yarn_raw_billing() { $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, "/") + 1); if($RT == 'billing/yarn_raw_billing?prop_id=1') { $data['url_val']='1'; $data['val']='billing/yarn_raw_billing?prop_id=1'; $data['ref']='indent'; } else if($RT == 'billing/yarn_raw_billing?prop_id=2') { $data['val']='billing/yarn_raw_billing?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->dashboard_po_no($table,$where); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->dashboard_po_no($table,$where); } else if($RT == 'billing/yarn_raw_billing?prop_id=3') { $data['url_val']='3'; $data['val']='billing/yarn_raw_billing?prop_id=1'; $data['ref']='month_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->monthly_created_po_generate($table,$m,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); } else if($RT == 'billing/yarn_raw_billing?prop_id=4') { $data['url_val']='4'; $data['val']='billing/yarn_raw_billing?prop_id=1'; $data['ref']='year_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->year_created_po_generate($table,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->year_approved_po_generate($table,$y); } // print_r($data['val']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- // $data['userdetails'] = $this->session_data_pass(); // $data['user_type_id'] = $this->access_id(); // $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_raw_billing_grid'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_raw_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $table='billing'; $indent=$this->vendor_model->max_select_billing_no($table); if(empty($indent)) { $data['sl_no']=0; } else { $data['sl_no']=$indent->billing_sl_no+1; } $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_raw_details'); $this->load->view('templates/footer_inside'); } /////////////////////////////////// yarn twist /////////////////////////////////////////////////////////////////////////////// public function yarn_twisting_billing() { $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, "/") + 1); if($RT == 'billing/yarn_twisting_billing?prop_id=1') { $data['url_val']='1'; $data['val']='billing/yarn_twisting_billing?prop_id=1'; $data['ref']='indent'; } else if($RT == 'billing/yarn_twisting_billing?prop_id=2') { $data['val']='billing/yarn_twisting_billing?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->dashboard_po_no($table,$where); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->dashboard_po_no($table,$where); } else if($RT == 'billing/yarn_twisting_billing?prop_id=3') { $data['url_val']='3'; $data['val']='billing/yarn_twisting_billing?prop_id=1'; $data['ref']='month_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->monthly_created_po_generate($table,$m,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); } else if($RT == 'billing/yarn_twisting_billing?prop_id=4') { $data['url_val']='4'; $data['val']='billing/yarn_twisting_billing?prop_id=1'; $data['ref']='year_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->year_created_po_generate($table,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->year_approved_po_generate($table,$y); } // print_r($data['val']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- // $data['userdetails'] = $this->session_data_pass(); // $data['user_type_id'] = $this->access_id(); // $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_twisting_billing_grid'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_twisting_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_twisting_details'); $this->load->view('templates/footer_inside'); } /////////////////////////////////// yarn twist /////////////////////////////////////////////////////////////////////////////// public function yarn_dyed_billing() { $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, "/") + 1); if($RT == 'billing/yarn_dyed_billing?prop_id=1') { $data['url_val']='1'; $data['val']='billing/yarn_dyed_billing?prop_id=1'; $data['ref']='indent'; } else if($RT == 'billing/yarn_dyed_billing?prop_id=2') { $data['val']='billing/yarn_dyed_billing?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->dashboard_po_no($table,$where); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->dashboard_po_no($table,$where); } else if($RT == 'billing/yarn_dyed_billing?prop_id=3') { $data['url_val']='3'; $data['val']='billing/yarn_dyed_billing?prop_id=1'; $data['ref']='month_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->monthly_created_po_generate($table,$m,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); } else if($RT == 'billing/yarn_dyed_billing?prop_id=4') { $data['url_val']='4'; $data['val']='billing/yarn_dyed_billing?prop_id=1'; $data['ref']='year_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->year_created_po_generate($table,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->year_approved_po_generate($table,$y); } // print_r($data['val']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- // $data['userdetails'] = $this->session_data_pass(); // $data['user_type_id'] = $this->access_id(); // $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_dyed_billing_grid'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_dyed_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_dyed_details'); $this->load->view('templates/footer_inside'); } /////////////////////////////////// yarn twist /////////////////////////////////////////////////////////////////////////////// public function swan_yarn_dyed_billing() { $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, "/") + 1); if($RT == 'billing/swan_yarn_dyed_billing?prop_id=1') { $data['url_val']='1'; $data['val']='billing/swan_yarn_dyed_billing?prop_id=1'; $data['ref']='indent'; } else if($RT == 'billing/swan_yarn_dyed_billing?prop_id=2') { $data['val']='billing/swan_yarn_dyed_billing?prop_id=1'; $data['url_val']='2'; $data['ref']='today_dashboard'; $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->dashboard_po_no($table,$where); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->dashboard_po_no($table,$where); } else if($RT == 'billing/swan_yarn_dyed_billing?prop_id=3') { $data['url_val']='3'; $data['val']='billing/swan_yarn_dyed_billing?prop_id=1'; $data['ref']='month_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->monthly_created_po_generate($table,$m,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); } else if($RT == 'billing/swan_yarn_dyed_billing?prop_id=4') { $data['url_val']='4'; $data['val']='billing/swan_yarn_dyed_billing?prop_id=1'; $data['ref']='year_dashboard'; $m=date('m'); $y=date('Y'); $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $data['pen_list']=$this->vendor_model->year_created_po_generate($table,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $data['app_list']=$this->vendor_model->year_approved_po_generate($table,$y); } // print_r($data['val']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- // $data['userdetails'] = $this->session_data_pass(); // $data['user_type_id'] = $this->access_id(); // $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/swan_yarn_dyed_billing_grid'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function yarn_dyed_stock_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_dyed_stock_grid'); $this->load->view('templates/footer_inside'); } public function swan_yarn_stock_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['back_val'] = 'grn_back'; $this->db->empty_table('packing_check_val'); $this->db->truncate('packing_check_val'); $this->load->view('templates/header_inside',$data); $this->load->view('billing/swan_yarn_stock_grid',$data); $this->load->view('templates/footer_inside'); } public function swan_yarn_dyed_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['back_val'] = 'grn_back'; $this->db->empty_table('packing_check_val'); $this->db->truncate('packing_check_val'); $this->load->view('templates/header_inside',$data); $this->load->view('billing/swan_yarn_dyed_details',$data); $this->load->view('templates/footer_inside'); } public function yarn_twisting_stock_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['back_val'] = 'grn_back'; $this->db->empty_table('packing_check_val'); $this->db->truncate('packing_check_val'); $this->load->view('templates/header_inside',$data); $this->load->view('billing/twisting_yarn_stock_grid',$data); $this->load->view('templates/footer_inside'); } public function raw_yarn_stock_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['back_val'] = 'grn_back'; $this->db->empty_table('packing_check_val'); $this->db->truncate('packing_check_val'); $this->load->view('templates/header_inside',$data); $this->load->view('billing/raw_yarn_stock_grid',$data); $this->load->view('templates/footer_inside'); } //////////// raw location ///////////////////////////////////////// public function fetch_all_stock_fabric_packing_location_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='fabric_inspection_details'; //$where=array('consumed_at'=>$location); $data = $this->outsource_model->display_yarn_raw_grid_data(); echo json_encode($data); } public function fetch_all_ho_stock_fabric_packing_location_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='fabric_inspection_details'; $location='HO'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_peenya_stock_fabric_packing_location_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='fabric_inspection_details'; $location='PEENYA - DYEING'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_nandi_stock_fabric_packing_location_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='fabric_inspection_details'; $location='NANDI'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_tailoring_stock_fabric_packing_location_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='fabric_inspection_details'; $location='PEENYA - TAILORING'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_BYATRANPURA_stock_fabric_packing_location_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='fabric_inspection_details'; $location='BYATRANPURA'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_VIJAYAPURA_stock_fabric_packing_location_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='fabric_inspection_details'; $location='VIJAYAPURA'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_DODDAJALA_stock_fabric_packing_location_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='fabric_inspection_details'; $location='DODDAJALA'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } public function fetch_all_kumara_stock_fabric_packing_location_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='fabric_inspection_details'; $location='KUMARA PARK'; $data = $this->outsource_model->display_yarn_raw_stock_grid_data($location); echo json_encode($data); } //////////// twist location ///////////////////////////////////////// public function fetch_twist_all_stock_fabric_packing_location_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='delivery_yarn_twisting'; $where=array('status'=>1); //$data = $this->outsource_model->display_yarn_twisting_grid_data(); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_ho_stock_fabric_packing_location_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='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'HO'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_peenya_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='PEENYA - DYEING'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'PEENYA - DYEING'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_nandi_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='NANDI'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'NANDI'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_tailoring_stock_fabric_packing_location_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='fabric_inspection_details'; //$location='PEENYA - TAILORING'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'PEENYA - TAILORING'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_BYATRANPURA_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='BYATRANPURA'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'BYATRANPURA'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_VIJAYAPURA_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='VIJAYAPURA'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'VIJAYAPURA'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_DODDAJALA_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='DODDAJALA'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'DODDAJALA'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } public function fetch_twist_all_kumara_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='KUMARA PARK'; $table='delivery_yarn_twisting'; $where=array('status'=>1,'consumed_at'=>'KUMARA PARK'); $data= $this->outsource_model->get_embroidery_data($table,$where); echo json_encode($data); } //////////// dyed location ///////////////////////////////////////// public function fetch_dyed_all_stock_fabric_packing_location_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='delivery_yarn_twisting'; $data = $this->outsource_model->display_yarn_dyed_grid_detailed_data(); echo json_encode($data); } public function fetch_dyed_all_ho_stock_fabric_packing_location_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); $location='HO'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_peenya_stock_fabric_packing_location_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='fabric_inspection_details'; $location='PEENYA - DYEING'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_nandi_stock_fabric_packing_location_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='fabric_inspection_details'; $location='NANDI'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_tailoring_stock_fabric_packing_location_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='fabric_inspection_details'; $location='PEENYA - TAILORING'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_BYATRANPURA_stock_fabric_packing_location_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='fabric_inspection_details'; $location='BYATRANPURA'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_VIJAYAPURA_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='VIJAYAPURA'; $location='VIJAYAPURA'; //$where=array('status'=>1,'consumed_at'=>'VIJAYAPURA'); $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_DODDAJALA_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='DODDAJALA'; $location='DODDAJALA'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } public function fetch_dyed_all_kumara_stock_fabric_packing_location_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='fabric_inspection_details'; // $location='KUMARA PARK'; $location='KUMARA PARK'; $data = $this->outsource_model->display_yarn_stock_dyed_grid_detailed_data($location); echo json_encode($data); } //////////// swan dyed location ///////////////////////////////////////// public function fetch_swan_dyed_all_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_ho_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'HO'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_peenya_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'PEENYA - DYEING'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_nandi_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'NANDI'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_tailoring_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'PEENYA - TAILORING'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_BYATRANPURA_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'BYATRANPURA'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_VIJAYAPURA_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'VIJAYAPURA'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_DODDAJALA_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'DODDAJALA'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function fetch_swan_dyed_all_kumara_stock_fabric_packing_location_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='work_order_dyeing'; $where=array('status'=>'COMPLETED','yarn_status'=>0,'rec_dyed_qua >'=>0,'location'=>'KUMARA PARK'); $data=$this->outsource_model->get_work_order_grid_data($table,$where); echo json_encode($data); } public function insert_billing_data() { $yarn_bill_no=$this->input->post('billing_id'); $table='billing'; $where=array('billing_sl_no'=>$yarn_bill_no); $billing_data=$this->vendor_model-> get_customerdata($table,$where); if(empty($billing_data)) { $d=date('d-m-Y'); $data = array('billing_no' => $this->input->post('billing_no'), 'billing_sl_no' => $this->input->post('billing_id'), 'vendor_name' => $this->input->post('supplier_name'), 'date' => $this->input->post('g_date'), 'currency' => $this->input->post('currency'), 'yarn_type' => $this->input->post('yarn_type'), 'address' => $this->input->post('address'), 'created_at'=>$d); $table='billing'; $this->db->insert($table,$data); } else { $d=date('d-m-Y'); $data = array('billing_no' => $this->input->post('billing_no'), 'billing_sl_no' => $this->input->post('billing_id'), 'vendor_name' => $this->input->post('supplier_name'), 'date' => $this->input->post('g_date'), 'currency' => $this->input->post('currency'), 'yarn_type' => $this->input->post('yarn_type'), 'address' => $this->input->post('address'), 'created_at'=>$d); $table='billing'; $where=array('billing_sl_no'=>$yarn_bill_no); $this->vendor_model->update_data($where,$table,$data); } } public function insert_check_box_data() { $table='billing'; $indent=$this->vendor_model->max_select_billing_number($table); $where=array('billing_sl_no'=>$indent->billing_sl_no); $table='billing'; $data = array('check_values' => $this->input->post('check_values')); $this->vendor_model->update_data($where,$table,$data); $d='yes'; echo json_encode($d); } public function yarn_details() { $table='billing'; $indent=$this->vendor_model->max_select_billing_number($table); $where=array('billing_sl_no'=>$indent->billing_sl_no); $data['billing_details']=$this->vendor_model->get_customerdata($table,$where); $data2=$data['billing_details']->check_values; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $expp = array_merge($exp, $path); $yarn_details=array(); if($data['billing_details']->yarn_type == 'Yarn - Raw') { foreach($exp as $val) { $where=$val; $row=$this->outsource_model->display_yarn_raw_id_stock_grid_data($where); array_push($yarn_details,$row); } $data['refer']='single'; $data['yarn_data']=$yarn_details; } else if($data['billing_details']->yarn_type == 'Yarn - Twisted') { foreach($exp as $val) { $table='delivery_yarn_twisting'; $where=array('status'=>1,'id'=>$val); $row= $this->outsource_model->get_embroidery_data($table,$where); array_push($yarn_details,$row); } $data['refer']='double'; $data['yarn_data']=$yarn_details; } else if($data['billing_details']->yarn_type == 'Yarn - Dyed') { foreach($exp as $val) { $row= $this->outsource_model->display_yarn_selected_dyed_grid_detailed_data($val); array_push($yarn_details,$row); } $data['refer']='single'; $data['yarn_data']=$yarn_details; } else if($data['billing_details']->yarn_type == 'Swan - Yarn - Dyed') { foreach($exp as $val) { $table='work_order_dyeing'; $where=array('id'=>$val); $row=$this->outsource_model->get_work_order_grid_data($table,$where); array_push($yarn_details,$row); } $data['refer']='double_val'; $data['yarn_data']=$yarn_details; } // print_r($data['yarn_data']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/yarn_raw_chck_box_data'); $this->load->view('templates/footer_inside'); } public function insert_billing_yarn_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $created_At=date('d-m-Y'); $datas=array( 'billing_no' => $this->input->post('billing_no'), 'billing_sl_no' => $this->input->post('billing_id'), 'vendor_name' => $this->input->post('supplier_name'), 'date' => $this->input->post('g_date'), 'currency' => $this->input->post('currency'), 'yarn_type' => $this->input->post('yarn_type'), 'address' => $this->input->post('address'), 'created_at' => $created_At, 'created_by' => $approved_by, 'status'=>1, 'total_amt'=>$this->input->post('total_amt') ); $table='billing'; $where = array('billing_sl_no' => $this->input->post('billing_id')); $this->vendor_model->update_data($where,$table,$datas); $billing_row=$this->vendor_model->get_customerdata($table,$where); $yarnid = $this->input->post('yarnid'); $yarnname = $this->input->post('yarnname'); $lot = $this->input->post('lot'); $bale=$this->input->post('bale'); $netwt=$this->input->post('netwt'); $bill_netwt= $this->input->post('bill_netwt'); $unitprice= $this->input->post('unitprice'); $inr_val = $this->input->post('inr_val'); $sgst=$this->input->post('sgst_val'); $cgst=$this->input->post('cgst_val'); $igst = $this->input->post('igst_val'); $totalvalue=$this->input->post('totalvalue'); $total_amt=$this->input->post('total_amt'); foreach($yarnid as $key=>$val) { $data=array('billing_id'=>$billing_row->id, 'yarnid'=>$yarnid[$key], 'yarnname'=>$yarnname[$key], 'lot'=>$lot[$key], 'bale'=>$bale[$key], 'netwt'=>$netwt[$key], 'bill_netwt'=>$bill_netwt[$key], 'unitprice'=>$unitprice[$key], 'inr_val'=>$inr_val[$key], 'sgst'=>$sgst[$key], 'cgst'=>$cgst[$key], 'igst'=>$igst[$key], 'totalvalue'=>$totalvalue[$key], 'total_amt'=>$total_amt, ); $table='billing_yarn'; $this->db->insert($table,$data); $real_stock=$netwt[$key]; $bill_stock=$bill_netwt[$key]; $bal_stock=$real_stock - $bill_stock; if($billing_row->yarn_type == 'Yarn - Raw') { $table='indent_yarn_goods_details'; $where=array('id'=>$yarnid[$key]); $data_val=array('issue_net_weight'=>$bal_stock); $this->vendor_model->update_data($where,$table,$data_val); } else if($billing_row->yarn_type == 'Yarn - Twisted') { $table='delivery_yarn_twisting'; $where=array('id'=>$yarnid[$key]); $data_val=array('issue_net_weight'=>$bal_stock); $this->vendor_model->update_data($where,$table,$data_val); } else if($billing_row->yarn_type == 'Yarn - Dyed') { $table='indent_yarn_goods_details'; $where=array('id'=>$yarnid[$key]); $data_val=array('issue_net_weight'=>$bal_stock); $this->vendor_model->update_data($where,$table,$data_val); } else if($billing_row->yarn_type == 'Swan - Yarn - Dyed') { $table='work_order_dyeing'; $where=array('id'=>$yarnid[$key]); $data_val=array('rec_dyed_qua'=>$bal_stock); $this->vendor_model->update_data($where,$table,$data_val); } } } public function yarn_details_fetch() { $table='billing'; $where=array('status'=>1); $data=$this->vendor_model->get_data($table,$where); echo json_encode($data); } public function yarn_result_fetch() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table='billing_yarn'; $where=array('billing_id'=>$i); $data=$this->vendor_model->get_data($table,$where); echo json_encode($data); } public function billing_preview() { $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='billing'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $where=array('billing_id'=>$val); $table='billing_yarn'; $data['pkg_data']=$this->vendor_model->get_where_dataa($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['total_rec_stock_notifications']=$this->rec_stock_page_notifications(); $data['marketing_totals']=$this->marketing_page_notifications(); $data['issue_fabric_insert_rows']=$this->issue_fabric_page_notifications(); $data['issue_cs_insert_rows']=$this->issue_cs_page_notifications(); $data['total_planning']=$this->planning_page_notifications(); $data['total_sample_notifications']= $this->sample_page_notifications(); $data['total_work_order_twisting_notifications']= $this->work_order_page_notifications(); $data['total_package_notifications']= $this->packing_page_notifications(); $data['total_design_notifications']=$this->design_weaving_page_notifications(); $data['yarn_count']=$this->masters_page_notifications(); $data['total_madeups_notifications']=$this->madeups_page_notifications(); $data['fabric_inpection_notifications']= $this->new_stores_page_notifications(); $data['total_rows_notifications']=$data['total_indent_notifications'] + $data['total_stock_notifications'] + $data['total_rec_stock_notifications'] + $data['marketing_totals'] + $data['issue_fabric_insert_rows'] + $data['issue_cs_insert_rows'] + $data['total_planning'] + $data['total_sample_notifications'] + $data['total_work_order_twisting_notifications'] + $data['total_package_notifications'] + $data['total_design_notifications'] + $data['yarn_count'] + $data['total_madeups_notifications'] + $data['fabric_inpection_notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $this->load->view('templates/header_inside',$data); $this->load->view('billing/billing_preview'); $this->load->view('templates/footer_inside'); } } ?>