ausgabe fehlender studenten

This commit is contained in:
Gerald Raab
2007-08-16 10:18:06 +00:00
parent 7b8fa5ae3c
commit 4fe5dafe8d
+14 -7
View File
@@ -10,8 +10,8 @@
require_once('../../../vilesci/config.inc.php');
require_once('../../../include/zeugnisnote.class.php');
require_once('../../../include/pruefung.class.php');
$adress='fas_sync@technikum-wien.at';
//$adress='raab@technikum-wien.at';
//$adress='fas_sync@technikum-wien.at';
$adress='raab@technikum-wien.at';
$conn=pg_connect(CONN_STRING) or die("Connection zur Portal Datenbank fehlgeschlagen");
$conn_fas=pg_connect(CONN_STRING_FAS) or die("Connection zur Vilesci Datenbank fehlgeschlagen");
@@ -37,7 +37,8 @@
$anz_processed=0;
$anz_students_processed = 0;
$stg_processed = "";
$fas_lvs_notinsync = array();
$fas_lvs_notinsync = array();
$stud_no_ext_id = array();
$headtext='';
$head_stg_text="Dies ist eine automatische Mail!\n\nFolgende Fehler sind bei der Synchronisation der Lehrveranstaltungen aufgetreten:\n\n";
@@ -61,7 +62,7 @@
$mitarbeiter_arr[$row->ext_id] = $row->mitarbeiter_uid;
}
//array aller studenten (ext_id->mitarbeiter_uid)
//array aller studenten (ext_id->student_uid)
$sqlstr = "SELECT ext_id, student_uid FROM tbl_student";
if($result = pg_query($conn, $sqlstr))
{
@@ -339,7 +340,7 @@
//$fasnoten_arr = getNoten4Student($conn_fas,$row->student_fk);
$fasnoten_arr = getNoten4Studiengang($conn_fas,$row->studiengang_pk);
$stg_processed .= $row->kuerzel." (".$row->studiengang_pk.") / ";
$studkeys_arr = array_keys($fasnoten_arr);
@@ -461,7 +462,9 @@
if($student_uid == "FEHLT")
{
$insert_error_zeug++;
$insert_error_zeug++;
$text .= "<span style='background-color:#cccccc;'>Zeugnis: Datensatz FAS ID".$idkey.": student_uid ohne zuordnung</span><br>";
if (!in_array($studkey, $stud_no_ext_id))
$stud_no_ext_id[] = $studkey;
}
else if ($lehrveranstaltung_id == "FEHLT")
@@ -559,6 +562,10 @@
$text .= "Zeugnisnoten update fehler/ok/noupdate: <span style='color:red'> ".$update_error_zeug."</span>/".$anz_update_zeug."/".$anz_not_updated_zeug."<br>";
$text .= "FAS- LVs nicht in sync-Tabelle: ";
foreach ($fas_lvs_notinsync as $lv_id)
$text .= $lv_id."; ";
$text .= "<br>";
$text .= "Studenten Ext-IDs: ";
foreach ($stud_no_ext_id as $stud_ext_id)
$text .= $stud_ext_id."; ";
$text .= "<br>";
@@ -567,7 +574,7 @@
$text .= "Dauer: ".$runzeit." s";
$text.="\nEND OF SYNCHRONISATION\n";
if (mail($adress,"FAS - Vilesci (Noten/Pruefungen)",$headtext."\n\n<html><body>".$text."</body></html>","From: vilesci@technikum-wien.at\nContent-Type: text/html\n"))
$sendmail=true;
else