EVOLUTION-NINJA
Edit File: pdf.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); class Vendor extends CI_Controller { public function __construct() { parent::__construct(); $this->check_islogin(); //check user login session exist or not $this->output->set_header('Last-Modified: ' . gmdate("D, d M Y H:i:s") . ' GMT'); $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); $this->output->set_header('Pragma: no-cache'); $this->output->set_header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); $this->load->model('yarn_model'); $this->load->model('marketing_model'); $this->load->model('planning_yarn'); $this->load->model('planning_shade'); $this->load->model('vendor_model'); $this->load->model('outsource_model'); $this->load->model('store_model'); date_default_timezone_set('asia/kolkata'); } public function log() { echo $_REQUEST['name'];exit; echo "login"; } //Checking the Login or not private function check_islogin() { if (!$this->session->userdata('logged_in')) { redirect(base_url(), 'refresh'); } } public function session_data_pass() { if ($this->session->userdata('logged_in')) { return $this->yarn_model->get_userdata(); } } public function 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') { $ttt1=date('d/m/Y'); $ddd1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$ttt1); $where1=array('received_date'=>$ddd1); $data['stock_split_data']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where,$where1); //"(status='live' OR status='dead')" $d=date('d-m-Y'); $table='cs_transfer'; $where=array('transfer_date'=>$d,'insert_notification_status'=>0); $data['stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['stoct_transfer_rows3']=0; $data['stock_split_data']=0; } $stock=$data['stoct_transfer_rows'] + $data['stoct_transfer_rows1'] + $data['stoct_transfer_rows2'] + $data['stoct_transfer_rows3'] + $data['stock_split_data']; return $stock; } public function rec_stock_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- received stock ------------------------------> $d=date('d-m-Y'); $table='fabric_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='swan_yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows1']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); $d=date('d-m-Y'); $table='yarn_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows2']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows']=0; $data['rec_stoct_transfer_rows1']=0; $data['rec_stoct_transfer_rows2']=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='cs_transfer'; $where=array('rec_date'=>$d,'update_notification_status'=>0); $data['rec_stoct_transfer_rows3']=$this->vendor_model->count_amount_notification_get_customerdata($table,$where); } else { $data['rec_stoct_transfer_rows3']=0; } //$data['total_rec_stock_notifications']=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3'] ; $rec_stock=$data['rec_stoct_transfer_rows'] + $data['rec_stoct_transfer_rows1'] + $data['rec_stoct_transfer_rows2'] + $data['rec_stoct_transfer_rows3']; return $rec_stock; } public function marketing_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- Marketing Module ------------------------------> $d=date('d-m-Y'); $where=$d; $data['marketing_rows']=$this->vendor_model->marketing_notification_getsuborder($where); $data['marketing_confirm_rows']=$this->vendor_model->marketing_notification_confirm_getsuborder($where); $data['marketing_update_num_rows']=$this->vendor_model->marketing_notification_update_getsuborder($where); $d=date('Y-m-d'); $where=$d; $data['marketing_on_date_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($where); $befdore_ten=date('Y-m-d',strtotime('+10 days')) . PHP_EOL; $data['marketing_ten_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_ten); $befdore_thirty=date('Y-m-d',strtotime('+30 days')) . PHP_EOL; $data['marketing_thirty_days_rows']=$this->vendor_model->marketing_notification_delivery_date_getsuborder($befdore_thirty); } else { $data['marketing_rows'] = 0; $data['marketing_confirm_rows'] = 0; $data['marketing_update_num_rows'] = 0; $data['marketing_on_date_rows'] = 0; $data['marketing_ten_days_rows'] = 0; $data['marketing_thirty_days_rows'] = 0; } $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $mark; } public function issue_fabric_page_notifications() { //<!---------------------- issue fabric Module ------------------------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='fabric_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $f=$this->vendor_model->issue_fabric_count_amount_get_customerdata($table,$where); } else { $f=0; } // $mark= $data['marketing_rows'] + $data['marketing_confirm_rows'] + $data['marketing_update_num_rows'] + $data['marketing_on_date_rows'] + $data['marketing_ten_days_rows'] + $data['marketing_thirty_days_rows']; return $f; } public function issue_cs_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { //<!---------------------- issue cs Module ------------------------------> $d=date('d-m-Y'); $table='cs_addstock'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $cs=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $cs=0; } return $cs; } public function planning_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing') { // //<!---------------------- Planning Module ------------------------------> $d=date('d-m-Y'); $data['planning_order_rows'] = $this->vendor_model->planning_notification_get_details($d); $dd=date('Y-m-d'); $where=$dd; $data['pallning_outsource_rows']=$this->vendor_model->outsource_planning_notification_get_details($where); $d=date('Y-m-d'); $where=$d; $data['planned_dyeing_on_date_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($where); $data['planned_weaving_on_date_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($where); $befdore_seven=date('Y-m-d',strtotime('+7 days')) . PHP_EOL; $data['planned_dyeing_sevenn_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($befdore_seven); $data['planned_weaving_sevenn_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($befdore_seven); $after_five=date('Y-m-d',strtotime('-5 days')) . PHP_EOL; $data['planned_dyeing_five_days_rows']=$this->vendor_model->marketing_notification_deying_date_getsuborder($after_five); $data['planned_weaving_five_days_rows']=$this->vendor_model->marketing_notification_weaving_date_getsuborder($after_five); } else { $data['planning_order_rows'] =0; $data['pallning_outsource_rows']=0; $data['planned_dyeing_on_date_rows'] =0; $data['planned_dyeing_sevenn_days_rows'] =0; $data['planned_dyeing_five_days_rows']=0; $data['planned_weaving_on_date_rows'] =0; $data['planned_weaving_sevenn_days_rows'] =0; $data['planned_weaving_five_days_rows']=0; } $p=$data['planning_order_rows'] + $data['pallning_outsource_rows'] + $data['planned_dyeing_on_date_rows'] + $data['planned_dyeing_sevenn_days_rows'] + $data['planned_dyeing_five_days_rows'] + $data['planned_weaving_on_date_rows'] + $data['planned_weaving_sevenn_days_rows'] + $data['planned_weaving_five_days_rows'] ; return $p; } public function issue_loom_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ issue_loom ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { $d=date('d-m-Y'); $table='issue_loom'; $where=array('issued_date'=>$d,'insert_notification_status'=>0); $indent_insert_rows=$this->vendor_model->count_of_pcs($table,$where); $d=date('d-m-Y'); $table='issue_loom'; $where=array('rements_approved_date'=>$d,'update_notification_status'=>0); $indent_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_panel_planning_order'; $where=array('issue_approved_date'=>$d,'approval_notification_status'=>0); $indent_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_insert_rows=0; $indent_approval_rows=0; $indent_update_rows=0; } $r=$indent_insert_rows + $indent_approval_rows + $indent_update_rows; return $r; } public function sample_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $emp_details=$this->vendor_model->get_customerdata($table,$where); if($emp_details->designation == 'Super Admin' || $emp_details->designation == 'Admin') { //<!------------------------ Sample request ---------------------------------> $d=date('d-m-Y'); $table='sample_request'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $sample_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_insert_rows=0; } if($emp_details->designation == 'Super Admin') { $d=date('d-m-Y'); $table='sample_request'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $sample_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $sample_update_rows=0; } $s= $sample_insert_rows + $sample_update_rows ; return $s; } public function work_order_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager') { //<!---------------------- work order ------------------------------> $d=date('d-m-Y'); $table='create_yarntwisting_work_order'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_twisting']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_dyeing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='workorder_dyeing_material'; $where=array('approved_date'=>$d,'insert_notification_status'=>0); $data['issue_work_order_dyeing_material_rows']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='finishing_embroidry'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $data['work_order_fabric_finishing']=$this->vendor_model->count_amount_work_order_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_twisting'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_twisting_finishing']=$this->vendor_model->count_amount_work_order_delivery_twisting_get_customerdata($table,$where); $d=date('d-m-Y'); $table='work_order_dyeing'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_dyeing_finishing']=$this->vendor_model->count_amount_work_order_delivery_dyed_get_customerdata($table,$where); $d=date('d-m-Y'); $table='weaving_factory_stock'; $where=array('rec_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_weaving_finishing']=$this->vendor_model->count_amount_work_order_delivery_weaving_fabric_get_customerdata($table,$where); $d=date('d/m/Y'); $table='finishing_embroidry_stock'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['work_order_delivery_finishing_finishing']=$this->vendor_model->count_amount_work_order_delivery_fabric_finishing_emp_get_customerdata($table,$where); } else { $data['work_order_twisting']=0; $data['work_order_dyeing']=0; $data['work_order_fabric_finishing']=0; $data['work_order_delivery_twisting_finishing']=0; $data['work_order_delivery_dyeing_finishing']=0; $data['work_order_delivery_weaving_finishing']=0; $data['work_order_delivery_finishing_finishing']=0; $data['issue_work_order_dyeing_material_rows']=0; } $w=$data['work_order_twisting'] + $data['work_order_dyeing'] + $data['work_order_fabric_finishing'] + $data['work_order_delivery_twisting_finishing'] + $data['work_order_delivery_dyeing_finishing'] + $data['work_order_delivery_weaving_finishing'] + $data['work_order_delivery_finishing_finishing'] + $data['issue_work_order_dyeing_material_rows']; return $w; } public function packing_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ package list ---------------------------------> if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d/m/Y'); $table='packing_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='packing_list_data'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $package_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='madeups_list_data'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $package_madeups_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $package_insert_rows=0; $package_update_rows=0; $package_madeups_insert_rows=0; } $packing= $package_insert_rows + $package_update_rows + $package_madeups_insert_rows; return $packing; } public function design_weaving_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ design weaving list ---------------------------------> if($data['emp_details']->designation == 'Super Admin') { $d=date('d-m-Y'); $table='design_weave'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_update_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('finalized_date'=>$d,'finalize_notification_status'=>0); $design_finalize_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_weave'; $where=array('approved_date'=>$d,'approval_notification_status'=>0); $design_approval_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows=0; $design_update_rows=0; $design_finalize_rows=0; $design_approval_rows=0; } $design= $design_insert_rows + $design_update_rows + $design_finalize_rows + $design_approval_rows; return $design; } public function masters_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!----------------------------- Masters Module ---------------------------------------> if($data['emp_details']->designation == 'Super Admin' ) { $d=date('d-m-Y'); $table='import_yarn'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $yarn_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='import_yarn'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $yarn_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='article_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $article_updated_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $fabric_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='fabric_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $fabric_upadted_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $shade_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='shade_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $shade_updated_row=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $color_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='color_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $color_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $customer_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $madeups_box_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $product_master_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $yarn_insert_rows=0; $yarn_insert_rows1=0; $article_updated_rows=0; $fabric_insert_rows=0; $fabric_upadted_rows=0; $shade_insert_rows=0; $shade_updated_row=0; $color_insert_rows=0; $color_insert_rows1=0; $customer_insert_rows1=0; $box_insert_rows1=0; $madeups_box_insert_rows1=0; $product_master_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'MARKETING' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'Marketing' || $data['emp_details']->designation == 'HO Marketing' || $data['emp_details']->designation == 'HO Marketing') { $d=date('d-m-Y'); $table='article_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $article_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='design_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $design_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $article_insert_rows=0; $design_insert_rows=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'HO Purchase Admin') { $d=date('d-m-Y'); $table='indent_product'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_product_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $indent_vednor_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $indent_product_insert_rows1=0; $indent_vednor_insert_rows1=0; } if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $d=date('d-m-Y'); $table='design_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $design_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='customer_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $customer_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='madeups_box_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $madeups_box_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $outsource_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='outsource_vendor_master'; $where=array('updated_on'=>$d,'update_notification_status'=>0); $outsource_insert_rows1=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_vendor_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_vednor_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='indent_product'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $indent_product_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d-m-Y'); $table='product_master'; $where=array('created_date'=>$d,'insert_notification_status'=>0); $product_master_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); } else { $design_insert_rows1=0; $customer_insert_rows=0; $box_insert_rows=0; $outsource_insert_rows=0; $outsource_insert_rows1=0; $indent_vednor_insert_rows=0; $indent_product_insert_rows=0; $product_master_insert_rows=0; $madeups_box_insert_rows=0; } $m=$yarn_insert_rows + $yarn_insert_rows1 + $article_insert_rows + $article_updated_rows + $fabric_insert_rows + $fabric_upadted_rows + $shade_updated_row + $design_insert_rows + $design_insert_rows1 + $color_insert_rows + $color_insert_rows1 + $customer_insert_rows + $customer_insert_rows1 + $box_insert_rows + $box_insert_rows1 + $outsource_insert_rows + $outsource_insert_rows1 + $indent_vednor_insert_rows + $indent_vednor_insert_rows1 + $indent_product_insert_rows + $indent_product_insert_rows1 + $product_master_insert_rows + $product_master_insert_rows1 + $madeups_box_insert_rows1 + $madeups_box_insert_rows; return $m; } public function madeups_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ madeups list ---------------------------------> if($data['emp_details']->designation == 'HO Madeups') { $d=date('d/m/Y'); $table='fabric_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_insert_rows=$this->vendor_model->count_amount_get_customerdata($table,$where); $d=date('d/m/Y'); $table='consumable_madeups'; $where=array('created_at'=>$d,'insert_notification_status'=>0); $madeups_list_madeups_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else { $madeups_list_insert_rows=0; $madeups_list_madeups_insert_rows=0; } if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive') { $input=date('d/m/Y'); $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); if($rr == '0' && $rrr == '0') { $t=$rrr1 . '/' . $rr1 . '/' . $year; //$t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr == '0' && $rrr != '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$day . '/' . $rr1 . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr == '0') { //$t=$rrr1 . '/' . $rr1 . '/' . $year; $t=$rrr1 . '/' . $month . '/' . $year; $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$t,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } else if($rr != '0' && $rrr != '0') { $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$input,'insert_notification_status'=>0); $madeups_list_madeups_delivery_insert_rows=$this->vendor_model->madeups_count_amount_get_customerdata($table,$where); } } else { $madeups_list_madeups_delivery_insert_rows=0; } $madeups = $madeups_list_insert_rows + $madeups_list_madeups_insert_rows + $madeups_list_madeups_delivery_insert_rows; return $madeups; } public function inward_purchases_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { $table='indent_yarn_goods_details'; $where=array('received_date'=>$d); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery1_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insertt_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insertt_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insertt_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } else { if($data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin' || $data['emp_details']->designation == 'PPC Manager' ) { // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['yarn_delivery_insert_rows']=0; $data['cs_delivery_insert_rows1']=0; $data['cs_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows']=0; $data['fabric_delivery_insert_rows2']=0; $data['fabric_delivery_insert_rows3']=0; $data['fabric_delivery_insert_rows4']=0; } } $data['total_res_inward_fabric']=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; $data['page_static']='inward_purchase'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } public function inward_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> // $d=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['yarn_delivery_inserted_rows']=$this->vendor_model->yarn_delivery_insert_getsuborder1($d); $data['yarn_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); //$d=date('d-m-Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$d,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows1']=$this->vendor_model->cs_delivery_insert_getsuborder1($d); $data['cs_delivery_insert_rows1']=$this->vendor_model->count_amount_get_customerdata($table,$where); $newDate = date("d/m/Y", strtotime($d)); //$d=date('d/m/Y'); $table='indent_cs_goods_details'; $where=array('received_date'=>$newDate,'insert_notification_status'=>0); $data['cs_delivery_inserted_rows']=$this->vendor_model->cs_delivery_insert_getsuborder1($newDate); $data['cs_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where); $input=$newDate; $datee = explode('/', $input); $day = $datee[0]; $month = $datee[1]; $year = $datee[2]; $rr=substr($month, 0, 1); $rr1=substr($month, 1, 2); $rrr=substr($day, 0, 1); $rrr1=substr($day, 1, 2); $t1=$rrr1 . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t1; $where1=array('received_date'=>$t1,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows1']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t2=$day . '/' . $rr1 . '/' . $year; $table='indent_goods_details'; $where=$t2; $where1=array('received_date'=>$t2,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows2']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows2']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $t3=$rrr1 . '/' . $month . '/' . $year; $table='indent_goods_details'; $where=$t3; $where1=array('received_date'=>$t3,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows3']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows3']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $table='indent_goods_details'; $where=$input; $where1=array('received_date'=>$input,'insert_notification_status'=>0); $data['fabric_delivery_inserted_rows4']=$this->vendor_model->fabric_delivery_goods_insert_getsuborder1($where); $data['fabric_delivery_insert_rows4']=$this->vendor_model->count_amount_get_customerdata($table,$where1); $new=$data['fabric_delivery_insert_rows'] + $data['fabric_delivery_insert_rows2'] + $data['fabric_delivery_insert_rows3'] + $data['fabric_delivery_insert_rows4'] + $data['yarn_delivery_insert_rows'] + $data['cs_delivery_insert_rows'] + $data['cs_delivery_insert_rows1']; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function new_stores_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; //<!------------------------ new stores list ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } $new= $data['fabric_inspection_rows'] ; // $new = $fabric_inpection_insert_rows + $fabric_delivery_insert_rows + $yarn_delivery_insert_rows + $cs_delivery_insert_rows; // print_r($new); // die(); return $new; } public function fabric_inspection_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='date_notification'; $where=array('status'=>0); $date_wise_data=$this->vendor_model->get_customerdata($table,$where); $data['date_rel_data']=$this->vendor_model->get_customerdata($table,$where); $d=$date_wise_data->req_date; if($date_wise_data->module_status == 'old') { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspections_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } else { if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' ) { //$d=date('d-m-Y'); $table='fabric_inspection'; $where=$d; $where1=array('created_date'=>$d,'insert_notification_status'=>0); $data['fabric_inspection_inserted_rows']=$this->vendor_model->fabric_inspection_update_getsuborder1($where); $data['fabric_inspection_rows']=$this->vendor_model->count_amount_get_customerdata($table,$where1); } else { $data['fabric_inspection_inserted_rows']=array(); $data['fabric_inspection_rows']=0; } } $data['total_res_fabric']= $data['fabric_inspection_rows'] ; $data['page_static']='fabric_inspection'; $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/notification_page',$data); $this->load->view('templates/footer_inside'); } public function access_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public function add_indent_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function location_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); //print_r($this->marketing_model->display_product_data());exit; $data['getalldata'] = $this->store_model->display_location_data(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/fabric_inword',$data); $this->load->view('templates/footer_inside'); } public function add_indent() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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(); $table='indent_add_indent'; $indent=$this->vendor_model->max_select_indent_no($table); $data['indent_no']=$indent->sl_indent_no+1; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['producttype1'] = ""; $data['unit1'] = ""; $data['required_on1']=""; $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_product_data($table); $table1='shade_master'; $data['shadetype']=$this->vendor_model->fetch_where_data($table1); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $table2='color_master'; $data['colors']=$this->vendor_model->fetch_where_data($table2); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } public function add_link_product() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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(); $table='purchase_master'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['getalldata_weft'] = $this->yarn_model->display_weft_yarnqty_data(); $data['getalldata'] = $this->yarn_model->display_warp_yarnqty_data(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_link_product',$data); $this->load->view('templates/footer_inside'); } public function indent_add() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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(); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table2='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table2); $table1='color_master'; $data['colors']=$this->vendor_model->fetch_where_data($table1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } public function purchase_order() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $data['indent']=$this->vendor_model->fetch_where_data($table); $table='indent_purchase_order'; $indent=$this->vendor_model->max_select_purchase_no($table); $data['sl_no']=$indent->sl_no+1; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase_order',$data); $this->load->view('templates/footer_inside'); } public function add_received_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/recived_details',$data); $this->load->view('templates/footer_inside'); } public function yarn_add_received_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/yarn_recived_details',$data); $this->load->view('templates/footer_inside'); } public function cs_add_received_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/cs_recived_details',$data); $this->load->view('templates/footer_inside'); } public function vendordetails() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/vendor'); $this->load->view('templates/footer_inside'); } public function vendor_master() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['country'] = $this->yarn_model->getcountries(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/vendor_master',$data); $this->load->view('templates/footer_inside'); } public function vendor_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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/vendor_details_grid'); $this->load->view('templates/footer_inside'); } public function purchase_order_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { //<!----add from -------------> $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $data1=array(); foreach($m_id as $menu_id) { $table='access_action_rights'; $where=array('menu_id'=>$menu_id,'department_id'=>$user_type_id_row); $arr=$this->vendor_model->get_where_row($table,$where); if(empty($arr)) { } else { //print_r($arr); $menu_id=$arr->menu_id; $table='swansilk_menu'; $where=array('menu_id'=>$menu_id); $url=$this->vendor_model->get_where_row($table,$where); if($url->reference_url == $data['val']) { $data['access_row']=$arr; } } } //----------tiill-------------------- $table='indent_add_indent'; $where=array('po_generated'=>0,'confirm'=>'Yes'); $data['confirmed_data']=$this->vendor_model->get_data_sl_fetch($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase_order_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function purchase_order_List() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $RT = substr($uri, strpos($uri, "/") + 12); if($RT == 'vendor/purchase_order_List?prop_id=1') { $data['url_val']='1'; $data['val']='vendor/purchase_order_List?prop_id=1'; $data['ref']='indent'; } else if($RT == 'vendor/purchase_order_List?prop_id=2') { $data['val']='vendor/purchase_order_List?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,'financ_year'=>$financial_year); $data['app_list']=$this->vendor_model->dashboard_po_no($table,$where); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1,'financ_year !='=>$financial_year); $data['pre_app_list']=$this->vendor_model->dashboard_po_no($table,$where); } else if($RT == 'vendor/purchase_order_List?prop_id=3') { $data['url_val']='3'; $data['val']='vendor/purchase_order_List?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,'financ_year'=>$financial_year); $data['app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1,'financ_year !='=>$financial_year); $data['pre_app_list']=$this->vendor_model->monthly_approved_po_generate($table,$m,$y); } else if($RT == 'vendor/purchase_order_List?prop_id=4') { $data['url_val']='4'; $data['val']='vendor/purchase_order_List?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,'financ_year'=>$financial_year); $data['app_list']=$this->vendor_model->year_approved_po_generate($table,$y); $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1,'financ_year !='=>$financial_year); $data['pre_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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase_order_list'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function redirect_purchase_order_List() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase_order_list'); $this->load->view('templates/footer_inside'); } public function vendor_master_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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-------------------- $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/vendor_master_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function add_link_product_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $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-------------------- $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_link_product_grid',$data); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function link_product() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; //<!----add from-------------> $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_id=$id['userid']; $table='employee_details'; $where=array('id'=>$approved_id); $dept_id_row=$this->vendor_model->get_where_row($table,$where); $user_type_id_row=$dept_id_row->user_type_id; //----------tiill-------------------- $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/link_product'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function insert_vendor_master_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); $idd=$this->session->userdata('logged_in'); $where=array('id'=>$idd); $data['approved_by']=$idd['username']; $d=date('d-m-Y'); $data = array( 'name' => $this->input->post('name'), 'import_fileno' => $this->input->post('importfileno'), 'address' => $this->input->post('comment'), 'city' => $this->input->post('city'), 'country' => $this->input->post('country'), 'pincode' => $this->input->post('pincode'), 'gst_no' => $this->input->post('gst_no'), 'pan_no' => $this->input->post('pan_no'), 'phone'=>$this->input->post('phone'), 'email'=>$this->input->post('email'), 'product'=>$this->input->post('product'), 'company_name' => $this->input->post('company_name'), 'amount' => $this->input->post('amount'), 'bank_name' => $this->input->post('bank_name'), 'bank_address' => $this->input->post('bank_address'), 'ac_no' => $this->input->post('ac_no'), 'swift_code' => $this->input->post('swift_code'), 'currency' => $this->input->post('currency'), 'ifsc_code' => $this->input->post('ifsc_code'), 'edit' => 'Select', 'status' => '1', 'created_by'=>$data['approved_by'], 'created_date'=>$d ); $table='indent_vendor_master'; $this->db->insert($table,$data); } public function update_vendor_master_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); $idd=$this->session->userdata('logged_in'); $where=array('id'=>$idd); $data['approved_by']=$idd['username']; $d=date('d-m-Y'); $vendor_id = $this->input->post('vendor_id'); $data = array( 'name' => $this->input->post('name'), 'import_fileno' => $this->input->post('importfileno'), 'address' => $this->input->post('comment'), 'city' => $this->input->post('city'), 'country' => $this->input->post('country'), 'pincode' => $this->input->post('pincode'), 'gst_no' => $this->input->post('gst_no'), 'pan_no' => $this->input->post('pan_no'), 'phone'=>$this->input->post('phone'), 'email'=>$this->input->post('email'), 'product'=>$this->input->post('product'), 'company_name' => $this->input->post('company_name'), 'amount' => $this->input->post('amount'), 'bank_name' => $this->input->post('bank_name'), 'bank_address' => $this->input->post('bank_address'), 'ac_no' => $this->input->post('ac_no'), 'swift_code' => $this->input->post('swift_code'), 'currency' => $this->input->post('currency'), 'ifsc_code' => $this->input->post('ifsc_code'), 'edit' => 'Select', 'status' => '1', 'updated_by'=>$data['approved_by'], 'updated_on'=>$d ); $where=array('id'=>$vendor_id); $table='indent_vendor_master'; $this->vendor_model->update_data($where,$table,$data); } public function insert_product_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); $data['approved_by']=$id['username']; $d=date('d-m-Y'); $data = array( 'product' => $this->input->post('product_name'), 'product_type' => $this->input->post('product_type'), 'product_description' => $this->input->post('product_desc'), 'construction_details' => $this->input->post('composition'), 'details' => $this->input->post('details'), 'width' => $this->input->post('width'), 'weight' => $this->input->post('weight'), 'unit' => $this->input->post('unit'), 'mill' => $this->input->post('mill'), 'price_mtr' => $this->input->post('price_mtr'), 'grade' => $this->input->post('grade'), 'references' => $this->input->post('reference'), 'yarntype' => $this->input->post('yarntype'), 'yarnquality' => $this->input->post('yarnquality'), 'yarnname' => $this->input->post('yarnname'), 'yarndenier' => $this->input->post('yarndenier'), 'yarnspecification' => $this->input->post('yarnspecification'), 'hanklength' => $this->input->post('hanklength'), 'hankweight' => $this->input->post('hankweight'), 'cgst' => $this->input->post('cgst'), 'sgst' => $this->input->post('sgst'), 'igst' => $this->input->post('igst'), 'edit' => 'Select', 'status' => '1', 'created_by'=>$data['approved_by'], 'created_date'=>$d ); $table='indent_product'; $this->db->insert($table,$data); } public function insert_product_link_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); $datass = array( 'product' => $this->input->post('p_name'), 'product_type' => $this->input->post('p_type'), 'product_description' => $this->input->post('p_desc'), 'vendor_name' => $this->input->post('v_name'), 'vendor_phone' => $this->input->post('v_phone'), 'vendor_address' => $this->input->post('v_address'), 'vendor_email' => $this->input->post('v_email'), 'status' => '1' ); $table='product_vendor'; $this->db->insert($table,$datass); } public function insert_purchase_order_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); $data['rec_sl_no'] = $this->input->post('sl_no'); $fetch_no = $this->input->post('indent_no'); $table='indent_add_indent'; $where=array('indent_no'=>$fetch_no); $data['fecth_no_data']=$this->vendor_model->get_customerdata($table,$where); $data = array( 'sl_no' => $this->input->post('sl_no'), 'indent_no' => $this->input->post('indent_no'), 'sl_indent_no' => $this->input->post('sl_indent_no'), 'supplier_name' => $this->input->post('supplier_name'), 'comment' => $this->input->post('comment'), 'rate_inr' => $this->input->post('rate_in_inr'), 'value_inr' => $this->input->post('value_in_inr'), 'edit' => 'Select', 'confirm' => 'No', 'remark' => ' ', 'status' => '1' ); $table='indent_purchase_order'; $this->db->insert($table,$data); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $data['indent']=$this->vendor_model->fetch_where_data($table); $table='indent_purchase_order'; $indent=$this->vendor_model->max_select_purchase_no($table); //$data['sl_no']=$indent->sl_no+1; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase_order',$data); $this->load->view('templates/footer_inside'); } public function update_purchase_order_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->input->post('id'); $data = array( 'sl_no' => $this->input->post('sl_no'), 'indent_no' => $this->input->post('indent_no'), 'supplier_name' => $this->input->post('supplier_name'), 'comment' => $this->input->post('comment'), 'remark' => $this->input->post('remark'), 'rate_inr' => $this->input->post('rate_in_inr'), 'value_inr' => $this->input->post('value_in_inr'), 'edit' => 'Select', 'status' => '1' ); $where=array('id'=>$id); $table='indent_purchase_order'; $this->vendor_model->update_data($where,$table,$data); } public function vendor_master_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_vendor_master'; $where=array('status'=>1); $detail=$this->vendor_model->get_data($table,$where); echo json_encode($detail); } public function search_by_customer() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $customer=$this->input->post('customer'); $where=array('product'=>$customer); $data=$this->vendor_model->get_customerdata($table,$where); echo json_encode($data); //print_r($data1); } public function vendor_add_link_product_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Fabrics'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_add_link_product_type_raw() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Yarn - Raw'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_add_link_product_type_twisted() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Yarn - Twisted'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_add_link_product_type_dyed() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Yarn - Dyed'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_add_link_product_type_consumables() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Consumables'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_add_link_product_type_spares() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Spares'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function vendor_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table='indent_po'; $where=array('po_id'=>$i); $detail=$this->vendor_model->getgoods_data($table,$where); foreach($detail as $d) { $table = 'indent_yarn_goods_details'; $where = array('po_list_id'=>$d->id); $getalldata = $this->vendor_model->fetch_tare_sum_update($where); $getalldata1 = $this->vendor_model->fetch_net_sum_update($where); $getalldata2= $this->vendor_model->fetch_gross_sum_update($where); $t_w=round($getalldata->tare_weight,2); $n_w=round($getalldata1->net_weight,2); $g_w=round($getalldata2->gross_weight,2); $table='indent_po'; $where=array('id'=>$d->id); $data=array('tare_weight'=>$t_w,'net_weight'=>$n_w,'gross_weight'=>$g_w); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } $gets = $this->uri->segment(4); $getss = $this->uri->segment(5); $rget=$gets.'/'.$getss; if($getss == '') { $table='indent_po'; $where=array('po_id'=>$i,'po_no'=>$gets); } else { $table='indent_po'; $where=array('po_id'=>$i,'po_no'=>$rget); } $details=$this->vendor_model->getgoods_data($table,$where); echo json_encode($details); } public function goods_details_subgrid_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); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $getalldata = $this->vendor_model->get_where_row($table,$where); $where=$getalldata->po_id; $getalldatae = $this->vendor_model->get_issue_purchase_table_data_grid_fabric($where); // $table = 'indent_goods_details'; // $where = array('po_list_id'=>$i); // $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldatae); } public function cs_goods_details_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_cs_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function cs_goods_subgrid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_cs_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_where_cinsumable_subgrid_data1($i); echo json_encode($getalldata); } public function yarn_goods_details_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_yarn_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->new_Stores_fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function add_vendor_link_product_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='product_vendor'; $where=array('status'=>1); $detail=$this->vendor_model->get_data($table,$where); echo json_encode($detail); } public function insert_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); $this->form_validation->set_rules('department', 'Department', 'trim|required|xss_clean|callback_uniq_producttype'); $this->form_validation->set_rules('consumed_at', 'Consumed At', 'trim|required|xss_clean'); //$this->form_validation->set_rules('fabricType', 'Fabric Type', 'trim|required|xss_clean'); $shade=$this->input->post('shades'); $color_shade=$this->input->post('color_shade'); $color_code=$this->input->post('color_code'); // if($shade!="") // { // $shades=$shade; // } // else // { // $shades=$color_code; // } if($color_code!="") { $shadees=$color_code; } else { $shadees=''; } if($color_shade!="") { $shades=$color_shade; } else { $shades=$shade; } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $data = array( 'sl_indent_no' => $this->input->post('sl_indent_no'), 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'product_id' => $this->input->post('product_id'), 'quantity' => $this->input->post('quantity'), 'unit' => $this->input->post('unitt'), 'purpose' => $this->input->post('purpose'), 'required_on' => $this->input->post('required_on_date'), 'product_type' => $this->input->post('producttypee'), 'shades' =>$shades, 'color_code' => $shadees, 'width' => $this->input->post('indentwidth').'CMS', 'yarn_details' => $this->input->post('det'), 'indented_by' => $approved_by, 'indented_date' => $d, 'confirm' => 'No', 'edit' => 'Select', 'generate_po' => 'Generate', 'status' => '1', 'yarn_dyed_shade' => $this->input->post('dyed_ssl_code'), ); $table='indent_add_indent'; $this->db->insert($table,$data); $v= $this->input->post('update_submit'); if($v == '') { $data['indent_no1'] = $this->input->post('indent_no'); $data['department_no1'] = $this->input->post('department'); $data['consumed_at_no1'] = $this->input->post('consumed_at'); $data['sl_indent_no1'] = $this->input->post('sl_indent_no'); $data['purpose1'] = $this->input->post('purpose'); $data['producttype1'] = $this->input->post('producttypee'); $data['unit1'] = $this->input->post('unitt'); $data['required_on1']=$this->input->post('required_on_date'); $table1='shade_master'; $data['shadetype']=$this->vendor_model->fetch_where_data($table1); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } else{ $data['val'] = 'vendor/add_indent_details'; $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; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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-------------------- $table1='shade_master'; $data['shadetype']=$this->vendor_model->fetch_where_data($table1); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid',$data); $this->load->view('templates/footer_inside'); } } } public function indent_grid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $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-------------------- //<!----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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid'); $this->load->view('templates/footer_inside'); } public function insert_goods_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); if($_FILES['file']['name']) { //echo "a"; $config['upload_path']='uploads/files/'; $config['allowed_types'] = 'gif|jpg|png|jpeg|pdf'; $this->load->library('upload',$config); if(! $this->upload->do_upload('document')) { //echo 'error'; } else { $config['source_image']=$this->upload->upload_path.$this->upload->file_name; $target='uploads/files/'.$this->upload->file_name; //echo $target; } } else { $target=""; //echo $target; } $data = array( 'po_no' => $this->input->post('po_no_id'), 'purpose' => $this->input->post('purpose'), 'invoice_no_id' => $this->input->post('invoice_no_id'), 'department' => $this->input->post('department'), 'date' => $this->input->post('current_date'), 'received_from' => $this->input->post('rec_from'), 'quantity' => $this->input->post('quantity'), 'rate' => $this->input->post('rate'), 'value' => $this->input->post('value'), 'description_of_goods' => $this->input->post('des_goods'), 'received_by' => $this->input->post('rec_by'), 'receiving_goods' => $this->input->post('recv_goods'), 'sending_goods' => $this->input->post('send_goods'), 'indent_approved_by' => $this->input->post('indented_by'), 'po_approved_by' => $this->input->post('po_approved_by'), 'document' => $target, 'status' => '1' ); $table='indent_goods'; $this->db->insert($table,$data); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/recived_details',$data); $this->load->view('templates/footer_inside'); } public function update_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $idd=$this->session->userdata('logged_in'); $where=array('id'=>$idd); $data['approved_by']=$idd['username']; $updated_on=date('d-m-Y'); $id = $this->input->post('id'); $shade=$this->input->post('shades'); $color_shade=$this->input->post('color_shade'); $color_code=$this->input->post('color_code'); if($color_code!="") { $shadees=$color_code; } else { $shadees=''; } if($color_shade!="") { $shades=$color_shade; } else { $shades=$shade; } $data = array( 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'sl_indent_no' => $this->input->post('sl_indent_no'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'product_id' => $this->input->post('product_id'), 'quantity' => $this->input->post('quantity'), 'unit' => $this->input->post('unit'), 'purpose' => $this->input->post('purpose'), 'required_on' => $this->input->post('required_on'), 'product_type' => $this->input->post('product_type'), 'width' => $this->input->post('width'), 'shades' => $shades, 'color_code' => $shadees, 'edit' => 'Select', 'generate_po' => 'Generate', 'confirm' => 'No', 'status' => '1', 'updated_on'=>$updated_on, 'updated_by'=>$data['approved_by'], 'yarn_dyed_shade' => $this->input->post('dyed_shade'), ); $where=array('id'=>$id); $table='indent_add_indent'; $this->vendor_model->update_data($where,$table,$data); } public function update_product_link_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); $data['approved_by']=$id['username']; $d=date('d-m-Y'); $product_id = $this->input->post('product_id'); $data = array( 'product' => $this->input->post('product_name'), 'product_type' => $this->input->post('product_type'), 'product_description' => $this->input->post('product_desc'), 'construction_details' => $this->input->post('composition'), 'details' => $this->input->post('details'), 'width' => $this->input->post('width'), 'weight' => $this->input->post('weight'), 'unit' => $this->input->post('unit'), 'mill' => $this->input->post('mill'), 'price_mtr' => $this->input->post('update_price_mtr'), 'grade' => $this->input->post('grade'), 'references' => $this->input->post('reference'), 'yarntype' => $this->input->post('yarntype'), 'yarnquality' => $this->input->post('yarnquality'), 'yarnname' => $this->input->post('yarnname'), 'yarndenier' => $this->input->post('yarndenier'), 'yarnspecification' => $this->input->post('yarnspecification'), 'hanklength' => $this->input->post('hanklength'), 'hankweight' => $this->input->post('hankweight'), 'cgst' => $this->input->post('cgst'), 'sgst' => $this->input->post('sgst'), 'igst' => $this->input->post('igst'), 'edit' => 'Select', 'status' => '1', 'updated_by'=>$data['approved_by'], 'updated_on'=>$d ); $where=array('id'=>$product_id); $table='indent_product'; $this->vendor_model->update_data($where,$table,$data); } public function insert_osl_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); $this->form_validation->set_rules('department', 'Department', 'trim|required|xss_clean|callback_uniq_producttype'); $this->form_validation->set_rules('consumed_at', 'Consumed At', 'trim|required|xss_clean'); //$this->form_validation->set_rules('fabricType', 'Fabric Type', 'trim|required|xss_clean'); $shade=$this->input->post('shades'); $color_shade=$this->input->post('color_shade'); $color_code=$this->input->post('color_code'); // if($shade!="") // { // $shades=$shade; // } // else // { // $shades=$color_code; // } if($color_code!="") { $shadees=$color_code; } else { $shadees=''; } if($color_shade!="") { $shades=$color_shade; } else { $shades=$shade; } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $data = array( 'sl_indent_no' => $this->input->post('sl_indent_no'), 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'product_id' => $this->input->post('product_id'), 'quantity' => $this->input->post('quantity'), 'unit' => $this->input->post('unitt'), 'purpose' => $this->input->post('purpose'), 'purpose_shadeid' => $this->input->post('purpose_shadeid'), 'required_on' => $this->input->post('required_on_date'), 'product_type' => $this->input->post('producttypee'), 'shades' =>$shades, 'color_code' => $shadees, 'width' => $this->input->post('indentwidth').'CMS', 'yarn_details' => $this->input->post('det'), 'indented_by' => $approved_by, 'indented_date' => $d, 'confirm' => 'No', 'edit' => 'Select', 'generate_po' => 'Generate', 'status' => '1' ); $table='indent_add_indent'; $this->db->insert($table,$data); $v= $this->input->post('update_submit'); if($v == '') { $data['indent_no1'] = $this->input->post('indent_no'); $data['department_no1'] = $this->input->post('department'); $data['consumed_at_no1'] = $this->input->post('consumed_at'); $data['sl_indent_no1'] = $this->input->post('sl_indent_no'); $data['purpose1'] = $this->input->post('purpose'); $data['producttype1'] = $this->input->post('producttypee'); $data['unit1'] = $this->input->post('unitt'); $data['required_on1']=$this->input->post('required_on_date'); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } else{ $data['val'] = 'vendor/add_indent_details'; $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; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid',$data); $this->load->view('templates/footer_inside'); } } } public function add_indent_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; if($id['usertype'] > 2) { $table='indent_add_indent'; $where=array('confirm'=>'No','po_generated'=>0,'indented_by'=>$approved_by); $detail=$this->vendor_model->get_data1($table,$where); echo json_encode($detail); } else { $table='indent_add_indent'; $where=array('confirm'=>'No','po_generated'=>0); $detail=$this->vendor_model->get_data1($table,$where); echo json_encode($detail); } } public function add_indent_subgrid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $where=array('status'=>1,'confirm'=>'Yes'); $detail=$this->vendor_model->get_data1($table,$where); echo json_encode($detail); } public function add_indent_subgrid_unconfirm_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $where=array('status'=>1,'confirm'=>'No'); $detail=$this->vendor_model->get_data1($table,$where); echo json_encode($detail); } public function add_indent_grid_confirm_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $where=array('po_generated'=>0,'confirm'=>'Yes'); $detail=$this->vendor_model->get_data21($table,$where); echo json_encode($detail); } public function unconfirmed_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->get_data($table,$where); echo json_encode($detail); } public function add_purchase_grid_details() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_result_created_po_generate($table,$m,$y); } else if($get == 'syear_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_result_created_po_generate($table,$y); } echo json_encode($detail); } public function add_purchase_grid_confirmed_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_purchase_order'; $where=array('confirm'=>'yes'); $detail=$this->vendor_model->get_data($table,$where); echo json_encode($detail); } public function auto_sea() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Getsearch($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->product; } echo json_encode($data); } public function auto_sea_pono() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Getsearch_pono($keyword); //print_r($data1); foreach($data1 as $row) { $data_val[]=$row->po_no; } echo json_encode($data_val); } public function search_by_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $customer=$this->input->post('customer'); $where=array('product'=>$customer); $data1=$this->vendor_model->get_where_data($table,$where); echo json_encode($data1); //print_r($data1); } public function auto() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Get_search($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->name; } echo json_encode($data); } public function auto_names() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Get_search_name($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->name; } echo json_encode($data); } public function vendor_search_by_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_vendor_master'; $customer=$this->input->post('customer'); $where=array('name'=>$customer); $data1=$this->vendor_model->get_where_data($table,$where); echo json_encode($data1); //print_r($data1); } public function get_indent_no() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $indent=$this->vendor_model->max_select_indent_no($table); $data1=$indent->sl_indent_no+1; echo json_encode($data1); } public function get_indent_no1() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_purchase_order'; $indent=$this->vendor_model->max_select_purchase_no($table); $data1=$indent->sl_no+1; echo json_encode($data1); } public function indent_id_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); //$pizza = substr($uri, strpos($uri, "/") + 1); //$url= explode("?", $pizza); //$data['val']=$url[0]; $table='indent_add_indent'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); $str=$data['fetch_data']->width; $data['numbers'] = preg_replace('/[^0-9]/', '', $str); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } public function indent_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); //$pizza = substr($uri, strpos($uri, "/") + 1); //$url= explode("?", $pizza); //$data['val']=$url[0]; $table='indent_add_indent'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); $str=$data['fetch_data']->width; $data['numbers'] = preg_replace('/[^0-9]/', '', $str); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table1='shade_master'; $data['shadetype']=$this->vendor_model->fetch_where_data($table1); $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } public function indent_ids() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); //$pizza = substr($uri, strpos($uri, "/") + 1); //$url= explode("?", $pizza); //$data['val']=$url[0]; $table='indent_add_indent'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); $str=$data['fetch_data']->width; $data['numbers'] = preg_replace('/[^0-9]/', '', $str); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='shade_master'; $data['shade_type']=$this->vendor_model->fetch_where_data($table1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_indent_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_add_indent'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['fetch_data']); //die(); $csgst=$data['fetch_data']->product_id; $table='indent_product'; $where=array('id'=>$csgst); $data['product_data']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $data['fin_y']=$financial_year; $table='indent_po'; $where=array('financ_year'=>$financial_year); // $indent=$this->vendor_model->max_select_purchase_no($table); $indent=$this->vendor_model->max_select_years_purchase_no($table,$where); //print_r($where); // die(); $data['sl_no']=$indent->po_id+1; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/po_generate',$data); $this->load->view('templates/footer_inside'); } public function vendor_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_add_indent'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_delete_fun() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_add_indent'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_delete_po() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_po'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_delete_fabric() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_goods_details'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_delete_yarn() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_yarn_goods_details'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_delete_spares() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_cs_goods_details'; $d=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_cs_goods_details'; $this->vendor_model->delete_vendor($table,$where); $table='indent_cs_goods_details'; $where=array('po_list_id'=>$d->po_list_id); $r=$this->vendor_model->get_data_customer($table); if(empty($r)) { $table='indent_po'; $where=array('id'=>$d->po_list_id); $data=array('quantity_approval'=>'NOT YET'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } else { $table='indent_po'; $where=array('id'=>$d->po_list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } return true; } public function purchase_order_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_po'; $this->vendor_model->delete_vendor($table,$where); return true; } public function delete_product_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='product_vendor'; $this->db->where($where); $this->db->delete($table); return true; } public function receive_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_goods'; $this->db->where($where); $this->db->delete($table); return true; } public function sub_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'weaving_factory_stock'; $where = array('id'=>$id); $this->vendor_model->delete_vendor($table,$where); // $this->db->where($where); // $this->db->delete($table); return true; } public function receive_yarn_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'create_yarntwisting_work_order'; $where = array('id'=>$id); $this->db->where($where); $this->db->delete($table); return true; } public function sub_yarn_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'work_order_twisting'; $where = array('id'=>$id); $this->db->where($where); $this->db->delete($table); return true; } public function sub_received_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'indent_goods_details'; $where = array('id'=>$id); $this->db->where($where); $this->db->delete($table); return true; } public function sub_yarn_twist_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'work_order_twisting'; $where = array('id'=>$id); $this->db->where($where); $this->db->delete($table); return true; } public function receive_yarn_twisting_details_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $table = 'create_yarntwisting_work_order'; $where = array('id'=>$id); $this->db->where($where); $this->db->delete($table); return true; } public function vendor_delete_order() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_add_indent'; $this->vendor_model->delete_vendor($table,$where); return true; } public function delete_purchase() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_purchase_order'; $this->db->where($where); $this->db->delete($table); return true; } public function vendor_master_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_vendor_master'; $this->vendor_model->delete_vendor($table,$where); return true; } public function vendor_edit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_vendor_master'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); $data['str']=$data['fetch_data']->import_fileno; $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['country'] = $this->yarn_model->getcountries(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/vendor_master',$data); $this->load->view('templates/footer_inside'); } public function auto_complete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $where=array('confirm'=>'Yes'); $data1=$this->vendor_model->Getsearch_auto($keyword,$where); //print_r($data1); foreach($data1 as $row) { $data[]=$row->indent_no; } echo json_encode($data); } public function auto_complete_vendor_name() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Getsearch_vendorname_auto($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->name; } echo json_encode($data); } public function auto_complete_shade() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Getsearch_shade_auto($keyword); //print_r($data1); foreach($data1 as $row) { $data[]=$row->color; } echo json_encode($data); } public function add_yes_confirmation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','remark'=>$remarks,'approved_by'=>$approved_by,'approved_date'=>$current_date); $table= 'indent_add_indent'; $details = $this->vendor_model->update_confirm_indent($data1,$where1); return true; } public function add_no_confirmation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post("id"); $where=array('id'=>$id); $data=array('confirm'=>'No'); $table= 'indent_add_indent'; $details = $this->vendor_model->update_new($data,$where); return true; } public function purchase_id() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_purchase_order'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $data['indent']=$this->vendor_model->fetch_where_data($table); $table='indent_purchase_order'; $indent=$this->vendor_model->max_select_purchase_no($table); $data['sl_no']=$indent->sl_no+1; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/update_purchse_order',$data); $this->load->view('templates/footer_inside'); } public function add_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $getalldata = $this->vendor_model->getsuborder1($i); echo json_encode($getalldata); } public function fetch_recived_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $po_no1 = $_REQUEST['po_no1']; // print_r($po_no1); // die(); $table=' indent_po'; $where=array('po_no'=>$po_no1); $data['po_no']=$this->vendor_model->get_customerdata($table,$where); // print_r($data['po_no']); // die(); $table='indent_goods'; $indent=$this->vendor_model->max_select_goods($table); $data['invoice_no']=$indent->invoice_no_id+1; $po_no_id=$data['po_no']->indent_no; $where1=array('indent_no'=>$po_no_id); $table1='indent_add_indent'; $data['result1']=$this->marketing_model->fetch_main_data($table1,$where1); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['recieved_by']=$id['username']; echo json_encode($data); } public function purchase_order_yes_confirmation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $where1=array('id'=>$id1); $data1=array('confirm'=>'Yes','remark'=>$remarks,'approved_by'=>$approved_by); $table= 'indent_purchase_order'; $details = $this->vendor_model->update_confirm_purchase($data1,$where1); return true; } public function purchase_order_no_confirmation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post("id"); $where=array('id'=>$id); $data=array('confirm'=>'No'); $table= 'indent_purchase_order'; $details = $this->vendor_model->update_confirm_purchase($data,$where); return true; } public function subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_add_indent'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->sl_indent_no; // print_r($data1); // die(); $table = 'indent_add_indent'; $where = array('sl_indent_no'=>$data1,'confirm'=>'No'); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function add_indent_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_add_indent'; $where = array('id'=>$i,'confirm'=>'Yes','po_generated'=>0); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->indent_no; // print_r($data1); // die(); $table = 'indent_add_indent'; $where = array('indent_no'=>$data1,'confirm'=>'Yes','po_generated'=>0); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function remark_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); $sl_indent_no = $this->input->post('sl_indent_no'); $data = array( 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'quantity' => $this->input->post('quantity'), 'purpose' => $this->input->post('purpose'), 'required_on' => $this->input->post('required_on'), 'generate_po' => 'Generate', 'edit' => 'Select', 'confirm' => 'No', 'status' => '1' ); $where=array('id'=>$sl_indent_no); $table='indent_add_indent'; $this->vendor_model->update_data($where,$table,$data); } public function add_purchase_order_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_add_indent'; $where = array('sl_indent_no'=>$i,'confirm'=>'Yes'); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); // $table='indent_purchase_order'; // $where=array('id'=>$val); // $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); // $data1=$indent->indent_no; // // // $table = 'indent_add_indent'; // $where = array('indent_no'=>$data1,'confirm'=>'No'); // $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function add_indent_unconfirm_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_add_indent'; $where = array('id'=>$i,'confirm'=>'No','po_generated'=>0); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->indent_no; // print_r($data1); // die(); $table = 'indent_add_indent'; $where = array('indent_no'=>$data1,'confirm'=>'No'); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function purchase_order_list_grid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $financ_year=$indent->financ_year; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'No','financ_year'=>$financ_year); $confirm='No'; $getalldata = $this->vendor_model->fetch_where_subgrid_datas1($data1,$financ_year,$confirm); echo json_encode($getalldata); } public function edit_product_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); $data['approved_by']=$id['username']; $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_product'; $where=array('id'=>$val); $data['fetch_product_data']=$this->vendor_model->get_customerdata($table,$where); $data['getalldata_weft'] = $this->yarn_model->display_weft_yarnqty_data(); $data['getalldata'] = $this->yarn_model->display_warp_yarnqty_data(); $data['userdetails']=$this->session_data_pass(); $table='purchase_master'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_link_product',$data); $this->load->view('templates/footer_inside'); } public function insert_new_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); $data['indent_no'] = $this->input->post('indent_no'); //$data['sl_indent_no'] = $this->input->post('sl_indent_no'); //$gen=$indent_no; //echo $gen; //$subcode_fun=array('subCode'=>$gen); echo json_encode($data); } public function create_unique() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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 ($_REQUEST['q'] == "import") { $charector = "I"; } else { $charector = "L"; } $this->db->like('import_fileno', $charector, 'after'); $query = $this->db->get('indent_vendor_master'); $invoiceno = $query->num_rows() + 1; $invID = str_pad($invoiceno, 5, '0', STR_PAD_LEFT); if ($_REQUEST['q'] == "import") { echo "I" . $invID; } else { echo "L" . $invID; } } public function add_indent_grid_unconfirm_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_add_indent'; $where=array('confirm'=>'No','po_generated'=>0); $detail=$this->vendor_model->get_sl_data1($table,$where); echo json_encode($detail); } public function update_purchase_order_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_purchase_order'; $where = array('sl_no'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data($table,$where); $id=$getalldata->sl_indent_no; $id1=$getalldata->id; $getalldata1 = $this->vendor_model->fetch_where_subgrid_data2($id,$id1); echo json_encode($getalldata1); } public function edit_update_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); $product_name=$_REQUEST['add_product']; $quantity=$_REQUEST['quantity']; $rate_inr=$_REQUEST['rate_inr']; $value_inr=$_REQUEST['value_inr']; $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $po_no= $id[0]; $get = $this->uri->segment(4); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $sl_indent_no= $id[0]; $table = 'indent_add_indent'; $where = array('sl_indent_no'=>$sl_indent_no); $getalldata = $this->vendor_model->fetch_where_subgrid_data($table,$where); $indent_no=$getalldata->indent_no; $data = array( 'sl_indent_no' => $sl_indent_no, 'po_id' => $po_no, 'indent_no' =>$indent_no, 'product_name' => $product_name, 'quantity' => $quantity, 'rate_inr' => $rate_inr, 'value_inr' => $value_inr, 'status' => '1' ); $table='indent_product_details'; $this->db->insert($table,$data); } public function productlist() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $type=$_REQUEST['type']; $productlist = $this->vendor_model->getproducts($type); echo json_encode($productlist); } public function getunit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $type=$_REQUEST['type']; $productlist = $this->vendor_model->getunit($type); echo json_encode($productlist); } public function generated_product_wish_list() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data2=$_REQUEST['ids']; $data1=substr($data2, 0, -1); $exp=array(); $path = explode("|", $data1); $exp = array_merge($exp, $path); $data1=array(); foreach($exp as $val) { $table='indent_add_indent'; $where=array('id'=>$val); $arr=$this->vendor_model->get_wish_list_dataa($val); array_push($data1,$arr); } $data['confirmed_data']=$data1; $table='indent_po'; //$indent=$this->vendor_model->max_select_purchase_no($table); // $data_sl_no=$indent->po_id+1; //if($data_sl_no == 1) //{ //$data['sl_no']=124; //} //else //{ //$data['sl_no']=$indent->po_id+1; //} $table='indent_po'; $where=array('financ_year'=>$financial_year); // $indent=$this->vendor_model->max_select_purchase_no($table); $indent=$this->vendor_model->max_select_years_purchase_no($table,$where); //print_r($where); // die(); $data['sl_no']=$indent->po_id+1; $data['fin_y']=$financial_year; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/po_generate',$data); $this->load->view('templates/footer_inside'); } public function insert_po_data() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $po_num = $this->input->post('po_no'); $where=array('po_no'=>$po_num); $po_details=$this->vendor_model->get_customerdata($table,$where); if(empty($po_details)) { $ind_id = $this->input->post('ind_id'); $where1=array('id'=>$ind_id); $data1=array('po_generated'=>'1'); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $cred_by=$id['username']; $table= 'indent_add_indent'; $this->vendor_model->update_po_list_confirm_purchase($table,$data1,$where1); if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $transaction_data = array( 'po_no' => $this->input->post('po_no'), 'shades' => $this->input->post('shades'), 'cgst' => $this->input->post('cgst'), 'sgst' => $this->input->post('sgst'), 'igst' => $this->input->post('igst'), 'width' => $this->input->post('width'), 'po_id' => $this->input->post('po_id'), 'indent_id' => $this->input->post('ind_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'product_name' => $this->input->post('p_name'), 'product_id' => $this->input->post('product_id'), 'confirm'=>'No', 'indent_no' => $this->input->post('i_no'), 'department' => $this->input->post('department'), 'indent_approved_by'=> $this->input->post('approved_by'), 'indent_approved_date' => $this->input->post('approved_date'), 'currency'=>$this->input->post('currency'), 'quantity'=>$this->input->post('quantityy'), 'unit'=>$this->input->post('unit'), 'indent_unit'=>$this->input->post('indent_unit'), 'purpose'=>$this->input->post('purpose'), 'product_type'=>$this->input->post('product_type'), 'edit' => 'Edit', 'financ_year'=>$financial_year, 'inrvalue' => $this->input->post('inrvalue'), //'gstval' => $this->input->post('gstval'), 'totalvalue' => $this->input->post('totalvalue'), 'ot_charges' => $this->input->post('ot_charges'), 'description' => $this->input->post('description'), 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'status'=>'1', 'created_date'=>date('d-m-Y'), 'created_by' => $cred_by, 'indented_by' => $this->input->post('indented_by'), ); $table='indent_po'; $this->db->insert($table,$transaction_data); $quantity=$this->input->post('quantity_val'); if(empty($quantity)) { } else { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $transaction_data1 = array( 'po_no' => $this->input->post('po_no'), 'po_id' => $this->input->post('po_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'product_name' => $this->input->post('ot_charges'), 'edit' => 'Edit', 'cgst' => $this->input->post('ot_cgst'), 'sgst' => $this->input->post('ot_sgst'), 'igst' => $this->input->post('ot_igst'), 'currency'=>$this->input->post('currency'), 'quantity'=>$this->input->post('quantity_val'), 'unit'=>$this->input->post('unit1'), 'financ_year'=>$financial_year, 'confirm'=>'No', 'inrvalue' => $this->input->post('inr_value_val'), //'gstval' => $this->input->post('gst_val_val'), 'totalvalue' => $this->input->post('total_value_val'), //'ot_charges' => $this->input->post('ot_charges'), 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'status'=>'1', 'created_by' => $cred_by, 'created_date'=>date('d-m-Y'), 'indented_by' => $this->input->post('indented_by'), ); $table='indent_po'; $this->db->insert($table,$transaction_data1); } $detail='not_existed'; echo json_encode($detail); } else { $detail='existed'; echo json_encode($detail); } } public function insert_po_multi_data() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $po_num = $this->input->post('po_no'); $where=array('po_no'=>$po_num); $po_details=$this->vendor_model->get_customerdata($table,$where); if(empty($po_details)) { $data2=$this->input->post('mul_ind_id'); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $cred_by=$id['username']; foreach($data2 as $val) { $table='indent_add_indent'; $where=array('id'=>$val); $data1=array('po_generated'=>'1'); $table= 'indent_add_indent'; $this->vendor_model->update_po_list_confirm_purchase($table,$data1,$where); } $p_name= $this->input->post('p_name'); $product_id= $this->input->post('product_id'); $approved_by= $this->input->post('approved_by'); $approved_date= $this->input->post('approved_date'); $i_no=$this->input->post('i_no'); $quantityy= $this->input->post('quantityy'); $unit=$this->input->post('unit'); $indent_unit=$this->input->post('indent_unit'); $department= $this->input->post('department'); $inrvalue=$this->input->post('inrvalue'); //$gstval= $this->input->post('gstval'); $totalvalue= $this->input->post('totalvalue'); $purpose= $this->input->post('purpose'); $indent_id=$this->input->post('mul_ind_id'); $shades = $this->input->post('shades'); $width = $this->input->post('width'); $product_type = $this->input->post('product_type'); $cgst = $this->input->post('cgst'); $sgst = $this->input->post('sgst'); $igst = $this->input->post('igst'); $description = $this->input->post('description'); $ind_by = $this->input->post('ind_by'); if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } foreach($p_name as $key=>$val) { $data=array('product_name'=>$p_name[$key], 'product_id'=>$product_id[$key], 'indent_no'=>$i_no[$key], 'department'=>$department[$key], 'quantity'=>$quantityy[$key], 'unit'=>$unit[$key], 'width'=>$width[$key], 'shades'=>$shades[$key], 'indent_id'=>$indent_id[$key], 'cgst'=>$cgst[$key], 'sgst'=>$sgst[$key], 'igst'=>$igst[$key], 'financ_year'=>$financial_year, 'indent_unit'=>$indent_unit[$key], 'inrvalue'=>$inrvalue[$key], //'gstval'=>$gstval[$key], 'indent_approved_by'=>$approved_by[$key], 'indent_approved_date'=>$approved_date[$key], 'totalvalue'=>$totalvalue[$key], 'purpose'=>$purpose[$key], 'product_type'=>$product_type[$key], 'description'=>$description[$key], 'indented_by'=>$ind_by[$key], 'po_no' => $this->input->post('po_no'), 'po_id' => $this->input->post('po_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'confirm'=>'No', 'currency'=>$this->input->post('currency'), 'ot_charges' => $this->input->post('ot_charges'), 'edit' => 'Edit', 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'status'=>'1', 'created_by' => $cred_by, 'created_date'=>date('d-m-Y'), ); //print_r($data); // die(); // if($unit[$key] != "" && $this->input->post('supplier_name') != "" && $description[$key] != "") // { $table='indent_po'; $this->db->insert($table,$data); //} } $quantity=$this->input->post('quantity_val'); if(empty($quantity)) { } else { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $transaction_data1 = array( 'po_no' => $this->input->post('po_no'), 'po_id' => $this->input->post('po_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'product_name' => $this->input->post('ot_charges'), 'confirm'=>'No', 'edit' => 'Edit', 'currency'=>$this->input->post('currency'), 'quantity'=>$this->input->post('quantity_val'), 'unit'=>$this->input->post('unit1'), //'width'=>$this->input->post('width'), 'inrvalue' => $this->input->post('inr_value_val'), 'sgst' => $this->input->post('osgst'), 'cgst' => $this->input->post('ocgst'), 'igst' => $this->input->post('oigst'), 'totalvalue' => $this->input->post('total_value_val'), //'ot_charges' => $this->input->post('ot_charges'), 'financ_year'=>$financial_year, 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'status'=>'1', 'created_date'=>date('d-m-Y'), 'created_by' => $cred_by, ); $table='indent_po'; $this->db->insert($table,$transaction_data1); } $detail='not_existed'; echo json_encode($detail); } else { $detail='existed'; echo json_encode($detail); } } public function purchase_order_list_yes_confirmation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id1=$this->input->post("id"); $remarks=$this->input->post("remarks"); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $current_date = date("d-m-Y"); $where1=array('id'=>$id1); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where1); $d_id=$d->po_id; $financ_year=$d->financ_year; $where2=array('po_id'=>$d_id,'financ_year'=>$financ_year); $table='indent_po'; $d_result=$this->vendor_model->get_podata($table,$where2); foreach($d_result as $r_id) { echo $r_id->id; $table='indent_po'; $where=array('id'=>$r_id->id); $data1=array('confirm'=>'Yes','remark'=>$remarks,'approved_by'=>$approved_by,'approved_date'=>$current_date); $table= 'indent_po'; $this->vendor_model->update_po_list_confirm_purchase($table,$data1,$where); } } public function confirmed_po_list() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Fabrics'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d/m/Y'); $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->new_stores_get_purchase_data1($d1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Fabrics'); // $detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_fabrics_datas($table,$where); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $o='Fabrics'; $a='Yes'; $detail=$this->vendor_model->mponthly_new_stores_fetch_dashboard_pos_list_id12($table,$m,$y,$o,$a); } else if($get == 'syear_dashboard') { $o='Fabrics'; $a='Yes'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->yearly_new_stores_fetch_dashboard_pos_list_id12($table,$y,$o,$a); } echo json_encode($detail); } public function confirmed_po_list_raw() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Raw'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Raw'; $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->news_dashboard_po_list_id_res($d1,$p1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Raw'); // $detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_yarns_raw_datas($table,$where); } else if($get == 'smonth_dashboard') { $p1='Yarn - Raw'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_news_dashboard_po_list_id_res($table,$m,$y,$p1); } else if($get == 'syear_dashboard') { $p1='Yarn - Raw'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_news_dashboard_po_list_id_res($table,$y,$p1); } echo json_encode($detail); } public function confirmed_po_list_twisted() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Twisted'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Twisted'; $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->news_dashboard_po_list_id_res($d1,$p1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Twisted'); //$detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_yarns_twist_datas($table,$where); } else if($get == 'smonth_dashboard') { $p1='Yarn - Twisted'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_news_dashboard_po_list_id_res($table,$m,$y,$p1); } else if($get == 'syear_dashboard') { $p1='Yarn - Twisted'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_news_dashboard_po_list_id_res($table,$y,$p1); } echo json_encode($detail); } public function confirmed_po_list_dyed() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Dyed'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $where1 = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'PARTLY'); $getalldata_status_c1 = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where1); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Yarn - Dyed'; $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->news_dashboard_po_list_id_res($d1,$p1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Dyed'); //$detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_yarns_dyed_datas($table,$where); } else if($get == 'smonth_dashboard') { $p1='Yarn - Dyed'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_news_dashboard_po_list_id_res($table,$m,$y,$p1); } else if($get == 'syear_dashboard') { $p1='Yarn - Dyed'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_news_dashboard_po_list_id_res($table,$y,$p1); } echo json_encode($detail); } public function cs_received_auto_sea_pono() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $status= array('Consumables', 'Spares'); $data1=$this->vendor_model->cs_received_Getsearch_pono($keyword,$status); foreach($data1 as $row) { $data_val[]=$row->po_no; } echo json_encode($data_val); } public function cs_received_issue_auto_sea_pono() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $status= array('Consumables', 'Spares'); $data1=$this->vendor_model->cs_received_issue_Getsearch_pono($keyword,$status); foreach($data1 as $row) { $data[]=$row->po_no; } echo json_encode($data); } public function cs_goods_details_subgrid_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); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $getalldata = $this->vendor_model->get_where_row($table,$where); $where=$getalldata->po_id; // $table = 'indent_po'; // $where = array('po_id'=>$r); // $result = $this->vendor_model->fetch_where_subgrid_data1($table,$where); // $data3=array(); // foreach($result as $r) // { // //print_r($r->id); // $where=$r->id; $getalldatae = $this->vendor_model->get_issue_purchase_table_data_grid_peenya($where); // array_push($data3,$arr); // } echo json_encode($getalldatae); } public function confirmed_po_list_consumables_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='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $detail=$this->vendor_model->get_issue_purchase_table_consum_data(); echo json_encode($detail); } public function confirmed_po_list_consumables() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Consumables'; $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->news_dashboard_cs_list_id_resul($d1,$p1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); // $detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_datas($table,$where); } else if($get == 'smonth_dashboard') { $p1='Consumables'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_news_cs_dashboard_po_list_id_resul($table,$m,$y,$p1); } else if($get == 'syear_dashboard') { $p1='Consumables'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_news_cs_dashboard_po_list_id_resul($table,$y,$p1); } echo json_encode($detail); } public function confirmed_po_list_spares() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Spares'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_yarn_goods_details'; $where=array('rec_date'=>$d1); $p1='Spares'; $table='indent_po'; $where=array('created_date'=>$d1); $detail=$this->vendor_model->news_dashboard_cs_list_id_resul($d1,$p1); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Spares'); //$detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_spares_datas($table,$where); } else if($get == 'smonth_dashboard') { $p1='Spares'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_news_cs_dashboard_po_list_id_resul($table,$m,$y,$p1); } else if($get == 'syear_dashboard') { $p1='Spares'; $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_news_cs_dashboard_po_list_id_resul($table,$y,$p1); } echo json_encode($detail); } public function confirmed_po_list_spares_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='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $detail=$this->vendor_model->get_issue_purchase_table_data_grid_spares_stock_data(); echo json_encode($detail); } public function confirmed_po_list_subgrid_fabric() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics'); $getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); echo json_encode($getalldata); } public function confirmed_po_list_consumable_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $data2=$indent->financ_year; //print_r($data1); //die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'financ_year'=>$data2,'confirm'=>'Yes','product_type'=>'Consumables'); $getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); // print_r($getalldata); echo json_encode($getalldata); } public function confirmed_po_list_spares_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares'); $getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); // print_r($getalldata); echo json_encode($getalldata); } public function confirmed_po_list_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw'); $getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); //print_r($getalldata); //die(); echo json_encode($getalldata); } public function confirmed_po_list_subgrid_twisted() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted'); $getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); echo json_encode($getalldata); } public function confirmed_po_list_subgrid_dyed() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = $data1; $getalldata = $this->vendor_model->group_indent_get_purchase_data3($table,$where); // print_r($getalldata); // die(); echo json_encode($getalldata); } public function edit_received_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$_REQUEST['id']; //$quantity=$_REQUEST['quantity']; $rate=$_REQUEST['rate']; $inr=$_REQUEST['inr']; $received_quantity=$_REQUEST['received_quantity']; $data = array( 'id' => $id, //'quantity' => $quantity, 'received_quantity' => $received_quantity, 'rate' => $rate, 'inr' => $inr, ); $table='indent_po'; $where=array('id'=>$id); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } public function add_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $list_id= $this->input->post('tr_id'); $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $po_id=$d->po_id; $po_no=$d->po_no; $indent_no=$d->indent_no; $quantity=$d->quantity; $rate=$d->rate; $inr=$d->inr; $data = array( 'rec_goods'=> $this->input->post('rec_goods'), 'rec_weight'=> $this->input->post('rec_weight'), 'consumed_at'=> $this->input->post('consumed_at'), 'indent_approved_by'=> $this->input->post('indented_by'), 'po_approved_by'=> $this->input->post('po_approved_by'), 'product_name'=> $this->input->post('product_name'), 'vendor_name'=> $this->input->post('vendor_name'), 'width'=> $this->input->post('width'), 'shades'=> $this->input->post('shades'), 'piece_no'=> $this->input->post('piece_no'), 'no_type'=> $this->input->post('in_dc_no'), 'no_type_val'=> $this->input->post('in_dc_val'), 'received_date'=> $this->input->post('received_date'), 'rec_by'=> $this->input->post('rec_by'), 'po_list_id'=> $this->input->post('tr_id'), 'po_id'=> $po_id, 'po_no'=> $po_no, 'indent_no'=> $indent_no, 'quantity'=> $quantity, 'rate'=> $rate, 'inr'=> $inr, 'status'=>'1', ); $table='indent_goods_details'; $this->db->insert($table,$data); $insert_val= $this->db->insert_id(); $i= $this->input->post('tr_id'); $table = 'indent_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_total_rec_goods($table,$where); $bal_qua=$getalldata->rec_goods; $bal_goods=$quantity; //print_r($bal_goods); // print_r($bal_qua); $bb_q=$bal_goods - $bal_qua; // print_r($bb_q); // die(); $table = 'indent_po'; $data=array('total_quantity'=>$bal_qua,'balanced_quantity'=>$bb_q); $where = array('id'=>$i); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $po_list_id= $this->input->post('tr_id'); $where=array('id'=>$po_list_id); $table='indent_po'; $indent_po_table=$this->vendor_model->get_customerdata($table,$where); $po_list_id1= $this->input->post('tr_id'); $where=array('po_list_id'=>$po_list_id1); $table='fabric_inspection_details'; $t=$this->store_model->fetch_where_subgrid_dataa($table,$where); if(empty($t->id)) { $rec_ggoods = $this->input->post('rec_goods'); $quty = $quantity - $rec_ggoods; $data = array('insert_goods_id'=>$insert_val, 'rec_goods'=> $this->input->post('rec_goods'), 'rec_bal_goods'=> $this->input->post('rec_goods'), 'rec_weight'=> $this->input->post('rec_weight'), 'consumed_at'=> $this->input->post('consumed_at'), 'indent_approved_by'=> $this->input->post('indented_by'), 'po_approved_by'=> $this->input->post('po_approved_by'), 'product_name'=> $this->input->post('product_name'), 'vendor_name'=> $this->input->post('vendor_name'), 'width'=> $this->input->post('width'), 'shades'=> $this->input->post('shades'), 'design'=> '', 'refernce_table'=> '', 'piece_no'=> $this->input->post('piece_no'), 'no_type'=> $this->input->post('in_dc_no'), 'no_type_val'=> $this->input->post('in_dc_val'), 'received_date'=> $this->input->post('received_date'), 'rec_by'=> $this->input->post('rec_by'), 'po_list_id'=> $this->input->post('tr_id'), 'po_id'=> $po_id, 'po_no'=> $po_no, 'indent_no'=> $indent_no, 'quantity'=> $quantity, 'available_quantity'=> $quty, 'rate'=> $rate, 'inr'=> $inr, 'status'=>'1', 'osl_like'=>'PO', 'unit'=>$indent_po_table->indent_unit, ); $table='fabric_inspection_details'; $this->db->insert($table,$data); } else { $rrec_goods = $this->input->post('rec_goods'); $table='fabric_inspection_details'; $where=array('id'=>$t->id); //$data=array('bal_goods'=>$sum); $tt=$this->store_model->fetch_where_subgrid_data($table,$where); $avil_quantity=$tt->available_quantity; $a_goods = $avil_quantity - $rrec_goods; $data = array('insert_goods_id'=>$insert_val, 'rec_goods'=> $this->input->post('rec_goods'), 'rec_bal_goods'=> $this->input->post('rec_goods'), 'rec_weight'=> $this->input->post('rec_weight'), 'consumed_at'=> $this->input->post('consumed_at'), 'indent_approved_by'=> $this->input->post('indented_by'), 'po_approved_by'=> $this->input->post('po_approved_by'), 'product_name'=> $this->input->post('product_name'), 'vendor_name'=> $this->input->post('vendor_name'), 'width'=> $this->input->post('width'), 'shades'=> $this->input->post('shades'), 'design'=> '', 'piece_no'=> $this->input->post('piece_no'), 'no_type'=> $this->input->post('in_dc_no'), 'no_type_val'=> $this->input->post('in_dc_val'), 'received_date'=> $this->input->post('received_date'), 'rec_by'=> $this->input->post('rec_by'), 'po_list_id'=> $this->input->post('tr_id'), 'po_id'=> $po_id, 'po_no'=> $po_no, 'indent_no'=> $indent_no, 'quantity'=> $quantity, 'available_quantity'=> $a_goods, 'rate'=> $rate, 'inr'=> $inr, 'status'=>'1', 'osl_like'=>'PO', 'unit'=>$indent_po_table->indent_unit, ); $table='fabric_inspection_details'; $this->db->insert($table,$data); } $where=array('po_list_id'=>$list_id); $table='fabric_inspection_details'; $bal=$this->store_model->fetch_where_rec_goods_total($table,$where); $where=array('po_list_id'=>$list_id); $table='fabric_inspection_details'; $bal_goods=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($bal); // die(); $v=$bal_goods->quantity; // print_r($v); // $vv=$bal->rec_goods; // print_r($vv); // $sum=$v - $vv; // print_r($sum); // die(); $table='fabric_inspection_details'; $where=array('po_list_id'=>$list_id); $data=array('bal_goods'=>$sum); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_goods_details'; $id=$this->input->post("tr_id"); $where=array('po_list_id'=>$id); $sum= $this->vendor_model->fetch_where_quantity_total($table,$where); $sum_quantity=$sum->rec_goods; $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $quantity=$d->quantity; $c_val11=$d->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11-$c_val12; if($sum_quantity >= $c_val1) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } elseif($sum_quantity < $c_val11) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } } public function history_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $data['val'] = substr($uri, strpos($uri, "/") + 12); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $access_menu_id=$this->access_details_id(); $m_id=unserialize($access_menu_id->menu_id); $check=""; foreach($m_id as $menu_id) { $table='swansilk_menu'; $where=array('delete_status'=>'ACTIVE','menu_id'=>$menu_id); $result= $this->marketing_model->fetch_main_data($table,$where); if($result->reference_url == $data['val']) { $check=$data['val']; } } if($check != "") { $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/history'); $this->load->view('templates/footer_inside'); } else { $this->session->sess_destroy(); redirect(base_url()); } } public function goods_details_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; // $table = 'indent_po'; // $where = array('id'=>$i); // $getalldata = $this->vendor_model->get_where_row($table,$where); // $where=$getalldata->po_id; // $getalldatae = $this->vendor_model->get_issue_purchase_table_data_grid_fabric($where); $table = 'indent_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function po_list_edit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_po'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['fetch_data']);//die(); $p_no = $data['fetch_data']->po_no; $table = 'indent_po'; $where = array('po_no'=>$p_no,'product_type != '=>''); $where1 = array('po_no'=>$p_no,'product_type'=>''); $data['fetch_set_data'] = $this->vendor_model->get_data_fetch($table,$where); //print_r($data['fetch_set_data']); //die(); $data['fetch_other_data'] = $this->vendor_model->get_data_fetch($table,$where1); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='indent_po'; $data['url_val']='1'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/edit_po_generate',$data); $this->load->view('templates/footer_inside'); } public function po_pending_edit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_po'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['fetch_data']);//die(); $p_no = $data['fetch_data']->po_no; $table = 'indent_po'; $where = array('po_no'=>$p_no,'product_type != '=>''); $where1 = array('po_no'=>$p_no,'product_type'=>''); $data['fetch_set_data'] = $this->vendor_model->get_data_fetch($table,$where); //print_r($data['fetch_set_data']); //die(); $data['fetch_other_data'] = $this->vendor_model->get_data_fetch($table,$where1); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='today_preview'; $data['url_val']='2'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/edit_po_generate',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_pending_edit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_po'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['fetch_data']);//die(); $p_no = $data['fetch_data']->po_no; $table = 'indent_po'; $where = array('po_no'=>$p_no,'product_type != '=>''); $where1 = array('po_no'=>$p_no,'product_type'=>''); $data['fetch_set_data'] = $this->vendor_model->get_data_fetch($table,$where); //print_r($data['fetch_set_data']); //die(); $data['fetch_other_data'] = $this->vendor_model->get_data_fetch($table,$where1); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='monthly_preview'; $data['url_val']='3'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/edit_po_generate',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_edit() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_po'; $where=array('id'=>$val); $data['fetch_data']=$this->vendor_model->get_customerdata($table,$where); //print_r($data['fetch_data']);//die(); $p_no = $data['fetch_data']->po_no; $table = 'indent_po'; $where = array('po_no'=>$p_no,'product_type != '=>''); $where1 = array('po_no'=>$p_no,'product_type'=>''); $data['fetch_set_data'] = $this->vendor_model->get_data_fetch($table,$where); //print_r($data['fetch_set_data']); //die(); $data['fetch_other_data'] = $this->vendor_model->get_data_fetch($table,$where1); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='year_preview'; $data['url_val']='4'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/edit_po_generate',$data); $this->load->view('templates/footer_inside'); } public function update_po_multi_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); $idd=$this->session->userdata('logged_in'); $where=array('id'=>$idd); $data['approved_by']=$idd['username']; $updated_on=date('d-m-Y'); $data2=$this->input->post('mul_ind_id'); $pr_type=$this->input->post('pp_type'); //indented_by $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $c_by=$id['username']; foreach($data2 as $val) { $table='indent_po'; $where=array('id'=>$val); $rows_id=$this->vendor_model->issue_fabric_exported_stock($table,$where); $table='indent_po'; $where=array('id'=>$val); $this->vendor_model->delete_vendor($table,$where); } $data2=$this->input->post('mul_ind_id'); $p_name= $this->input->post('p_name'); $pro_id= $this->input->post('pro_id'); //print_r($p_name); //die(); $shades=$this->input->post('shades'); $width= $this->input->post('width'); $i_no=$this->input->post('i_no'); $quantityy= $this->input->post('quantityy'); $unit=$this->input->post('unit'); $department= $this->input->post('department'); $inrvalue=$this->input->post('inrvalue'); $description= $this->input->post('description'); $totalvalue= $this->input->post('totalvalue'); $rate_val= $this->input->post('rate_val'); //$inr_val= $this->input->post('inr_val'); $indent_unit= $this->input->post('indent_unit'); $purpose= $this->input->post('purpose'); $sgst= $this->input->post('sgst'); $cgst= $this->input->post('cgst'); $i_igst= $this->input->post('i_igst'); $indent_approved_by = $this->input->post('approved_by'); $indent_id = $this->input->post('indent_id'); $indent_width = $this->input->post('indent_width'); foreach($p_name as $key=>$val) { $data1=array( 'product_id'=>$pro_id[$key], 'product_name'=>$p_name[$key], 'indent_no'=>$i_no[$key], 'department'=>$department[$key], 'quantity'=>$quantityy[$key], 'unit'=>$unit[$key], 'inrvalue'=>$inrvalue[$key], 'description'=>$description[$key], 'totalvalue'=>$totalvalue[$key], 'product_type'=>$pr_type[$key], 'rate'=>$rate_val[$key], //'inrvalue'=>$inr_val[$key], 'indent_unit'=>$indent_unit[$key], 'purpose'=>$purpose[$key], 'indent_id'=>$indent_id[$key], 'shades'=>$shades[$key], 'width'=>$width[$key], 'sgst'=>$sgst[$key], 'cgst'=>$cgst[$key], 'igst'=>$i_igst[$key], 'width'=>$indent_width[$key], 'po_no' => $this->input->post('po_no'), 'po_id' => $this->input->post('po_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'confirm'=>'No', 'currency'=>$this->input->post('currency'), 'ot_charges' => $this->input->post('ot_charges'), 'edit' => 'Edit', 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'indent_approved_by' => $this->input->post('approved_by'), 'created_by' => $c_by, 'created_date'=>$rows_id->created_date, 'indented_by' => $this->input->post('indented_by'), 'status'=>'1', 'updated_on'=>$updated_on, 'updated_by'=>$data['approved_by'], ); $table='indent_po'; $this->db->insert($table,$data1); } $ot_id=$this->input->post('ot_id'); //print_r($data2); //die(); $table='indent_po'; $where=array('id'=>$ot_id); $this->vendor_model->delete_vendor($table,$where); $quantity_val=$this->input->post('quantity_val'); if(empty($quantity_val)) { } else { $transaction_data1 = array( 'po_no' => $this->input->post('po_no'), 'po_id' => $this->input->post('po_id'), 'vendor_name' => $this->input->post('supplier_name'), 'g_date' => $this->input->post('g_date'), 'address' => $this->input->post('address'), 'product_name' => $this->input->post('ot_charges'), 'edit' => 'Edit', 'currency'=>$this->input->post('currency'), 'quantity'=>$this->input->post('quantity_val'), 'unit'=>$this->input->post('unit1'), 'confirm'=>'No', 'inrvalue' => $this->input->post('inr_value_val'), 'sgst' => $this->input->post('osgst'), 'cgst' => $this->input->post('ocgst'), 'igst' => $this->input->post('oigst'), 'totalvalue' => $this->input->post('total_value_val'), //'ot_charges' => $this->input->post('ot_charges'), 'total_amt' => $this->input->post('total_amt'), 'discount' => $this->input->post('discount'), 'grand_total' => $this->input->post('g_total'), 'note' => $this->input->post('note'), 'comment' => $this->input->post('comment'), 'gst_no' => $this->input->post('gst_no'), 'terms_payment' => $this->input->post('terms_payment'), 'bank_details' => $this->input->post('bank_details'), 'indent_approved_by' => $this->input->post('approved_by'), 'created_by' => $c_by, 'indented_by' => $this->input->post('indented_by'), 'status'=>'1', ); $table='indent_po'; $this->db->insert($table,$transaction_data1); } } public function receive_quantity() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $id=$this->input->post("id"); $where=array('id'=>$id); $data['quantity'] = $this->vendor_model->fetch_where_subgrid_data($table,$where); $yarn=$data['quantity']->product_id; $table='indent_product'; $where=array('id'=>$yarn); $data['yarn_details'] = $this->vendor_model->fetch_where_subgrid_data($table,$where); $st=$data['quantity']->product_name; $strArray = explode(' ',$st); $data['p_name'] = $strArray[1]; $table='indent_goods_details'; $id=$this->input->post("id"); $where=array('po_list_id'=>$id); $data['sum_quantity']= $this->vendor_model->fetch_where_quantity_total($table,$where); $c_val11=$data['quantity']->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11+$c_val12; $c_val2=$data['sum_quantity']->rec_goods; $data['c_val']=$c_val1 - $c_val2; // print_r($data['c_val']); // die(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); echo json_encode($data); } public function history_fetched_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; // $details = $this->vendor_model->history_data_fetch_po($table); $details = $this->vendor_model->history_data_fetch_new_po($table); echo json_encode($details); } public function product_delete() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('id'); $where=array('id'=>$id); $table='indent_product'; $this->vendor_model->delete_vendor($table,$where); return true; } public function fetch_yarn_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table="import_yarn"; $where=array('id'=>$i); $details=$this->vendor_model->get_data_fetch($table,$where); echo json_encode($details); } public function fetch_productyarn_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table="indent_product"; $where=array('id'=>$i); $details=$this->vendor_model->get_data_fetch($table,$where); echo json_encode($details); } public function add_yarn_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $list_id= $this->input->post('tr_id'); $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $po_id=$d->po_id; $po_no=$d->po_no; $indent_no=$d->indent_no; $quantity=$d->quantity; $rate=$d->rate; $inr=$d->inr; $data = array( 'rec_date'=> $this->input->post('rec_date'), 'yarnname'=> $this->input->post('yarnname'), 'yarndenier'=> $this->input->post('yarndenier'), 'yarnspecification'=> $this->input->post('yarnspecification'), 'invoice'=> $this->input->post('invoice'), 'received_date'=> $this->input->post('received_date'), 'received_quality'=>$this->input->post('received_quality'), 'lot'=> $this->input->post('lot'), 'bale'=> $this->input->post('bale'), 'po_list_id'=> $this->input->post('tr_id'), 'gross_weight'=> $this->input->post('gross_weight'), 'net_weight'=> $this->input->post('net_weight'), 'issue_gross_weight'=> $this->input->post('gross_weight'), 'issue_net_weight'=> $this->input->post('net_weight'), 'tare_weight'=> $this->input->post('tare_weight'), 'mill'=> $this->input->post('mill'), 'grade'=> $this->input->post('grade'), 'consumed_at'=> $this->input->post('consumed_at'), 'ssl_shade'=> $this->input->post('yarn_dyed_shades'), 'rec_by'=> $this->input->post('received_by'), 'status'=>'1', ); $table='indent_yarn_goods_details'; $this->db->insert($table,$data); $i= $this->input->post('tr_id'); $table = 'indent_yarn_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_total_yarn_rec_goods($table,$where); $bal_qua=$getalldata->gross_weight; $bal_goods=$quantity; //print_r($bal_goods); // print_r($bal_qua); $bb_q=$bal_goods - $bal_qua; // print_r($bb_q); // die(); $table = 'indent_po'; $data=array('total_quantity'=>$bal_qua,'balanced_quantity'=>$bb_q); $where = array('id'=>$i); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_yarn_goods_details'; $id=$this->input->post("tr_id"); $where=array('po_list_id'=>$id); $sum= $this->vendor_model->fetch_where_cs_quantity_total($table,$where); $sum_quantity=$sum->gross_weight; $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $quantity=$d->quantity; $c_val11=$d->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11-$c_val12; if($sum_quantity >= $c_val1) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_yarn_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } elseif($sum_quantity < $c_val11) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_yarn_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } } public function add_cs_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $list_id= $this->input->post('tr_id'); $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $po_id=$d->po_id; $po_no=$d->po_no; $indent_no=$d->indent_no; $quantity=$d->quantity; $rate=$d->rate; $inr=$d->inr; $data = array( 'rec_date'=> $this->input->post('rec_date'), 'invoice'=> $this->input->post('invoice'), 'consumed_at'=> $this->input->post('consumed_at'), 'received_quality'=> $this->input->post('received_quality'), 'received_bal_quality'=> $this->input->post('received_quality'), 'received_date'=> $this->input->post('received_date'), 'po_list_id'=> $this->input->post('tr_id'), 'po_id'=> $this->input->post('po_id1'), 'rec_by'=> $this->input->post('received_by'), 'status'=>'1', ); $table='indent_cs_goods_details'; $this->db->insert($table,$data); $r_quality= $this->input->post('received_quality'); $table = 'cs_addstock'; $i= $this->input->post('tr_id'); $where = array('cs_id'=>$i); $getall_issue_data = $this->vendor_model->fetch_total_spares_issue_rec_goods($table,$where); // print_r($getall_issue_data); // die(); //$bal_val=$getalldata->received_quality; $bal_issue=$getall_issue_data->balanced_quantity; if($bal_issue != '') { $bal_quaa=$r_quality + $bal_issue; $table = 'indent_po'; $data=array('total_quantity'=>$bal_quaa,'balanced_quantity'=>$bb_q); $where = array('id'=>$i); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } else { $i= $this->input->post('tr_id'); $table = 'indent_cs_goods_details'; $where = array('po_list_id'=>$i); $getalldata = $this->vendor_model->fetch_total_spares_rec_goods($table,$where); $bal_qua=$getalldata->received_quality; $bal_goods=$quantity; $bb_q=$bal_goods - $bal_qua; $table = 'indent_po'; $data=array('total_quantity'=>$bal_qua,'balanced_quantity'=>$bb_q); $where = array('id'=>$i); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } $table='indent_cs_goods_details'; $id=$this->input->post("tr_id"); $where=array('po_list_id'=>$id); $sum= $this->vendor_model->fetch_where_consum_spares_quantity_total($table,$where); $sum_quantity=$sum->received_quality; $where=array('id'=>$list_id); $table='indent_po'; $d=$this->vendor_model->get_customerdata($table,$where); $quantity=$d->quantity; $c_val11=$d->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11-$c_val12; if($sum_quantity >= $c_val1) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_cs_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Completed'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } elseif($sum_quantity < $c_val11) { $table='indent_po'; $where=array('id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); $table='indent_cs_goods_details'; $where=array('po_list_id'=>$list_id); $data=array('quantity_approval'=>'Partly'); $this->vendor_model->update_po_list_confirm_purchase($table,$data,$where); } } public function yarn_raw_auto_sea_pono() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $status= array('Yarn - Raw', 'Yarn - Twisted', 'Yarn - Dyed'); // $where=array('product_type'=>'Yarn - Raw', 'product_type'=>'Yarn - Twisted' , 'product_type'=>'Yarn - Dyed'); $data1=$this->vendor_model->yarn_raw_Getsearch_pono($keyword,$status); //print_r($data1); foreach($data1 as $row) { $data_val[]=$row->po_no; } echo json_encode($data_val); } public function cs_goods_stock_details_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_cs_goods_details'; $where = array('po_list_id'=>$i,'quantity_approval'=>'Completed'); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function receive_cs_quantity() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $id=$this->input->post("id"); $where=array('id'=>$id); $data['quantity'] = $this->vendor_model->fetch_where_subgrid_data($table,$where); $table='indent_cs_goods_details'; $id=$this->input->post("id"); $where=array('po_list_id'=>$id); $data['sum_quantity']= $this->vendor_model->fetch_where_consum_spares_quantity_total($table,$where); $where=array('po_list_id'=>$id); $table='indent_cs_goods_details'; $data['location']= $this->vendor_model->get_customerdata($table,$where); $c_val11=$data['quantity']->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11+$c_val12; $c_val2=$data['sum_quantity']->received_quality; $data['c_val']=$c_val1 - $c_val2; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); echo json_encode($data); } public function receive_yarn_quantity() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $id=$this->input->post("id"); $where=$id; $data_quantity = $this->vendor_model->group_indent_get_purchase_details1($table,$where); if($data_quantity->yarn_dyed_shade == '') { $data['quantity'] = $this->vendor_model->group_indent_get_purchase_details2($table,$where); $data['s']=' '; } else { //$data['quantity'] = $this->vendor_model->group_indent_get_purchase_details($table,$where); $data['quantity'] = $this->vendor_model->group_indent_get_shade_purchase_details($table,$where); $data['s']=$data['quantity']->shadeName; } if($data_quantity->color_code == '') { $data['c']=' '; } else { $data['c']=$data_quantity->color_code; } $yarn=$data['quantity']->product_id; // print_r($yarn); // die(); $table='indent_product'; $where=array('id'=>$yarn); $data['yarn_details'] = $this->vendor_model->fetch_where_subgrid_data($table,$where); $table='indent_yarn_goods_details'; $id=$this->input->post("id"); $where=array('po_list_id'=>$id); $data['sum_quantity']= $this->vendor_model->fetch_where_cs_net_quantity_total($table,$where); // $c_val1=$data['quantity']->quantity; // $c_val2=$data['sum_quantity']->gross_weight; // $data['c_val']=$c_val1 - $c_val2; $c_val11=$data['quantity']->quantity; $c_val12=$c_val11*15 /100; $c_val1=$c_val11+$c_val12; $c_val2=$data['sum_quantity']->net_weight; $data['c_val']=$c_val1 - $c_val2; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $where=array('id'=>$id['userid']); $table='employee_details'; $data['emp_loc']=$this->vendor_model-> get_customerdata($table,$where); echo json_encode($data); } public function insert_product_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); $data = array( 'product' => $this->input->post('product_name'), 'product_type' => $this->input->post('product_type'), 'unit' => $this->input->post('unit'), 'mill' => $this->input->post('mill'), 'grade' => $this->input->post('grade'), 'references' => $this->input->post('reference'), 'yarntype' => $this->input->post('yarntype'), 'yarnquality' => $this->input->post('yarnquality'), 'yarnname' => $this->input->post('yarnname'), 'yarndenier' => $this->input->post('yarndenier'), 'yarnspecification' => $this->input->post('yarnspecification'), 'hanklength' => $this->input->post('hanklength'), 'hankweight' => $this->input->post('hankweight'), 'edit' => 'Select', 'status' => '1' ); $table='indent_product'; $this->db->insert($table,$data); } public function edit_yarn_product_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_product'; $where=array('id'=>$val); $data['fetch_product_data']=$this->vendor_model->get_customerdata($table,$where); // print_r($data['fetch_product_data']); // die(); $data['getalldata_weft'] = $this->yarn_model->display_weft_yarnqty_data(); $data['getalldata'] = $this->yarn_model->display_warp_yarnqty_data(); $data['userdetails']=$this->session_data_pass(); $table='purchase_master'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/edit_link_product'); $this->load->view('templates/footer_inside'); } public function yarn_goods_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table="indent_product"; $where=array('id'=>$i); $details=$this->vendor_model->get_data_fetch($table,$where); echo json_encode($details); } public function delete_yarn_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); $id1=$this->input->post("id"); $where=array('id'=>$id1); $table= 'indent_product'; $details = $this->vendor_model->delete_vendor($table,$where); return true; } public function update_product_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); $product_id = $this->input->post('product_id'); $table='indent_product'; $where=array('id'=>$product_id); $id=$this->vendor_model->get_customerdata($table,$where); $g_id=$id->id; $idd=$this->session->userdata('logged_in'); $where=array('id'=>$idd); $data['approved_by']=$idd['username']; $d=date('d-m-Y'); if(empty($g_id)) { $data = array( 'product' => $this->input->post('product_name'), 'product_type' => $this->input->post('product_type'), 'unit' => $this->input->post('unit'), 'mill' => $this->input->post('mill'), 'grade' => $this->input->post('grade'), 'references' => $this->input->post('reference'), 'yarntype' => $this->input->post('yarntype'), 'yarnquality' => $this->input->post('yarnquality'), 'yarnname' => $this->input->post('yarnname'), 'yarndenier' => $this->input->post('yarndenier'), 'yarnspecification' => $this->input->post('yarnspecification'), 'hanklength' => $this->input->post('hanklength'), 'hankweight' => $this->input->post('hankweight'), 'sgst' => $this->input->post('sgst'), 'cgst' => $this->input->post('cgst'), 'igst' => $this->input->post('igst'), 'edit' => 'Select', 'status' => '1', 'created_by'=>$data['approved_by'], 'created_date'=>$d ); $table='indent_product'; $this->db->insert($table,$data); } else { $data = array( 'product' => $this->input->post('product_name'), 'product_type' => $this->input->post('product_type'), 'unit' => $this->input->post('unit'), 'mill' => $this->input->post('mill'), 'grade' => $this->input->post('grade'), 'references' => $this->input->post('reference'), 'sgst' => $this->input->post('sgst'), 'cgst' => $this->input->post('cgst'), 'igst' => $this->input->post('igst'), 'edit' => 'Select', 'status' => '1', 'updated_by'=>$data['approved_by'], 'updated_on'=>$d ); $table='indent_product'; $where=array('id'=>$product_id); $this->vendor_model->update_data($where,$table,$data); } } public function indent_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; // $val = substr($uri, strpos($uri, "=") + 1); $val=$this->uri->segment(3); $val2=$this->uri->segment(4); $where=array('id'=>$val); $table='indent_add_indent'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; if($val2==1){ $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No'); }else { $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'Yes'); } $table='indent_add_indent'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No','product_type' =>'FABRICS'); $table='indent_add_indent'; $data['width_fetch_data1']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No','product_type' =>'Fabrics'); $table='indent_add_indent'; $data['width_fetch_data12']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'Yes','product_type'=>'Yarn - Dyed'); $table='indent_add_indent'; $data['fetch_dyed_data']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent',$data); $this->load->view('templates/footer_inside'); } public function purchase_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $financ_year=$data['fetch']->financ_year; $where=array('po_id'=>$po_id,'financ_year'=>$financ_year); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase',$data); $this->load->view('templates/footer_inside'); } public function po_purchase_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_approved_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase',$data); $this->load->view('templates/footer_inside'); } public function po_approved_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='year_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/purchase',$data); $this->load->view('templates/footer_inside'); } public function fabric_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function consumable_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function spares_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function yarn_dyed_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function yarn_twisted_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function yarn_raw_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/goods_recived'); $this->load->view('templates/footer_inside'); } public function pre_approved_purchase_grid_details() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1,'financ_year !='=>$financial_year); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','financ_year !='=>$financial_year); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No','financ_year !='=>$financial_year); $detail=$this->vendor_model->monthly_result_approved_po_generate($table,$m,$y); } else if($get == 'syear_dashboard') { $table='indent_po'; $where=array('confirm'=>'No','financ_year !='=>$financial_year); $detail=$this->vendor_model->year_result_approved_po_generate($table,$y); } echo json_encode($detail); } public function approved_purchase_grid_details() { if (date('m') <= 3) { $financial_year = (date('y')-1) . '/' . date('y'); } else { $financial_year = date('y') . '/' . (date('y') + 1); } $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $m=date('m'); $y=date('Y'); if($get == 'stoday_dashboard') { $d1=date('d-m-Y'); $table='indent_po'; $where=array('approved_date'=>$d1); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'sindent') { $table='indent_po'; $where=array('confirm'=>'Yes','financ_year'=>$financial_year); $detail=$this->vendor_model->get_purchase_data($table,$where); } else if($get == 'smonth_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->monthly_result_approved_po_generate($table,$m,$y); } else if($get == 'syear_dashboard') { $table='indent_po'; $where=array('confirm'=>'No'); $detail=$this->vendor_model->year_result_approved_po_generate($table,$y); } echo json_encode($detail); } public function purchase_order_approved_list_grid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_po'; $where = array('id'=>$i); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $financ_year=$indent->financ_year; // print_r($data1); // die(); $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','financ_year'=>$financ_year); $confirm='Yes'; //$getalldata = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $getalldata = $this->vendor_model->fetch_where_subgrid_datas1($data1,$financ_year,$confirm); echo json_encode($getalldata); } //////////////////////////////////////////////////////////////////// public function add_indent_grid_approved_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['username']; if($id['usertype'] > 2) { $table='indent_add_indent'; $where=array('confirm'=>'Yes','indented_by'=>$approved_by); $detail=$this->vendor_model->get_data_desc($table,$where); echo json_encode($detail); } else { $table='indent_add_indent'; $where=array('confirm'=>'Yes'); $detail=$this->vendor_model->get_data_desc($table,$where); echo json_encode($detail); } } public function add_indent_approved_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'indent_add_indent'; $where = array('id'=>$i,'confirm'=>'Yes'); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->indent_no; // print_r($data1); // die(); $table = 'indent_add_indent'; $where = array('indent_no'=>$data1,'confirm'=>'Yes'); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function auto_fetch() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword = $_REQUEST['po_no']; $data1=$this->vendor_model->Getsearch_id_pono($keyword); foreach($data1 as $row) { $data[]=$row; } echo json_encode($data); } public function fetch_recived_id_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $po_no1 = $_REQUEST['po_no']; // print_r($po_no1); // die(); $table=' indent_po'; $where=array('id'=>$po_no1,'confirm'=>'Yes','product_type'=>'Fabrics'); $data['po_no']=$this->vendor_model->get_customerdata($table,$where); echo json_encode($data); } public function resetpassword() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $email= $this->input->post('email'); $login_table= 'employee_details'; $check_email= array('email'=>$email); $email= $this->session->set_userdata($check_email); $checkingemail= $this->vendor_model->get_customerdata($login_table,$check_email); print_r($checkingemail); die(); } public function purchase_grn_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $financ_year=$data['po_details']->financ_year; $where=array('po_id'=>$val1,'financ_year'=>$financ_year); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = $this->indent_page_notifications(); $data['total_stock_notifications']=$this->stock_page_notifications(); $data['inward_purchases_notifications']= $this->inward_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['issue_loom_notifications']= $this->issue_loom_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['issue_loom_notifications'] + $data['inward_purchases_notifications'];$data['indent_p']='indent_preview'; $data['access'] = $this->access_details(); $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function po_purchase_grn_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['indent_p']='today_preview'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function grn_po_approved_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['indent_p']='year_preview'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $data['indent_p']='year_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function grn_po_purchase_order_approved_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['indent_p']='monthly_preview'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function po_purchase_grn_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications'];$data['indent_p']='today_preview'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function vendor_add_link_product_type_services() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_product'; $where=array('status'=>1,'product_type'=>'Services'); $detail=$this->vendor_model->geting_data($table,$where); echo json_encode($detail); } public function purchase_order_approved_grn_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='monthly_preview'; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function po_approved_grn_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); // print_r($val); // die(); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); // print_r($data['po_details']->product_type); // die(); if($data['po_details']->product_type == 'FABRICS') { $where=array('po_list_id'=>$val); $table='indent_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['goods_details']=$this->store_model->get_data_fetch($table,$where); $table1='indent_po'; $where1=array('po_id'=>$po_id); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); $po_id=$goods_id->po_id; $where=array('po_id'=>$po_id); $table='indent_goods_details'; $data['product_details']=$this->store_model->getproduct_data_fetch($table,$where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['indent_p']='year_preview'; $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/goods_recived',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Yarn - Raw' || $data['po_details']->product_type == 'Yarn - Twisted' || $data['po_details']->product_type == 'Yarn - Dyed') { $where=array('po_list_id'=>$val); $table='indent_yarn_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $po_id=$goods_id->po_list_id; $where=array('po_id'=>$val1); $table='indent_yarn_goods_details'; $data['goods_details']=$this->store_model->fetch_yarn_new_data($where); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['indent_p']='year_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/yarn_raw_goods_details',$data); $this->load->view('templates/footer_inside'); } else if($data['po_details']->product_type == 'Consumables' || $data['po_details']->product_type == 'Spares') { $where=array('po_list_id'=>$val); $table='indent_cs_goods_details'; $goods_id=$this->store_model->fetch_where_subgrid_data($table,$where); $where=array('id'=>$val); $table='indent_po'; $data['po_details']=$this->store_model->fetch_where_subgrid_data($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details1']=$this->store_model->fetch_where_subgrid_data1($table,$where); $val1=$data['po_details']->po_id; $where=array('po_id'=>$val1); $table='indent_po'; $data['po_details11']=$this->store_model->fetch_where_subgrid_data1($table,$where); if(empty($goods_id)) { } else { $where=$goods_id->po_id; $data['goods_details']=$this->store_model->get_data_cs_fetch($where); $table1='indent_po'; $po_idd=$goods_id->po_list_id; $where1=array('id'=>$po_idd); $data['prpose_details']=$this->store_model->get_data_fetch($table1,$where1); } $data['back_fun']='grn'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $data['indent_p']='year_preview'; $this->load->view('templates/header_inside',$data); $this->load->view('new_stores/consumable_spares_preview',$data); $this->load->view('templates/footer_inside'); } } public function loom_subgrid() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; $table = 'issue_loom'; $where = array('weaving_panel_id'=>$i); $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); // $data1=$indent->order_id; // $data2=$indent->article; // $table = 'weaving_panel_planning_order'; // $where = array('order_id'=>$data1,'article'=>$data2); // $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); echo json_encode($getalldata); } public function raw_yarn_goods_subgrid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; // print_r($i); // $table = 'indent_yarn_goods_details'; // $where = array('po_list_id'=>$i); // $getalldata = $this->vendor_model->fetch_where_subgrid_data1($table,$where); $table = 'indent_po'; $where = array('id'=>$i); $getalldata = $this->vendor_model->get_where_row($table,$where); $where=$getalldata->po_id; $table = 'indent_po'; $where = array('po_id'=>$where); $get_po_id=$this->vendor_model->get_podata($table,$where); $data1=array(); foreach($get_po_id as $val) { $table='indent_yarn_goods_details'; $where=$val->id; $arr=$this->vendor_model->get_issue_purchase_table_data_grid_stock_yarn_raw($where); if(empty($arr)) { } else { array_push($data1,$arr); } } $data2=array(); foreach($data1 as $dd) { foreach($dd as $d) { $arry=array( 'id' => $d->id, 'yarnname' => $d->yarnname, 'rec_date' => $d->rec_date, 'invoice' => $d->invoice, 'received_date' => $d->received_date, 'lot' => $d->lot, 'bale' => $d->bale, 'gross_weight' => $d->gross_weight, 'net_weight' => $d->net_weight, 'tare_weight' => $d->tare_weight, 'mill' => $d->mill, 'grade' => $d->grade, 'consumed_at' => $d->consumed_at, 'rec_by' => $d->rec_by, ); array_push($data2,$arry); } } // print_r($data2); // die(); //$getalldatae = $this->vendor_model->get_issue_purchase_table_data_grid_stock_yarn_raw($where); // print_r($getalldata); // die(); echo json_encode($data2); } public function twisting_yarn_goods_details_subgrid() { $get = $this->uri->segment(3); preg_match_all('!\d+!', $get, $matches); $id=""; foreach($matches as $matches) { $id=$matches; } $i= $id[0]; // print_r($i); // die(); $table = 'indent_po'; $where = array('id'=>$i); $getalldata = $this->vendor_model->get_where_row($table,$where); $where=$getalldata->po_id; $table = 'indent_po'; $where = array('po_id'=>$where); $get_po_id=$this->vendor_model->get_podata($table,$where); $data1=array(); foreach($get_po_id as $val) { $table='indent_yarn_goods_details'; $where=$val->id; $arr=$this->vendor_model->get_issue_purchase_table_data_grid_stock_yarn_raw($where); if(empty($arr)) { } else { array_push($data1,$arr); } } $data2=array(); foreach($data1 as $dd) { foreach($dd as $d) { $arry=array( 'id' => $d->id, 'yarnname' => $d->yarnname, 'rec_date' => $d->rec_date, 'invoice' => $d->invoice, 'received_date' => $d->received_date, 'lot' => $d->lot, 'bale' => $d->bale, 'gross_weight' => $d->gross_weight, 'net_weight' => $d->net_weight, 'tare_weight' => $d->tare_weight, 'mill' => $d->mill, 'grade' => $d->grade, 'consumed_at' => $d->consumed_at, 'rec_by' => $d->rec_by, ); array_push($data2,$arry); } } // print_r($data2); // die(); //$getalldatae = $this->vendor_model->get_issue_purchase_table_data_grid_stock_yarn_raw($where); // print_r($getalldata); // die(); echo json_encode($data2); //echo json_encode($getalldata); } public function vendor_fabric_delete_fun() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('as'); $where=array('id'=>$id); $table='indent_goods_details'; $this->vendor_model->delete_vendor($table,$where); $where=array('insert_goods_id'=>$id); $table='fabric_inspection_details'; $this->vendor_model->delete_vendor($table,$where); return true; } public function outsource_consumable_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val1 = substr($uri, strpos($uri, "=") + 1); $arr = explode('/',trim($val1)); //print_r($arr[1]); $data['location']=$arr[0]; $data['yarn_type']=$arr[1]; $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $data['userdetails'] = $this->session_data_pass(); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('out_source_master/consumable_spares_location',$data); $this->load->view('templates/footer_inside'); } public function outsource_cs_location() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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"]; $val1 = substr($uri, strpos($uri, "=") + 1); $arr = explode('/',trim($val1)); //print_r($arr[1]); $get=$arr[0]; $yarn_type=$arr[1]; // print_r($arr); // die(); if($get == 'HO') { $gett='HO'; } else if($get == 'DYEING') { $gett='PEENYA - DYEING'; } else if($get == 'NANDI') { $gett='NANDI'; } else if($get == 'TAILORING') { $gett='PEENYA - TAILORING'; } else if($get == 'BYATRANPURA') { $gett='BYATRANPURA'; } else if($get == 'VIJAYAPURA') { $gett='VIJAYAPURA'; } else if($get == 'DODDAJALA') { $gett='DODDAJALA'; } else if($get == 'KUMARA') { $gett='KUMARA PARK'; } // $table='work_order_dyeing'; // $where=array('status'=>'COMPLETED','yarn_status'=>0,'location'=>$gett); $data=$this->vendor_model->get_issue_purchase_table_cs_location_data($gett,$yarn_type); echo json_encode($data); } public function indent_pending_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_add_indent'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No'); $table='indent_add_indent'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No','product_type' =>'FABRICS'); $table='indent_add_indent'; $data['width_fetch_data1']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No','product_type' =>'Fabrics'); $table='indent_add_indent'; $data['width_fetch_data12']=$this->vendor_model->get_data($table,$where); $sl_indent_no=$data['fetch']->sl_indent_no; $where=array('sl_indent_no'=>$sl_indent_no,'confirm'=>'No','product_type'=>'Yarn - Dyed'); $table='indent_add_indent'; $data['fetch_dyed_data']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent',$data); $this->load->view('templates/footer_inside'); } public function purchase_pending_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $financ_year=$data['fetch']->financ_year; $where=array('po_id'=>$po_id,'financ_year'=>$financ_year); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/pending_purchase',$data); $this->load->view('templates/footer_inside'); } public function po_pending_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='today_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/pending_purchase',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_pending_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='monthly_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/pending_purchase',$data); $this->load->view('templates/footer_inside'); } public function purchase_order_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $data['fetch']=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $data['fetch_data']=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $data['fetch_address']=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='year_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/pending_purchase',$data); $this->load->view('templates/footer_inside'); } public function indent_po_creation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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"]; $v = substr($uri, strpos($uri, "=") + 1); $data['shade_id']=$v; $data['osl_val']=$this->marketing_model->shade_ides($v); $dd=$this->marketing_model->shade_ides($v); $table='indent_product'; $f=$dd->articleNo; $where=array('product'=>$f); $data['product_ids']=$this->vendor_model->fetch_where_subgrid_data($table,$where); //print_r($data['product_ids']); //die(); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $indent=$this->vendor_model->max_select_indent_no($table); $data['indent_no']=$indent->sl_indent_no+1; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['producttype1'] = ""; $data['unit1'] = ""; $data['required_on1']=""; $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_product_data($table); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $table2='color_master'; $data['colors']=$this->vendor_model->fetch_where_data($table2); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/osl_indent_add',$data); $this->load->view('templates/footer_inside'); } public function planning_indent_po_creation() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$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"]; $v = substr($uri, strpos($uri, "=") + 1); $data['shade_id']=$v; $data['osl_val']=$this->marketing_model->planning_shade_id($v); $dd=$this->marketing_model->planning_shade_id($v); $table='indent_product'; $f=$dd->articleNo; $where=array('product'=>$f); $data['product_ids']=$this->vendor_model->fetch_where_subgrid_data($table,$where); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $indent=$this->vendor_model->max_select_indent_no($table); $data['indent_no']=$indent->sl_indent_no+1; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $data['producttype1'] = ""; $data['unit1'] = ""; $data['required_on1']=""; $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_product_data($table); $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $table2='color_master'; $data['colors']=$this->vendor_model->fetch_where_data($table2); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/osl_indent_add',$data); $this->load->view('templates/footer_inside'); } public function planning_indent_po_creation_test() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('s'); $res=$this->marketing_model->planning_shade_id($id); $osl=$res->oslNo; $shadeID=$res->shadeID; $table='indent_add_indent'; $where=array('purpose'=>$osl,'purpose_shadeid'=>$shadeID); $result=$this->marketing_model->fetch_main_data($table,$where); if(empty($result)) { $data='fail'; echo json_encode($data); } else { $data='success'; echo json_encode($data); } } public function insert_outsource_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); $this->form_validation->set_rules('department', 'Department', 'trim|required|xss_clean|callback_uniq_producttype'); $this->form_validation->set_rules('consumed_at', 'Consumed At', 'trim|required|xss_clean'); //$this->form_validation->set_rules('fabricType', 'Fabric Type', 'trim|required|xss_clean'); $shade=$this->input->post('shades'); $color_shade=$this->input->post('color_shade'); $color_code=$this->input->post('color_code'); // if($shade!="") // { // $shades=$shade; // } // else // { // $shades=$color_code; // } if($color_code!="") { $shadees=$color_code; } else { $shadees=''; } if($color_shade!="") { $shades=$color_shade; } else { $shades=$shade; } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $data = array( 'sl_indent_no' => $this->input->post('sl_indent_no'), 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'product_id' => $this->input->post('product_id'), 'quantity' => $this->input->post('quantity'), 'unit' => $this->input->post('unitt'), 'purpose' => $this->input->post('purpose'), 'required_on' => $this->input->post('required_on_date'), 'product_type' => $this->input->post('producttypee'), 'shades' =>$shades, 'color_code' => $shadees, 'width' => $this->input->post('indentwidth').'CMS', 'yarn_details' => $this->input->post('det'), 'indented_by' => $approved_by, 'indented_date' => $d, 'confirm' => 'No', 'edit' => 'Select', 'generate_po' => 'Generate', 'status' => '1', 'outsource_product' => '1' ); $table='indent_add_indent'; $this->db->insert($table,$data); $v= $this->input->post('update_submit'); if($v == '') { $data['indent_no1'] = $this->input->post('indent_no'); $data['department_no1'] = $this->input->post('department'); $data['consumed_at_no1'] = $this->input->post('consumed_at'); $data['sl_indent_no1'] = $this->input->post('sl_indent_no'); $data['purpose1'] = $this->input->post('purpose'); $data['producttype1'] = $this->input->post('producttypee'); $data['unit1'] = $this->input->post('unitt'); $data['required_on1']=$this->input->post('required_on_date'); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } else{ $data['val'] = 'vendor/add_indent_details'; $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; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid',$data); $this->load->view('templates/footer_inside'); } } } public function insert_outsource_osl_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); $this->form_validation->set_rules('department', 'Department', 'trim|required|xss_clean|callback_uniq_producttype'); $this->form_validation->set_rules('consumed_at', 'Consumed At', 'trim|required|xss_clean'); //$this->form_validation->set_rules('fabricType', 'Fabric Type', 'trim|required|xss_clean'); $shade=$this->input->post('shades'); $color_shade=$this->input->post('color_shade'); $color_code=$this->input->post('color_code'); // if($shade!="") // { // $shades=$shade; // } // else // { // $shades=$color_code; // } if($color_code!="") { $shadees=$color_code; } else { $shadees=''; } if($color_shade!="") { $shades=$color_shade; } else { $shades=$shade; } $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $data = array( 'sl_indent_no' => $this->input->post('sl_indent_no'), 'indent_no' => $this->input->post('indent_no'), 'department' => $this->input->post('department'), 'consumed_at' => $this->input->post('consumed_at'), 'add_product' => $this->input->post('add_product'), 'product_id' => $this->input->post('product_id'), 'quantity' => $this->input->post('quantity'), 'unit' => $this->input->post('unitt'), 'purpose' => $this->input->post('purpose'), 'purpose_shadeid' => $this->input->post('purpose_shadeid'), 'required_on' => $this->input->post('required_on_date'), 'product_type' => $this->input->post('producttypee'), 'shades' =>$shades, 'color_code' => $shadees, 'width' => $this->input->post('indentwidth').'CMS', 'yarn_details' => $this->input->post('det'), 'indented_by' => $approved_by, 'indented_date' => $d, 'confirm' => 'No', 'edit' => 'Select', 'generate_po' => 'Generate', 'status' => '1', 'outsource_product' => '1' ); $table='indent_add_indent'; $this->db->insert($table,$data); $v= $this->input->post('update_submit'); if($v == '') { $data['indent_no1'] = $this->input->post('indent_no'); $data['department_no1'] = $this->input->post('department'); $data['consumed_at_no1'] = $this->input->post('consumed_at'); $data['sl_indent_no1'] = $this->input->post('sl_indent_no'); $data['purpose1'] = $this->input->post('purpose'); $data['producttype1'] = $this->input->post('producttypee'); $data['unit1'] = $this->input->post('unitt'); $data['required_on1']=$this->input->post('required_on_date'); $data['userdetails'] = $this->session_data_pass(); $table='indent_add_indent'; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $table='department'; $data['department']=$this->vendor_model->fetch_where_data($table); $table='consumed_at'; $data['consumed_at']=$this->vendor_model->fetch_where_data($table); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $table1='purchase_master'; $data['producttype']=$this->vendor_model->fetch_where_data($table1); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/indent_add',$data); $this->load->view('templates/footer_inside'); } else{ $data['val'] = 'vendor/add_indent_details'; $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; $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $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'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/add_indent_grid',$data); $this->load->view('templates/footer_inside'); } } } public function confirmed_po_doddajala_consumables_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); $gett='DODDAJALA'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_vijayapura_consumables_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); $gett='VIJAYAPURA'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_byatranpura_consumables_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); $gett='BYATRANPURA'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_tailoring_consumables_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); $gett='PEENYA - TAILORING'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_nandi_consumables_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); $gett='NANDI'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_peenya_consumables_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); $gett='PEENYA - DYEING'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } public function confirmed_po_ho_consumables_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); $gett='HO'; $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables','location'=>$gett); $detail=$this->vendor_model->get_issue_purchase_table_madeups_consum_data($gett); echo json_encode($detail); } ////////////////////////////////////////// history /////////////////////////////////////////////////// public function fabric_stock_confirmed_po_list() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Fabrics'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Fabrics','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Fabrics'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function fabric_stock_confirmed_po_list_raw() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Raw'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Raw','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Raw'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function fabric_stock_confirmed_po_list_twisted() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Twisted'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Twisted','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Twisted'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function fabric_stock_confirmed_po_list_dyed() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Dyed'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); $where1 = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Yarn - Dyed','quantity_approval'=>'PARTLY'); $getalldata_status_c1 = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where1); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $m=date('m'); $y=date('Y'); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Yarn - Dyed'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function fabric_stock_confirmed_po_list_consumables() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Consumables','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Consumables'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function fabric_stock_confirmed_po_list_spares() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Spares'); $details=$this->vendor_model->get_purchase_data($table,$where); foreach($details as $d) { $table = 'indent_po'; $where = array('id'=>$d->id); $indent = $this->vendor_model->fetch_where_subgrid_data($table,$where); $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'NOT YET'); $getalldata_status = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status)) { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'COMPLETED'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } else { $data1=$indent->po_id; $table = 'indent_po'; $where = array('po_id'=>$data1,'confirm'=>'Yes','product_type'=>'Spares','quantity_approval'=>'COMPLETED'); $getalldata_status_c = $this->vendor_model->fetch_where_ot_charges_subgrid_data($table,$where); if(empty($getalldata_status_c)) { $data=array('complition_status'=>'NOT YET'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } else { $data=array('complition_status'=>'PARTLY'); $where = array('id'=>$d->id); $table = 'indent_po'; $this->vendor_model->update_access($where,$table,$data); } } } $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Spares'); $detail=$this->vendor_model->get_purchase_data($table,$where); echo json_encode($detail); } public function history_weaving_fabric_grid_details() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $table='weaving_panel_planning_order'; // $where=array('status'=>'Waiting for Yarn' || 'Received Yarn'); $detail=$this->outsource_model->get_work_fabric_history_order_data($table); echo json_encode($detail); } public function auto_complete_customer_name() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $keyword=$this->input->get('term'); $data1=$this->vendor_model->Getsearch_customername_auto($keyword); //print_r($data1); foreach($data1 as $row) { $datas[]=$row->customerName; } echo json_encode($datas); } public function services_grid_details() { $get = $this->uri->segment(3); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $m=date('m'); $y=date('Y'); $table='indent_po'; $where=array('confirm'=>'Yes','product_type'=>'Services'); // $detail=$this->vendor_model->get_purchase_data($table,$where); $detail=$this->vendor_model->get_purchase_new_or_datas($table,$where); echo json_encode($detail); } ///////////////// chat functions ///////////////// public function insert_chat_messages() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $timestamp = date("Y-m-d H:i:s"); $timestamp_date = date("Y-m-d"); $to_nam=$this->input->post('chat_user_id'); $from_nam=$id['userid']; $table='employee_details'; $where=array('id'=>$to_nam); $tt=$this->vendor_model->get_customerdata($table,$where); $table='employee_details'; $where=array('id'=>$from_nam); $t=$this->vendor_model->get_customerdata($table,$where); $datas = array( 'message' => $this->input->post('chat_message'), 'to_id' => $this->input->post('chat_user_id'), 'from_id' => $id['userid'], 'from_name'=>$t->name, 'to_name'=>$tt->name, 'message_time'=>$timestamp, 'unread'=>0, 'msg_date'=>$d ); $table='chat_message'; $this->db->insert($table,$datas); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $to_id = $this->input->post('chat_user_id'); $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_one'=>0); $table='chat_message'; $rr=$this->vendor_model->get_customerdata($table,$where); $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_two'=>0); $table='chat_message'; $rrr=$this->vendor_model->get_customerdata($table,$where); if(!empty($rr) && !empty($rrr)) { $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_one'=>0,'sender_two'=>0); $table='chat_message'; $result=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $wheree=array('from_id'=>$to_id,'to_id'=>$id['userid'],'sender_one'=>0,'sender_two'=>0); $table='chat_message'; $resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$wheree); $data['final_val']=1; } else { $where=array('from_id'=>$id['userid'],'to_id'=>$to_id); $table='chat_message'; $result=array(); $resultt=array(); $data['final_val']=0; } //$where=array('from_id'=>$to_id,'to_id'=>$id['userid']); //$table='chat_message'; //$resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $data['res']=array_merge($result,$resultt); $data_res=array_merge($result,$resultt); sort($data['res']); sort($data_res); $times_offline = array(); foreach($data_res as $u) { $offline_time=$u->message_time; $today = time(); $createdday = strtotime($offline_time); //mysql timestamp of when post was created $datediff = abs($today - $createdday); $difftext = ""; $years = floor($datediff / (365 * 60 * 60 * 24)); $months = floor(($datediff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); $days = floor(($datediff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); $hours = floor($datediff / 3600); $minutes = floor($datediff / 60); $seconds = floor($datediff); //year checker if ($difftext == "") { if ($years > 1) $difftext = $years . " years ago"; elseif ($years == 1) $difftext = $years . " year ago"; } //month checker if ($difftext == "") { if ($months > 1) $difftext = $months . " months ago"; elseif ($months == 1) $difftext = $months . " month ago"; } //month checker if ($difftext == "") { if ($days > 1) $difftext = $days . " days ago"; elseif ($days == 1) $difftext = $days . " day ago"; } //hour checker if ($difftext == "") { if ($hours > 1) $difftext = $hours . " hours ago"; elseif ($hours == 1) $difftext = $hours . " hour ago"; } //minutes checker if ($difftext == "") { if ($minutes > 1) $difftext = $minutes . " minutes ago"; elseif ($minutes == 1) $difftext = $minutes . " minute ago"; } //seconds checker if ($difftext == "") { if ($seconds > 1) $difftext = $seconds . " seconds ago"; elseif ($seconds == 1) $difftext = "Just now"; elseif ($seconds == 0) $difftext = "Just now"; } //return $difftext; array_push($times_offline,$difftext); } $data['timings_offline']=$times_offline; //echo json_encode($data); } public function update_unread() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $to_id = $this->input->post('id'); $where=array('from_id'=>$to_id,'to_id'=>$id['userid']); $table='chat_message'; $datar=array('unread'=>1); $this->vendor_model->update_data($where,$table,$datar); $det=1; echo json_encode($det); } public function fetch_chat_data() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $to_id = $this->input->post('id'); $where=array('from_id'=>$to_id,'to_id'=>$id['userid']); // $table='chat_message'; // $datar=array('unread'=>1); // $this->vendor_model->update_data($where,$table,$datar); $to_id = $this->input->post('id'); $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_one !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $rr=$this->vendor_model->get_customerdata($table,$where); $where=array('from_id'=>$to_id,'to_id'=>$id['userid'],'sender_two !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $rrr=$this->vendor_model->get_customerdata($table,$where); if(!empty($rr) && !empty($rrr)) { $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_one !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $result=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $wheree=array('from_id'=>$to_id,'to_id'=>$id['userid'],'sender_one !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$wheree); $data['final_val']=1; } else if(empty($rr) && !empty($rrr)) { $result=array(); $wheree=array('from_id'=>$to_id,'to_id'=>$id['userid'],'sender_one !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$wheree); $data['final_val']=1; } else if(!empty($rr) && empty($rrr)) { $where=array('from_id'=>$id['userid'],'to_id'=>$to_id,'sender_one !='=>$id['userid'],'sender_two !='=>$id['userid']); $table='chat_message'; $result=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $resultt=array(); $data['final_val']=1; } else { $where=array('from_id'=>$id['userid'],'to_id'=>$to_id); $table='chat_message'; $result=array(); $resultt=array(); $data['final_val']=0; } // print_R($rr); // print_R('--------------'); // print_R($rrr); // print_r($data['final_val']); // die(); //$where=array('from_id'=>$to_id,'to_id'=>$id['userid']); //$table='chat_message'; //$resultt=$this->vendor_model->fetch_where_subgrid_data_chatting($table,$where); $data['res']=array_merge($result,$resultt); $data_res=array_merge($result,$resultt); sort($data['res']); sort($data_res); $time_off_line = array(); foreach($data_res as $u) { $offline_time=$u->message_time; $todays = date('Y-m-d H:i:s'); $createdday = strtotime($offline_time); //mysql timestamp of when post was created $today = strtotime($todays); $datediff = abs($today - $createdday); $difftext = ""; $years = floor($datediff / (365 * 60 * 60 * 24)); $months = floor(($datediff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); $days = floor(($datediff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); $hours = floor($datediff / 3600); $minutes = floor($datediff / 60); $seconds = floor($datediff); // print_r($years); // print_r('-------year--------'); // print_r($months); // print_r('-------month--------'); // print_r($days); // print_r('-------days--------'); // print_r($hours); // print_r('-------hour--------'); // print_r($minutes); // print_r('-------minu--------'); // print_r($seconds); // die(); //year checker if ($difftext == "") { if ($years > 1) $difftext = $years . " years ago"; elseif ($years == 1) $difftext = $years . " year ago"; } //month checker if ($difftext == "") { if ($months > 1) $difftext = $months . " months ago"; elseif ($months == 1) $difftext = $months . " month ago"; } //month checker if ($difftext == "") { if ($days > 1) $difftext = $days . " days ago"; elseif ($days == 1) $difftext = $days . " day ago"; } //hour checker if ($difftext == "") { if ($hours > 1) $difftext = $hours . " hours ago"; elseif ($hours == 1) $difftext = $hours . " hour ago"; } //minutes checker if ($difftext == "") { if ($minutes > 1) $difftext = $minutes . " minutes ago"; elseif ($minutes == 1) $difftext = $minutes . " minute ago"; } //seconds checker if ($difftext == "") { if ($seconds > 1) $difftext = $seconds . " seconds ago"; elseif ($seconds == 1) $difftext = "Just now"; elseif ($seconds == 0) $difftext = "Just now"; } //return $difftext; array_push($time_off_line,$difftext); } $data['timings_offline']=$time_off_line; echo json_encode($data); } public function fetch_chat_count_list() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $approved_by=$id['username']; $d=date("d-m-Y"); $where=array('unread'=>0,'to_id'=>$id['userid']); $table='chat_message'; $data['chat_list']=$this->vendor_model->count_chatting($table,$where); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); echo json_encode($data); } public function chat_history() { $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'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $data_user_list=$this->vendor_model->fetch_where_data($table); $time_offline = array(); foreach($data_user_list as $u) { $offline_time=$u->offline_time; $today = time(); $createdday = strtotime($offline_time); //mysql timestamp of when post was created $datediff = abs($today - $createdday); $difftext = ""; $years = floor($datediff / (365 * 60 * 60 * 24)); $months = floor(($datediff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); $days = floor(($datediff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); $hours = floor($datediff / 3600); $minutes = floor($datediff / 60); $seconds = floor($datediff); // print_r($years); // print_r('-------year--------'); // print_r($months); // print_r('-------month--------'); // print_r($days); // print_r('-------days--------'); // print_r($hours); // print_r('-------hour--------'); // print_r($minutes); // print_r('-------minu--------'); // print_r($seconds); // die(); //year checker if ($difftext == "") { if ($years > 1) $difftext = $years . " years ago"; elseif ($years == 1) $difftext = $years . " year ago"; } //month checker if ($difftext == "") { if ($months > 1) $difftext = $months . " months ago"; elseif ($months == 1) $difftext = $months . " month ago"; } //month checker if ($difftext == "") { if ($days > 1) $difftext = $days . " days ago"; elseif ($days == 1) $difftext = $days . " day ago"; } //hour checker if ($difftext == "") { if ($hours > 1) $difftext = $hours . " hours ago"; elseif ($hours == 1) $difftext = $hours . " hour ago"; } //minutes checker if ($difftext == "") { if ($minutes > 1) $difftext = $minutes . " minutes ago"; elseif ($minutes == 1) $difftext = $minutes . " minute ago"; } //seconds checker if ($difftext == "") { if ($seconds > 1) $difftext = $seconds . " seconds ago"; elseif ($seconds == 1) $difftext = "Just now"; elseif ($seconds == 0) $difftext = "Just now"; } //return $difftext; array_push($time_offline,$difftext); } $data['timing_offline']=$time_offline; $where=$id['userid']; $table='chat_message'; $data['chat_list']=$this->vendor_model->count_chatting($table,$where); $data['users_id']=$id['userid']; echo json_encode($data); } public function chat_counting_history() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $chatting_count=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); echo json_encode($chatting_count); } /////////////////////// 14-11-2018 /////////////////////////////// public function planning_change_weaving_factory() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $id=$this->input->post('s'); $res=$this->marketing_model->chage_weaving_factory_planning_shade($id); echo json_encode($res); } public function vendor_preview() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_vendor_master'; $where=array('id'=>$val); $data['result']=$this->vendor_model->get_customerdata($table,$where); $data['str']=$data['result']->import_fileno; $data['userdetails'] = $this->session_data_pass(); $table='indent_product'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['country'] = $this->yarn_model->getcountries(); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/preview_vendor_master',$data); $this->load->view('templates/footer_inside'); } public function preview_product_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); $data['approved_by']=$id['username']; $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $table='indent_product'; $where=array('id'=>$val); $data['fetch_product_data']=$this->vendor_model->get_customerdata($table,$where); $data['getalldata_weft'] = $this->yarn_model->display_weft_yarnqty_data(); $data['getalldata'] = $this->yarn_model->display_warp_yarnqty_data(); $data['userdetails']=$this->session_data_pass(); $table='purchase_master'; $data['product']=$this->vendor_model->fetch_where_data($table); $data['user_type_id'] = $this->access_id(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['access'] = $this->access_details(); $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='chat_message'; $where=array('unread'=>'0','to_id'=>$emp_row); $data['chatting_count']=$this->vendor_model->count_amount_work_order_delivery_yarn_po_get_customerdata($table,$where); $this->load->view('templates/header_inside',$data); $this->load->view('vendor_master/preview_add_link_product',$data); $this->load->view('templates/footer_inside'); } public function split_page_notifications() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); //<!------------------------ stock ---------------------------------> if($data['emp_details']->designation == 'PPC Manager' || $data['emp_details']->designation == 'PPC Executive' || $data['emp_details']->designation == 'ACCOUNTS' || $data['emp_details']->designation == 'Accounts' || $data['emp_details']->designation == 'Super Admin' || $data['emp_details']->designation == 'Admin') { $ttt1=date('d/m/Y'); $ddd1=date('d-m-Y'); $table='fabric_inspection_details'; $where=array('received_date'=>$ttt1,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); $ttt=date('d/m/Y'); $table='fabric_madeups_delivery_confirmation'; $where=array('rec_date'=>$ttt,'split_noti'=>'Yes','insert_notification_status'=>0); $data['stock_madeups_split_data_res_count']=$this->vendor_model->fabric_inspection_split_count_amount_get_customerdata($table,$where); } else { $data['stock_split_data_res_count']=0; $data['stock_madeups_split_data_res_count']=0; } $stock=$data['stock_split_data_res_count'] + $data['stock_madeups_split_data_res_count']; return $stock; } public function purchase_preview_pdf() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $fetch=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $financ_year=$data['fetch']->financ_year; $where=array('po_id'=>$po_id,'financ_year'=>$financ_year); $table='indent_po'; $fetch_data=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $fetch_address=$this->vendor_model->get_customerdata($table,$where); $data['userdetails'] = $this->session_data_pass(); $data['user_type_id'] = $this->access_id(); $data['access'] = $this->access_details(); $data['total_indent_notifications'] = 0; // $this->indent_page_notifications();notifications']; $data['indent_p']='indent_preview'; $table='employee_details'; $data['user_list']=$this->vendor_model->fetch_where_data($table); include("assets/mpdf60/mpdf.php"); $mpdf = new mPDF('c', 'A4-L'); $mpdf->mirrorMargins = 1; $html = ''; $index = 1; $html=$html.'</div><div class="content-wrapper print" id="print_report" style="padding:10px;">'; $html=$html.'<table width="100%" style="border-spacing:0;">'; $html=$html.'<tr><td colspan="11"></td><td style="text-align:right;">E-mail : sales@swansilk.com</td>';$html=$html.'</tr><tr>'; $html=$html.'<td colspan="11"></td><td style="text-align:right;">Phone : 080-41888298</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:900;font-size:30px;font-style:Akashi;">Deco-Textil</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">"SWAN HOUSE" No:40, 4th Cross, Residency Road, Banglore - 560025. INDIA</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">GSTN: 29AACFD0446K1ZG     PAN: AACFD0446K </td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PURCHASE ORDER</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="10"></td><td colspan="2" style="text-align:right;"> </td></tr><tr>'; $html=$html.'<td colspan="10">'.if(empty($fetch_address)) { } else { echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; }.'</td>'; $html=$html.'<td colspan="2" style="text-align:right;">PO# : '.$fetch->po_no'.</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Date : '.$fetch->created_date.'</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Currency :.'$fetch->currency.'</td></tr><tr>'; $html=$html.'<td colspan="2" style="padding-top: 1%;">Sir / Madam,</td>'; $html=$html.'<td colspan="8"></td></tr><tr>'; $html=$html.'<td colspan="12">'; $html=$html.'<p style="padding-left:5%;padding-top: 1%;">We request you to supply the following materials as per the terms mentioned here below. kindly mention our P.O No in your invoice.</p></td></tr></table>'; $html=$html.'<table border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px">'; $html=$html.'<thead>'; $html=$html.'<tr>'; $html=$html.'<th>SL No.</th>'; $html=$html.'<th>PARTICULARS</th>'; $html=$html.'<th>DESCRIPTION</th>'; $html=$html.'<th>QTY</th>'; if($fetch->currency == 'INR') { $html=$html.'<th>RATE IN INR</th>'; $html=$html.'<th>VALUE IN INR</th>'; } else if($fetch->currency == 'CHF') { $html=$html.'<th>RATE IN CHF</th>'; $html=$html.'<th>VALUE IN CHF</th>'; } else if($fetch->currency == 'EUR') { $html=$html.'<th>RATE IN EUR</th>'; $html=$html.'<th>VALUE IN EUR</th>'; } else if($fetch->currency == 'GBP') { $html=$html.'<th>RATE IN GBP</th>'; $html=$html.'<th>VALUE IN GBP</th>'; } else if($fetch->currency == 'USD') { $html=$html.'<th>RATE IN USD</th>'; $html=$html.'<th>VALUE IN USD</th>'; } $html=$html.'<th>CGST</th>'; $html=$html.'<th>SGST</th>'; $html=$html.'<th>IGST</th>'; $html=$html.'<th>TAX Amount</th>'; $html=$html.'<th>TOT VALUE IN INR</th>'; $html=$html.'</tr></thead><tbody>'; $i=1; $ttl_amt=0; $ttl_amtt=0;$t_val8=0; if(isset($fetch_data)) { foreach($fetch_data as $fetch_data){ $t=0;$t_val1=0; $t_val2=0; $t_val3=0;$t_val4=0;$t_val5=0;$t_val6=0;$totalvalue=0;$t_amt=0;$totalvalue1=0;$t_val7=0; $t_amtt=0; $t_val1=$fetch_data->cgst; $t_val2=$fetch_data->sgst; $t_val22=$fetch_data->igst; $t_val3=$fetch_data->inrvalue; $t= $t_val1+$t_val2+$t_val22; $t_val4=$t_val3 * $t/100; $totalvalue=$t_val4 + $t_val5; $t_val6=$fetch_data->totalvalue; $t_amt=$totalvalue+$t_val6; $ttl_amt+=$t_amt; $t_val7=$fetch_data->totalvalue; $t_amtt=$t_amt - $totalvalue ; $ttl_amtt+=$fetch_data->totalvalue; $t_val8+=$fetch_data->totalvalue; $html=$html.'<tr><td>'.$i.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->product_name.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->description.'</td>'; $html=$html.'<td>'.$fetch_data->quantity . " " . $fetch_data->indent_unit.'</td>'; $html=$html.'<td>'.$fetch_data->unit.'</td>'; $html=$html.'<td>'.$fetch_data->inrvalue.'</td>'; $html=$html.'<td>'.$fetch_data->cgst.'</td>'; $html=$html.'<td>'.$fetch_data->sgst.'</td>'; $html=$html.'<td>'.$fetch_data->igst.'</td>'; if($fetch->po_no == 'SSL-2018-PO-132'){ $html=$html.'<td>'.'0'.'</td>'; } else if($fetch->po_no == 'SSL-2018-PO-227') { $html=$html.'<td>'.'99750'.'</td>'; } else { $html=$html.'<td>'.$t_val4.'</td>'; } $html=$html.'<td>'.$fetch_data->totalvalue.'</td>'; $html=$html.'</tr>'; $i++; } } $html=$html.'<tr>'; $html=$html.'<td colspan="6" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : ">NOTE :'.$fetch_data->note.'</textarea></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in ₹</td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in CHF</td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in €</td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in £</td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in $</td>'; } $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;">'.$ttl_amtt.'</td></tr>'; $html=$html.'<tr><td colspan="6" style="border-top:1px solid transparent !important;"></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "₹/-" .')</b></td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "CHF/-" .')</b></td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "€/-" .')</b></td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "£/-" .')</b></td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "$/-" .')</b></td>'; } $html=$html.'</tr></tbody></table>'; $html=$html.'<table width="100%" style="margin-top:10px;"><tr>'; $html=$html.'<td>  1. Material Delivery : '.$fetch_data->comment.'</td> </tr>'; $html=$html.'<tr><td>  2. GST No. : '.$fetch_data->gst_no.'</td></tr>'; $html=$html.'<tr><td>  3. Terms of payment : '.$fetch_data->terms_payment.'</td></tr>'; $html=$html.'<tr><td >  4. Bank Details : '.$fetch_data->bank_details.'</td></tr></table>'; $html=$html.'<table style="width:100%;margin-top:20px;"><tr>'; $html=$html.'<td>FOR Deco-Textil</td>'; $html=$html.'<td style="text-align:right;">FOR Deco-Textil</td></tr>'; $html=$html.'<tr ><td style="padding-top:7%;">EXECUTIVE - PURCHASE</td>'; $html=$html.'<td style="text-align:right;padding-top:7%;">DIRECTOR</td></tr>'; $html=$html.'<tr><td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td>'; $html=$html.'</tr></table></div>'; $mpdf->SetDisplayMode('fullpage'); $mpdf->SetWatermarkText(''); $mpdf->watermark_font = 'DejaVuSansCondensed'; $mpdf->showWatermarkText = true; $mpdf->WriteHTML($html); //$data = date('d-M-y-H-i'); //$file='generated_po/yaskawa'.$data.'PO.pdf'; $mpdf->Output('PO.pdf', 'F'); } public function po_purchase_preview_pdf() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $fetch=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $fetch_data=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $fetch_address=$this->vendor_model->get_customerdata($table,$where); include("assets/mpdf60/mpdf.php"); $mpdf = new mPDF('c', 'A4-L'); $mpdf->mirrorMargins = 1; $html = ''; $index = 1; $html=$html.'</div><div class="content-wrapper print" id="print_report" style="padding:10px;">'; $html=$html.'<table width="100%" style="border-spacing:0;">'; $html=$html.'<tr><td colspan="11"></td><td style="text-align:right;">E-mail : sales@swansilk.com</td>';$html=$html.'</tr><tr>'; $html=$html.'<td colspan="11"></td><td style="text-align:right;">Phone : 080-41888298</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:900;font-size:30px;font-style:Akashi;">Deco-Textil</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">"SWAN HOUSE" No:40, 4th Cross, Residency Road, Banglore - 560025. INDIA</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">GSTN: 29AACFD0446K1ZG     PAN: AACFD0446K </td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PURCHASE ORDER</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="10"></td><td colspan="2" style="text-align:right;"> </td></tr><tr>'; $html=$html.'<td colspan="10">'.if(empty($fetch_address)) { } else { echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; }.'</td>'; $html=$html.'<td colspan="2" style="text-align:right;">PO# : '.$fetch->po_no'.</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Date : '.$fetch->created_date.'</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Currency :.'$fetch->currency.'</td></tr><tr>'; $html=$html.'<td colspan="2" style="padding-top: 1%;">Sir / Madam,</td>'; $html=$html.'<td colspan="8"></td></tr><tr>'; $html=$html.'<td colspan="12">'; $html=$html.'<p style="padding-left:5%;padding-top: 1%;">We request you to supply the following materials as per the terms mentioned here below. kindly mention our P.O No in your invoice.</p></td></tr></table>'; $html=$html.'<table border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px">'; $html=$html.'<thead>'; $html=$html.'<tr>'; $html=$html.'<th>SL No.</th>'; $html=$html.'<th>PARTICULARS</th>'; $html=$html.'<th>DESCRIPTION</th>'; $html=$html.'<th>QTY</th>'; if($fetch->currency == 'INR') { $html=$html.'<th>RATE IN INR</th>'; $html=$html.'<th>VALUE IN INR</th>'; } else if($fetch->currency == 'CHF') { $html=$html.'<th>RATE IN CHF</th>'; $html=$html.'<th>VALUE IN CHF</th>'; } else if($fetch->currency == 'EUR') { $html=$html.'<th>RATE IN EUR</th>'; $html=$html.'<th>VALUE IN EUR</th>'; } else if($fetch->currency == 'GBP') { $html=$html.'<th>RATE IN GBP</th>'; $html=$html.'<th>VALUE IN GBP</th>'; } else if($fetch->currency == 'USD') { $html=$html.'<th>RATE IN USD</th>'; $html=$html.'<th>VALUE IN USD</th>'; } $html=$html.'<th>CGST</th>'; $html=$html.'<th>SGST</th>'; $html=$html.'<th>IGST</th>'; $html=$html.'<th>TAX Amount</th>'; $html=$html.'<th>TOT VALUE IN INR</th>'; $html=$html.'</tr></thead><tbody>'; $i=1; $ttl_amt=0; $ttl_amtt=0;$t_val8=0; if(isset($fetch_data)) { foreach($fetch_data as $fetch_data){ $t=0;$t_val1=0; $t_val2=0; $t_val3=0;$t_val4=0;$t_val5=0;$t_val6=0;$totalvalue=0;$t_amt=0;$totalvalue1=0;$t_val7=0; $t_amtt=0; $t_val1=$fetch_data->cgst; $t_val2=$fetch_data->sgst; $t_val22=$fetch_data->igst; $t_val3=$fetch_data->inrvalue; $t= $t_val1+$t_val2+$t_val22; $t_val4=$t_val3 * $t/100; $totalvalue=$t_val4 + $t_val5; $t_val6=$fetch_data->totalvalue; $t_amt=$totalvalue+$t_val6; $ttl_amt+=$t_amt; $t_val7=$fetch_data->totalvalue; $t_amtt=$t_amt - $totalvalue ; $ttl_amtt+=$fetch_data->totalvalue; $t_val8+=$fetch_data->totalvalue; $html=$html.'<tr><td>'.$i.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->product_name.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->description.'</td>'; $html=$html.'<td>'.$fetch_data->quantity . " " . $fetch_data->indent_unit.'</td>'; $html=$html.'<td>'.$fetch_data->unit.'</td>'; $html=$html.'<td>'.$fetch_data->inrvalue.'</td>'; $html=$html.'<td>'.$fetch_data->cgst.'</td>'; $html=$html.'<td>'.$fetch_data->sgst.'</td>'; $html=$html.'<td>'.$fetch_data->igst.'</td>'; if($fetch->po_no == 'SSL-2018-PO-132'){ $html=$html.'<td>'.'0'.'</td>'; } else if($fetch->po_no == 'SSL-2018-PO-227') { $html=$html.'<td>'.'99750'.'</td>'; } else { $html=$html.'<td>'.$t_val4.'</td>'; } $html=$html.'<td>'.$fetch_data->totalvalue.'</td>'; $html=$html.'</tr>'; $i++; } } $html=$html.'<tr>'; $html=$html.'<td colspan="6" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : ">NOTE :'.$fetch_data->note.'</textarea></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in ₹</td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in CHF</td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in €</td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in £</td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in $</td>'; } $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;">'.$ttl_amtt.'</td></tr>'; $html=$html.'<tr><td colspan="6" style="border-top:1px solid transparent !important;"></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "₹/-" .')</b></td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "CHF/-" .')</b></td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "€/-" .')</b></td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "£/-" .')</b></td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "$/-" .')</b></td>'; } $html=$html.'</tr></tbody></table>'; $html=$html.'<table width="100%" style="margin-top:10px;"><tr>'; $html=$html.'<td>  1. Material Delivery : '.$fetch_data->comment.'</td> </tr>'; $html=$html.'<tr><td>  2. GST No. : '.$fetch_data->gst_no.'</td></tr>'; $html=$html.'<tr><td>  3. Terms of payment : '.$fetch_data->terms_payment.'</td></tr>'; $html=$html.'<tr><td >  4. Bank Details : '.$fetch_data->bank_details.'</td></tr></table>'; $html=$html.'<table style="width:100%;margin-top:20px;"><tr>'; $html=$html.'<td>FOR Deco-Textil</td>'; $html=$html.'<td style="text-align:right;">FOR Deco-Textil</td></tr>'; $html=$html.'<tr ><td style="padding-top:7%;">EXECUTIVE - PURCHASE</td>'; $html=$html.'<td style="text-align:right;padding-top:7%;">DIRECTOR</td></tr>'; $html=$html.'<tr><td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td>'; $html=$html.'</tr></table></div>'; $mpdf->SetDisplayMode('fullpage'); $mpdf->SetWatermarkText(''); $mpdf->watermark_font = 'DejaVuSansCondensed'; $mpdf->showWatermarkText = true; $mpdf->WriteHTML($html); //$data = date('d-M-y-H-i'); //$file='generated_po/yaskawa'.$data.'PO.pdf'; $mpdf->Output('PO.pdf', 'F'); } public function purchase_order_approved_preview_pdf() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $fetch=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $fetch_data=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $fetch_address=$this->vendor_model->get_customerdata($table,$where); include("assets/mpdf60/mpdf.php"); $mpdf = new mPDF('c', 'A4-L'); $mpdf->mirrorMargins = 1; $html = ''; $index = 1; $html=$html.'</div><div class="content-wrapper print" id="print_report" style="padding:10px;">'; $html=$html.'<table width="100%" style="border-spacing:0;">'; $html=$html.'<tr><td colspan="11"></td><td style="text-align:right;">E-mail : sales@swansilk.com</td>';$html=$html.'</tr><tr>'; $html=$html.'<td colspan="11"></td><td style="text-align:right;">Phone : 080-41888298</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:900;font-size:30px;font-style:Akashi;">Deco-Textil</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">"SWAN HOUSE" No:40, 4th Cross, Residency Road, Banglore - 560025. INDIA</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">GSTN: 29AACFD0446K1ZG     PAN: AACFD0446K </td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PURCHASE ORDER</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="10"></td><td colspan="2" style="text-align:right;"> </td></tr><tr>'; $html=$html.'<td colspan="10">'.if(empty($fetch_address)) { } else { echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; }.'</td>'; $html=$html.'<td colspan="2" style="text-align:right;">PO# : '.$fetch->po_no'.</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Date : '.$fetch->created_date.'</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Currency :.'$fetch->currency.'</td></tr><tr>'; $html=$html.'<td colspan="2" style="padding-top: 1%;">Sir / Madam,</td>'; $html=$html.'<td colspan="8"></td></tr><tr>'; $html=$html.'<td colspan="12">'; $html=$html.'<p style="padding-left:5%;padding-top: 1%;">We request you to supply the following materials as per the terms mentioned here below. kindly mention our P.O No in your invoice.</p></td></tr></table>'; $html=$html.'<table border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px">'; $html=$html.'<thead>'; $html=$html.'<tr>'; $html=$html.'<th>SL No.</th>'; $html=$html.'<th>PARTICULARS</th>'; $html=$html.'<th>DESCRIPTION</th>'; $html=$html.'<th>QTY</th>'; if($fetch->currency == 'INR') { $html=$html.'<th>RATE IN INR</th>'; $html=$html.'<th>VALUE IN INR</th>'; } else if($fetch->currency == 'CHF') { $html=$html.'<th>RATE IN CHF</th>'; $html=$html.'<th>VALUE IN CHF</th>'; } else if($fetch->currency == 'EUR') { $html=$html.'<th>RATE IN EUR</th>'; $html=$html.'<th>VALUE IN EUR</th>'; } else if($fetch->currency == 'GBP') { $html=$html.'<th>RATE IN GBP</th>'; $html=$html.'<th>VALUE IN GBP</th>'; } else if($fetch->currency == 'USD') { $html=$html.'<th>RATE IN USD</th>'; $html=$html.'<th>VALUE IN USD</th>'; } $html=$html.'<th>CGST</th>'; $html=$html.'<th>SGST</th>'; $html=$html.'<th>IGST</th>'; $html=$html.'<th>TAX Amount</th>'; $html=$html.'<th>TOT VALUE IN INR</th>'; $html=$html.'</tr></thead><tbody>'; $i=1; $ttl_amt=0; $ttl_amtt=0;$t_val8=0; if(isset($fetch_data)) { foreach($fetch_data as $fetch_data){ $t=0;$t_val1=0; $t_val2=0; $t_val3=0;$t_val4=0;$t_val5=0;$t_val6=0;$totalvalue=0;$t_amt=0;$totalvalue1=0;$t_val7=0; $t_amtt=0; $t_val1=$fetch_data->cgst; $t_val2=$fetch_data->sgst; $t_val22=$fetch_data->igst; $t_val3=$fetch_data->inrvalue; $t= $t_val1+$t_val2+$t_val22; $t_val4=$t_val3 * $t/100; $totalvalue=$t_val4 + $t_val5; $t_val6=$fetch_data->totalvalue; $t_amt=$totalvalue+$t_val6; $ttl_amt+=$t_amt; $t_val7=$fetch_data->totalvalue; $t_amtt=$t_amt - $totalvalue ; $ttl_amtt+=$fetch_data->totalvalue; $t_val8+=$fetch_data->totalvalue; $html=$html.'<tr><td>'.$i.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->product_name.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->description.'</td>'; $html=$html.'<td>'.$fetch_data->quantity . " " . $fetch_data->indent_unit.'</td>'; $html=$html.'<td>'.$fetch_data->unit.'</td>'; $html=$html.'<td>'.$fetch_data->inrvalue.'</td>'; $html=$html.'<td>'.$fetch_data->cgst.'</td>'; $html=$html.'<td>'.$fetch_data->sgst.'</td>'; $html=$html.'<td>'.$fetch_data->igst.'</td>'; if($fetch->po_no == 'SSL-2018-PO-132'){ $html=$html.'<td>'.'0'.'</td>'; } else if($fetch->po_no == 'SSL-2018-PO-227') { $html=$html.'<td>'.'99750'.'</td>'; } else { $html=$html.'<td>'.$t_val4.'</td>'; } $html=$html.'<td>'.$fetch_data->totalvalue.'</td>'; $html=$html.'</tr>'; $i++; } } $html=$html.'<tr>'; $html=$html.'<td colspan="6" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : ">NOTE :'.$fetch_data->note.'</textarea></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in ₹</td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in CHF</td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in €</td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in £</td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in $</td>'; } $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;">'.$ttl_amtt.'</td></tr>'; $html=$html.'<tr><td colspan="6" style="border-top:1px solid transparent !important;"></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "₹/-" .')</b></td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "CHF/-" .')</b></td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "€/-" .')</b></td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "£/-" .')</b></td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "$/-" .')</b></td>'; } $html=$html.'</tr></tbody></table>'; $html=$html.'<table width="100%" style="margin-top:10px;"><tr>'; $html=$html.'<td>  1. Material Delivery : '.$fetch_data->comment.'</td> </tr>'; $html=$html.'<tr><td>  2. GST No. : '.$fetch_data->gst_no.'</td></tr>'; $html=$html.'<tr><td>  3. Terms of payment : '.$fetch_data->terms_payment.'</td></tr>'; $html=$html.'<tr><td >  4. Bank Details : '.$fetch_data->bank_details.'</td></tr></table>'; $html=$html.'<table style="width:100%;margin-top:20px;"><tr>'; $html=$html.'<td>FOR Deco-Textil</td>'; $html=$html.'<td style="text-align:right;">FOR Deco-Textil</td></tr>'; $html=$html.'<tr ><td style="padding-top:7%;">EXECUTIVE - PURCHASE</td>'; $html=$html.'<td style="text-align:right;padding-top:7%;">DIRECTOR</td></tr>'; $html=$html.'<tr><td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td>'; $html=$html.'</tr></table></div>'; $mpdf->SetDisplayMode('fullpage'); $mpdf->SetWatermarkText(''); $mpdf->watermark_font = 'DejaVuSansCondensed'; $mpdf->showWatermarkText = true; $mpdf->WriteHTML($html); //$data = date('d-M-y-H-i'); //$file='generated_po/yaskawa'.$data.'PO.pdf'; $mpdf->Output('PO.pdf', 'F'); } public function po_approved_preview_pdf() { $id=$this->session->userdata('logged_in'); $where=array('id'=>$id); $data['approved_by']=$id['username']; $emp_row=$id['userid']; $table='employee_details'; $where=array('id'=>$emp_row); $data['emp_details']=$this->vendor_model->get_customerdata($table,$where); $uri = $_SERVER["REQUEST_URI"]; $val = substr($uri, strpos($uri, "=") + 1); $where=array('id'=>$val); $table='indent_po'; $fetch=$this->vendor_model->get_customerdata($table,$where); //$data['total_amt']=$data['fetch_data']->cgst $indent_no=$data['fetch']->indent_no; $table='indent_add_indent'; $where=array('indent_no'=>$indent_no); $data['fetch_dept']=$this->vendor_model->get_customerdata($table,$where); $po_id=$data['fetch']->po_id; $where=array('po_id'=>$po_id); $table='indent_po'; $fetch_data=$this->vendor_model->get_data($table,$where); $v_address=$data['fetch']->vendor_name; $where=array('name'=>$v_address); $table='indent_vendor_master'; $fetch_address=$this->vendor_model->get_customerdata($table,$where); include("assets/mpdf60/mpdf.php"); $mpdf = new mPDF('c', 'A4-L'); $mpdf->mirrorMargins = 1; $html = ''; $index = 1; $html=$html.'</div><div class="content-wrapper print" id="print_report" style="padding:10px;">'; $html=$html.'<table width="100%" style="border-spacing:0;">'; $html=$html.'<tr><td colspan="11"></td><td style="text-align:right;">E-mail : sales@swansilk.com</td>';$html=$html.'</tr><tr>'; $html=$html.'<td colspan="11"></td><td style="text-align:right;">Phone : 080-41888298</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:900;font-size:30px;font-style:Akashi;">Deco-Textil</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">"SWAN HOUSE" No:40, 4th Cross, Residency Road, Banglore - 560025. INDIA</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;">GSTN: 29AACFD0446K1ZG     PAN: AACFD0446K </td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="12" style="text-align:center;font-weight:600;text-decoration: underline;">PURCHASE ORDER</td>'; $html=$html.'</tr><tr>'; $html=$html.'<td colspan="10"></td><td colspan="2" style="text-align:right;"> </td></tr><tr>'; $html=$html.'<td colspan="10">'.if(empty($fetch_address)) { } else { echo $fetch_address->name . "<br/>" .$fetch_address->address . "<br/>". $fetch_address->city . "<br/>". $fetch_address->country . "-". $fetch_address->pincode; }.'</td>'; $html=$html.'<td colspan="2" style="text-align:right;">PO# : '.$fetch->po_no'.</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Date : '.$fetch->created_date.'</td></tr><tr>'; $html=$html.'<td colspan="10"></td>'; $html=$html.'<td colspan="2" style="text-align:right;">Currency :.'$fetch->currency.'</td></tr><tr>'; $html=$html.'<td colspan="2" style="padding-top: 1%;">Sir / Madam,</td>'; $html=$html.'<td colspan="8"></td></tr><tr>'; $html=$html.'<td colspan="12">'; $html=$html.'<p style="padding-left:5%;padding-top: 1%;">We request you to supply the following materials as per the terms mentioned here below. kindly mention our P.O No in your invoice.</p></td></tr></table>'; $html=$html.'<table border="1" width="100%" style="border-spacing:0;margin-top: 1%;" cellpadding="5px">'; $html=$html.'<thead>'; $html=$html.'<tr>'; $html=$html.'<th>SL No.</th>'; $html=$html.'<th>PARTICULARS</th>'; $html=$html.'<th>DESCRIPTION</th>'; $html=$html.'<th>QTY</th>'; if($fetch->currency == 'INR') { $html=$html.'<th>RATE IN INR</th>'; $html=$html.'<th>VALUE IN INR</th>'; } else if($fetch->currency == 'CHF') { $html=$html.'<th>RATE IN CHF</th>'; $html=$html.'<th>VALUE IN CHF</th>'; } else if($fetch->currency == 'EUR') { $html=$html.'<th>RATE IN EUR</th>'; $html=$html.'<th>VALUE IN EUR</th>'; } else if($fetch->currency == 'GBP') { $html=$html.'<th>RATE IN GBP</th>'; $html=$html.'<th>VALUE IN GBP</th>'; } else if($fetch->currency == 'USD') { $html=$html.'<th>RATE IN USD</th>'; $html=$html.'<th>VALUE IN USD</th>'; } $html=$html.'<th>CGST</th>'; $html=$html.'<th>SGST</th>'; $html=$html.'<th>IGST</th>'; $html=$html.'<th>TAX Amount</th>'; $html=$html.'<th>TOT VALUE IN INR</th>'; $html=$html.'</tr></thead><tbody>'; $i=1; $ttl_amt=0; $ttl_amtt=0;$t_val8=0; if(isset($fetch_data)) { foreach($fetch_data as $fetch_data){ $t=0;$t_val1=0; $t_val2=0; $t_val3=0;$t_val4=0;$t_val5=0;$t_val6=0;$totalvalue=0;$t_amt=0;$totalvalue1=0;$t_val7=0; $t_amtt=0; $t_val1=$fetch_data->cgst; $t_val2=$fetch_data->sgst; $t_val22=$fetch_data->igst; $t_val3=$fetch_data->inrvalue; $t= $t_val1+$t_val2+$t_val22; $t_val4=$t_val3 * $t/100; $totalvalue=$t_val4 + $t_val5; $t_val6=$fetch_data->totalvalue; $t_amt=$totalvalue+$t_val6; $ttl_amt+=$t_amt; $t_val7=$fetch_data->totalvalue; $t_amtt=$t_amt - $totalvalue ; $ttl_amtt+=$fetch_data->totalvalue; $t_val8+=$fetch_data->totalvalue; $html=$html.'<tr><td>'.$i.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->product_name.'</td>'; $html=$html.'<td style="text-transform: uppercase !important;">'.$fetch_data->description.'</td>'; $html=$html.'<td>'.$fetch_data->quantity . " " . $fetch_data->indent_unit.'</td>'; $html=$html.'<td>'.$fetch_data->unit.'</td>'; $html=$html.'<td>'.$fetch_data->inrvalue.'</td>'; $html=$html.'<td>'.$fetch_data->cgst.'</td>'; $html=$html.'<td>'.$fetch_data->sgst.'</td>'; $html=$html.'<td>'.$fetch_data->igst.'</td>'; if($fetch->po_no == 'SSL-2018-PO-132'){ $html=$html.'<td>'.'0'.'</td>'; } else if($fetch->po_no == 'SSL-2018-PO-227') { $html=$html.'<td>'.'99750'.'</td>'; } else { $html=$html.'<td>'.$t_val4.'</td>'; } $html=$html.'<td>'.$fetch_data->totalvalue.'</td>'; $html=$html.'</tr>'; $i++; } } $html=$html.'<tr>'; $html=$html.'<td colspan="6" style="border-bottom:1px solid transparent !important;"> <textarea rows="1" id="note" name="note" style="width: 100%; border: transparent; " placeholder="NOTE : ">NOTE :'.$fetch_data->note.'</textarea></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in ₹</td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in CHF</td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in €</td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in £</td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-right:1px solid transparent !important;">GRAND Total in $</td>'; } $html=$html.'<td colspan="3" style="border-bottom:1px solid transparent !important;border-left:1px solid transparent !important;text-align:right;">'.$ttl_amtt.'</td></tr>'; $html=$html.'<tr><td colspan="6" style="border-top:1px solid transparent !important;"></td>'; if($fetch->currency == 'INR'){ $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "₹/-" .')</b></td>'; } else if($fetch->currency == 'CHF') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "CHF/-" .')</b></td>'; } else if($fetch->currency == 'EUR') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "€/-" .')</b></td>'; } else if($fetch->currency == 'GBP') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "£/-" .')</b></td>'; } else if($fetch->currency == 'USD') { $html=$html.'<td colspan="5" style="border-top:1px solid transparent !important;"><b>('. convert_number_to_words(round($ttl_amtt)) . "$/-" .')</b></td>'; } $html=$html.'</tr></tbody></table>'; $html=$html.'<table width="100%" style="margin-top:10px;"><tr>'; $html=$html.'<td>  1. Material Delivery : '.$fetch_data->comment.'</td> </tr>'; $html=$html.'<tr><td>  2. GST No. : '.$fetch_data->gst_no.'</td></tr>'; $html=$html.'<tr><td>  3. Terms of payment : '.$fetch_data->terms_payment.'</td></tr>'; $html=$html.'<tr><td >  4. Bank Details : '.$fetch_data->bank_details.'</td></tr></table>'; $html=$html.'<table style="width:100%;margin-top:20px;"><tr>'; $html=$html.'<td>FOR Deco-Textil</td>'; $html=$html.'<td style="text-align:right;">FOR Deco-Textil</td></tr>'; $html=$html.'<tr ><td style="padding-top:7%;">EXECUTIVE - PURCHASE</td>'; $html=$html.'<td style="text-align:right;padding-top:7%;">DIRECTOR</td></tr>'; $html=$html.'<tr><td colspan="2" style="text-align:center; padding-top:5%;">IT IS A COMPUTER GENERATED FORMAT. SIGNATURE IS NOT REQUIRED</td>'; $html=$html.'</tr></table></div>'; $mpdf->SetDisplayMode('fullpage'); $mpdf->SetWatermarkText(''); $mpdf->watermark_font = 'DejaVuSansCondensed'; $mpdf->showWatermarkText = true; $mpdf->WriteHTML($html); //$data = date('d-M-y-H-i'); //$file='generated_po/yaskawa'.$data.'PO.pdf'; $mpdf->Output('PO.pdf', 'F'); } } ?>