From be4a31145802981d2b97adefd53f515dd10a295b Mon Sep 17 00:00:00 2001 From: Rudolf Hangl Date: Thu, 30 Apr 2009 15:13:20 +0000 Subject: [PATCH] --- cis/private/lehre/abgabe_lektor_details.php | 130 +++++++++++++++--- cis/private/lehre/abgabe_lektor_frameset.html | 2 +- cis/private/lehre/abgabe_student_details.php | 6 +- .../lehre/abgabe_student_frameset.html | 2 +- 4 files changed, 117 insertions(+), 23 deletions(-) diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php index 8cbad4203..08e67350b 100644 --- a/cis/private/lehre/abgabe_lektor_details.php +++ b/cis/private/lehre/abgabe_lektor_details.php @@ -25,6 +25,7 @@ * abgabe_lektor ist die Lektorenmaske des Abgabesystems * für Diplom- und Bachelorarbeiten *******************************************************************************************************/ +//echo Test($_REQUEST); require_once('../../config.inc.php'); require_once('../../../include/functions.inc.php'); @@ -124,28 +125,45 @@ if(isset($_POST["schick"])) $row_std=@pg_fetch_object($result_std); if($command=='insert') { - //neuer Termin - $qry="INSERT INTO campus.tbl_paabgabe (projektarbeit_id, paabgabetyp_kurzbz, fixtermin, datum, kurzbz, abgabedatum, insertvon, insertamum, updatevon, updateamum) - VALUES ('$projektarbeit_id', '$paabgabetyp_kurzbz', ".($fixtermin==1?'true':'false').", '$datum', '$kurzbz', NULL, '$user', now(), NULL, NULL)"; - //echo $qry; - if(!$result=pg_query($conn, $qry)) + $qrychk="SELECT * FROM campus.tbl_paabgabe + WHERE projektarbeit_id='$projektarbeit_id' AND paabgabetyp_kurzbz='$paabgabetyp_kurzbz' AND fixtermin=".($fixtermin==1?'true':'false')." AND datum='$datum' AND kurzbz='$kurzbz'"; + if($result=pg_query($conn, $qrychk)) { - echo "Termin konnte nicht eingetragen werden!
 "; - } - else - { - $row=@pg_fetch_object($result); - $qry_typ="SELECT bezeichnung FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='".$paabgabetyp_kurzbz."'"; - if($result_typ=pg_query($conn, $qry_typ)) + if(pg_num_rows($result)>0) { - $row_typ=@pg_fetch_object($result_typ); + //Datensatz bereits vorhanden } else { - $row_typ->bezeichnung=''; + //neuer Termin + $qry="INSERT INTO campus.tbl_paabgabe (projektarbeit_id, paabgabetyp_kurzbz, fixtermin, datum, kurzbz, abgabedatum, insertvon, insertamum, updatevon, updateamum) + VALUES ('$projektarbeit_id', '$paabgabetyp_kurzbz', ".($fixtermin==1?'true':'false').", '$datum', '$kurzbz', NULL, '$user', now(), NULL, NULL)"; + //echo $qry; + if(!$result=pg_query($conn, $qry)) + { + echo "Termin konnte nicht eingetragen werden!
 "; + } + else + { + $row=@pg_fetch_object($result); + $qry_typ="SELECT bezeichnung FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='".$paabgabetyp_kurzbz."'"; + if($result_typ=pg_query($conn, $qry_typ)) + { + $row_typ=@pg_fetch_object($result_typ); + } + else + { + $row_typ->bezeichnung=''; + } + $mail = new mail($uid."@".DOMAIN, "vilesci@".DOMAIN, "Neuer Termin Bachelor-/Diplomarbeitsbetreuung", + "Sehr geehrte".($row_std->anrede=="Herr"?"r":"")." ".$row_std->anrede." ".trim($row_std->titelpre." ".$row_std->vorname." ".$row_std->nachname." ".$row_std->titelpost)."!\n\nIhr(e) Betreuer(in) hat einen neuen Termin angelegt:\n".$datum_obj->formatDatum($datum,'d.m.Y').", ".$row_typ->bezeichnung.", ".$kurzbz."\n\nMfG\nIhr(e) Betreuer(in)\n\n--------------------------------------------------------------------------\nDies ist ein vom Bachelor-/Diplomarbeitsabgabesystem generiertes Info-Mail\ncis->Mein CIS->Bachelor- und Diplomarbeitsabgabe\n--------------------------------------------------------------------------"); + } + $command=''; } - $mail = new mail($uid."@".DOMAIN, "vilesci@".DOMAIN, "Neuer Termin Bachelor-/Diplomarbeitsbetreuung", - "Sehr geehrte".($row_std->anrede=="Herr"?"r":"")." ".$row_std->anrede." ".trim($row_std->titelpre." ".$row_std->vorname." ".$row_std->nachname." ".$row_std->titelpost)."!\n\nIhr(e) Betreuer(in) hat einen neuen Termin angelegt:\n".$datum_obj->formatDatum($datum,'d.m.Y').", ".$row_typ->bezeichnung.", ".$kurzbz."\n\nMfG\nIhr(e) Betreuer(in)\n\n--------------------------------------------------------------------------\nDies ist ein vom Bachelor-/Diplomarbeitsabgabesystem generiertes Info-Mail\ncis->Mein CIS->Bachelor- und Diplomarbeitsabgabe\n--------------------------------------------------------------------------"); + } + else + { + echo "Datenbank-Zugriffsfehler!"; } } if($command=='update') @@ -201,11 +219,15 @@ if(isset($_POST["schick"])) "Sehr geehrte".($row_std->anrede=="Herr"?"r":"")." ".$row_std->anrede." ".trim($row_std->titelpre." ".$row_std->vorname." ".$row_std->nachname." ".$row_std->titelpost)."!\n\nIhr(e) Betreuer(in) hat einen Termin geändert:\nVon: ".$datum_obj->formatDatum($row_old->datum,'d.m.Y').", ".$row_told->bezeichnung.", ".$row_old->kurzbz."\nAuf: ".$datum_obj->formatDatum($datum,'d.m.Y').", ".$row_typ->bezeichnung." ".$kurzbz."\n\nMfG\nIhr(e) Betreuer(in)\n\n--------------------------------------------------------------------------\nDies ist ein vom Bachelor-/Diplomarbeitsabgabesystem generiertes Info-Mail\ncis->Mein CIS->Bachelor- und Diplomarbeitsabgabe\n--------------------------------------------------------------------------"); } } + $command=''; } - $mail->setReplyTo($user."@".DOMAIN); - if(!$mail->send()) + if(isset($mail)) { - echo "Fehler beim Versenden des Mails!
 "; + $mail->setReplyTo($user."@".DOMAIN); + if(!$mail->send()) + { + echo "Fehler beim Versenden des Mails!
 "; + } } } } @@ -213,6 +235,7 @@ if(isset($_POST["schick"])) { echo "Datumseingabe ungültig!
 "; } + unset($_POST["schick"]); } //Löschen eines Termines if(isset($_POST["del"])) @@ -258,6 +281,7 @@ if(isset($_POST["del"])) { echo "Datumseingabe ungültig!
 "; } + unset($_POST["del"]); } $qry="SELECT * FROM campus.tbl_paabgabe WHERE projektarbeit_id='".$projektarbeit_id."' ORDER BY datum;"; @@ -380,5 +404,73 @@ $htmlstr .= "\n"; $htmlstr .= "\n"; echo $htmlstr; +function Test($arr=constLeer,$lfd=0,$displayShow=true,$onlyRoot=false ) +{ + + $tmpArrayString=''; + + if (!is_array($arr) && !is_object($arr)) return $arr; + + if (is_array($arr) && count($arr)<1 && $displayShow) return ''; + + if (is_array($arr) && count($arr)<1 && $displayShow) return "
