o'], 'plastic_welding_part_desc' => $_POST['part_desc'], 'plastic_welding_annul_volume' => $_POST['annul_volume'], 'plastic_welding_lot_run_size' => $_POST['lot_run_size'], 'plastic_welding_part_a_pastic_type' => $_POST['part_a_pastic_type'], 'plastic_welding_part_b_name' => $_POST['part_b_name'], 'plastic_welding_total_wt_kg_a_b' => $_POST['total_wt_kg_a_b'], 'plastic_welding_thickness_plastics_mm' => $_POST['thickness_plastics_mm'], 'plastic_welding_weld_type' => $_POST['weld_type'], 'plastic_welding_weld_length_mm' => $_POST['weld_length_mm'], 'plastic_welding_add_inserts' => $_POST['add_inserts'], 'plastic_welding_no_sides_needs_inserts' => $_POST['no_sides_needs_inserts'], 'plastic_welding_quantity_of_inserts' => $_POST['quantity_of_inserts'], ); $override_val = array('min_lot', 'overri_sga', 'old_overri_sga', 'lot_run_size', 'tot_ct', 'old_tot_ct', 'tot_inserts', 'old_tot_inserts', 'total_cycle_override', 'old_total_cycle_override', 'sga_p_override', 'old_sga_p_override', 'override_min_lot_run_charges', 'old_override_min_lot_run_charges','welding_burdern_rate_per_hr'); foreach ($override_val as $value) { if (!empty($_POST[$value])) { $plastic[$value] = $_POST[$value]; } else { $plastic[$value] = null; } } $data['select_part_a'] = $_POST['part_a_pastic_type']; $data['select_part_b'] = $_POST['part_b_name']; $data['select_kgs'] = $_POST['total_wt_kg_a_b']; $data['select_thickness'] = $_POST['thickness_plastics_mm']; $data['select_no_inserts'] = $_POST['no_sides_needs_inserts']; $this->session->set_userdata($plastic); $this->load->library('tool_lib/plastic__welding'); $plastic['sga_p_override']=$this->plastic__welding->sga_p_override($plastic); $plastic['override_min_lot_run_charges']=$this->plastic__welding->override_min_lot_run_charges($plastic); $plastic['welding_burdern_rate_per_hr']=$this->plastic__welding->welding_burdern_rate_per_hr($plastic); $plastic['weld_line_efficiency']=$this->plastic__welding->weld_line_efficiency($plastic); $plastic['wt_translation_formula']= $this->plastic__welding->wt_translation_formula($plastic); $plastic['insert_handling_time_calc']=$this->plastic__welding->insert_handling_time_calc($plastic); $plastic['handling_c_time_for_load_unload_sec_part']=$this->plastic__welding->handling_c_time_for_load_unload_sec_part($plastic); $plastic['welding_total_c_time_sec_part']=$this->plastic__welding->welding_total_c_time_sec_part($plastic); $plastic['total_cost_inserts']= $this->plastic__welding->total_cost_inserts($plastic); $plastic['hot_handling_cycle_load_unload']=$this->plastic__welding->hot_handling_cycle_load_unload($plastic); $plastic['hot_process_mc_cyc_sec_unit']=$this->plastic__welding->hot_process_mc_cyc_sec_unit($plastic); $plastic['lot_impact_weld_hotinsrt_no_part_p_hr']= $this->plastic__welding->lot_impact_weld_hotinsrt_no_part_p_hr($plastic); $plastic['hot_tot_cyc_time_sec_part']= $this->plastic__welding->hot_tot_cyc_time_sec_part($plastic); $plastic['global_table']['Plastic Welding']=$this->plastic__welding->global_table($plastic_data=$plastic); $plastic['tool_list'] = array('Plastic Welding'); $plastic['secondary_name'] = array(); $plastic['primary_name'] = 'Plastic Welding'; $data['result'] = $plastic; } $estimated_usa_more=number_format($data['result']['global_table']["Plastic Welding"]['material_cost']["Plastic Welding"]['material_cost']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['process_cost']["Plastic Welding"]['process_cost']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['setup_cost']["Plastic Welding"]['setup_cost']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['sga_profit']["Plastic Welding"]['sga_profit_cost']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['other_cost']["Plastic Welding"]['Other Cost']["USA"],3); $estimated_usa_less=number_format($data['result']['global_table']["Plastic Welding"]['material_cost']["Plastic Welding"]['material_cost_comp']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['process_cost']["Plastic Welding"]['process_cost_comp']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['setup_cost']["Plastic Welding"]['setup_cost_comp']["USA"],3) + number_format($data['result']['global_table']["Plastic Welding"]['sga_profit']["Plastic Welding"]['sga_profit_cost_comp']["USA"],3)+ number_format($data['result']['global_table']["Plastic Welding"]['other_cost']["Plastic Welding"]['Other Cost_comp']["USA"],3); $cost_per_piece = ($estimated_usa_more + $estimated_usa_less)/2; if(isset($_GET['id']) && !empty($_GET['id'])){ $where = array('credit_id' => $_GET['id']); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $model_data_first[] = $this->Alldata->DetailData('plans',$where); } } if(isset($_GET['id']) && !empty($_GET['id'])){ $data['seconsecondary_plan'] = $this->Alldata->get_secondary_plan($_GET['id']); } $data['wt_kgs'] = $this->Alldata->getDatamodel('welding_wt_kgs'); $data['thickness'] = $this->Alldata->getDatamodel('welding_thickness_chart'); $data['part_a'] = $this->Alldata->getDatamodel('inj_weld_mat_part_a'); $data['process_tbl'] = $this->Alldata->getDatamodel('welding_process_tbl'); $data['select_thickness'] = 0; $data['select_kgs'] = 0; $data['select_part_a'] = 0; $data['select_part_b'] = 0; $data['select_process_tbl'] = 0; $data['select_no_inserts'] = 0; $this->saveimage(); $this->load->view("plastic_welding_friction/view_plastic_welding_friction",$data); } public function saveimage(){ if ($this->session->userdata('isLoggedIn')) { if (!file_exists($this->session->userdata('folder_name').'/charts_plastic_weilding_integration')) { mkdir($this->session->userdata('folder_name').'/charts_plastic_weilding_integration', 0777, true); } $folder_path = $this->session->userdata('folder_name').'/charts_plastic_weilding_integration'; } else { if (!file_exists('assets/tool_charts/charts_plastic_weilding_integration')) { mkdir('assets/tool_charts/charts_plastic_weilding_integration', 0777, true); } $folder_path = 'assets/tool_charts/charts_plastic_weilding_integration'; } $img = $this->input->Post('img'); $img = str_replace('data:image/png;base64,', '', $img); $img = str_replace(' ', '+', $img); $data = base64_decode($img); file_put_contents($folder_path.'/image.png', $data); } public function fun_plastic_welding_friction_pdf() { if(!$this->session->has_userdata('isLoggedIn') || !$this->session->userdata['isLoggedIn']) { } else { if(isset($_POST["hidden_html"]) && $_POST["hidden_html"] != '') { $estimate_name_ip=$this->input->post('estimate_name_ip'); $creditid=$this->input->post('creditid'); $loggedin_email=base64_decode($this->session->userdata('email')); $isNamePresent = $this->Alldata->checkName('user_portfolio_friction',$estimate_name_ip); if ($isNamePresent) { $this->session->set_userdata($estimate_name_ip); $this->load->library('pdf'); $this->load->view('plastic_welding_friction/pdf_plastic_welding_friction'); $html = $this->output->get_output(); $session_id=$this->session->userdata('id'); $partno=$this->session->userdata('partno'); $part_desc=$this->session->userdata('part_desc'); $annul_volume=$this->session->userdata('annul_volume'); $lot_run_size=$this->session->userdata('lot_run_size'); $part_a_pastic_type=$this->session->userdata('part_a_pastic_type'); $part_b_name=$this->session->userdata('part_b_name'); $total_wt_kg_a_b=$this->session->userdata('total_wt_kg_a_b'); $thickness_plastics_mm=$this->session->userdata('thickness_plastics_mm'); $weld_type=$this->session->userdata('weld_type'); $weld_length_mm=$this->session->userdata('weld_length_mm'); $add_inserts=$this->session->userdata('add_inserts'); $no_sides_needs_inserts=$this->session->userdata('no_sides_needs_inserts'); $quantity_of_inserts=$this->session->userdata('quantity_of_inserts'); $file_name = $estimate_name_ip.'.pdf'; $pdf_file_path=$this->session->userdata('folder_name')."/".$file_name; $this->session->set_userdata($pdf_file_path); $is_premium=$_POST['is_premium']; $creditid=$this->input->post('creditid'); $html .= 'File Name: '.$estimate_name_ip; $html .= $_POST["hidden_html"]; $this->pdf->loadHtml($html); $this->pdf->set_paper(array(0,0,609.4488,1000.63), 'portrait'); $this->pdf->set_option("isPhpEnabled", true); $this->pdf->set_option('isRemoteEnabled', TRUE); $this->pdf->render(); $canvas = $this->pdf->getCanvas(); $w = $canvas->get_width(); $h = $canvas->get_height(); $pageNumberWidth = $w / 2; $pageNumberHeight = $h - 50; $imageURL = 'assets/img/watermark.png'; $imgWidth = 400; $imgHeight = 60; $text = "{PAGE_NUM} of {PAGE_COUNT}"; $canvas->set_opacity(.8,'Multiply'); $x = (($w-$imgWidth)/2); $y = (($h-$imgHeight)/2); $output = $this->pdf->output(); file_put_contents($pdf_file_path, $output); $insertdata = array( 'register_id'=>$session_id, 'pdf_file_path'=>$pdf_file_path, 'partno'=>$partno, 'part_desc'=>$part_desc, 'annul_volume'=>$annul_volume, 'lot_run_size'=>$lot_run_size, 'part_a_pastic_type'=>$part_a_pastic_type, 'part_b_name'=>$part_b_name, 'total_wt_kg_a_b'=>$total_wt_kg_a_b, 'thickness_plastics_mm'=>$thickness_plastics_mm, 'weld_type'=>$weld_type, 'weld_length_mm'=>$weld_length_mm, 'add_inserts'=>$add_inserts, 'no_sides_needs_inserts'=>$no_sides_needs_inserts, 'quantity_of_inserts'=>$quantity_of_inserts, 'estimate_name'=>$estimate_name_ip, 'is_premium'=>$is_premium, 'credit_id'=>$creditid, ); $result = $this->Alldata->insertData('user_portfolio_friction',$insertdata); if ($result) { if(!empty($creditid)){ $where = array('credit_id' => $creditid); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $premium_plan[] = $this->Alldata->DetailData('plans',$where); } } ### Mahen 10-07-2020 $id=$this->input->post('creditid'); $where=array('credit_id'=>$id); $credit = $this->Alldata->DetailData('credit_tbl',$where); if(!empty($credit)){ $credits = $credit[0]['credits']; $mcredit = $credits-1; $where=array('credit_id'=>$credit[0]['credit_id']); $data=array('credits'=>$mcredit); $this->Alldata->UpdateData('credit_tbl',$data,$where); ### Mahen 10-07-2020 } if ($_POST["flag"] === 'true') { $message['message'] = 'Done'; echo json_encode($message); exit; } else { $this->session->set_flashdata('Your Data & pdf Saved successfully in your Portfolio!!'); redirect(base_url('portfolio/Injection_portfolio')); } } else { $message['message'] = 'Failed to Update pdf !!'; echo json_encode($message); exit; } } elseif($_POST["flag"] === 'true') { $message['message'] = 'Estimate Name is already present'; echo json_encode($message); exit; } } } } public function edit_plastic_welding_friction($sid="register_id",$u_p_id="user_friction_id",$credit_id="") { $data['wt_kgs'] = $this->Alldata->getDatamodel('welding_wt_kgs'); $data['thickness'] = $this->Alldata->getDatamodel('welding_thickness_chart'); $data['part_a'] = $this->Alldata->getDatamodel('inj_weld_mat_part_a'); $data['process_tbl'] = $this->Alldata->getDatamodel('welding_process_tbl'); $data['select_thickness'] = 0; $data['select_kgs'] = 0; $data['select_part_a'] = 0; $data['select_part_b'] = 0; $data['select_process_tbl'] = 0; $where = array('user_friction_id'=>$u_p_id); $data['edit_plastic_input'] = $this->Alldata->DetailData('user_portfolio_friction',$where); $this->allData['edit_plastic_input']= $data; if( $data['edit_plastic_input'][0]["is_premium"] == "Yes" || $data['edit_plastic_input'][0]["is_premium"] == "YES" ){ if($credit_id != ""){ $where = array('credit_id' => $credit_id); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $premium_plan[] = $this->Alldata->DetailData('plans',$where); } $data['seconsecondary_plan'] = $this->Alldata->get_secondary_plan($credit_id); }elseif(!empty($data['edit_plastic_input'])){ $where = array('credit_id' => $data['edit_plastic_input'][0]['credit_id']); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $premium_plan[] = $this->Alldata->DetailData('plans',$where); } $data['seconsecondary_plan'] = $this->Alldata->get_secondary_plan($data['edit_plastic_input'][0]['credit_id']); } } $this->session->set_userdata($data); $this->load->view("plastic_welding_friction/edit_plastic_welding_friction",$data); } public function edit_plastic_welding_friction_result($sid="register_id",$u_p_id="user_friction_id",$credit_id="") { $data = array( 'user_friction_id' =>$u_p_id, 'partno' => $_POST['partno'], 'part_desc' => $_POST['part_desc'], 'annul_volume' => $_POST['annul_volume'], 'lot_run_size' => $_POST['lot_run_size'], 'part_a_pastic_type' => $_POST['part_a_pastic_type'], 'part_b_name' => $_POST['part_b_name'], 'total_wt_kg_a_b' => $_POST['total_wt_kg_a_b'], 'thickness_plastics_mm' => $_POST['thickness_plastics_mm'], 'weld_type' => $_POST['weld_type'], 'weld_length_mm' => $_POST['weld_length_mm'], 'add_inserts' => $_POST['add_inserts'], 'no_sides_needs_inserts' => $_POST['no_sides_needs_inserts'], 'quantity_of_inserts' => $_POST['quantity_of_inserts'], ); $plastic = array( 'user_friction_id' =>$u_p_id, 'partno' => $_POST['partno'], 'part_desc' => $_POST['part_desc'], 'annul_volume' => $_POST['annul_volume'], 'lot_run_size' => $_POST['lot_run_size'], 'part_a_pastic_type' => $_POST['part_a_pastic_type'], 'part_b_name' => $_POST['part_b_name'], 'total_wt_kg_a_b' => $_POST['total_wt_kg_a_b'], 'thickness_plastics_mm' => $_POST['thickness_plastics_mm'], 'weld_type' => $_POST['weld_type'], 'weld_length_mm' => $_POST['weld_length_mm'], 'add_inserts' => $_POST['add_inserts'], 'no_sides_needs_inserts' => $_POST['no_sides_needs_inserts'], 'quantity_of_inserts' => $_POST['quantity_of_inserts'], 'plastic_welding_partno' => $_POST['partno'], 'plastic_welding_part_desc' => $_POST['part_desc'], 'plastic_welding_annul_volume' => $_POST['annul_volume'], 'plastic_welding_lot_run_size' => $_POST['lot_run_size'], 'plastic_welding_part_a_pastic_type' => $_POST['part_a_pastic_type'], 'plastic_welding_part_b_name' => $_POST['part_b_name'], 'plastic_welding_total_wt_kg_a_b' => $_POST['total_wt_kg_a_b'], 'plastic_welding_thickness_plastics_mm' => $_POST['thickness_plastics_mm'], 'plastic_welding_weld_type' => $_POST['weld_type'], 'plastic_welding_weld_length_mm' => $_POST['weld_length_mm'], 'plastic_welding_add_inserts' => $_POST['add_inserts'], 'plastic_welding_no_sides_needs_inserts' => $_POST['no_sides_needs_inserts'], 'plastic_welding_quantity_of_inserts' => $_POST['quantity_of_inserts'], ); $override_val = array('min_lot', 'overri_sga', 'old_overri_sga', 'lot_run_size', 'tot_ct', 'old_tot_ct', 'tot_inserts', 'old_tot_inserts', 'total_cycle_override', 'old_total_cycle_override', 'sga_p_override', 'old_sga_p_override', 'override_min_lot_run_charges', 'old_override_min_lot_run_charges','welding_burdern_rate_per_hr'); foreach ($override_val as $value) { if (!empty($_POST[$value])) { $plastic[$value] = $_POST[$value]; } else { $plastic[$value] = null; } } $where = array('user_friction_id'=>$u_p_id); $data['edit_plastic_input'] = $this->Alldata->DetailData('user_portfolio_friction',$where); $data['select_part_a'] = $_POST['part_a_pastic_type']; $data['select_part_b'] = $_POST['part_b_name']; $data['select_kgs'] = $_POST['total_wt_kg_a_b']; $data['select_thickness'] = $_POST['thickness_plastics_mm']; $data['select_no_inserts'] = $_POST['no_sides_needs_inserts']; $this->load->library('tool_lib/plastic__welding'); $plastic['sga_p_override']=$this->plastic__welding->sga_p_override($plastic); $plastic['override_min_lot_run_charges']=$this->plastic__welding->override_min_lot_run_charges($plastic); $plastic['welding_burdern_rate_per_hr']=$this->plastic__welding->welding_burdern_rate_per_hr($plastic); $plastic['weld_line_efficiency']=$this->plastic__welding->weld_line_efficiency($plastic); $plastic['wt_translation_formula']= $this->plastic__welding->wt_translation_formula($plastic); $plastic['insert_handling_time_calc']=$this->plastic__welding->insert_handling_time_calc($plastic); $plastic['handling_c_time_for_load_unload_sec_part']=$this->plastic__welding->handling_c_time_for_load_unload_sec_part($plastic); $plastic['welding_total_c_time_sec_part']=$this->plastic__welding->welding_total_c_time_sec_part($plastic); $plastic['total_cost_inserts']= $this->plastic__welding->total_cost_inserts($plastic); $plastic['hot_handling_cycle_load_unload']=$this->plastic__welding->hot_handling_cycle_load_unload($plastic); $plastic['hot_process_mc_cyc_sec_unit']=$this->plastic__welding->hot_process_mc_cyc_sec_unit($plastic); $plastic['lot_impact_weld_hotinsrt_no_part_p_hr']= $this->plastic__welding->lot_impact_weld_hotinsrt_no_part_p_hr($plastic); $plastic['hot_tot_cyc_time_sec_part']= $this->plastic__welding->hot_tot_cyc_time_sec_part($plastic); $plastic['global_table']['Plastic Welding']=$this->plastic__welding->global_table($plastic_data=$plastic); $plastic['tool_list'] = array('Plastic Welding'); $plastic['secondary_name'] = array(); $plastic['primary_name'] = 'Plastic Welding'; $plastic['creditid'] = $data['edit_plastic_input'][0]['credit_id']; $this->session->set_userdata($plastic); $data['result'] = $plastic; if( $data['edit_plastic_input'][0]["is_premium"] == "Yes" || $data['edit_plastic_input'][0]["is_premium"] == "YES" ){ if($credit_id != ""){ $where = array('credit_id' => $credit_id); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $premium_plan[] = $this->Alldata->DetailData('plans',$where); } $data['seconsecondary_plan'] = $this->Alldata->get_secondary_plan($credit_id); }elseif(!empty($data['edit_plastic_input'])){ $where = array('credit_id' => $data['edit_plastic_input'][0]['credit_id']); $plandetail = $this->Alldata->DetailData('credit_tbl',$where); $plan_id = explode(',',$plandetail[0]['plan_id']); for($i=0;$i$plan_id[$i]); $premium_plan[] = $this->Alldata->DetailData('plans',$where); } $data['seconsecondary_plan'] = $this->Alldata->get_secondary_plan($data['edit_plastic_input'][0]['credit_id']); } } $data['wt_kgs'] = $this->Alldata->getDatamodel('welding_wt_kgs'); $data['thickness'] = $this->Alldata->getDatamodel('welding_thickness_chart'); $data['part_a'] = $this->Alldata->getDatamodel('inj_weld_mat_part_a'); $data['process_tbl'] = $this->Alldata->getDatamodel('welding_process_tbl'); $data['select_thickness'] = 0; $data['select_kgs'] = 0; $data['select_part_a'] = 0; $data['select_part_b'] = 0; $data['select_process_tbl'] = 0; $this->session->set_userdata($data); $this->session->set_userdata($plastic); $this->load->view("plastic_welding_friction/edit_plastic_welding_friction",$data); } }

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /var/www/html/Smart-Solutions-CE-version/application/controllers/plastic_welding_friction/Plastic_welding_friction.php:1)

Filename: core/Common.php

Line Number: 570

Backtrace:

File: /var/www/html/Smart-Solutions-CE-version/index.php
Line: 167
Function: require_once