$template = readTemplate($fname,$dummy); if ($template) $text = $template->txt; else { $fname = defaultTemplateLanguage(); $template = readTemplate($fname,$dummy); if (!$template) die("Impossible to load a valid template"); else $text = $template->getV1(); } $fbgname = getTemplateBackgroundFilename(); if (!file_exists($fbgname)) $fbgname = ""; if (!isset($_GET["t"])) printCertificate(null,null,null,null,null); else { $CERTIFICATES = true; // flag require_once "extrarep.php"; // does all the work over db } sql_close(); $pdf->SetDisplayMode("fullpage","single"); $pdf->Output(preg_replace("/\W/","",$_SESSION["c_name"])." - Certificates.pdf", "I"); ?>