array_shift($rs); foreach ($rs as $r) { $pdf_data['services'] .= ', ' . $r['srv_name']; } } else { b1n_regGoBackExit('Could not get services for this Handler.\\nAborting PDF Generation.'); } // Remarks $pdf_data['remarks'] = $reg_data['remarks']; // Itinerary $query = "\n SELECT\n *\n FROM\n func_list_leg_pdf('" . implode(':', $ids) . "') AS \n (\n apt_name_depart text,\n apt_name_arrive text,\n apt_timezone_depart text,\n apt_timezone_arrive text,\n \n leg_etd_dt text,\n leg_etd_localtime_dt text,\n\n leg_eta_dt text,\n leg_eta_localtime_dt text\n )"; $rs = $sql->query($query); if ($rs && is_array($rs)) { $pdf_data['itinerary'] = $rs; } else { b1n_regGoBackExit('Could not get Legs.\\nAborting PDF Generation.'); } // Pax Manifest $query = "\n SELECT\n pax_name,\n TO_CHAR(pax_dob_dt, 'DDMONYY') AS pax_dob_dt,\n cts_name AS pax_cts_name,\n pax_ppt_nbr\n FROM \n \"leg_pax\"\n NATURAL JOIN \"pax\"\n NATURAL JOIN \"citizenship\"\n WHERE\n leg_id = '" . $leg_id . "'"; $rs = $sql->query($query); $pdf_data['pax'] = $rs; // Start Building the Document // ----------------------------------------------------------------- $opr_phone_prefix = ''; if (!empty($data['opr_phone_country_code'])) { $opr_phone_prefix = '+' . $data['opr_phone_country_code'] . '-'; } if (!empty($data['opr_phone_city_code'])) { $opr_phone_prefix .= $data['opr_phone_city_code'] . '-'; } $footer = $data['opr_name'] . '. ';
<?php // $Id: handler.php,v 1.7 2003/02/15 18:04:03 binary Exp $ $page1_title = 'Handling'; // Getting handler ID of the airport of the Last checked Leg $query = "\n SELECT\n hdl_id\n FROM\n \"leg\"\n JOIN \"airport\" ON (leg.apt_id_arrive = airport.apt_id)\n WHERE\n leg_id = '" . b1n_inBd($leg_id) . "'"; $rs = $sql->singleQuery($query); if ($rs && is_array($rs)) { $hdl_id = $rs['hdl_id']; } else { b1n_regGoBackExit('Could not get ID of the Handler of the last checked Leg.\\nAborting PDF Generation.'); } // Configuration Hash $reg_config = array("Contacts" => array("reg_data" => "contacts", "db" => "none", "check" => "fk", "type" => "select", "extra" => array("seltype" => "fk", "table" => "view_hdl_ctc", "text" => "ctc_name", "value" => "ctc_id", "name" => "contacts[]", "params" => array("multiple" => ""), "where" => "hdl_id = '" . b1n_inBd($hdl_id) . "'"), "mand" => true), "Request" => array("reg_data" => "services", "db" => "none", "check" => "fk", "type" => "select", "extra" => array("seltype" => "fk", "table" => "service", "text" => "srv_name", "value" => "srv_id", "name" => "services[]", "params" => array("multiple" => ""), "where" => "srv_provider = 'H'"), "mand" => true), "Remarks" => array("reg_data" => "remarks", "db" => "Remarks", "check" => "none", "type" => "text", "extra" => array("size" => b1n_DEFAULT_SIZE, "maxlen" => b1n_DEFAULT_MAXLEN), "mand" => false));
unset($dinc); unset($dend); // getVars from $_REQUEST and put them in $reg_data hash // action1 if ($action1 == 'print') { // getVars from $_REQUEST and put them in $reg_data hash $reg_data = b1n_regExtract($reg_config); if (b1n_havePermission(b1n_FUNC_LIST_LEG)) { require $page0 . "/" . $page1 . "/print.php"; } exit; } // If we are going to change, include the 'Trip' input if ($action1 == 'change' || $action0 == 'change') { $aux = $reg_config; $reg_config = array(); $reg_config["Trip"] = array("reg_data" => "leg_trip", "db" => "leg_trip", "check" => "numeric", "type" => "text", "extra" => array("size" => 3, "maxlen" => 3), "load" => true, "mand" => true); $reg_config += $aux; $reg_data = b1n_regExtract($reg_config); } elseif ($action0 == 'caterer') { $reg_data = b1n_regExtract($reg_config); $aux = count($reg_data['ids']); if ($aux <= 0) { b1n_regGoBackExit('You have to check, at least, one leg.'); } elseif ($aux > 1) { b1n_regGoBackExit('You cannot check more than one leg for Catering Order'); } } else { $reg_data = b1n_regExtract($reg_config); } require b1n_INCPATH . "/reg.inc.php";
// Getting Data to Build the Document // Contacts $query = "\n SELECT\n ctc_name\n FROM\n \"view_cat_ctc\"\n WHERE\n cat_id = '" . $cat_id . "' AND (ctc_id IS NULL"; foreach ($pdf_data['contacts'] as $c) { $query .= " OR ctc_id = '" . b1n_inBd($c) . "'"; } $query .= ") LIMIT " . b1n_PDF_CAT_MAX_CTC; $rs = $sql->query($query); if ($rs && is_array($rs)) { $pdf_data['contacts'] = $rs[0]['ctc_name']; array_shift($rs); foreach ($rs as $r) { $pdf_data['contacts'] .= ' / ' . $r['ctc_name']; } } else { b1n_regGoBackExit('Could not get contacts for this Caterer.\\nAborting PDF Generation.'); } // Start Building the Document // ----------------------------------------------------------------- $opr_phone_prefix = ''; if (!empty($data['opr_phone_country_code'])) { $opr_phone_prefix = '+' . $data['opr_phone_country_code'] . '-'; } if (!empty($data['opr_phone_city_code'])) { $opr_phone_prefix .= $data['opr_phone_city_code'] . '-'; } $footer = $data['opr_name'] . '. '; $footer .= 'Phone: ' . $opr_phone_prefix . $data['opr_coffice_phone'] . ' '; $footer .= 'Fax: ' . $opr_phone_prefix . $data['opr_coffice_fax'] . "\n"; $footer .= $data['opr_address'] . ' - ' . $data['opr_city'] . ' - ' . $data['opr_country']; $pdf->b1n_SetHeader(strtoupper("Catering Order\n" . $data['acf_registry'] . ' ' . $data['acf_model']));
define('b1n_PDF_LINE_SPACE', '5'); define('b1n_PDF_DEFAULT_FONTSIZE', '12'); require b1n_LIBPATH . '/pdf.lib.php'; $pdf = new PDF(); $pdf->SetTitle($page1_title); $pdf->Open(); $pdf->AliasNbPages(); switch ($action0) { case 'handler': case 'permit': case 'gedec': case 'caterer': require $page0 . '/' . $page1 . '/' . $action0 . '_pdf.php'; break; default: b1n_regGoBackExit('Invalid Request.\\nWhat are you trying to do? (2)'); } $pdf->Output($action0 . '-' . strtolower(date('dMY')) . '.pdf', true); exit; } $colspan = 3; ?> <html> <head> <title>FlyWatch <?php echo b1n_VERSION; ?> - <?php echo $page1_title; ?> Module</title>
fod_id, fdt_name, fod_name FROM "fdt_fod" NATURAL JOIN "foodtype" NATURAL JOIN "food" ORDER BY fdt_name, fod_name'; $fdt_fod = $sql->query($query); if ($fdt_fod && is_array($fdt_fod)) { foreach ($fdt_fod as $r) { $reg_config += array($r['fdt_name'] . ' - ' . $r['fod_name'] => array('reg_data' => 'qtd_' . $r['fdt_id'] . '_' . $r['fod_id'], 'name' => $r['fod_name'], 'db' => 'none', 'check' => 'numeric', 'mand' => false)); } } else { b1n_regGoBackExit('Could not get any FoodType (or Food), did you really add some?.\\nAborting PDF Generation.'); } $reg_config += array('Remarks' => array('reg_data' => 'remarks', 'db' => 'none', 'check' => 'none', 'mand' => false)); $reg_data = b1n_regExtract($reg_config); if ($action2 == 'generate' && b1n_regPdfCheckCaterer($sql, $ret_msgs, $reg_data, $reg_config)) { // Generate PDF $action2 = 'GO'; } else { ?> <html> <head> <title>FlyWatch <?php echo b1n_VERSION; ?> - <?php echo $page1_title;
// We need: // 1 - Operator // 2 - Aircraft // 3 - Crew Members // 3a - PIC // 3b - SIC // 3c - Extra1 // 3d - Extra2 // 4 - Pax Manifest // 5 - Itinerary Piece $pdf_data = array(); // Getting Data to Build the Document // ----------------------------------------------------------------- $data = $sql->singleQuery("SELECT * FROM \"view_general_declaration\" WHERE leg_id = '" . $leg_id . "'"); if (!is_array($data)) { b1n_regGoBackExit('Could not get data from view_general_declaration.\\nAborting PDF Generation'); } // Remarks $pdf_data['remarks'] = $reg_data['remarks']; // Pax Manifest $query = "\n SELECT\n pax_name,\n TO_CHAR(pax_dob_dt, 'DDMONYY') AS pax_dob_dt,\n cts_name AS pax_cts_name,\n pax_ppt_nbr\n FROM \n \"leg_pax\"\n NATURAL JOIN \"pax\"\n NATURAL JOIN \"citizenship\"\n WHERE\n leg_id = '" . $leg_id . "'"; $rs = $sql->query($query); $pdf_data['pax'] = $rs; exit; // Start Building the Document // ----------------------------------------------------------------- $opr_phone_prefix = ''; if (!empty($data['opr_phone_country_code'])) { $opr_phone_prefix = '+' . $data['opr_phone_country_code'] . '-'; } if (!empty($data['opr_phone_city_code'])) {