function Test (???)
"; + + + + $lfdnr=$lfd + 1; + + $tmpAnzeigeStufe=''; + + for ($i=1;$i<$lfdnr;$i++) $tmpAnzeigeStufe.="="; + + $tmpAnzeigeStufe.="=>"; + + while (list( $tmp_key, $tmp_value ) = each($arr) ) + + { + + if (!$onlyRoot && (is_array($tmp_value) || is_object($tmp_value)) && count($tmp_value) >0) + + { + + $tmpArrayString.="
$tmpAnzeigeStufe $tmp_key".Test($tmp_value,$lfdnr); + + } else if ( (is_array($tmp_value) || is_object($tmp_value)) ) + + { + + $tmpArrayString.="
$tmpAnzeigeStufe $tmp_key -- 0 Records"; + + } else if ($tmp_value!='') + + { + + $tmpArrayString.="
$tmpAnzeigeStufe $tmp_key :== ".$tmp_value; + + } else { + + $tmpArrayString.="
$tmpAnzeigeStufe $tmp_key :-- (is Empty :: $tmp_value)"; + + } + + } + + if ($lfd!='') { return $tmpArrayString; } + + if (!$displayShow) { return $tmpArrayString; } + + + + $tmpArrayString.="
"; + + $tmpArrayString="


******* START *******
".$tmpArrayString."
******* ENDE *******


"; + + $tmpArrayString.="
Server:: ".$_SERVER['PHP_SELF']."
"; + + return "$tmpArrayString"; + +} + +//=========================================================================================== ?> \ No newline at end of file diff --git a/cis/private/lehre/abgabe_lektor_frameset.html b/cis/private/lehre/abgabe_lektor_frameset.html index d53fd663b..da622bcc6 100644 --- a/cis/private/lehre/abgabe_lektor_frameset.html +++ b/cis/private/lehre/abgabe_lektor_frameset.html @@ -4,7 +4,7 @@ Bachelor-/Diplomarbeitsabgabe - Lektor - + diff --git a/cis/private/lehre/abgabe_student_details.php b/cis/private/lehre/abgabe_student_details.php index 0a4149d4c..dbbe0c31b 100644 --- a/cis/private/lehre/abgabe_student_details.php +++ b/cis/private/lehre/abgabe_student_details.php @@ -90,6 +90,7 @@ $error = false; $rechte = new benutzerberechtigung($conn); $rechte->getBerechtigungen($user); $htmlstr=''; + if($command=='add') { //zusätzliche Daten bearbeiten @@ -112,7 +113,7 @@ if($command=='add') } if(!$error) { - $qry_upd="UPDATE lehre.tbl_projektarbeit SET + $qry_upd="UPDATE lehre.tbl_projektarbeit SET seitenanzahl = '".$seitenanzahl."', abgabedatum = now(), sprache = '".addslashes($sprache)."', @@ -334,9 +335,10 @@ if($command!="add") $htmlstr .= "\n"; } - + $command!=""; $htmlstr .= "\n"; echo $htmlstr; echo ''; } + ?> \ No newline at end of file diff --git a/cis/private/lehre/abgabe_student_frameset.html b/cis/private/lehre/abgabe_student_frameset.html index 3b60c6655..b4c550d13 100644 --- a/cis/private/lehre/abgabe_student_frameset.html +++ b/cis/private/lehre/abgabe_student_frameset.html @@ -4,7 +4,7 @@ Bachelor-/Diplomarbeitsabgabe - Student - +