<?php

#include("kurs/datenbankanbindung.php"); // f&uuml;gt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php

//$mtknr = $_GET[mtknr];





//error_reporting (E_ALL);



#define('FPDF_FONTPATH','../../stud/prints/font/');

#require('../../stud/prints/fpdi.php');



#$pdf= new utfFPDF();

$db = dbconnect();

$res_ansp = $db->query("SELECT wert1 name, wert2 mail FROM parameter WHERE pid='6'");

$row_ansp = $res_ansp->fetch_array();



$res_kontakt = $db->query("SELECT wert1 tel, wert2 fax FROM parameter WHERE pid='5'");

$row_kontakt = $res_kontakt->fetch_array();



$pagecount = $pdf->setSourceFile("anlage_zuweisungschreiben_anwaerter.pdf");

$tplidx = $pdf->ImportPage(1);

$pdf->addPage();

$pdf->useTemplate($tplidx,0,0,0);



$heute_format = date("d.m.Y", mktime(0, 0, 0, date("m"), date("d"), date("Y")));  // ISO-8601 Format wie in der Datenbank: Formatierung f&uuml;r Vergleiche erforderlich



$pdf->SetFont('Times', '', 10);

$pdf->SetY(56.7);

$pdf->SetX(117.9);

$pdf->MultiCell(47, 3, "Ludwigsburg,", 0, 'L');



$pdf->SetFont('Times', '', 10);

$pdf->SetY(56.7);

$pdf->SetX(136.1);

$pdf->MultiCell(47, 3, "$heute_format", 0, 'R');





$pdf->SetFont('Times', '', 10);

$pdf->SetY(60.9);

$pdf->SetX(117.9);

$pdf->MultiCell(47, 3, "Bearbeiter/in", 0, 'L');



$pdf->SetFont('Times', '', 10);

$pdf->SetY(60.9);

$pdf->SetX(136.1);

$pdf->MultiCell(47, 3, "$row_ansp[name]", 0, 'R');





$pdf->SetFont('Times', '', 10);

$pdf->SetY(65.1);

$pdf->SetX(117.9);

$pdf->MultiCell(47, 3, "Telefon", 0, 'L');



$pdf->SetFont('Times', '', 10);

$pdf->SetY(65.1);

$pdf->SetX(136.1);

$pdf->MultiCell(47, 3, "$row_kontakt[tel]", 0, 'R');





$pdf->SetFont('Times', '', 10);

$pdf->SetY(69.3);

$pdf->SetX(117.9);

$pdf->MultiCell(47, 3, "Fax", 0, 'L');



$pdf->SetFont('Times', '', 10);

$pdf->SetY(69.3);

$pdf->SetX(136.1);

$pdf->MultiCell(47, 3, "$row_kontakt[fax]", 0, 'R');





$pdf->SetFont('Times', '', 10);

$pdf->SetY(73.5);

$pdf->SetX(117.9);

$pdf->MultiCell(47, 3, "e-mail", 0, 'L');



$pdf->SetFont('Times', '', 10);

$pdf->SetY(73.5);

$pdf->SetX(136.1);

$pdf->MultiCell(47, 3, "$row_ansp[mail]", 0, 'R');





$db = dbconnect();



$res = $db->query("SELECT mtknr, nachname, vorname, postrasse, poort, poplz, Jahrgang, stg FROM stud WHERE uid='$uid1'");

$row = $res->fetch_array();







$pdf->SetFont('Times', '', 12);

$pdf->SetY(59.5);

$pdf->SetX(23);

$pdf->Cell(0, 3, "$row[vorname] $row[nachname]", 0, 0, 'L');





$pdf->SetFont('Times', '', 12);

$pdf->SetY(64.5);

$pdf->SetX(23);

$pdf->Cell(0, 3, "$row[postrasse]", 0, 0, 'L');





$pdf->SetFont('Times', 'B', 12);

$pdf->SetY(73.5);

$pdf->SetX(23);

$pdf->Cell(0, 3, "$row[poplz] $row[poort]", 0, 0, 'L');







$tplidx = $pdf->ImportPage(2);

$pdf->addPage();

$pdf->useTemplate($tplidx,0,0,0);





$res1 = $db->query("SELECT DATE_FORMAT(antrag_von, '%d.%m.%Y') antrag_von, DATE_FORMAT(antrag_bis, '%d.%m.%Y') antrag_bis FROM stan_frist WHERE jahrgang='$row[Jahrgang]'");

$row1 = $res1->fetch_array();





$pdf->SetFont('Times', '', 12);

$pdf->SetY(108.3);

$pdf->SetX(114);

$pdf->Cell(0, 3, "$row1[antrag_von]", 0, 0, 'L');



$pdf->SetFont('Times', '', 12);

$pdf->SetY(108.3);

$pdf->SetX(141);

$pdf->Cell(0, 3, "$row1[antrag_bis]", 0, 0, 'L');



//$pdf->Output("newpdf.pdf","i");

//$pdf->closeParsers();

?>