skik/admin/bescheinigung/seminarscheine_sk.php
2023-04-14 10:24:52 +02:00

126 lines
3.7 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?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
#define('FPDF_FONTPATH','font/');
require('../../prints3/as_utf_class.php');
require_once("../../prints3/table_def.inc");
$pdf= new utfFPDF();
$pagecount = $pdf->setSourceFile("blanko_ludwigsburg_2023.pdf");
$tplidx = $pdf->ImportPage(1);
$db = dbconnect();
if(!isset($_GET['stud'])){
$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"
;
}else{
$uid = $_GET['stud'];
$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.uid=\"$uid\"
AND stud.durchgefallen != 'Y'
AND skik_wunsch.prioritaet=0"
;
}
$result = $db->query($query)
or die ("Cannot execute query");
while ($row = $result->fetch_array()){
// 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(76);
$pdf->SetX(0);
#$pdf->SetTextColor(255,0,255);
$pdf->MultiCell(210, 6, 'Bescheinigung über die Teilnahme am Modul Sprach-', 0, 'C');
$pos = $pdf->GetY()+3;
$pdf->SetY($pos);
$pdf->SetX(0);
$pdf->MultiCell(210, 6, 'kurse / Interkulturelle Kompetenzen', 0, 'C');
$pos = $pdf->GetY()+20;
$pdf->SetY($pos);
$pdf->SetFont('ARIAL', 'B', 12);
$pdf->Cell(0, 0, $row['vorname'] . ' ' . $row['nachname'], 0, 0, 'C');
$pos = $pdf->GetY()+20;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 12);
$pdf->MultiCell(160, 6, 'hat im Studienjahr 20' . $Jahr . '/20' . $Jahr2 . ' am Modul IKK/Sprachen:', 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', 'B', 12);
$bezeichnung = str_replace("", "-", $row['Bezeichnung']);
$niveau = str_replace("", "-", $row['niveau']);
$pdf->MultiCell(160, 6, '"'.$bezeichnung.'" '.$niveau.'*', 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(160, 0, 'unter der Leitung von: '.$row['ansprechpart'], 0, 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(160, 0, 'teilgenommen.', 0, 0, 'C');
$pos = $pdf->GetY()+20;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->Cell(0, 0, 'Ludwigsburg, ' . date("d.m.Y", time()), 0, 0, 'L');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 9);
$pdf->Cell(160, 0, 'Diese Bescheinigung wurde maschinell erstellt und ist ohne Unterschrift gültig!', 0, 0, 'R');
$PDF_Name = "SK_" . $row['FPRNr'] . '_' . $row['Jahrgang'] . ".pdf";
}
$pdf->SetAuthor('HS-Ludwigsburg');
$pdf->Output($PDF_Name, "D");
?>