fachprojekt/admin/fachprojektscheine/Kopie von seminarscheine.php
2023-02-27 12:57:51 +01:00

1 line
4.1 KiB
PHP
Executable File

<?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();
$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"
;
$result = $db->query($query)
or die ("Cannot execute query");
define('FPDF_FONTPATH','font/');
require('as_utf_class.php');
$pdf=new utfFPDF();
while ($row = $result->fetch_array()){
// Definitionen
$Jahr = $row[Jahrgang];
$Jahr2 = $row[Jahrgang] + 1; //wandelt '04' in '5' umd
if ($Jahr < 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->Image('fachprojektschein.jpg', 1,1,208,295);
$pdf->SetLineWidth(0.3);
// Linie oben rechts
$pdf->Line(140, 10.5, 191, 10.5);
$pdf->SetFont('Arial', 'B', 10);
$pdf->SetY(15);
$pdf->SetX(139);
$pdf->Cell(0, 3, 'Fachhochschule Ludwigsburg', 0, 0, 'L');
$pdf->Line(140, 21.5, 191, 21.5);
$pdf->SetY(26);
$pdf->SetX(139);
$pdf->Cell(0, 3, 'Hochschule für öffentliche', 0, 0, 'L');
$pdf->SetY(30);
$pdf->SetX(139);
$pdf->Cell(0, 3, 'Verwaltung und Finanzen', 0, 0, 'L');
$pdf->Line(140, 37, 191, 37);
// Rahmen erstellen
// $pdf->SetY(60);
// $pdf->SetX(20);
// $pdf->Cell(170,202,'',1,0,'L');
// $pdf->Image('rechteck.jpg', 20, 60, 170.773, 202.353);
$pdf->SetFont('TIMES', 'B', 26);
$pdf->SetY(81);
$pdf->Cell(0, 0, 'Fachprojektbescheinigung', 0, 0, 'C');
$pdf->SetFont('TIMES', 'B', 16);
$pdf->SetY(105);
$pdf->Cell(0, 0, $row[vorname] . ' ' . $row[nachname], 0, 0, 'C');
$pdf->SetFont('TIMES', '', 12);
$pdf->SetY(125);
$pdf->SetX(26);
$pdf->Cell(0, 0, 'hat im Studienjahr 20' . $Jahr . '/20' . $Jahr2 . ' im Fachprojekt:', 0, 0, 'L');
$pdf->SetY(138);
$pdf->SetX(26);
$pdf->SetFont('TIMES', 'B', 16);
$pdf->MultiCell(160, 6, '"'.$row[Bezeichnung].'"', 0, 'C');
$pdf->SetY(163);
$pdf->SetX(26);
$pdf->SetFont('TIMES', '', 12);
$pdf->Cell(0, 0, 'folgende Seminararbeit gefertigt:', 0, 0, 'L');
$pdf->SetY(171);
$pdf->SetX(26);
$pdf->SetFont('TIMES', 'B', 16);
$pdf->MultiCell(160, 6, '"'.$row[Thema].'"', 0, 'C');
$pdf->SetY(194);
$pdf->SetX(26);
$pdf->SetFont('TIMES', '', 12);
$pdf->Cell(0, 0, 'Die Leistung im Fachprojekt wurde bewertet mit', 0, 0, 'L');
$pdf->SetFont('TIMES', 'B', 12);
$pdf->SetY(208);
$pdf->Cell(0, 0, $ergebnis, 0, 0, 'C');
$pdf->SetFont('TIMES', '', 12);
$pdf->SetY(214);
IF ($row[Note] == 'NULL') {
$Note = "--";
} ELSE {
$Note = $row[Note];
}
$pdf->Cell(0, 0, '(' . $Note . ' ' . $Punkt . ')', 0, 0, 'C');
$pdf->SetY(234);
$pdf->SetX(26);
$pdf->Cell(0, 0, 'Ludwigsburg, den ' . date("d.m.Y", time()), 0, 0, 'L');
$pdf->SetY(254);
$pdf->SetX(38);
$pdf->Cell(0, 0, $row[ansprechpart], 0, 0, 'L');
//$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");
?>