diff --git a/vilesci/bis/lehrgangsmeldung.php b/vilesci/bis/lehrgangsmeldung.php
index 262821df2..c192fe33d 100644
--- a/vilesci/bis/lehrgangsmeldung.php
+++ b/vilesci/bis/lehrgangsmeldung.php
@@ -185,6 +185,7 @@ if($result = $db->db_query($qry))
$gemeinde=$rowadr->gemeinde;
$strasse=$rowadr->strasse;
$nation=$rowadr->nation;
+ $co_name = $rowadr->co_name;
}
else
{
@@ -192,7 +193,58 @@ if($result = $db->db_query($qry))
$gemeinde='';
$strasse='';
$nation='';
+ $co_name = '';
}
+
+ // Zustelladresse & c/o Name(=abweichender Empfaenger)
+ $qryzustelladr = "
+ SELECT *
+ FROM public.tbl_adresse
+ WHERE zustelladresse IS TRUE
+ AND person_id=". $db->db_add_param($row->pers_id). ";
+ ";
+ $results = $db->db_query($qryzustelladr);
+
+ if ($db->db_num_rows($results) != 1)
+ {
+ $error_log1.= "Es sind ".$db->db_num_rows($results)." Zustelladressen eingetragen\n";
+ }
+
+ $zustell_plz = '';
+ $zustell_gemeinde = '';
+ $zustell_strasse = '';
+ $zustell_nation = '';
+
+ if ($rowzustelladr = $db->db_fetch_object($results))
+ {
+ $zustell_plz = $rowzustelladr->plz;
+ $zustell_gemeinde = $rowzustelladr->gemeinde;
+ $zustell_strasse = $rowzustelladr->strasse;
+ $zustell_nation = $rowzustelladr->nation;
+ }
+
+ // eMail-Adresse
+ $qry_mail = "
+ SELECT kontakt
+ FROM public.tbl_kontakt
+ WHERE kontakttyp = 'email'
+ AND zustellung = TRUE
+ AND person_id = ". $db->db_add_param($row->pers_id). "
+ ORDER BY insertamum DESC LIMIT 1;
+ ";
+
+ $email = '';
+ if ($result = $db->db_query($qry_mail))
+ {
+ if($db->db_num_rows($result) == 1)
+ {
+ if($row_mail = $db->db_fetch_object($result))
+ {
+ $email = $row_mail->kontakt;
+ }
+ }
+ }
+
if($row->gebdatum<'1920-01-01' OR $row->gebdatum==null OR $row->gebdatum=='')
{
$error_log.=(!empty($error_log)?', ':'')."Geburtsdatum ('".$row->gebdatum."')";
@@ -237,6 +289,7 @@ if($result = $db->db_query($qry))
{
$error_log.=(!empty($error_log)?', ':'')."Ersatzkennzeichen ('".$row->ersatzkennzeichen."') enthält Geburtsdatum (".$row->gebdatum.") nicht";
}
+ // Wenn SVNR fehlt, darf Ersatzkennzeichen nicht fehlen (und umgekehrt)
if(($row->svnr=='' || $row->svnr==null)&&($row->ersatzkennzeichen=='' || $row->ersatzkennzeichen==null))
{
$error_log.=(!empty($error_log)?', ':'')."SVNR ('".$row->svnr."') bzw. ErsKz ('".$row->ersatzkennzeichen."') fehlt";
@@ -306,6 +359,49 @@ if($result = $db->db_query($qry))
}
}
}
+ if($row->bpk == '' || $row->bpk == null)
+ {
+ $error_log .= (!empty($error_log) ? ', ' : '') . "bPK fehlt";
+ }
+
+ if($row->bpk != '' && $row->bpk != null)
+ {
+ if (!preg_match('/[a-zA-Z0-9\+\/]{27}=/', $row->bpk))
+ {
+ $error_log.=(!empty($error_log) ? ', ' : ''). "bPK-Zeichenfolge ist ungültig";
+ }
+
+ if (strlen($row->bpk) != 28)
+ {
+ $error_log.=(!empty($error_log) ? ', ' : ''). "bPK ist nicht 28 Zeichen lang";
+ }
+ }
+
+ if ($zustell_plz == '' || $zustell_plz == null)
+ {
+ $error_log.=(!empty($error_log)?', ':'')."Zustell-PLZ fehlt";
+ }
+
+ if ($zustell_gemeinde == '' || $zustell_gemeinde == null)
+ {
+ $error_log.=(!empty($error_log)?', ':'')."Zustell-Gemeinde fehlt";
+ }
+
+ if ($zustell_strasse == '' || $zustell_strasse == null)
+ {
+ $error_log.=(!empty($error_log)?', ':'')."Zustell-Strasse fehlt";
+ }
+
+ if ($zustell_nation == '' || $zustell_nation == null)
+ {
+ $error_log.=(!empty($error_log)?', ':'')."Zustell-Nation fehlt";
+ }
+
+ if ($email == '' || $email == null)
+ {
+ $error_log.=(!empty($error_log)?', ':'')."eMail Adresse fehlt oder eMail-Zustellung auf 'Nein' gesetzt.";
+ }
+
//Bestimmen der aktuellen Prestudentrolle (Status) und des akt. Ausbildungssemesters des Studenten
$qrystatus="SELECT * FROM public.tbl_prestudentstatus
WHERE prestudent_id=".$db->db_add_param($row->prestudent_id)." AND studiensemester_kurzbz=".$db->db_add_param($ssem)."
@@ -481,7 +577,21 @@ if($result = $db->db_query($qry))
".trim($row->matrikelnr)."
".$row->matr_nr."
".date("dmY", $datumobj->mktime_fromdate($row->gebdatum))."
- ".strtoupper($row->geschlecht)."
+ ".strtoupper($row->geschlecht)."";
+
+ if ($row->titelpre != '')
+ {
+ $datei .= "
+ " . $row->titelpre . "";
+ }
+
+ if ($row->titelpost != '')
+ {
+ $datei .= "
+ " . $row->titelpost . "";
+ }
+
+ $datei .= "
".$row->vorname."
".$row->nachname."";
@@ -495,6 +605,10 @@ if($result = $db->db_query($qry))
$datei.="
".$row->ersatzkennzeichen."";
}
+
+ $datei.="
+ ".$row->bpk."
+ ";
$datei.="
".$row->staatsbuergerschaft."
@@ -502,6 +616,19 @@ if($result = $db->db_query($qry))
".$gemeinde."
".$nation."
+ ". $zustell_plz. "
+ ". $zustell_gemeinde. "
+ ". $zustell_strasse. "
+ ". $zustell_nation. "";
+
+ if ($co_name != '')
+ {
+ $datei .= "
+ ". $co_name. "";
+ }
+
+ $datei.="
+ ". $email. "
".$row->zgv_code."
".date("dmY", $datumobj->mktime_fromdate($row->zgvdatum))."";