コード例 #1
0
 function estimate_details($id, $details = 'details', $update_estimate = 'update_estimate')
 {
     global $current_language, $app_list_strings;
     $object = new ComponentEstimateCalc();
     $mod_strings = return_module_language($current_language, $object->object_name);
     $object->retrieve($id);
     $xtpl = new XTemplate('modules/ComponentEstimateCalc/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("total_paper", $paperestimate['total_paper_price']);
         $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');
 }
コード例 #2
0
$theme_path = 'themes/' . $theme . '/';
$image_path = $theme_path . 'images/';
require_once $theme_path . 'layout_utils.php';
$xtpl = new XTemplate('modules/Estimates/DetailView.html');
////Auto Estimate
if (isset($_REQUEST['estimate_id']) && isset($_REQUEST['mode']) && $_REQUEST['mode'] == "auto") {
    $components_to_estimate = $focus->build_component_estimates_list($focus->id);
    for ($i = 0; $i < count($components_to_estimate); $i++) {
        $component_id = $components_to_estimate[$i]['id'];
        $componentEstimate = new ComponentEstimateCalc();
        if ($components_to_estimate[$i]['outdated'] == true) {
            $componentEstimate->retrieve($components_to_estimate[$i]['estimate_id']);
        }
        $paperestimate = $componentEstimate->paperEstimate($component_id, null);
        $pressestimate = $componentEstimate->pressEstimate($component_id, null);
        $operations = $componentEstimate->operationsEstimate($component_id);
        $prepress = $componentEstimate->prepressEstimate($component_id);
        $componentEstimate->name = $mod_strings['LBL_EST_NAME_PREFIX'] . "-" . $components_to_estimate[$i]['name'];
        $componentEstimate->component_id = $components_to_estimate[$i]['id'];
        $componentEstimate->component_name = $components_to_estimate[$i]['name'];
        $componentEstimate->estimate_id = $focus->id;
        $componentEstimate->estimate_name = $focus->name;
        $componentEstimate->assigned_user_id = $current_user->id;
        $componentEstimate->total_paper = $paperestimate['total_paper_price'];
        $componentEstimate->total_press = $pressestimate['total_price'];
        $componentEstimate->total_prepress = $prepress['total_price'];
        $componentEstimate->total_operations = $operations['total_price'];
        $componentEstimate->paper_singleprice = $components_to_estimate[$i]['price'];
        $componentEstimate->status = "uptodate";
        $componentEstimate->press_rate_a_id = $pressestimate['press_rate'][0]['id'];
        $componentEstimate->press_rate_a_name = $pressestimate['press_rate'][0]['name'];
コード例 #3
0
$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/ComponentEstimateCalc/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'])) {
        $component_name = $_REQUEST['component_name'];
    }
コード例 #4
0
$bodyHtml .= $pdf->createHeading();
$bodyHtml .= $focus->component_estimate_pdf();
$bodyHtml .= "<newpage>";
////
////
//Prepress
$CompEstCalc = new ComponentEstimateCalc();
$query = 'SELECT component_id FROM ' . $CompEstCalc->table_name . ' WHERE estimate_id="' . $focus->estimate_id . '" AND deleted=0 ';
$result = $focus->db->query($query, true, "Error filling layout fields: ");
$i = 0;
while (($row = $focus->db->fetchByAssoc($result)) != null) {
    $i++;
    $CompEstCalc->retrieve($row['id']);
    $paperEst = $CompEstCalc->paperEstimate($row['component_id'], null, false, true);
    $pressEst = $CompEstCalc->pressEstimate($row['component_id'], null, false, true);
    $operationsEst = $CompEstCalc->operationsEstimate($row['component_id'], false, true);
    $prepressEst = $CompEstCalc->prepressEstimate($row['component_id'], false, true);
    $mod_strings_cec = return_module_language($current_language, "ComponentEstimateCalc");
    $compsHtml = "";
    $compsHtml .= $pdf->sectionHeading($mod_strings["LBL_EST_PDF"]);
    //shortcuts
    $singlePrice = $paperEst["paper_singleprice"] . " " . $mod_strings["LBL_UNITS"];
    $paperPrice = $paperEst["total_paper_price"] . " " . $mod_strings["LBL_UNITS"];
    //paper
    $compsHtml .= $pdf->createHeading($mod_strings_cec["LBL_PAPER"]);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_CLEAN_QTY_QP"], true, true, false);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_PAPERWOST_QP"]);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_QP"]);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_SHETS_QP"]);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_PAGES"]);
    $compsHtml .= $pdf->genCells($mod_strings_cec["LBL_PAPER_SINGLE_PRICE"]);