$data_graph = $fc->drawDataForGraph(); //if(count($fc->weeks_projected)>0) $data_graph .= '|||'.$fc->drawDataForGraph(1, true); return $data_source . $kw_year . '|||' . $data_graph; } function displayLTFCollection($id, $name, $products) { return '<div id="level-col-' . $id . '" class="ui-state-default' . ' ui-corner-all pointer level-cols" style="padding:4px;float:left;' . 'margin-right:10px;">' . $name . ' (' . $products . ')</div>'; } if (isset($_POST['me_action'])) { if ($_POST['me_action'] == 'SAVENEWFACTOR') { $kw_year = tep_db_prepare_input($_POST['kw_year']); $kw_start = tep_db_prepare_input($_POST['kw_start']); $kw_end = tep_db_prepare_input($_POST['kw_end']); $new_factor = tep_db_prepare_input($_POST['new_factor']); $fc = new forecasting($kw_year, $forecasting_conf['elements-sourcing-projection']); $fc->updateFactor($kw_start, $kw_end, $new_factor); echo utf8_encode(drawDataGraph($fc, $kw_year)); exit; } elseif ($_POST['me_action'] == 'CHANGEYEAR') { $kw_year = tep_db_prepare_input($_POST['kw_year']); $fc = new forecasting($kw_year, $forecasting_conf['elements-sourcing-projection']); echo utf8_encode(drawDataGraph($fc, $kw_year)); exit; } elseif ($_POST['me_action'] == 'SAVEESPROJECTION') { $kw_year = tep_db_prepare_input($_POST['kw_year']); $new_esp = tep_db_prepare_input($_POST['new_esp']); $forecasting_conf['elements-sourcing-projection'] = $new_esp; save_config('forecasting', $forecasting_conf); $fc = new forecasting($kw_year, $forecasting_conf['elements-sourcing-projection']); echo utf8_encode(drawDataGraph($fc, $kw_year)); exit;