* SPDX-License-Identifier: AGPL-3.0-only ************************************/ // ITS4YOU TT0093 VlMe N require_once('data/Tracker.php'); require_once('include/utils/UserInfoUtil.php'); require_once('include/database/PearDatabase.php'); global $adb; global $log; global $mod_strings; global $app_strings; global $current_language; global $theme; global $table_prefix; $theme_path="themes/".$theme."/"; $image_path=$theme_path."images/"; $Templates = explode(";",$_REQUEST['templates']); sort($Templates); $c = ''; if(count($Templates) > 0) { foreach ($Templates AS $templateid) { $sql = "SELECT ".$table_prefix."_pdfmaker.*, ".$table_prefix."_pdfmaker_settings.* FROM ".$table_prefix."_pdfmaker LEFT JOIN ".$table_prefix."_pdfmaker_settings ON ".$table_prefix."_pdfmaker_settings.templateid = ".$table_prefix."_pdfmaker.templateid WHERE ".$table_prefix."_pdfmaker.templateid=?"; $result = $adb->pquery($sql, array($templateid)); $num_rows = $adb->num_rows($result); if ($num_rows > 0) { $pdftemplateResult = $adb->fetch_array($result); $Margins = array("top" => $pdftemplateResult["margin_top"], "bottom" => $pdftemplateResult["margin_bottom"], "left" => $pdftemplateResult["margin_left"], "right" => $pdftemplateResult["margin_right"]); $Decimals = array("point"=>$pdftemplateResult["decimal_point"], "decimals"=>$pdftemplateResult["decimals"], "thousands"=>$pdftemplateResult["thousands_separator"]); $templatename = $pdftemplateResult["filename"]; $nameOfFile = $pdftemplateResult["file_name"]; $description = $pdftemplateResult["description"]; $module = $pdftemplateResult["module"]; $body = decode_html($pdftemplateResult["body"]); $header = decode_html($pdftemplateResult["header"]); $footer = decode_html($pdftemplateResult["footer"]); $format = $pdftemplateResult["format"]; $orientation = $pdftemplateResult["orientation"]; $c .= ""; } } } header('Content-Type: application/xhtml+xml'); header("Content-Disposition: attachment; filename=export.xml"); echo ""; echo ""; echo $c; echo ""; exit; function cdataEncode($text, $encode = false) { $From = array(""); $To = array("<|!|[%|CDATA|[%|", "|%]|]|>"); if ($text != "") { $pos1 = strpos("", $text); if ($pos1 === false && $pos2 === false && $encode == false) { $content = $text; } else { $encode_text = str_replace($From, $To, $text); $content = ""; } } else { $content = ""; } return $content; } ?>