1 line
		
	
	
		
			7.6 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			1 line
		
	
	
		
			7.6 KiB
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
	
	
	
| <?php
 | |
| 
 | |
| #include("kurs/datenbankanbindung.php"); // fügt die Datenbankanbindung ein: Sys:\php\includes\kurs\datenbankanbindung.php
 | |
| 
 | |
| #$uid1=$_GET["uid1"];
 | |
| 
 | |
| 
 | |
| 
 | |
| #error_reporting (E_ALL);
 | |
| 
 | |
| 
 | |
| 
 | |
| #define('FPDF_FONTPATH','../../stud/prints/font/');
 | |
| 
 | |
| #require('../../stud/prints/as_utf_class.php');
 | |
| 
 | |
| #require_once("../../stud/prints/table_def.inc");
 | |
| 
 | |
| 
 | |
| 
 | |
| #$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("briefkopf_blanko.pdf");
 | |
| 
 | |
| 
 | |
| 
 | |
| $tplidx = $pdf->ImportPage(1);
 | |
| 
 | |
| 
 | |
| 
 | |
| $pdf->SetAutoPageBreak(true, 20);
 | |
| 
 | |
| $pdf->SetTopMargin(0);
 | |
| 
 | |
| $pdf->SetRightMargin(23);
 | |
| 
 | |
| $pdf->SetAutoPageBreak(TRUE, 0);
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $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ü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, "Bearbeiterin", 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();
 | |
| 
 | |
| 
 | |
| 
 | |
| $db = dbconnect();
 | |
| 
 | |
