2022-11-28 09:17:05 +01:00

108 lines
3.1 KiB
PHP
Executable File

<?php
session_start();
$user_admin=$_SESSION["user_admin"];
$jahrgang=$_SESSION["jahrgang"];
include("kurs/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
#require_once("class.fpdf_table.php");
define('FPDF_FONTPATH','font/');
require('as_utf_class.php');
require_once("table_def.inc");
$pdf= new utfFPDF();
$pagecount = $pdf->setSourceFile("deckblatt.pdf");
$tplidx = $pdf->ImportPage(1);
$pdf->SetAutoPageBreak(true, 20);
$pdf->SetTopMargin(0);
$pdf->SetRightMargin(23);
$pdf->SetAutoPageBreak(TRUE, 0);
// Rechte&uuml;berpr&uuml;fung
$db = dbconnect();
if ($user_admin == ""){ require("../../index.php"); exit;} //Wenn man nicht angemeldet ist, darf man nicht auf die Seite
$result = $db->query("SELECT 1 FROM brt_admin_rechte, brt_admin_rechte_zuord , brt_admin where brt_admin_rechte.brt_admin_rolle = brt_admin_rechte_zuord.brt_admin_rolle AND brt_admin_rechte_zuord.waid = brt_admin.waid AND brt_admin.user = '$user_admin' AND brt_admin_rechte_zuord.brt_admin_rolle = 'a_deckbl'");
$row = $result->fetch_array();
if ($row[0] != 1){ echo "Sie haben keine Rechte die Seite zu öffnen"; exit;}
// Rechte&uuml;berpr&uuml;fung ende
$db = dbconnect();
$query = "SELECT a.uid, b.vorname, b.nachname, b.stg, a.eb_doz_nr, a.zb_nachname, a.zb_vorname
FROM brt_thema a, stud b
WHERE a.uid = b.uid
AND b.jahrgang ='$jahrgang'
AND b.durchgefallen != \"Y\"
AND b.hs='L'
ORDER BY b.nachname ASC";
$result = $db->query ($query)
or die ("Cannot execute query");
while ($row = $result->fetch_array()){
$pdf->addPage();
$pdf->useTemplate($tplidx,0,0,0);
#$pos=$pdf->GetY()+3;
$pdf->SetFont('Arial', '', 12);
$pdf->SetY(75);
$pdf->SetX(63.4);
$pdf->MultiCell(0, 4.5, "$row[nachname], $row[vorname]", 0, 'J');
if($row['stg'] == 'I'){
$pdf->SetFont('Arial', '', 10);
$pdf->SetY(89.9);
$pdf->SetX(112.6);
$pdf->MultiCell(0, 4.5, "X", 0, 'J');
}
if($row['stg'] == 'R'){
$pdf->SetFont('Arial', '', 10);
$pdf->SetY(94.7);
$pdf->SetX(112.6);
$pdf->MultiCell(0, 4.5, "X", 0, 'J');
}
if($row['stg'] == 'F'){
$pdf->SetFont('Arial', '', 10);
$pdf->SetY(99.6);
$pdf->SetX(112.6);
$pdf->MultiCell(0, 4.5, "X", 0, 'J');
}
if($row['stg'] == 'S'){
$pdf->SetFont('Arial', '', 10);
$pdf->SetY(104.4);
$pdf->SetX(112.6);
$pdf->MultiCell(0, 4.5, "X", 0, 'J');
}
$result_doz = $db->query("SELECT doz_name, doz_vorname
FROM doz
WHERE doz_nr='$row[eb_doz_nr]'");
$row_doz = $result_doz->fetch_array();
#$pos=$pdf->GetY()+3;
$pdf->SetFont('Arial', '', 12);
$pdf->SetY(129);
$pdf->SetX(63.4);
$pdf->MultiCell(0, 4.5, "$row_doz[doz_name], $row_doz[doz_vorname]", 0, 'J');
#$pos=$pdf->GetY()+3;
$pdf->SetFont('Arial', '', 12);
$pdf->SetY(169.9);
$pdf->SetX(63.4);
if($row['zb_vorname'] != ''){
$trenner = ',';
}else{
$trenner = '';
}
$pdf->MultiCell(0, 4.5, "$row[zb_nachname]$trenner $row[zb_vorname]", 0, 'J');
}
$pdf->Output();
?>