diff --git a/include/betriebsmittel.class.php b/include/betriebsmittel.class.php index 7a82ce87c..9aaaf381a 100644 --- a/include/betriebsmittel.class.php +++ b/include/betriebsmittel.class.php @@ -1,5 +1,5 @@ addslashes($this->betriebsmittel_id).', '. $this->addslashes($this->beschreibung).', '. $this->addslashes($this->betriebsmitteltyp).', '. @@ -111,7 +110,6 @@ class betriebsmittel $this->addslashes($this->ort_kurzbz).', '. $this->addslashes($this->ext_id).', now(), '. $this->addslashes($this->insertvon).', now(), '. - $this->addslashes($this->ext_id2).', '. $this->addslashes($this->updatevon).');'; $this->done=true; } @@ -125,7 +123,7 @@ class betriebsmittel $update=false; if($rowz->beschreibung!=$this->beschreibung) $update=true; if($rowz->betriebsmitteltyp!=$this->betriebsmitteltyp) $update=true; - if($rowz->nummer!=$this->nummer) $update=true; + //if($rowz->nummer!=$this->nummer) $update=true; if($rowz->reservieren!=$this->reservieren) $update=true; if($rowz->ort_kurzbz!=$this->ort_kurzbz) $update=true; @@ -133,11 +131,11 @@ class betriebsmittel { $qry='UPDATE public.tbl_betriebsmittel SET '. 'betriebsmitteltyp='.$this->addslashes($this->betriebsmitteltyp).', '. - 'nummer='.$this->addslashes($this->nummer).', '. + 'beschreibung='.$this->addslashes($this->beschreibung).', '. + //'nummer='.$this->addslashes($this->nummer).', '. 'reservieren='.($this->reservieren?'true':'false').', '. 'ort_kurzbz='.$this->addslashes($this->ort_kurzbz).', '. 'ext_id='.$this->addslashes($this->ext_id).', '. - 'ext_id2='.$this->addslashes($this->ext_id2).', '. 'updateamum= now(), '. 'updatevon='.$this->addslashes($this->updatevon).' '. 'WHERE betriebsmittel_id='.$this->addslashes($this->betriebsmittel_id).';'; diff --git a/include/betriebsmittelperson.class.php b/include/betriebsmittelperson.class.php index 862c15628..bce932f0b 100644 --- a/include/betriebsmittelperson.class.php +++ b/include/betriebsmittelperson.class.php @@ -1,5 +1,5 @@ betriebsmittel_id)) { - $this->errormsg = 'betriebsmittel_id muss eine gueltige Zahl sein: '.$this->betriebsmittel_id.' ('.$this->person_id.')'; + $this->errormsg = "betriebsmittel_id muss eine gueltige Zahl sein: ".$this->betriebsmittel_id." (".$this->person_id.")\n"; return false; } @@ -140,19 +140,18 @@ class betriebsmittelperson if($update) { - $qry='UPDATE public.tbl_schluessel SET '. + $qry='UPDATE public.tbl_betriebsmittelperson SET '. 'betriebsmittel_id='.$this->addslashes($this->betriebsmittel_id).', '. 'person_id='.$this->addslashes($this->person_id).', '. - 'schluesseltyp='.$this->addslashes($this->schluesseltyp).', '. - 'nummer='.$this->addslashes($this->nummer).', '. + 'anmerkung='.$this->addslashes($this->anmerkung).', '. 'kaution='.$this->addslashes($this->kaution).', '. 'ausgegebenam='.$this->addslashes($this->ausgegebenam).', '. 'retouram='.$this->addslashes($this->retouram).', '. 'ext_id='.$this->addslashes($this->ext_id).', '. 'updateamum= now(), '. 'updatevon='.$this->addslashes($this->updatevon).' '. - 'WHERE betriebsmittel_id='.$this->addslashes($this->betriebsmittel_id).' - AND person_id='.$this->addslashes($this->person_id).';'; + 'WHERE betriebsmittel_id='.$this->addslashes($this->betriebsmittel_id). + ' AND person_id='.$this->addslashes($this->person_id).';'; $this->done=true; } } diff --git a/include/betriebsmitteltyp.class.php b/include/betriebsmitteltyp.class.php index 5c3f55336..50a07bf47 100644 --- a/include/betriebsmitteltyp.class.php +++ b/include/betriebsmitteltyp.class.php @@ -89,7 +89,7 @@ class betriebsmitteltyp // ************************************************************ function save() { - + $dbanzahl=0; $qry1='SELECT * FROM public.tbl_betriebsmitteltyp WHERE beschreibung='.$this->addslashes($this->beschreibung).';'; if($result1=pg_query($this->conn,$qry1)) { @@ -97,9 +97,18 @@ class betriebsmitteltyp { if($row1 = pg_fetch_object($result1)) { + if($row1->anzahl==null) + { + $dbanzahl=0; + } + else + { + $dbanzahl=$row1->anzahl; + } $qry='UPDATE public.tbl_betriebsmitteltyp SET '. - 'anzahl =anzahl+'.$this->anzahl.' '. + 'anzahl ='.$dbanzahl."+".$this->anzahl.' '. 'WHERE beschreibung='.$this->addslashes($this->beschreibung).';'; + echo nl2br($qry."\n"); } } else @@ -109,6 +118,7 @@ class betriebsmitteltyp $this->addslashes($this->beschreibung).', '. $this->addslashes($this->anzahl).', '. $this->addslashes($this->kaution).');'; + echo nl2br($qry."\n"); } if(pg_query($this->conn,$qry)) { diff --git a/include/schluesseltyp.class.php b/include/schluesseltyp.class.php index 76c9bce2b..40b37a611 100644 --- a/include/schluesseltyp.class.php +++ b/include/schluesseltyp.class.php @@ -89,7 +89,6 @@ class schluesseltyp // ************************************************************ function save() { - $qry1='SELECT * FROM public.tbl_schluesseltyp WHERE beschreibung='.$this->addslashes($this->beschreibung).';'; if($result1=pg_query($this->conn,$qry1)) { @@ -97,9 +96,18 @@ class schluesseltyp { if($row1 = pg_fetch_object($result1)) { + if($row1->anzahl=null) + { + $dbanzahl=0; + } + else + { + $dbanzahl=$row1->anzahl; + } $qry='UPDATE public.tbl_schluesseltyp SET '. - 'anzahl =anzahl+'.$this->anzahl.' '. + 'anzahl ='.$dbanzahl."+".$this->anzahl.' '. 'WHERE beschreibung='.$this->addslashes($this->beschreibung).';'; + echo nl2br($qry."\n"); } } else @@ -109,6 +117,7 @@ class schluesseltyp $this->addslashes($this->beschreibung).', '. $this->addslashes($this->anzahl).', '. $this->addslashes($this->kaution).');'; + echo nl2br($qry."\n"); } if(pg_query($this->conn,$qry)) {