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, geschlecht, postrasse, poplz, poort, ag, jahrgang FROM stud WHERE uid='$uid1'"); $row_stud = $res_stud->fetch_array(); if($row_stud['geschlecht'] == 'M'){ $anredeform = "geehrter"; $anrede = "Herr"; }else{ $anredeform = "geehrte"; $anrede = "Frau"; } $res_zuw_alt = $db->query("SELECT date_format(zuweis_dat, '%d.%m.%Y') zuweis_dat FROM stan_antrag WHERE saaid='$saaid_alt'"); $row_zuw_alt = $res_zuw_alt->fetch_array(); $res_zuw_neu = $db->query("SELECT date_format(zuweis_dat, '%d.%m.%Y') zuweis_dat, date_format(aend_dat, '%d.%m.%Y') aend_dat FROM stan_antrag WHERE saaid='$saaid'"); $row_zuw_neu = $res_zuw_neu->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='EZS' AND admin='$user_admin'"); $row_dat = $res_dat->fetch_array(); $heute_format = $row_dat['datum']; } if(isset($hist2)){ # hist2 ist der Papieraktendruck. Dabei kann beliebig oft die Anschreiben ausgedruckt werden. Das Datum soll allerdings das Ursprungsdatum sein. Das geht nicht über die HistorieTabelle $res_dat = $db->query("SELECT min(date_format(datum, '%d.%m.%Y')) datum FROM stan_printqueue_antrag WHERE zuweisung='EZS' AND saaid in (SELECT saaid FROM stan_antrag WHERE uid='$uid1')"); $row_dat = $res_dat->fetch_array(); $heute_format = $row_dat['datum']; } #$pdf->Image('anschreiben_kehl/logo.png', 124, 10,71); #https://www.fpdf.de/funktionsreferenz/?funktion=Image $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(64); $pdf->SetX(24); $pdf->Cell(0, 3, "$row_stud[vorname] $row_stud[nachname]", 0, 0, 'L'); $pos = $pdf->GetY()+4; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(24); $pdf->Cell(0, 3, "$row_stud[postrasse]", 0, 0, 'L'); $pos = $pdf->GetY()+4; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(24); $pdf->Cell(0, 3, "$row_stud[poplz] $row_stud[poort]", 0, 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetY(62.3); $pdf->SetX(137); $pdf->MultiCell(47, 3, "Kontakt:", 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetY(62.3); $pdf->SetX(155.3); $pdf->SetTextColor(20,93,156); $pdf->MultiCell(47, 3, "Corinne Feger", 0, 'L'); $pos=$pdf->GetY()+0.9; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(137); $pdf->SetTextColor(0,0,0); $pdf->MultiCell(47, 3, "Telefon:", 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(155.3); $pdf->MultiCell(47, 3, "+49 (0) 7851 894-126", 0, 'L'); $pos=$pdf->GetY()+0.9; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(137); $pdf->MultiCell(47, 3, "E-Mail:", 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(155.3); $pdf->MultiCell(47, 3, "feger@hs-kehl.de", 0, 'L'); #$pos=$pdf->GetY()+4.1; #$pdf->SetFont('Arial', '', 10); #$pdf->SetY($pos); #$pdf->SetX(137); #$pdf->MultiCell(47, 3, "Ihr Zeichen:", 0, 'L'); # #$pdf->SetFont('Arial', '', 10); #$pdf->SetY($pos); #$pdf->SetX(155.3); #$pdf->MultiCell(47, 3, "", 0, 'L'); #$pos=$pdf->GetY()+0.6; # #$pdf->SetFont('Arial', '', 10); #$pdf->SetY($pos); #$pdf->SetX(137); #$pdf->MultiCell(47, 3, "Unser Zeichen:", 0, 'L'); # #$pdf->SetFont('Arial', '', 10); #$pdf->SetY($pos); #$pdf->SetX(155.3); #$pdf->MultiCell(47, 3, "", 0, 'L'); $pos=$pdf->GetY()+0.9; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(137); $pdf->MultiCell(47, 3, "Datum:", 0, 'L'); $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(155.3); $pdf->MultiCell(47, 3, "$heute_format", 0, 'L'); # Händischer Eintrag: Anruf Fr. Grampp. Da Kehl am 30.03.2015 vordatieren wollte #$pdf->MultiCell(47, 3, "15.04.2015", 0, 'L'); ########Kontaktdaten HS Ende ##################### ######## Betreff ################################# $pdf->SetFont('Arial', 'B', 10); $pdf->SetY(103.5); $pdf->SetX(23); $pdf->MultiCell(150, 3, "Änderung der Zuweisung für die praktische Ausbildung", 0, 'L'); ######## Betreff Ende ############################ $pos=$pdf->GetY()+10.0; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(150, 3, "Sehr $anredeform $anrede $row_stud[vorname] $row_stud[nachname],", 0, 'L'); $pos=$pdf->GetY()+7.1; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "aufgrund Ihres Änderungsantrages vom $row_zuw_neu[aend_dat] wird hiermit der Bescheid über die Zuweisung zu den Ausbildungsstellen in der praktischen Ausbildung der Hochschule Kehl vom $row_zuw_alt[zuweis_dat] wie folgt geändert:", 0, 'J'); $pos=$pdf->GetY()+3.2; $pdf->SetFont('Arial', 'U', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 7.4, "Bisherige Zuweisung:", 0, 'J'); #$jahrgang='08'; #$standort='1'; #$_POST[termin] = '1'; $db = dbconnect(); $columns = 4; //five columns $pos=$pdf->GetY()+1.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'] = "Abteilung"; $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'] = "Vertiefungsbereich"; # $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 a.saaid, b.aendid FROM stan_printqueue_antrag a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND druckstatus = 'N' AND b.uid='$uid1' ORDER BY b.beginn "; }else{ $query = "SELECT a.saaid, b.aendid FROM stan_printqueue_hist a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND druckstatus = 'N' AND b.uid='$uid1' ORDER BY b.beginn "; } if(isset($hist2)){ $query = "SELECT a.saaid, b.aendid FROM stan_printqueue_antrag a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND b.uid='$uid1' ORDER BY b.beginn "; } $result = $db->query ($query) or die ("Cannot execute query1e"); $hinweis_umzug_alt=0; while ($row = $result->fetch_array()) { $data = Array(); $res_alt_aend = $db->query("SELECT date_format(beginn, '%d.%m.%Y') beginn, date_format(ende, '%d.%m.%Y') ende, dst_id, abteilung, e.bezeichnung, umzugsverg FROM stan_antrag a, stan_vertiefungsbereich e WHERE a.vert_bereich=e.vbid AND a.saaid<'$row[saaid]' AND a.aendid='$row[aendid]' ORDER BY a.saaid DESC LIMIT 1"); $row_alt_aend = $res_alt_aend->fetch_array(); $result_data2 = $db->query("SELECT distinct 1 FROM stan_dienststellen WHERE dst_id= '$row_alt_aend[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_alt_aend[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_alt_aend[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_alt_aend[beginn] -\n$row_alt_aend[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_alt_aend['umzugsverg'] == 'J'){ $data[1]['TEXT'] = "$rowdata3[bez]*"; $hinweis_umzug_alt=1; }else{ $data[1]['TEXT'] = "$rowdata3[bez]"; } $data[1]['T_ALIGN'] = "L"; $data[1]['V_ALIGN'] = "M"; $data[2]['TEXT'] = "$row_alt_aend[abteilung]"; $data[2]['T_ALIGN'] = "L"; $data[2]['V_ALIGN'] = "M"; $data[3]['TEXT'] = "$row_alt_aend[bezeichnung]"; $data[3]['T_ALIGN'] = "L"; $data[3]['V_ALIGN'] = "M"; $data[4]['TEXT'] = "$row_alt_aend[standort]"; $data[4]['T_ALIGN'] = "L"; $data[4]['V_ALIGN'] = "M"; $pdf->Draw_Data($data,NULL,6); // -->letzter Parameter Höhe der Datenspalte. Neu prgrammiert in prints/class.fpdf_table.php am 15.04.2009 # eingefügt am 20.01.2021: Problem ist, dass in pdf_gen_mail diese Funktion aufgerufen wird. Wenn nur ein Änderungsantrag vorliegt werden dann alle bisherigen Schreiben # mit aktuellem Drukdatum versehen. Es bestand die Sorge, dass alle DST nochmals eine Mail bekommen haben. $result_druckstat = $db->query("SELECT druckstatus FROM stan_printqueue_antrag WHERE saaid='$row[saaid]'"); $row_druckstat = $result_druckstat->fetch_array(); if($row_druckstat['druckstatus'] != 'G'){ $saaid_prnt .= "$row[saaid],"; } } $pdf->Draw_Table_Border(); ## Für eine spätere history die gedruckten Saaids sammeln für das Dokument if(!isset($hist) or !isset($hist2)){ $res_dat = $db->query("UPDATE stan_printqueue_antrag SET printed_obj='$saaid_prnt' WHERE zuweisung='AES' AND saaid IN (SELECT a.saaid FROM stan_antrag a WHERE uid='$uid1')"); $saaid_prnt = ''; } $pos=$pdf->GetY()+3.2; $pdf->SetFont('Arial', 'U', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 7.4, "Geänderte Zuweisung", 0, 'J'); $db = dbconnect(); $columns = 4; //five columns $pos=$pdf->GetY()+1.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'] = "Abteilung"; $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'] = "Vertiefungsbereich"; # $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 a.saaid FROM stan_printqueue_antrag a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND druckstatus = 'N' AND b.uid='$uid1' ORDER BY b.beginn "; }else{ $query = "SELECT a.saaid FROM stan_printqueue_hist a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND druckstatus = 'N' AND b.uid='$uid1' ORDER BY b.beginn "; } if(isset($hist2)){ $query = "SELECT a.saaid FROM stan_printqueue_antrag a, stan_antrag b WHERE a.saaid = b.saaid AND a.zuweisung='AES' AND b.uid='$uid1' ORDER BY b.beginn "; } $result = $db->query ($query) or die ("Cannot execute query1f"); $hinweis_umzug_neu=0; while ($row = $result->fetch_array()) { $data = Array(); $res_neu_aend = $db->query("SELECT date_format(beginn, '%d.%m.%Y') beginn, date_format(ende, '%d.%m.%Y') ende, dst_id, abteilung, e.bezeichnung, umzugsverg FROM stan_antrag a, stan_vertiefungsbereich e WHERE a.vert_bereich=e.vbid AND a.saaid ='$row[saaid]' ORDER BY a.saaid DESC LIMIT 1"); $row_neu_aend = $res_neu_aend->fetch_array(); $result_data2 = $db->query("SELECT distinct 1 FROM stan_dienststellen WHERE dst_id= '$row_neu_aend[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_neu_aend[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_neu_aend[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_neu_aend[beginn] -\n$row_neu_aend[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_neu_aend['umzugsverg'] == 'J'){ $data[1]['TEXT'] = "$rowdata3[bez]*"; $hinweis_umzug_neu=1; }else{ $data[1]['TEXT'] = "$rowdata3[bez]"; } $data[1]['T_ALIGN'] = "L"; $data[1]['V_ALIGN'] = "M"; $data[2]['TEXT'] = "$row_neu_aend[abteilung]"; $data[2]['T_ALIGN'] = "L"; $data[2]['V_ALIGN'] = "M"; $data[3]['TEXT'] = "$row_neu_aend[bezeichnung]"; $data[3]['T_ALIGN'] = "L"; $data[3]['V_ALIGN'] = "M"; $data[4]['TEXT'] = "$row_neu_aend[standort]"; $data[4]['T_ALIGN'] = "L"; $data[4]['V_ALIGN'] = "M"; $pdf->Draw_Data($data,NULL,6); // -->letzter Parameter Höhe der Datenspalte. Neu prgrammiert in prints/class.fpdf_table.php am 15.04.2009 } $pdf->Draw_Table_Border(); if($hinweis_umzug_alt == 1 or $hinweis_umzug_neu == 1){ $pos=$pdf->GetY()+4.4; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "* Für diesen Praxisabschnitt wird eine Umzugsvergütung gewährt.", 0, 'J'); } $pos=$pdf->GetY()+6.4; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "Die übrigen Bestimmungen des Bescheids vom $row_zuw_alt[zuweis_dat] gelten weiterhin.", 0, 'J'); $pos=$pdf->GetY()+5.0; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "Freundliche Grüße", 0, 'J'); $pos=$pdf->GetY()+14.8; $pdf->SetFont('Arial', '', 10); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "gez. Corinne Feger\nStellv. Leitung Servicezentrum Studium & Lehre", 0, 'J'); $pos=$pdf->GetY()+5.0; $pdf->SetFont('Arial', '', 8); $pdf->SetY($pos); $pdf->SetX(23); $pdf->MultiCell(170, 4.8, "Hinweis: Aus technischen Gründen erhalten Sie auch bei geringfügigen Änderungen ein neues Zuweisungsschreiben.", 0, 'J'); ?>