This commit is contained in:
Rudolf Hangl
2007-02-26 16:48:55 +00:00
parent a372c7c41a
commit 9675118807
4 changed files with 35 additions and 19 deletions
+6 -8
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
/* Copyright (C) 2007 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -21,7 +21,7 @@
*/
/**
* Klasse Betriebsmittel
* @create 22-12-2006
* @create 22-01-2007
*/
class betriebsmittel
@@ -38,7 +38,6 @@ class betriebsmittel
var $reservieren; // @var boolean
var $ort_kurzbz; // @var string
var $ext_id; // @var integer
var $ext_id2; // @var integer
var $insertamum; // @var timestamp
var $insertvon; // @var bigint
var $updateamum; // @var timestamp
@@ -102,7 +101,7 @@ class betriebsmittel
//Neuen Datensatz einfuegen
$qry='INSERT INTO public.tbl_betriebsmittel (betriebsmittel_id, beschreibung, betriebsmitteltyp, nummer, reservieren, ort_kurzbz,
ext_id, insertamum, insertvon, updateamum, ext_id2, updatevon) VALUES('.
ext_id, insertamum, insertvon, updateamum, updatevon) VALUES('.
$this->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).';';
+6 -7
View File
@@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
/* Copyright (C) 2007 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
@@ -120,7 +120,7 @@ class betriebsmittelperson
//Pruefen ob betriebsmittel_id eine gueltige Zahl ist
if(!is_numeric($this->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;
}
}
+12 -2
View File
@@ -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))
{
+11 -2
View File
@@ -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))
{