2023-04-14 07:38:10 +02:00

173 lines
5.0 KiB
PHP
Executable File
Raw Permalink 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_ProsID=$_COOKIE["ck_ProsID"];
$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();
if(!isset($_GET['stud'])){
$query = "SELECT stud.nachname, stud.vorname, stud.Jahrgang, fachprojekt.Bezeichnung,fachprojekt.FPRNr, fachprojekt.ansprechpart ,fach_ergebnis.Thema, fach_ergebnis.Note
FROM stud, fach_ergebnis, fachprojekt
WHERE fach_ergebnis.uid=stud.uid
AND fach_ergebnis.id=fachprojekt.id
AND stud.Jahrgang=\"$jahrgang\"
AND stud.durchgefallen != 'Y'
AND fach_ergebnis.id = $ck_ProsID"
;
}else{
$uid = $_GET['stud'];
$query = "SELECT stud.nachname, stud.vorname, stud.Jahrgang, fachprojekt.Bezeichnung,fachprojekt.FPRNr, fachprojekt.ansprechpart ,fach_ergebnis.Thema, fach_ergebnis.Note
FROM stud, fach_ergebnis, fachprojekt
WHERE fach_ergebnis.uid=stud.uid
AND fach_ergebnis.id=fachprojekt.id
AND stud.uid=\"$uid\"
AND stud.durchgefallen != 'Y'"
;
}
$result = $db->query($query)
or die ("Cannot execute query");
define('FPDF_FONTPATH','font/');
require('prints/as_utf_class.php');
require_once("prints/table_def.inc");
$pdf= new utfFPDF();
$pagecount = $pdf->setSourceFile("blanko_ludwigsburg_2023.pdf");
#$pagecount = $pdf->setSourceFile("anschreiben/aenderung_praxisstelle.pdf");
$tplidx = $pdf->ImportPage(1);
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
}
if($row['Note'] >= "1,0" AND $row['Note'] <="1,5"){$ergebnis="sehr gut";}
if($row['Note'] >= "1,6" AND $row['Note'] <="2,5"){$ergebnis="gut";}
if($row['Note'] >= "2,6" AND $row['Note'] <="3,5"){$ergebnis="befriedigend";}
if($row['Note'] >= "3,6" AND $row['Note'] <="4,0"){$ergebnis="ausreichend";}
if($row['Note'] >= "4,1" AND $row['Note'] <="5,0"){$ergebnis="nicht ausreichend";}
#$Punkt = "Note";
// 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 über die Teilnahme am Fachprojekt', 0, 0, 'C');
$pdf->SetFont('ARIAL', 'B', 14);
$pdf->SetY(97);
$pdf->Cell(0, 0, $row['vorname'] . ' ' . $row['nachname'], 0, 0, 'C');
$pdf->SetFont('ARIAL', '', 12);
$pdf->SetY(120);
$pdf->SetX(10);
$pdf->Cell(0, 0, 'hat im Studienjahr 20' . $Jahr . '/20' . $Jahr2 . ' im Fachprojekt:', 0, 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(51);
$pdf->SetFont('ARIAL', 'B', 12);
$bezeichnung = str_replace("", "-", $row['Bezeichnung']);
$pdf->MultiCell(110, 6, $bezeichnung, 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(0, 0, 'unter der Leitung von:', 0, 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(10);
$pdf->Cell(0, 0, $row['ansprechpart'], 0, 0, 'C');
$pos = $pdf->GetY()+12;
$pdf->SetY($pos);
$pdf->SetX(10);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(0, 0, 'folgende Fachprojektarbeit gefertigt/folgendes Referat gehalten:', 0, 0, 'C');
$pos = $pdf->GetY()+9;
$pdf->SetY($pos);
$pdf->SetX(25);
$pdf->SetFont('ARIAL', 'B', 12);
$Thema = str_replace("", "-", $row['Thema']);
$pdf->MultiCell(160, 6, $Thema, 0, 'C');
/*
$pos = $pdf->GetY()+11;
$pdf->SetY($pos);
$pdf->SetX(24);
$pdf->SetFont('ARIAL', '', 12);
$pdf->Cell(0, 0, 'Die Leistung wurde bewertet mit:', 0, 0, 'L');
$pos = $pdf->GetY()+8;
$pdf->SetFont('ARIAL', 'B', 12);
$pdf->SetY($pos);
$pdf->Cell(0, 0, $ergebnis, 0, 0, 'C');
$pos = $pdf->GetY()+8;
$pdf->SetFont('ARIAL', '', 12);
$pdf->SetY($pos);
IF ($row[Note] == 'NULL') {
$Note = "--";
} ELSE {
$Note = $row[Note];
}
$pdf->Cell(0, 0, '(' . $Note . ')', 0, 0, 'C');
*/
$pos = $pdf->GetY()+32;
$pdf->SetFont('ARIAL', '', 12);
$pdf->SetY($pos);
$pdf->SetX(19);
$pdf->Cell(0, 0, 'Ludwigsburg, ' . date("d.m.Y", time()), 0, 0, 'L');
$pos = $pdf->GetY()+9;
$pdf->SetFont('ARIAL', '', 9);
$pdf->SetY($pos);
$pdf->SetX(19);
$pdf->Cell(0, 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 = "Fachprojekt_" . $row['FPRNr'] . '_' . $row['Jahrgang'] . ".pdf";
}
$pdf->SetTitle('Fachprojektscheine');
$pdf->SetAuthor('FH-Ludwigsburg');
// $pdf->SetCreator('SetCreator');
// $pdf->SetSubject('SetSubject');
$pdf->Output($PDF_Name, "D");
?>