| $res_prx = $db->query("SELECT bezeichnung, zuw_str, zuw_plz, zuw_ort
 | |
| 
 | |
|                           FROM stan_antrag
 | |
| 
 | |
|                          WHERE saaid='$saaid'");
 | |
| 
 | |
| $row_prx = $res_prx->fetch_array();
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $pdf->SetFont('Times', '', 12);
 | |
| 
 | |
| $pdf->SetY(59.5);
 | |
| 
 | |
| $pdf->SetX(23);
 | |
| 
 | |
| $pdf->Cell(0, 3, "$row_prx[bezeichnung]", 0, 0, 'L');
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $pdf->SetFont('Times', '', 12);
 | |
| 
 | |
| $pdf->SetY(64.5);
 | |
| 
 | |
| $pdf->SetX(23);
 | |
| 
 | |
| $pdf->Cell(0, 3, "$row_prx[zuw_str]", 0, 0, 'L');
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $pdf->SetFont('Times', 'B', 12);
 | |
| 
 | |
| $pdf->SetY(73.5);
 | |
| 
 | |
| $pdf->SetX(23);
 | |
| 
 | |
| $pdf->Cell(0, 3, "$row_prx[zuw_plz] $row_prx[zuw_ort]", 0, 0, 'L');
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $db = dbconnect();
 | |
| 
 | |
| $res = $db->query("SELECT nachname, vorname, stg, Jahrgang FROM stud WHERE uid='$uid1'");
 | |
| 
 | |
| $row = $res->fetch_array();
 | |
| 
 | |
| 
 | |
| 
 | |
| $pdf->SetFont('Times', 'B', 12);
 | |
| 
 | |
| $pdf->SetY(100);
 | |
| 
 | |
| $pdf->SetX(23);
 | |
| 
 | |
| $pdf->MultiCell(0, 4.5, "Praxisstellenübersicht für $row[vorname] $row[nachname]", 0, 'L');
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $result_tmp1 = $db->query("DELETE FROM stan_tmp_zuweis_adm WHERE uid='$uid1'");
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $result_tmp1 = $db->query("INSERT INTO stan_tmp_zuweis_adm
 | |
| 
 | |
|                                  SELECT t1.saaid
 | |
| 
 | |
| 				      , t1.uid
 | |
| 
 | |
| 				      , t1.beginn		
 | |
| 
 | |
| 				      , t1.ende
 | |
| 
 | |
| 				      , t1.ort
 | |
| 
 | |
| 				      , t2.bezeichnung
 | |
| 
 | |
| 				      , t1.bezeichnung art_bez
 | |
| 
 | |
| 				   FROM stan_antrag t1, stan_stellenbereiche t2
 | |
| 
 | |
| 				  WHERE t1.uid = '$uid1'
 | |
| 
 | |
|                                     AND t1.sachbereich = t2.sbid
 | |
| 
 | |
|                                     AND t1.zuweisung='Z'
 | |
| 
 | |
|                                     AND status = '0'
 | |
| 
 | |
|                           ");
 | |
| 
 | |
| 
 | |
| 
 | |
| $result = $db->query("SELECT max(saaid) max_id FROM stan_tmp_zuweis_adm WHERE uid='$uid1'");
 | |
| 
 | |
| $row4 = $result->fetch_array();
 | |
| 
 | |
| $saaid_neu = $row4[max_id] + 1; // Damit alle Einträge eine ID haben
 | |
| 
 | |
| $result = $db->query("SELECT bezeichnung 
 | |
| 
 | |
|                          FROM stan_pu_wunsch, stan_pu_standorte
 | |
| 
 | |
|                         WHERE stan_pu_wunsch.ort = stan_pu_standorte.pusoid
 | |
| 
 | |
|                           AND uid='$uid1'
 | |
| 
 | |
|                           AND prioritaet=0");
 | |
| 
 | |
| $row4 = $result->fetch_array();
 | |
| 
 | |
| $result_tmp1 = $db->query("INSERT INTO stan_tmp_zuweis_adm SELECT $saaid_neu, '$uid1', beginn, ende, '$row4[bezeichnung]', 'Praxisbegleitender Unterricht', ''  FROM stan_sperrzeit WHERE jahrgang ='$row[Jahrgang]' AND kennung = '$row[stg]'");
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
|                                 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $pos = $pdf->GetY()+10;
 | |
| 
 | |
| 
 | |
| 
 | |
| $columns = 3; //five columns
 | |
| 
 | |
| 
 | |
| 
 | |
| #$pdf->SetX(30);
 | |
| 
 | |
| $pdf->SetY($pos);
 | |
| 
 | |
| 	//we initialize the table class
 | |
| 
 | |
| 	$pdf->Table_Init($columns, true, true);
 | |
| 
 | |
| 
 | |
| 
 | |
| 	$table_subtype = $table_default_table_type;
 | |
| 
 | |
| 	$pdf->Set_Table_Type($table_subtype);
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	//TABLE HEADER SETTINGS
 | |
| 
 | |
| 	$header_subtype = $table_default_header_type;
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	for($i=0; $i<$columns; $i++) $header_type[$i] = $table_default_header_type;
 | |
| 
 | |
| 
 | |
| 
 | |
| 	$header_type[0]['WIDTH'] = 40;
 | |
| 
 | |
| 	$header_type[1]['WIDTH'] = 61;
 | |
| 
 | |
| 	$header_type[2]['WIDTH'] = 61;
 | |
| 
 | |
| 
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	$header_type[0]['TEXT'] = "Zeitraum";
 | |
| 
 | |
| 	$header_type[1]['TEXT'] = "Ausbildungsstelle";
 | |
| 
 | |
| 	$header_type[2]['TEXT'] = "Sachbereich";
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	#$header_type[1]['COLSPAN'] = "2";
 | |
| 
 | |
| 
 | |
| 
 | |
| 	//set the header type
 | |
| 
 | |
| 	$pdf->Set_Header_Type($header_type);
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	$pdf->Draw_Header();
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	//TABLE DATA SETTINGS
 | |
| 
 | |
| 	$data_subtype = $table_default_data_type;
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	$data_type = Array();//reset the array
 | |
| 
 | |
| 	for ($i=0; $i<$columns; $i++) $data_type[$i] = $data_subtype;
 | |
| 
 | |
| 
 | |
| 
 | |
| 	$pdf->Set_Data_Type($data_type);
 | |
| 
 | |
| 	
 | |
| 
 | |
| 	$fsize = 10;
 | |
| 
 | |
| 	$colspan = 1;
 | |
| 
 | |
| 	$rr = 255;
 | |
| 
 | |
| 
 | |
| 
 | |
|         $db = dbconnect();
 | |
| 
 | |
|         $query = "SELECT ma.uid, DATE_FORMAT(beginn, '%d.%m.%Y') beginn, DATE_FORMAT(ende, '%d.%m.%Y') ende, bezeichnung, sachbereich, art
 | |
| 
 | |
|                                             FROM stan_tmp_zuweis_adm ma
 | |
| 
 | |
|                                            WHERE ma.uid = '$uid1'
 | |
| 
 | |
|                                            ORDER BY ma.uid, ma.beginn";
 | |
| 
 | |
|         $result = $db->query ($query)
 | |
| 
 | |
|            or die ("Cannot execute query");
 | |
| 
 | |
|  
 | |
| 
 | |
|         while ($row = $result->fetch_array())
 | |
| 
 | |
| 	{
 | |
| 
 | |
| 		$data = Array();
 | |
| 
 | |
| 		
 | |
| 
 | |
| 		$res2 = $db->query("SELECT bezeichnung FROM stan_stellenbereiche WHERE sbid='$row[sachbereich]'");
 | |
| 
 | |
| 		$row2 = $res2->fetch_array();
 | |
| 
 | |
| 		
 | |
| 
 | |
| 		
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| /* Schriftgröße
 | |
| 
 | |
| 		$data[0]['T_SIZE'] = $fsize;
 | |
| 
 | |
| 		$data[1]['T_SIZE'] = $fsize+3;
 | |
| 
 | |
| 		$data[3]['T_SIZE'] = $fsize+4;
 | |
| 
 | |
| */
 | |
| 
 | |
| /* Schriftfarbe und Zellenhintergrund
 | |
| 
 | |
| 		$data[0]['T_COLOR'] = array(0,0,0); //Schriftfarbe
 | |
| 
 | |
| 		$data[0]['BG_COLOR'] = array($rr,$rr,$rr);
 | |
| 
 | |
| 		$data[3]['T_COLOR'] = array($rr,240,240);
 | |
| 
 | |
| 		$data[3]['BG_COLOR'] = array($rr,100,135);
 | |
| 
 | |
| */
 | |
| 
 | |
| 			$data[0]['TEXT'] = "$row[beginn] - $row[ende]";
 | |
| 
 | |
| 			$data[0]['T_ALIGN'] = "L"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY
 | |
| 
 | |
| 			$data[0]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM
 | |
| 
 | |
| 		       #$data[0]['T_TYPE'] = "BI"; // B=BOLD, I=ITALIC
 | |
| 
 | |
| 			
 | |
| 
 | |
| 			if($row[sachbereich] == 'Praxisbegleitender Unterricht'){
 | |
| 
 | |
| 			  $data[1]['TEXT'] = "PU $row[bezeichnung]";
 | |
| 
 | |
| 			}else{
 | |
| 
 | |
| 			  $data[1]['TEXT'] = "$row[art] in $row[bezeichnung]";
 | |
| 
 | |
| 			}
 | |
| 
 | |
| 			$data[1]['T_ALIGN'] = "L";
 | |
| 
 | |
| 			$data[1]['V_ALIGN'] = "M";
 | |
| 
 | |
| 			
 | |
| 
 | |
| 			$data[2]['TEXT'] = "$row[sachbereich]";
 | |
| 
 | |
| 			$data[2]['T_ALIGN'] = "L";
 | |
| 
 | |
| 			$data[2]['V_ALIGN'] = "M";
 | |
| 
 | |
| 			
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 		$pdf->Draw_Data($data);
 | |
| 
 | |
| 	}
 | |
| 
 | |
| 
 | |
| 
 | |
| 	$pdf->Draw_Table_Border();
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| $result_tmp1 = $db->query("DELETE FROM stan_tmp_zuweis_adm WHERE uid='$uid1'");
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| #require("urlaubskarte.php");
 | |
| 
 | |
| #require("anlage_zuweisungschreiben_anwaerter.php");
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| #$pdf->Output("$uid1-Anschreiben.pdf","D");
 | |
| 
 | |
| #$pdf->closeParsers();
 | |
| 
 | |
| ?>
 |