function estimate_details($id, $details = 'details', $update_estimate = 'update_estimate') { global $current_language, $app_list_strings; $object = new ComponentEstimate(); $mod_strings = return_module_language($current_language, $object->object_name); $object->retrieve($id); $xtpl = new XTemplate('modules/ComponentEstimate/EstimateDetails.html'); $xtpl->assign('MOD', $mod_strings); if ($object->status == "uptodate") { ///////////// DETAILS ///////////// $prepress = $object->prepressEstimate($object->component_id); $press_rate[] = $object->press_rate_a_id; $press_rate[] = $object->press_rate_b_id; $pressestimate = $object->pressEstimate($object->component_id, $press_rate); $paperestimate = $object->paperEstimate($object->component_id, $object->paper_rate_id); $operations = $object->operationsEstimate($object->component_id, true); ///Press $xtpl->assign("press_price_lines", $pressestimate['layout_html']); /// ///Paper & Paperwaste $client_paper = $paperestimate['client_paper']; $xtpl->assign("paper_singleprice", $paperestimate['paper_singleprice']); $xtpl->assign("clean_quantity_qp", $paperestimate['clean_quantity_qp']); $xtpl->assign("paperwaste_qp", $paperestimate['paperwaste_qp']); $xtpl->assign("qp", $paperestimate['qp']); $xtpl->assign("sheets_qp", $paperestimate['sheets_qp']); $xtpl->assign("pages", $paperestimate['pages']); $xtpl->assign("paper_waste_rows", $paperestimate['paperestimate_html']); $xtpl->assign("paper_operation_waste_rows", $paperestimate['operations_html']); $xtpl->assign("client_paper", $app_list_strings['client_paper_options'][$client_paper]); /// ///Prepress $xtpl->assign("prepress_lines", $prepress['html']); /// ///Operations $xtpl->assign("operation_lines", $operations['html']); /// $xtpl->assign("details", $details); //////////////////////////////////// } else { $xtpl->assign("details", $update_estimate); } $xtpl->parse('details'); $xtpl->out('details'); }
} $press_rate = array(); $press_rate[] = null; $press_rate[] = null; if (isset($_REQUEST['press_rate_a_id']) && !empty($_REQUEST['press_rate_a_id'])) { $press_rate[0] = $_REQUEST['press_rate_a_id']; } if (isset($_REQUEST['press_rate_b_id']) && !empty($_REQUEST['press_rate_b_id'])) { $press_rate[1] = $_REQUEST['press_rate_b_id']; } $press_paperwaste_rate = null; if (isset($_REQUEST['press_paperwaste_rate']) && !empty($_REQUEST['press_paperwaste_rate'])) { $press_paperwaste_rate = $_REQUEST['press_paperwaste_rate']; } $paperestimate = $focus->paperEstimate($component_id, $press_paperwaste_rate); $prepress = $focus->prepressEstimate($component_id); $pressestimate = $focus->pressEstimate($component_id, $press_rate); $operations = $focus->operationsEstimate($component_id); /// Error Check if (!empty($focus->errors)) { $errors_output = $focus->displayErrors(); $theme_path = 'themes/' . $theme . '/'; $image_path = $theme_path . 'images/'; require_once $theme_path . 'layout_utils.php'; $xtpl = new XTemplate('modules/ComponentEstimate/ErrorView.html'); $xtpl->assign('MOD', $mod_strings); $xtpl->assign('errors_output', $errors_output); $xtpl->parse('main'); $xtpl->out('main'); } else { if (!empty($_REQUEST['component_name']) && isset($_REQUEST['component_name']) && !is_null($_REQUEST['component_name'])) {