skik/admin/bescheinigung/seminarscheine_ik.php
2023-04-14 08:04:19 +02:00

129 lines
3.8 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();
## Seminarschein interkulturelle Kommunikation
#if($row2['art'] == 'SK'){
# $pagecount = $pdf->setSourceFile("blanko_ludwigsburg_sk.pdf");
#}else{
$pagecount = $pdf->setSourceFile("blanko_ludwigsburg_2023.pdf");
#}
#$pagecount = $pdf->setSourceFile("anschreiben/aenderung_praxisstelle.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', 22);
$pdf->SetY(76);
#$pdf->SetTextColor(255,0,255);
$pdf->Cell(0, 0, 'Bescheinigung für Soziale Kompetenzen', 0, 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 . ' im Modul Soziale Kompetenzen den Kurs:', 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', 'B', 12);
$bezeichnung = str_replace("", "-", $row['Bezeichnung']);
$pdf->MultiCell(160, 6, "$bezeichnung", 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->MultiCell(160, 0, 'belegt.', 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->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");
?>