$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");
?>
Пример #2
0
		if ($row["average"]!=$lasta || ($timetype!=3 && $row["best"]!=$lastb))
		{
			$classification = $count;
			$lasta = $row["average"];
			$lastb = $row["best"];
		}
		if ($row["best"] > "A") break;
		if ($classification && $classification<=$qualified) 
		{
			IF(!isset($CERTIFICATES))
			{
				$pdf->Write(5,$classification . ". " . romance($row["name"]) . " (" . formatTime($row[($avgtype==2?"best":"average")],$timetype) . ")");
				$pdf->Ln();
			}
			ELSE
				printCertificate($text, romance($row["name"]), $classification, $rowEvt["name"], formatTime($row[($avgtype==2?"best":"average")],$timetype));
		}
	}
	$pdf->Ln();
}

//----------------------------------------------------------------------------------------------------------------------------

IF(!isset($CERTIFICATES))
{	
	$pdf->AddPage();
	$pdf->SetFont('DejaVu','B',16);
	$pdf->Write(5,$_SESSION["c_name"]);
	$pdf->Ln();
	$pdf->SetFont('','',14);
	$pdf->Write(5,"Special classifications (for Rubik's Cube only)");