<?php

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

$uid1=$_COOKIE["uid1"];





error_reporting (E_ALL);



define('FPDF_FONTPATH','font/');

require('as_utf_class.php');



$pdf= new utfFPDF();





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



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



$db = dbconnect();



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

$row = $res->fetch_array();





$query = "SELECT bezeichnung, bereich, str, plz, ort, sachbereich

               , ansprechpartner, DATE_FORMAT(beginn, '%d.%m.%Y') beginn

               , DATE_FORMAT(beginn, '%Y%m%d') beginnform, DATE_FORMAT(ende, '%d.%m.%Y') ende

	    FROM sta_antrag t1

	   WHERE t1.status = (

	                      SELECT MAX(t2.status)

	                        FROM sta_antrag t2

	                       WHERE t1.aendid = t2.aendid

	                     )

             AND t1.uid = '$uid1'

             AND (t1.zuweisung is NULL OR t1.zuweisung='Z')

           ORDER BY beginnform";

         

$result = $db->query ($query)

   or die ("Cannot execute query");



while ($row1 = $result->fetch_array()){



$res2 = $db->query("SELECT bezeichnung FROM sta_stellenbereiche WHERE sbid='$row1[sachbereich]'");

$row2 = $res2->fetch_array();





$pdf->addPage();

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

$pdf->SetFont('Arial', '', 11);

$pdf->SetY(60);

$pdf->SetX(24);

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





$pdf->SetFont('Arial', '', 11);

$pdf->SetY(65);

$pdf->SetX(24);

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





$pdf->SetFont('Arial', 'B', 11);

$pdf->SetY(74);

$pdf->SetX(24);

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





$pdf->SetY(135);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[bezeichnung]", 0, 'L');



$pdf->SetY(140);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[str]", 0, 'L');



$pdf->SetY(145);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[plz] $row1[ort]", 0, 'L');





$pdf->SetY(157);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[ansprechpartner]", 0, 'L');





$pdf->SetY(170);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[bereich]", 0, 'L');





$pdf->SetY(184);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row1[beginn] bis $row1[ende]", 0, 'L');





$pdf->SetY(197);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 4,"$row2[bezeichnung]", 0, 'L');





$pdf->SetY(215);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 5,"Wir stimmen der Zuweisung von $row[vorname] $row[nachname] im Rahmen der praktischen Ausbildung im gehobenen nichttechnischen Verwaltungsdienst gem. ยง 17 Abs. 1 AprOVw gD zu:", 0, 'L');

/*

$pdf->SetY(220);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 3,"im gehobenen nichttechnischen Verwaltungsdienst gem.", 0, 'L');





$pdf->SetY(225);

$pdf->SetX(24);

$pdf->SetFont('Arial', '', 11);

$pdf->MultiCell(160, 3,"ยง 17 Abs. 1 AprOVw gD zu:", 0, 'L');

*/





}





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

$pdf->closeParsers();

?>