diff --git a/include/akte.class.php b/include/akte.class.php index 655bd986f..35f3b90f5 100644 --- a/include/akte.class.php +++ b/include/akte.class.php @@ -199,7 +199,7 @@ class akte else { //Bestehenden Datensatz aktualisieren - $qry= "UPDATE public.tbl_akte SET "; + $qry= "UPDATE public.tbl_akte SET". " person_id=".$this->addslashes($this->person_id).",". " dokument_kurzbz=".$this->addslashes($this->dokument_kurzbz).",". " inhalt=".$this->addslashes($this->inhalt).",". @@ -212,7 +212,7 @@ class akte " updatevon=".$this->addslashes($this->updatevon).",". " ext_id=".$this->addslashes($this->ext_id).",". " uid=".$this->addslashes($this->uid). - " WHERE akte_id='".addslashes($akte_id)."'"; + " WHERE akte_id='".addslashes($this->akte_id)."'"; } if(pg_query($this->conn, $qry)) diff --git a/include/betriebsmitteltyp.class.php b/include/betriebsmitteltyp.class.php index bb5cd93d8..875d4291f 100644 --- a/include/betriebsmitteltyp.class.php +++ b/include/betriebsmitteltyp.class.php @@ -119,6 +119,7 @@ class betriebsmitteltyp function save() { $dbanzahl=0; + $qry=''; $qry1='SELECT * FROM public.tbl_betriebsmitteltyp WHERE beschreibung='.$this->addslashes($this->beschreibung).';'; if($result1=pg_query($this->conn,$qry1)) { diff --git a/include/functions.inc.php b/include/functions.inc.php index fa74216c1..da9755c59 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -7,9 +7,19 @@ function db_query($conn, $sql_query) return ''; } -function get_uid() +function crlf() { - return strtolower(trim($_SERVER['REMOTE_USER'])); + // doing some DOS-CRLF magic... + $crlf="\n"; + $client=getenv("HTTP_USER_AGENT"); + if (ereg('[^(]*\((.*)\)[^)]*',$client,$regs)) + { + $os = $regs[1]; + // this looks better under WinX + if (eregi("Win",$os)) + $crlf="\r\n"; + } + return $crlf; } function check_lektor($uid, $conn) diff --git a/include/globals.inc.php b/include/globals.inc.php index 4010aee68..95a342541 100644 --- a/include/globals.inc.php +++ b/include/globals.inc.php @@ -1,6 +1,6 @@ conn,$qry)) { $this->errormsg = 'Fehler beim lesen der Lehrform'; diff --git a/include/lvgesamtnote.class.php b/include/lvgesamtnote.class.php index ab5e6a85d..64dd13958 100644 --- a/include/lvgesamtnote.class.php +++ b/include/lvgesamtnote.class.php @@ -137,7 +137,7 @@ class lvgesamtnote $this->errormsg = 'Lehrveranstaltung_id ist ungueltig'; return false; } - if($student_uid=='') + if($this->student_uid=='') { $this->errormsg = 'UID muss angegeben werden'; return false; diff --git a/include/lvinfo.class.php b/include/lvinfo.class.php index 7371f362e..efb3145c1 100644 --- a/include/lvinfo.class.php +++ b/include/lvinfo.class.php @@ -191,7 +191,7 @@ class lvinfo //Laenge Pruefen if(strlen($this->sprache)>16) { - $this->errormsg = "Sprache darf nicht laenger als 16 Zeichen sein bei ".$this->$lvinfo_id." - $this->sprache"; + $this->errormsg = "Sprache darf nicht laenger als 16 Zeichen sein bei ".$this->lvinfo_id." - $this->sprache"; return false; } if(!is_numeric($this->lehrveranstaltung_id)) diff --git a/include/mitarbeiter.class.php b/include/mitarbeiter.class.php index 995d4b4dd..e028c1d92 100644 --- a/include/mitarbeiter.class.php +++ b/include/mitarbeiter.class.php @@ -258,7 +258,7 @@ class mitarbeiter extends benutzer //echo $sql_query; if(!($erg=pg_query($this->conn, $sql_query))) { - $this->errormsg=pg_errormessage($conn); + $this->errormsg=pg_errormessage($this->conn); return false; } $num_rows=pg_numrows($erg); @@ -336,7 +336,7 @@ class mitarbeiter extends benutzer if(!($erg=pg_query($this->conn, $sql_query))) { - $this->errormsg=pg_errormessage($conn); + $this->errormsg=pg_errormessage($this->conn); return false; } $num_rows=pg_numrows($erg); @@ -385,7 +385,7 @@ class mitarbeiter extends benutzer if(!($erg=pg_query($this->conn, $sql_query))) { - $this->errormsg=pg_errormessage($conn); + $this->errormsg=pg_errormessage($this->conn); return false; } $num_rows=pg_numrows($erg); diff --git a/include/ortraumtyp.class.php b/include/ortraumtyp.class.php index 2834f5d0f..83bd2c420 100644 --- a/include/ortraumtyp.class.php +++ b/include/ortraumtyp.class.php @@ -82,7 +82,7 @@ class ortraumtyp */ function load($ort_kurzbz, $hierarchie) { - if($ort_kurzbz == '' || !is_numeric($hierarche) || $hierarchie=='') + if($ort_kurzbz == '' || !is_numeric($hierarchie) || $hierarchie=='') { $this->errormsg = 'Kein gültiger Schlüssel vorhanden'; return false; diff --git a/include/raumtyp.class.php b/include/raumtyp.class.php index 5507c0181..ec005c47f 100644 --- a/include/raumtyp.class.php +++ b/include/raumtyp.class.php @@ -82,7 +82,7 @@ class raumtyp */ function load($raumtyp_kurzbz) { - if($raum_kurzbz == '') + if($raumtyp_kurzbz == '') { $this->errormsg = 'Kein gültiger Schlüssel vorhanden'; return false; diff --git a/include/schluesseltyp.class.php b/include/schluesseltyp.class.php index 212150c24..0da1184bc 100644 --- a/include/schluesseltyp.class.php +++ b/include/schluesseltyp.class.php @@ -131,7 +131,7 @@ class schluesseltyp } else { - $this->errormsg = 'Fehler beim Zugriff auf den Schluesseltypen-Datensatz: '.$this->schluesseltyp.' '.$qry; + $this->errormsg = 'Fehler beim Zugriff auf den Schluesseltypen-Datensatz: '.$this->schluesseltyp.' '.$qry1; return false; } } diff --git a/include/wochenplan.class.php b/include/wochenplan.class.php index 7e8ed5de1..66a4294d9 100644 --- a/include/wochenplan.class.php +++ b/include/wochenplan.class.php @@ -81,6 +81,7 @@ class wochenplan $this->kal_link='stpl_kalender.php?type='.$type; $this->datum=mktime(); $this->init_stdplan(); + $this->crlf=crlf(); } function init_stdplan() @@ -474,23 +475,23 @@ class wochenplan // Formularbeginn wenn Lektor if ($this->user=='lektor' && $this->type=='ort') - echo '
'; } } @@ -762,10 +764,12 @@ class wochenplan if (isset($this->std_plan[$i][$j][0]->lehrfach)) { // Daten aufbereiten - unset($lvb); + if (isset($lvb)) + unset($lvb); //$lvb=array(); $kollision=-1; - unset($a_unr); + if (isset($a_unr)) + unset($a_unr); foreach ($this->std_plan[$i][$j] as $lehrstunde) { $a_unr[]=$lehrstunde->unr; @@ -806,12 +810,18 @@ class wochenplan foreach ($a_unr as $unr) { // Daten vorbereiten - unset($lektor); - unset($lehrverband); - unset($lehrfach); - unset($ort); - unset($updateamum); - unset($updatevon); + if (isset($lektor)) + unset($lektor); + if (isset($lehrverband)) + unset($lehrverband); + if (isset($lehrfach)) + unset($lehrfach); + if (isset($ort)) + unset($ort); + if (isset($updateamum)) + unset($updateamum); + if (isset($updatevon)) + unset($updatevon); $paramList=''; $z=0; foreach ($this->std_plan[$i][$j] as $lehrstunde) @@ -993,6 +1003,8 @@ class wochenplan */ function load_stpl_search($datum,$stpl_id,$db_stpl_table, $block=1) { + // Initatialisierung der Variablen + $lehrverband=array(); // Name der View $stpl_view=VIEW_BEGIN.$db_stpl_table; $stpl_view_id=$db_stpl_table.TABLE_ID; @@ -1158,6 +1170,8 @@ class wochenplan */ function load_lva_search($datum,$lva_id,$db_stpl_table,$type) { + // Initialiseren der Variablen + $lehrverband=array(); // Name der View $stpl_view=VIEW_BEGIN.$db_stpl_table; $lva_stpl_view=VIEW_BEGIN.'lva_'.$db_stpl_table; @@ -1352,7 +1366,8 @@ class wochenplan for ($t=1;$t<7;$t++) for ($s=$min_stunde;$s<=$max_stunde;$s++) { - unset($raster[$t][$s]); + if (isset($raster[$t][$s])) + unset($raster[$t][$s]); $raster[$t][$s]->ort=array(); $raster[$t][$s]->kollision=false; } @@ -1466,10 +1481,14 @@ class wochenplan if (isset($this->std_plan[$i][$j][0]->lehrfach)) { // Daten aufbereiten - unset($unr); - unset($lektor); - unset($lehrverband); - unset($lehrfach); + if (isset($unr)) + unset($unr); + if (isset($lektor)) + unset($lektor); + if (isset($lehrverband)) + unset($lehrverband); + if (isset($lehrfach)) + unset($lehrfach); foreach ($this->std_plan[$i][$j] as $lehrstunde) { $unr[]=$lehrstunde->unr;