require_once '../functions.php';
require_once '../functions-2.php';
require_once DIR_WS_FUNCTIONS . 'html_output.php';
tep_db_connect();
use_class('depot_orders');
use_class('forecasting');
use_class('Product');
$class_do = new depot_orders();
$segments_id = tep_db_prepare_input($_POST['segmentid']);
$keywords = tep_db_prepare_input($_POST['pids']);
$fc_year = date('Y');
$current_month = date('m');
$fc = new forecasting($fc_year);
$fc->calcForecastLevelling();
$target_is_overlap = $fc->isLevellingTargetOverlap();
$list = $class_do->recommendationList($segments_id, $keywords);
$header = array();
$header['a'] = 'No';
$header['b'] = 'Image';
$header['c'] = 'Info';
$header['d'] = 'Size';
$header['e'] = 'EAN';
$header['f'] = 'L30D Sold No Promo';
$header['g'] = 'L30D Sold';
$header['h'] = 'Stock Available';
$header['i'] = 'Stock Target';
$header['j'] = 'Refill Ordered';
$header['k'] = 'Missing Quantity';
$header['l'] = 'Levelling Target (' . date('F') . ')';
$header['m'] = 'Levelling Orders Internal';
$header['n'] = 'Levelling Orders Outsourcing';