skik/admin/seminarscheine.php
2023-02-27 10:20:09 +01:00

1 line
4.9 KiB
PHP
Executable File

<?php
$ck_SID=$_COOKIE["ck_SID"];
$user_admin=$_COOKIE["user_admin"];
$jahrgang=$_COOKIE["jahrgang"];
include("kurs/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
$db = dbconnect();
$result = $db->query("SELECT art FROM skik_kurs WHERE id=$ck_SID");
$row2 = $result->fetch_array();
define('FPDF_FONTPATH','font/');
require('prints/as_utf_class.php');
require_once("prints/table_def.inc");
$pdf= new utfFPDF();
if($row2['art'] == 'SK'){
$pagecount = $pdf->setSourceFile("blanko_ludwigsburg_sk.pdf");
}else{
$pagecount = $pdf->setSourceFile("blanko_ludwigsburg_ik.pdf");
}
#$pagecount = $pdf->setSourceFile("anschreiben/aenderung_praxisstelle.pdf");
$tplidx = $pdf->ImportPage(1);
$db = dbconnect();
$query = "SELECT stud.nachname, stud.vorname, stud.Jahrgang, skik_kurs.Bezeichnung,skik_kurs.niveau,skik_kurs.FPRNr, skik_kurs.ansprechpart , skik_kurs.art
FROM stud, skik_wunsch, skik_kurs
WHERE skik_wunsch.uid=stud.uid
AND skik_wunsch.id=skik_kurs.id
AND stud.Jahrgang=\"$jahrgang\"
AND stud.durchgefallen != 'Y'
AND skik_wunsch.id = $ck_SID
AND skik_wunsch.prioritaet=0"
;
$result = $db->query($query)
or die ("Cannot execute query");
while ($row = $result->fetch_array()){
if($row2['art'] == 'SK'){
// Definitionen
$Jahr = $row[Jahrgang];
$Jahr2 = $row[Jahrgang] + 1; //wandelt '04' in '5' umd
if ($Jahr2 < 10){
$Jahr2='0'.$Jahr2; // wenn Jahr2 unter 10 ist eine Prefix 0 anf&uuml;gen, damit es zb. 20'05' gibt
}
// Definitionen Ende
$pdf->AddPage();
$pdf->useTemplate($tplidx,0,0,0);
$pdf->SetFont('ARIAL', 'B', 20);
$pdf->SetY(88);
#$pdf->SetTextColor(255,0,255);
if($row[art] =='SK'){
$pdf->Cell(0, 0, 'Bescheinigung für Sprachkurse', 0, 0, 'C');
}
if($row[art] =='IK'){
$pdf->SetX(20);
$pdf->MultiCell(163, 4, 'Bescheinigung', 0, 'C');
$pdf->SetY(92);
$pdf->SetX(20);
$pdf->MultiCell(163, 4, 'für Interkulturelle Kommunikation', 0, 'C');
}
$pdf->SetFont('ARIAL', 'B', 16);
$pdf->SetY(114);
$pdf->Cell(0, 0, $row[vorname] . ' ' . $row[nachname], 0, 0, 'C');
$pdf->SetFont('ARIAL', '', 12);
$pdf->SetY(140);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'hat im Studienjahr 20' . $Jahr . '/20' . $Jahr2 . ' im Modul Sprachen und Interkulturalität den Sprachkurs', 0, 0, 'L');
$pos = $pdf->GetY()+21;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', 'B', 16);
$pdf->MultiCell(160, 6, '"'.$row[Bezeichnung].'" '.$row[niveau].'*', 0, 'C');
$pos = $pdf->GetY()+18;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(0, 0, 'belegt.', 0, 0, 'L');
$pos = $pdf->GetY()+34;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'Ludwigsburg, den ' . date("d.m.Y", time()), 0, 0, 'L');
$pos = $pdf->GetY()+32;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'Kursleiter/in:', 0, 0, 'L');
$pos = $pdf->GetY()+16;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->Cell(0, 0, $row[ansprechpart], 0, 0, 'L');
//$pdf->Image('fusszeile.jpg', 20, 267, 5.1, 12.7);
$PDF_Name = "SK_" . $row[FPRNr] . '_' . $row[Jahrgang] . ".pdf";
}
if($row2['art'] == 'IK'){
// Definitionen
$Jahr = $row[Jahrgang];
$Jahr2 = $row[Jahrgang] + 1; //wandelt '04' in '5' umd
if ($Jahr2 < 10){
$Jahr2='0'.$Jahr2; // wenn Jahr2 unter 10 ist eine Prefix 0 anf&uuml;gen, damit es zb. 20'05' gibt
}
// Definitionen Ende
$pdf->AddPage();
$pdf->useTemplate($tplidx,0,0,0);
$pdf->SetFont('ARIAL', 'B', 20);
$pdf->SetY(83);
#$pdf->SetTextColor(255,0,0);
$pdf->Cell(0, 0, 'Bescheinigung für Interkulturalität', 0, 0, 'C');
$pdf->SetFont('ARIAL', 'B', 16);
$pdf->SetY(105);
$pdf->Cell(0, 0, $row[vorname] . ' ' . $row[nachname], 0, 0, 'C');
$pdf->SetFont('ARIAL', '', 12);
$pdf->SetY(125);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'hat im Studienjahr 20' . $Jahr . '/20' . $Jahr2 . ' im Modul 15 das Fach Interkulturalität belegt.', 0, 0, 'L');
$pdf->SetY(230);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'Ludwigsburg, den ' . date("d.m.Y", time()), 0, 0, 'L');
$pos = $pdf->GetY()+25;
$pdf->SetY($pos);
$pdf->SetX(29);
$pdf->Cell(0, 0, 'Seminarleiter/in:', 0, 0, 'L');
$pos = $pdf->GetY()+16;
$pdf->SetY($pos);
$pdf->SetX(29);
$pdf->Cell(0, 0, $row[ansprechpart], 0, 0, 'L');
//$pdf->Image('fusszeile.jpg', 20, 267, 5.1, 12.7);
$PDF_Name = "SK_" . $row[FPRNr] . '_' . $row[Jahrgang] . ".pdf";
}
}
$pdf->SetAuthor('HS-Ludwigsburg');
$pdf->Output($PDF_Name, "D");
?>