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(); $res_stud = $db->query("SELECT nachname, vorname, postrasse, poplz, poort, ag, jahrgang FROM stud WHERE uid='$uid1'"); $row_stud = $res_stud->fetch_array(); if(!isset($hist)){ $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 }else{ $res_dat = $db->query("SELECT min(date_format(datum, '%d.%m.%Y')) datum FROM stan_printqueue_hist WHERE zuweisung='SOZ' AND admin='$user_admin'"); $row_dat = $res_dat->fetch_array(); $heute_format = $row_dat[datum]; } $pdf->Image('anschreiben/logo.png', 116, 10,64); #https://www.fpdf.de/funktionsreferenz/?funktion=Image $pdf->SetFont('Arial', '', 12); $pdf->SetY(59.5); $pdf->SetX(13); #$pdf->SetTextColor(255,0,255); $pdf->Cell(0, 3, "$row_stud[vorname] $row_stud[nachname]", 0, 0, 'L'); $pos = $pdf->GetY()+4; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->Cell(0, 3, "$row_stud[ag] / $row_stud[jahrgang]", 0, 0, 'L'); $pos = $pdf->GetY()+4; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->Cell(0, 3, "$row_stud[postrasse]", 0, 0, 'L'); $pos = $pdf->GetY()+4; $pdf->SetFont('Arial', 'B', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->Cell(0, 3, "$row_stud[poplz] $row_stud[poort]", 0, 0, 'L'); $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(56); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "Zulassung", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pos=$pdf->GetY()+3.7; $pdf->SetY($pos); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "Ludwigsburg,", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(143.1); $pdf->MultiCell(47, 3, "$heute_format", 0, 'R'); $pos=$pdf->GetY()+0.3; $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "Bearbeiter/in", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(143.1); $pdf->MultiCell(47, 3, "$row_ansp[name]", 0, 'R'); $pos=$pdf->GetY()+0.3; $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "Telefon", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(143.1); $pdf->MultiCell(47, 3, "$row_kontakt[tel]", 0, 'R'); $pos=$pdf->GetY()+0.3; $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "Fax", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(143.1); $pdf->MultiCell(47, 3, "$row_kontakt[fax]", 0, 'R'); $pos=$pdf->GetY()+0.3; $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(117.9); $pdf->MultiCell(47, 3, "e-mail", 0, 'L'); $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(143.1); $pdf->MultiCell(47, 3, "$row_ansp[mail]", 0, 'R'); $pdf->SetFont('Arial', '', 8); $pdf->SetY(45); $pdf->SetX(13); $pdf->MultiCell(80, 3, "HS Ludwigsburg ".uchr(149)." Postfach 0489 ".uchr(149)." 71604 Ludwigsburg", 0, 'L'); ########Kontaktdaten HS Ende ##################### ######## Betreff ################################# $pdf->SetFont('Arial', 'B', 12); $pdf->SetY(96.2); $pdf->SetX(13); $pdf->MultiCell(150, 3, "Zuweisung zu den praxisbegleitenden Arbeitsgemeinschaften;", 0, 'L'); ######## Betreff Ende ############################ $pos=$pdf->GetY()+6.6; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(150, 3, "Sehr geehrte(r) $row_cur_uid[vorname] $row_cur_uid[nachname],", 0, 'L'); $pos=$pdf->GetY()+6.0; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "wir weisen Sie zu den praxisbegleitenden Arbeitsgemeinschaften an folgenden Standorten zu:", 0, 'J'); $db = dbconnect(); $columns = 4; //five columns $pos=$pdf->GetY()+5.0; $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'] = 29.4; $header_type[0]['T_ALIGN'] = "L"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY $header_type[0]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM $header_type[0]['TEXT'] = "Zeitraum"; $header_type[1]['WIDTH'] = 59.9; $header_type[1]['T_ALIGN'] = "L"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY $header_type[1]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM $header_type[1]['TEXT'] = "Ausbildungsstelle"; $header_type[2]['WIDTH'] = 35; $header_type[2]['T_ALIGN'] = "C"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY $header_type[2]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM $header_type[2]['TEXT'] = "Vertiefungsbereich"; $header_type[3]['WIDTH'] = 44; $header_type[3]['T_ALIGN'] = "L"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY $header_type[3]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM $header_type[3]['TEXT'] = "AG-Standort"; # $header_type[4]['WIDTH'] = 25.7; # $header_type[4]['T_ALIGN'] = "C"; //C=CENTER, L=LEFT, R=RIGHT, J=JUSTIFY # $header_type[4]['V_ALIGN'] = "M"; //T=TOP, M=MIDDLE, B=BOTTOM # $header_type[4]['TEXT'] = "AG-Standort"; #$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(); if(!isset($hist)){ $query = "SELECT date_format(beginn, '%d.%m.%Y') beginn, date_format(beginn, '%Y%m%d') beginnform, date_format(ende, '%d.%m.%Y') ende, bezeichnung vertiefungsbereich, standort, dst_id, wagsid, uid, saaid FROM stan_zuw_so WHERE uid='$uid1' ORDER BY beginnform ASC"; }else{ $query = "SELECT distinct a.saaid, b.dst_id, date_format(beginn, '%d.%m.%Y') beginn, date_format(beginn, '%Y%m%d') beginnform, date_format(ende, '%d.%m.%Y') ende, bezeichnung vertiefungsbereich, standort FROM stan_printqueue_hist a, stan_antrag b, stan_ag_standort c, stan_standort d, stan_vertiefungsbereich e WHERE a.saaid=b.saaid AND a.printed_obj=c.agsid AND c.sid = d.sid AND c.vbid=e.vbid AND b.uid='$uid1' ORDER BY beginnform ASC"; } $result = $db->query ($query) or die ("Cannot execute query1"); while ($row = $result->fetch_array()) { ## Eintrag für die Printqueue if(!isset($hist)){ $datum = date("Y-m-d H:i:s",time()); $sql_queue = $db->query("INSERT INTO stan_printqueue_antrag (saaid, zuweisung, datum, klartext, printed_obj, admin, hs_admin, druckstatus, sort_order) VALUES ('$row[saaid]', 'SOZ', '$datum', 'Standortzuweisung', '$row[wagsid]', '$user_admin', '$hs', 'G', '1')"); } $data = Array(); $result_data2 = $db->query("SELECT distinct 1 FROM stan_dienststellen WHERE dst_id= '$row[dst_id]'"); $rowdata2 = $result_data2->fetch_array(); if($rowdata2[0] == '1'){ $result_data3 = $db->query("SELECT bez , str , plz , postfach , plz_postfach , ort , bundesland , staat FROM stan_dienststellen WHERE dst_id='$row[dst_id]'"); $rowdata3 = $result_data3->fetch_array(); }else{ $result_data3 = $db->query("SELECT bez , str , plz , postfach , plz_postfach , ort , bundesland , staat FROM stan_dienststellen_tmp WHERE dst_id='$row[dst_id]'"); $rowdata3 = $result_data3->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] -\n$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 $data[1]['TEXT'] = "$rowdata3[bez]"; $data[1]['T_ALIGN'] = "L"; $data[1]['V_ALIGN'] = "M"; $data[2]['TEXT'] = "$row[vertiefungsbereich]"; $data[2]['T_ALIGN'] = "L"; $data[2]['V_ALIGN'] = "M"; $data[3]['TEXT'] = "$row[standort]"; $data[3]['T_ALIGN'] = "L"; $data[3]['V_ALIGN'] = "M"; # $data[4]['TEXT'] = "$row[standort]"; # $data[4]['T_ALIGN'] = "L"; # $data[4]['V_ALIGN'] = "M"; $pdf->Draw_Data($data,NULL,5); // -->letzter Parameter Höhe der Datenspalte. Neu prgrammiert in prints/class.fpdf_table.php am 15.04.2009 $saaid_prnt .= "$row[saaid],"; } $pdf->Draw_Table_Border(); $pos=$pdf->GetY()+5.0; $pdf->SetFont('Arial', 'B', 12); $pdf->SetY($pos); $pdf->SetX(13); #$pdf->SetTextColor(255,0,255); $pdf->MultiCell(188, 4.8, "Die Teilnahme an den in diesem Zeitraum angebotenen Terminen ist verpflichtend.", 0, 'J'); $pos=$pdf->GetY()+4.0; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "Eine Übersicht Ihrer Termine und aktuelle Informationen, wie z.B. Raum- oder Terminänderungen, können Sie über das Praxisstellensystem (Schritt 3 / AG-Übersicht) einsehen. Wir empfehlen Ihnen deshalb dringend, die Einsichtnahme regelmäßig vor einem anstehenden AG-Termin vorzunehmen.", 0, 'J'); $pos=$pdf->GetY()+4.0; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "Sollten Sie an der Teilnahme einzelner Terminen durch Urlaub, Krankheit oder in sonstigen begründeten Ausnahmefällen gehindert sein, informieren Sie bitte sowohl Ihre Ausbildungsstelle, als auch die zuständige AG-Leitung.", 0, 'J'); $pos=$pdf->GetY()+4.0; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "Weiterhin empfehlen wir Ihnen eine Weiterleitungsfunktion Ihres Hochschul- Emailaccounts einzurichten, da wichtige Informationen der AG-Leitung und evtl. der Hochschule dorthin versandt werden.\nBei Vorliegen aller Voraussetzungen erhalten Sie für die Reisen zum AG-Standort Reisekosten nach den Vorschriften des Landesreisekostengesetzes.", 0, 'J'); $pos=$pdf->GetY()+4.0; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "Mit freundlichen Grüßen", 0, 'J'); $pos=$pdf->GetY()+9.8; $pdf->SetFont('Arial', '', 12); $pdf->SetY($pos); $pdf->SetX(13); $pdf->MultiCell(188, 4.8, "$row_ansp[name]", 0, 'J'); #require("urlaubskarte.php"); /* $pagecount = $pdf->setSourceFile("anschreiben/anlage_zuweisung.pdf"); $tplidx1 = $pdf->ImportPage(1); $pdf->addPage(); $pdf->useTemplate($tplidx1,0,0,0); $tplidx1 = $pdf->ImportPage(2); $pdf->addPage(); $pdf->useTemplate($tplidx1,0,0,0); $tplidx1 = $pdf->ImportPage(3); $pdf->addPage(); $pdf->useTemplate($tplidx1,0,0,0); */ ?>