/* Decoded by unphp.net */ query("SELECT license FROM vtiger_pdfmaker_version WHERE version='".$$xxx0e."'");if(!$xxx12 || ($$xxx0d->query_result($xxx12,0,"license")!=$xxx46($$xxx0f) && $$xxx0d->query_result($xxx12,0,"license")!=$xxx46("basic/".$$xxx0f))){ echo "Invalid license key! Please contact the vendor of PDF Maker."; exit;}else{ if(isset($_REQUEST["idslist"]) && $_REQUEST["idslist"]!=""){$xxx13 = $xxx3d(";", $xxx4a($_REQUEST["idslist"],";"));if(isset($_SESSION[$_REQUEST["relmodule"]."_listquery"])){$xxx14 = $_SESSION[$_REQUEST["relmodule"]."_listquery"];$xxx15 = $xxx11->table_index; $xxx16 = $$xxx0d->query($xxx14);$xxx17 = array();while($xxx18 = $$xxx0d->fetchByAssoc($xxx16)){if(isset($xxx18[$xxx15]) && $xxx44($xxx18[$xxx15], $xxx13)){$xxx17[$xxx18[$xxx15]] = $xxx18[$xxx15];}}$xxx13 = $xxx3c($xxx17);}else{$xxx4b($xxx13);} } elseif(isset($_REQUEST['record'])) {$xxx13 = array($_REQUEST["record"]); } $xxx19 = $xxx4e($_REQUEST["commontemplateid"],";"); $xxx1a = $xxx3d(";",$xxx19); $xxx1b=""; if($_REQUEST["mode"] == "content") {$xxx1c = array();foreach($xxx13 as $xxx1d){ $xxx11->retrieve_entity_info($xxx1d,$_REQUEST["relmodule"]); $xxx11->id = $xxx1d; foreach ($xxx1a AS $xxx1e) {$xxx1f = $xxx10->GetPDFContentRef($xxx1e, $_REQUEST["relmodule"], $xxx11, $_REQUEST["language"]);$xxx20 = $xxx1f->getContent();$xxx21 = $xxx20["body"];$xxx21 = $xxx4c("#LISTVIEWBLOCK_START#","",$xxx21);$xxx21 = $xxx4c("#LISTVIEWBLOCK_END#","",$xxx21);$xxx1c[$xxx1e]["header"] = $xxx20["header"];$xxx1c[$xxx1e]["body"] = $xxx21;$xxx1c[$xxx1e]["footer"] = $xxx20["footer"]; }}include_once("modules/PDFMaker/EditPDF.php");showEditPDFForm($xxx1c); } else {if (isset($_REQUEST["type"]) && ($_REQUEST["type"] == "doc" OR $_REQUEST["type"] == "rtf")){$xxx22 = array();$xxx23 = 1;foreach($xxx13 as $xxx1d){ $xxx11->retrieve_entity_info($xxx1d,$_REQUEST["relmodule"]);$xxx11->id = $xxx1d;foreach ($xxx1a AS $xxx1e){ $xxx1f = $xxx10->GetPDFContentRef($xxx1e, $_REQUEST["relmodule"], $xxx11, $_REQUEST["language"]); $xxx1f->pagebreak = "
"; $xxx24 = $xxx1f->getSettings(); if($xxx1b=="")$xxx1b = $xxx1f->getFilename(); if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "edit") { $xxx25 = $_REQUEST["header".$xxx1e]; $xxx21 = $_REQUEST["body".$xxx1e]; $xxx26 = $_REQUEST["footer".$xxx1e]; } else { $xxx20 = $xxx1f->getContent(); $xxx25 = $xxx20["header"]; $xxx21 = $xxx20["body"]; $xxx26 = $xxx20["footer"]; } if ($xxx25 != "" OR $xxx26 != "") { $xxx27 = "cache/pdfmaker/".$xxx1d."_headerfooter_".$xxx1e."_".$xxx23.".html"; $xxx25 = $xxx4c("{PAGENO}","1",$xxx25); $xxx26 = $xxx4c("{PAGENO}","1",$xxx26);$xxx25 = $xxx4c("{nb}","1",$xxx25); $xxx26 = $xxx4c("{nb}","1",$xxx26); $xxx28 = '';} else { $xxx27 = ""; $xxx28 = "";}$xxx21 = $xxx4c("#LISTVIEWBLOCK_START#","",$xxx21);$xxx21 = $xxx4c("#LISTVIEWBLOCK_END#","",$xxx21);$xxx29 = "
";$xxx29 .= $xxx21;$xxx29 .= "
";$xxx2a[$xxx1e][] = $xxx23;$xxx22[$xxx23] = array("settings" => $xxx24, "content" => $xxx29, "headerfooterurl" => $xxx27 , "headerfooter" => $xxx28);$xxx23++; }}if($xxx1b==""){$xxx1b = $xxx10->GenerateName($xxx13, $xxx1a, $_REQUEST["relmodule"]);}@$xxx43("Cache-Control: ");@$xxx43("Pragma: ");if ($_REQUEST["type"] == "doc"){ @$xxx43("Content-type: application/vnd.ms-word"); @$xxx43("Content-Disposition: attachment;Filename=".$xxx1b.".doc");}elseif ($_REQUEST["type"] == "rtf"){ @$xxx43("Content-type: application/rtf"); @$xxx43("Content-Disposition: attachment;Filename=".$xxx1b.".rtf");}echo "";echo "";echo "";echo "";echo " ";echo "";echo "";foreach ($xxx22 AS $xxx2d => $xxx2c){if ($xxx2d > 1) echo "
";echo $xxx2c["content"];}echo "";echo "";}else{$xxx38 = "";if (isset($_REQUEST["mode"]) && $_REQUEST["mode"] == "edit"){foreach($xxx1a as $xxx1e){$xxx38["header".$xxx1e] = $_REQUEST["header".$xxx1e];$xxx38["body".$xxx1e] = $_REQUEST["body".$xxx1e];$xxx38["footer".$xxx1e] = $_REQUEST["footer".$xxx1e];}} $xxx39 = "";$xxx1b = $xxx10->GetPreparedMPDF($xxx39, $xxx13, $xxx1a, $_REQUEST["relmodule"], $_REQUEST["language"], $xxx38); if($_REQUEST['is_portal'] == "true"){$xxx3a = "cache/".$xxx4f();$xxx3b = $xxx3a."/".$xxx1b.".pdf";$xxx47($xxx3a);$xxx39->Output($xxx3b, "F");$_SESSION["portal_pdf_name"] = $xxx3b;}else{$xxx39->Output('cache/'.$xxx1b.'.pdf');@$xxx48();$xxx43('Content-Type: application/pdf');$xxx43("Content-length: ".$xxx3f("./cache/$xxx1b.pdf"));$xxx43("Cache-Control: private");$xxx43("Content-Disposition: attachment; filename=$xxx1b.pdf");$xxx43("Content-Description: PHP Generated Data");echo $xxx41($xxx40("./cache/$xxx1b.pdf", "r"),$xxx3f("./cache/$xxx1b.pdf"));@$xxx50("cache/$xxx1b.pdf");} }} } ?>