mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
This commit is contained in:
@@ -0,0 +1,452 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 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
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger < christian.paminger@technikum-wien.at >
|
||||
* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasse betriebsmittelstatus (FAS-Online)
|
||||
* @create 13-01-2007
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class betriebsmittel_betriebsmittelstatus extends basis_db
|
||||
{
|
||||
private $schema_inventar='wawi';
|
||||
|
||||
public $new;
|
||||
public $debug=false;
|
||||
public $result = array();
|
||||
|
||||
/*
|
||||
betriebsmittelbetriebsmittelstatus_id integer NOT NULL DEFAULT nextval('wawi.tbl_betriebsmittel_betriebsmi_betriebsmittelbetriebsmittels_seq'::regclass),
|
||||
betriebsmittel_id integer NOT NULL,
|
||||
betriebsmittelstatus_kurzbz character varying(16) NOT NULL,
|
||||
datum bigint,
|
||||
updateamum timestamp without time zone,
|
||||
updatevon character varying(32),
|
||||
insertamum timestamp without time zone,
|
||||
insertvon character varying(32),
|
||||
*/
|
||||
|
||||
//Tabellenspalten
|
||||
public $betriebsmittelbetriebsmittelstatus_id; // Integer
|
||||
public $betriebsmittel_id; // Integer
|
||||
public $betriebsmittelstatus_kurzbz; //string
|
||||
public $anmerkung; //String
|
||||
public $datum; //Int
|
||||
public $updateamum; // timestamp without time zone,
|
||||
public $updatevon; // character varying(32),
|
||||
public $insertamum; // timestamp without time zone,
|
||||
public $insertvon; // character varying(32),
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param $betriebsmittelstatus
|
||||
*/
|
||||
public function __construct($betriebsmittelbetriebsmittelstatus_id=null)
|
||||
{
|
||||
|
||||
parent::__construct();
|
||||
if($betriebsmittelbetriebsmittelstatus_id!=null)
|
||||
$this->load($betriebsmittelbetriebsmittelstatus_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Funktion mit der ID $betriebsmittelstatus
|
||||
* @param $betriebsmittelstatus
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($betriebsmittelbetriebsmittelstatus_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
$qry='';
|
||||
$where='';
|
||||
|
||||
$qry.=' select * from '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus';
|
||||
// Bedingungen hinzufuegen
|
||||
$where.=" where betriebsmittelbetriebsmittelstatus_id=".$this->addslashes(trim($betriebsmittelbetriebsmittelstatus_id)) ;
|
||||
$qry.=$where;
|
||||
|
||||
// Sortierung
|
||||
$qry.=' order by datum ';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
|
||||
$bmt = new betriebsmittel_betriebsmittelstatus();
|
||||
$bmt->betriebsmittelbetriebsmittelstatus_id = $row->betriebsmittelbetriebsmittelstatus_id;
|
||||
$bmt->betriebsmittel_id = $row->betriebsmittel_id;
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->anmerkung = $row->anmerkung;
|
||||
$bmt->datum = $row->datum;
|
||||
$bmt->updateamum = $row->updateamum;
|
||||
$bmt->updatevon = $row->updatevon;
|
||||
$bmt->insertamum = $row->insertamum;
|
||||
$bmt->insertvon = $row->insertvon;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
if (count($this->result)==1)
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id = $this->result[0]->betriebsmittelbetriebsmittelstatus_id;
|
||||
$this->betriebsmittel_id = $this->result[0]->betriebsmittel_id;
|
||||
$this->betriebsmittelstatus_kurzbz = $this->result[0]->betriebsmittelstatus_kurzbz;
|
||||
$this->anmerkung = $this->result[0]->anmerkung;
|
||||
$this->datum = $this->result[0]->datum;
|
||||
$this->updateamum = $this->result[0]->updateamum;
|
||||
$this->updatevon = $this->result[0]->updatevon;
|
||||
$this->insertamum = $this->result[0]->insertamum;
|
||||
$this->insertvon = $this->result[0]->insertvon;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Laedt die Funktion mit der ID $betriebsmittel und Optional einen Status
|
||||
* @param $betriebsmittel_id
|
||||
* @param $betriebsmittelstatus_kurzbz
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load_betriebsmittel_id($betriebsmittel_id,$betriebsmittelstatus_kurzbz=null)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
if(!is_numeric($betriebsmittel_id))
|
||||
{
|
||||
$this->errormsg = 'Betriebsmittel_id ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry='';
|
||||
$where='';
|
||||
$qry.=' select * from '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus';
|
||||
// Bedingungen hinzufuegen
|
||||
$where.=" where betriebsmittel_id=".$this->addslashes(trim($betriebsmittel_id)) ;
|
||||
if (!is_null($betriebsmittelstatus_kurzbz) && !empty($betriebsmittelstatus_kurzbz))
|
||||
$where.=" and trim(betriebsmittelstatus_kurzbz)=".$this->addslashes(trim($betriebsmittelstatus_kurzbz)) ;
|
||||
$qry.=$where;
|
||||
// Sortierung
|
||||
$qry.=' order by datum desc,updateamum desc,insertamum desc';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$bmt = new betriebsmittel_betriebsmittelstatus();
|
||||
$bmt->betriebsmittelbetriebsmittelstatus_id = $row->betriebsmittelbetriebsmittelstatus_id;
|
||||
$bmt->betriebsmittel_id = $row->betriebsmittel_id;
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->anmerkung = $row->anmerkung;
|
||||
$bmt->datum = $row->datum;
|
||||
$bmt->updateamum = $row->updateamum;
|
||||
$bmt->updatevon = $row->updatevon;
|
||||
$bmt->insertamum = $row->insertamum;
|
||||
$bmt->insertvon = $row->insertvon;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
if (count($this->result)==1)
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id = $this->result[0]->betriebsmittelbetriebsmittelstatus_id;
|
||||
$this->betriebsmittel_id = $this->result[0]->betriebsmittel_id;
|
||||
$this->betriebsmittelstatus_kurzbz = $this->result[0]->betriebsmittelstatus_kurzbz;
|
||||
$this->anmerkung = $this->result[0]->anmerkung;
|
||||
$this->datum = $this->result[0]->datum;
|
||||
$this->updateamum = $this->result[0]->updateamum;
|
||||
$this->updatevon = $this->result[0]->updatevon;
|
||||
$this->insertamum = $this->result[0]->insertamum;
|
||||
$this->insertvon = $this->result[0]->insertvon;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Funktion mit der ID $betriebsmittel und Optional einen Status
|
||||
* @param $betriebsmittel_id
|
||||
* @param $betriebsmittelstatus_kurzbz
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load_last_betriebsmittel_id($betriebsmittel_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
if ($betriebsmittel_id)
|
||||
$this->betriebsmittel_id=$betriebsmittel_id;
|
||||
|
||||
if(!is_numeric($this->betriebsmittel_id))
|
||||
{
|
||||
$this->errormsg = 'Betriebsmittel_id ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry='';
|
||||
$where='';
|
||||
|
||||
$qry.=' select * from '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus';
|
||||
// Bedingungen hinzufuegen
|
||||
$where.=" where betriebsmittel_id=".$this->addslashes(trim($this->betriebsmittel_id)) ;
|
||||
|
||||
$qry.=$where;
|
||||
// Sortierung
|
||||
$qry.=' order by betriebsmittelbetriebsmittelstatus_id desc limit 1';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$bmt = new betriebsmittel_betriebsmittelstatus();
|
||||
|
||||
$bmt->betriebsmittelbetriebsmittelstatus_id = $row->betriebsmittelbetriebsmittelstatus_id;
|
||||
$bmt->betriebsmittel_id = $row->betriebsmittel_id;
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->anmerkung = $row->anmerkung;
|
||||
$bmt->datum = $row->datum;
|
||||
$bmt->updateamum = $row->updateamum;
|
||||
$bmt->updatevon = $row->updatevon;
|
||||
$bmt->insertamum = $row->insertamum;
|
||||
$bmt->insertvon = $row->insertvon;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
if (count($this->result)==1)
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id = $this->result[0]->betriebsmittelbetriebsmittelstatus_id;
|
||||
$this->betriebsmittel_id = $this->result[0]->betriebsmittel_id;
|
||||
$this->betriebsmittelstatus_kurzbz = $this->result[0]->betriebsmittelstatus_kurzbz;
|
||||
$this->anmerkung = $this->result[0]->anmerkung;
|
||||
$this->datum = $this->result[0]->datum;
|
||||
$this->updateamum = $this->result[0]->updateamum;
|
||||
$this->updatevon = $this->result[0]->updatevon;
|
||||
$this->insertamum = $this->result[0]->insertamum;
|
||||
$this->insertvon = $this->result[0]->insertvon;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Laedt alle betriebsmittelstatus
|
||||
* @return true wenn ok, false wenn Fehler
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
$qry='';
|
||||
$where='';
|
||||
|
||||
$qry.=' select * FROM '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus';
|
||||
$qry.=" where betriebsmittelstatus_kurzbz >'' ";
|
||||
|
||||
// Bedingungen hinzufuegen
|
||||
$qry.=$where;
|
||||
|
||||
// Sortierung
|
||||
$qry.=' order by betriebsmittel_id,datum desc,insertamum desc ';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$bmt = new betriebsmittel_betriebsmittelstatus();
|
||||
$bmt->betriebsmittelbetriebsmittelstatus_id = $row->betriebsmittelbetriebsmittelstatus_id;
|
||||
$bmt->betriebsmittel_id = $row->betriebsmittel_id;
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->anmerkung = $row->anmerkung;
|
||||
$bmt->datum = $row->datum;
|
||||
$bmt->updateamum = $row->updateamum;
|
||||
$bmt->updatevon = $row->updatevon;
|
||||
$bmt->insertamum = $row->insertamum;
|
||||
$bmt->insertvon = $row->insertvon;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
if (count($this->result)==1)
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id = $this->result[0]->betriebsmittelbetriebsmittelstatus_id;
|
||||
$this->betriebsmittel_id = $this->result[0]->betriebsmittel_id;
|
||||
$this->betriebsmittelstatus_kurzbz = $this->result[0]->betriebsmittelstatus_kurzbz;
|
||||
$this->anmerkung = $this->result[0]->anmerkung;
|
||||
$this->datum = $this->result[0]->datum;
|
||||
$this->updateamum = $this->result[0]->updateamum;
|
||||
$this->updatevon = $this->result[0]->updatevon;
|
||||
$this->insertamum = $this->result[0]->insertamum;
|
||||
$this->insertvon = $this->result[0]->insertvon;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert die Daten in die Datenbank
|
||||
* @return true wenn erfolgreich, false im Fehlerfall
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
if(!is_numeric($this->betriebsmittel_id))
|
||||
{
|
||||
$this->errormsg = 'Betriebsmittel_id ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
$qry='';
|
||||
if($this->new)
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id='';
|
||||
$qry='INSERT INTO '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus
|
||||
(betriebsmittel_id,betriebsmittelstatus_kurzbz,anmerkung,datum,insertamum,insertvon,updateamum,updatevon ) VALUES('.
|
||||
$this->addslashes($this->betriebsmittel_id).','.
|
||||
$this->addslashes($this->betriebsmittelstatus_kurzbz).','.
|
||||
$this->addslashes($this->anmerkung).','.
|
||||
($this->datum?$this->addslashes($this->datum):'now()').', '.
|
||||
($this->insertamum?$this->addslashes($this->insertamum):'now()').', '.
|
||||
$this->addslashes($this->insertvon).', '.
|
||||
($this->updateamum?$this->addslashes($this->updateamum):'now()').', '.
|
||||
$this->addslashes((empty($this->updatevon)?$this->updatevon:$this->insertvon)) .'); ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry='UPDATE '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus SET '.
|
||||
"betriebsmittel_id =".$this->addslashes($this->betriebsmittel_id).', '.
|
||||
"betriebsmittelstatus_kurzbz =".$this->addslashes($this->betriebsmittelstatus_kurzbz).', '.
|
||||
"anmerkung =".$this->addslashes($this->anmerkung).', '.
|
||||
"datum =".($this->datum?$this->addslashes($this->datum):'now()').', '.
|
||||
"updateamum =".($this->updateamum?$this->addslashes($this->updateamum):'now()').', '.
|
||||
"updatevon =".$this->addslashes((empty($this->updatevon)?$this->updatevon:$this->insertvon)).' '.
|
||||
" WHERE betriebsmittelbetriebsmittelstatus_id=".$this->addslashes($this->betriebsmittelbetriebsmittelstatus_id);
|
||||
}
|
||||
|
||||
# echo "<br> $qry <br>";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($this->new)
|
||||
{
|
||||
$qry = "SELECT currval('".$this->schema_inventar.".tbl_betriebsmittel_betriebsmi_betriebsmittelbetriebsmittels_seq') as id;";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->betriebsmittelbetriebsmittelstatus_id= $row->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Lesen der Sequence '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Lesen der Sequence '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $this->betriebsmittelbetriebsmittelstatus_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Betriebsmittel Betriebsmittelstatus-Datensatzes '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt die Daten in die Datenbank
|
||||
* @return true wenn erfolgreich, false im Fehlerfall
|
||||
*/
|
||||
public function delete($betriebsmittelbetriebsmittelstatus_id=null)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
if (!is_null($betriebsmittelbetriebsmittelstatus_id))
|
||||
$this->betriebsmittelbetriebsmittelstatus_id=$betriebsmittelbetriebsmittelstatus_id;
|
||||
if(!is_numeric($this->betriebsmittelbetriebsmittelstatus_id))
|
||||
{
|
||||
$this->errormsg = 'Betriebsmittelbetriebsmittelstatus_id ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry='DELETE from '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus '.
|
||||
' WHERE betriebsmittelbetriebsmittelstatus_id='.$this->addslashes($this->betriebsmittelbetriebsmittelstatus_id);
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim entfernen des Betriebsmittel Betriebsmittelstatus-Datensatzes '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Entfernt die alle Daten zu einem Betriebsmittel in die Datenbank
|
||||
* @return true wenn erfolgreich, false im Fehlerfall
|
||||
*/
|
||||
public function delete_betriebsmittel($betriebsmittel_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg='';
|
||||
|
||||
|
||||
if(!is_numeric($betriebsmittel_id))
|
||||
{
|
||||
$this->errormsg = 'Betriebsmittel_id ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
$qry='DELETE from '.$this->schema_inventar.'.tbl_betriebsmittel_betriebsmittelstatus '.
|
||||
' WHERE betriebsmittel_id='.$this->addslashes($betriebsmittel_id);
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim entfernen des Betriebsmittel Betriebsmittelstatus-Datensatzes '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 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
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Klasse betriebsmittelstatus (FAS-Online)
|
||||
* @create 13-01-2007
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class betriebsmittelstatus extends basis_db
|
||||
{
|
||||
private $schema_inventar='wawi';
|
||||
public $debug=false; // boolean
|
||||
|
||||
public $new;
|
||||
public $result = array();
|
||||
|
||||
//Tabellenspalten
|
||||
public $betriebsmittelstatus_kurzbz; //string
|
||||
public $beschreibung; //string
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param $betriebsmittelstatus
|
||||
*/
|
||||
public function __construct($betriebsmittelstatus_kurzbz=null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if($betriebsmittelstatus_kurzbz!=null)
|
||||
$this->load($betriebsmittelstatus_kurzbz);
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Funktion mit der ID $betriebsmittelstatus
|
||||
* @param $betriebsmittelstatus
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($betriebsmittelstatus_kurzbz)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
$qry='';
|
||||
$where='';
|
||||
|
||||
$qry.=' select * FROM '.$this->schema_inventar.'.tbl_betriebsmittelstatus';
|
||||
// Bedingungen hinzufuegen
|
||||
|
||||
$where.=" where trim(UPPER(betriebsmittelstatus_kurzbz))=".$this->addslashes(mb_strtoupper(trim($betriebsmittelstatus_kurzbz))) ;
|
||||
|
||||
$qry.=$where;
|
||||
|
||||
// Sortierung
|
||||
$qry.=' order by betriebsmittelstatus_kurzbz ';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$bmt = new betriebsmittelstatus();
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->beschreibung = $row->beschreibung;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Laedt alle betriebsmittelstatus
|
||||
* @return true wenn ok, false wenn Fehler
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
$qry='';
|
||||
$where='';
|
||||
|
||||
$qry.=' select * FROM '.$this->schema_inventar.'.tbl_betriebsmittelstatus';
|
||||
$qry.=" where betriebsmittelstatus_kurzbz >'' ";
|
||||
|
||||
// Bedingungen hinzufuegen
|
||||
$qry.=$where;
|
||||
|
||||
// Sortierung
|
||||
$qry.=' order by betriebsmittelstatus_kurzbz ';
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$bmt = new betriebsmittelstatus();
|
||||
$bmt->betriebsmittelstatus_kurzbz = $row->betriebsmittelstatus_kurzbz;
|
||||
$bmt->beschreibung = $row->beschreibung;
|
||||
$this->result[] = $bmt;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert die Daten in die Datenbank
|
||||
* @return true wenn erfolgreich, false im Fehlerfall
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
/*
|
||||
betriebsmittelbetriebsmittelstatus_id integer NOT NULL DEFAULT nextval('wawi.tbl_betriebsmittel_betriebsmi_betriebsmittelbetriebsmittels_seq'::regclass),
|
||||
betriebsmittel_id integer NOT NULL,
|
||||
betriebsmittelstatus_kurzbz character varying(16) NOT NULL,
|
||||
datum bigint,
|
||||
updateamum timestamp without time zone,
|
||||
updatevon character varying(32),
|
||||
insertamum timestamp without time zone,
|
||||
insertvon character varying(32),
|
||||
*/
|
||||
$this->errormsg = '';
|
||||
$qry='';
|
||||
if($this->new)
|
||||
{
|
||||
$qry='INSERT INTO '.$this->schema_inventar.'.tbl_betriebsmittelstatus
|
||||
(betriebsmittelstatus_kurzbz, beschreibung )
|
||||
VALUES('.$this->addslashes($this->betriebsmittelstatus_kurzbz)
|
||||
.','.$this->addslashes($this->beschreibung).'); ';
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry='UPDATE '.$this->schema_inventar.'.tbl_betriebsmittelstatus SET '.
|
||||
"beschreibung =".$this->addslashes($this->beschreibung) .
|
||||
" WHERE betriebsmittelstatus_kurzbz=".$this->addslashes($this->betriebsmittelstatus_kurzbz);
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim speichern des Betriebsmittelstatus-Datensatzes '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Entfernt die Daten in die Datenbank
|
||||
* @return true wenn erfolgreich, false im Fehlerfall
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$this->errormsg = '';
|
||||
$qry='DELETE '.$this->schema_inventar.'.tbl_betriebsmittelstatus '.
|
||||
" WHERE betriebsmittelstatus_kurzbz=".$this->addslashes($this->betriebsmittelstatus_kurzbz);
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim entfernen des Betriebsmittelstatus-Datensatzes '.($this->debug?$this->db_last_error()."<br />$qry<br />":'');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -212,7 +212,6 @@ class firma extends basis_db
|
||||
{
|
||||
$this->firma_id = $row->id;
|
||||
$this->db_query('COMMIT');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
@charset "utf-8";
|
||||
|
||||
table.navbar {width:100%;border: 1px solid WindowFrame;}
|
||||
table.navbar tr {text-align:left;}
|
||||
table.navbar td {text-align:left;white-space: nowrap;}
|
||||
table.navbar .ac_submit {width:10%;background-color: #FFFFDD;}
|
||||
|
||||
.ac_results iframe {
|
||||
display:none;/*sorry for IE5*/
|
||||
display/**/:block;/*sorry for IE5*/
|
||||
position:absolute;top:0;left:0; z-index:-1;width:3000px; height:3000px;}
|
||||
.ac_results {padding: 0px;border: 1px solid black;background-color: white;overflow: hidden;z-index: 99999;}
|
||||
.ac_results ul {width: 100%;list-style-position: outside;list-style: none;padding: 0;margin: 0;}
|
||||
.ac_results li {margin: 0px;padding: 2px 5px;cursor: default;display: block;
|
||||
/* if width will be 100% horizontal scrollbar will apear
|
||||
when scroll mode will be used */
|
||||
/*width: 100%;*/
|
||||
font: menu;
|
||||
font-size: 12px;
|
||||
/* it is very important, if line-height not setted or setted
|
||||
in relative units scroll will be broken in firefox */
|
||||
line-height: 16px; overflow: hidden;
|
||||
}
|
||||
.ac_loading {background: #ffffff url('indicator.gif') right center no-repeat; }
|
||||
.ac_odd {background-color: #eee;}
|
||||
.ac_over {background-color: navy;color: white;font-weight: bold;}
|
||||
.ac_input {border: 1px solid WindowFrame;background-color: #FBFBFB;}
|
||||
|
||||
|
||||
/* Component containers
|
||||
----------------------------------*/
|
||||
.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; }
|
||||
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; }
|
||||
.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; }
|
||||
.ui-widget-content a { color: #333333; }
|
||||
|
||||
.ui-widget-header { border: 1px solid #e78f08; background: #f6a828; color: #ffffff; font-weight: bold; }
|
||||
.ui-widget-header a { color: #ffffff; }
|
||||
|
||||
/* Date picker specific styles follow */
|
||||
.ui-datepicker { font-size:smaller; width: 17em; padding: .2em .2em 0;}
|
||||
.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
||||
.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
||||
.ui-datepicker .ui-datepicker-prev { left:2px; }
|
||||
.ui-datepicker .ui-datepicker-next { right:2px; }
|
||||
.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
||||
.ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
||||
.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
||||
.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
||||
.ui-datepicker .ui-datepicker-title select { float:left; font-size:1em; margin:1px 0; }
|
||||
.ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
||||
.ui-datepicker select.ui-datepicker-month,
|
||||
.ui-datepicker select.ui-datepicker-year { width: 49%;}
|
||||
.ui-datepicker .ui-datepicker-title select.ui-datepicker-year { float: right; }
|
||||
.ui-datepicker table {border:1px;width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
||||
.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
||||
.ui-datepicker td { border: 0; padding: 1px; }
|
||||
.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
||||
.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
||||
div.datepicker {
|
||||
position: relative;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
width: 196px;
|
||||
height: 147px;
|
||||
position: absolute;
|
||||
cursor: default;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: none;
|
||||
}
|
||||
.datepickerContainer {
|
||||
background: #121212;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
left: 10px;
|
||||
}
|
||||
@@ -0,0 +1,356 @@
|
||||
<?php
|
||||
/* Copyright (C) 2006 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
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
|
||||
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and.
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at>.
|
||||
*/
|
||||
/**
|
||||
* Klasse standort
|
||||
* @create 02-03-2010
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class standort extends basis_db
|
||||
{
|
||||
public $new; // boolean
|
||||
public $result = array(); // standort Objekt
|
||||
|
||||
//Tabellenspalten
|
||||
public $standort_id; // integer
|
||||
public $adresse_id; // integer
|
||||
public $kurzbz; // string
|
||||
public $bezeichnung; // string
|
||||
public $updateamum; // timestamp
|
||||
public $updatevon; // string
|
||||
public $insertamum; // timestamp
|
||||
public $insertvon; // string
|
||||
public $ext_id; // integer
|
||||
public $firma_id; // integer
|
||||
|
||||
public $personfunktionstandort_id; // integer
|
||||
public $person_id; // integer
|
||||
public $funktion_kurzbz; // string
|
||||
public $position; // string
|
||||
public $anrede; // string
|
||||
|
||||
public $funktion_beschreibung; // string
|
||||
public $funktion_aktiv; // boolean
|
||||
public $funktion_fachbereich; // string
|
||||
public $funktion_semester; // string
|
||||
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param $adress_id ID der standort die geladen werden soll (Default=null)
|
||||
*/
|
||||
public function __construct($standort_id=null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if(!is_null($standort_id))
|
||||
$this->load($standort_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die standort mit der ID $standort_id
|
||||
* @param $adress_id ID der zu ladenden standort
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load($standort_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
|
||||
//Pruefen ob adress_id eine gueltige Zahl ist
|
||||
if(!is_numeric($standort_id) || $standort_id == '')
|
||||
{
|
||||
$this->errormsg = 'standort_id muss eine Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Daten aus der Datenbank lesen
|
||||
$qry = "SELECT * FROM public.tbl_standort WHERE standort_id='".addslashes($standort_id)."'";
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->standort_id = $row->standort_id;
|
||||
$this->adresse_id = $row->adresse_id;
|
||||
$this->kurzbz = $row->kurzbz;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->ext_id = $row->ext_id;
|
||||
$this->firma_id = $row->firma_id;
|
||||
$this->result[] = $row;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Es ist kein Datensatz mit dieser ID vorhanden';
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle Standort zu der Adress ID die uebergeben wird
|
||||
* @param adress_id ID der Adresse zu der die standortn geladen werden sollen
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load_pers($adress_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
|
||||
//Pruefen ob pers_id eine gueltige Zahl ist
|
||||
if(!is_numeric($adress_id) || $adress_id == '')
|
||||
{
|
||||
$this->errormsg = 'Adressen ID muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Lesen der Daten aus der Datenbank
|
||||
$qry = "SELECT * FROM public.tbl_standort WHERE adress_id='".addslashes($adress_id)."'";
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->standort_id = $row->standort_id;
|
||||
$this->adresse_id = $row->adresse_id;
|
||||
$this->kurzbz = $row->kurzbz;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->updateamum = $row->updateamum;
|
||||
$this->updatevon = $row->updatevon;
|
||||
$this->insertamum = $row->insertamum;
|
||||
$this->insertvon = $row->insertvon;
|
||||
$this->ext_id = $row->ext_id;
|
||||
$this->firma_id = $row->firma_id;
|
||||
$this->result[] = $row;
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle standortn zu der Firma die uebergeben wird
|
||||
* @param $firma_id ID der Firma zu der die standortn geladen werden sollen
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function load_firma($firma_id)
|
||||
{
|
||||
$this->result=array();
|
||||
$this->errormsg = '';
|
||||
|
||||
//Pruefen ob pers_id eine gueltige Zahl ist
|
||||
if(!is_numeric($firma_id) || $firma_id == '')
|
||||
{
|
||||
$this->errormsg = 'firma_id muss eine gültige Zahl sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
//Lesen der Daten aus der Datenbank
|
||||
$qry = "SELECT * FROM public.tbl_standort WHERE firma_id='".addslashes($firma_id)."'";
|
||||
|
||||
if(!$this->db_query($qry))
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$adr_obj = new standort();
|
||||
|
||||
$adr_obj->standort_id = $row->standort_id;
|
||||
$adr_obj->adresse_id = $row->adresse_id;
|
||||
$adr_obj->kurzbz = $row->kurzbz;
|
||||
$adr_obj->bezeichnung = $row->bezeichnung;
|
||||
$adr_obj->updateamum = $row->updateamum;
|
||||
$adr_obj->updatevon = $row->updatevon;
|
||||
$adr_obj->insertamum = $row->insertamum;
|
||||
$adr_obj->insertvon = $row->insertvon;
|
||||
$adr_obj->ext_id = $row->ext_id;
|
||||
$adr_obj->firma_id = $row->firma_id;
|
||||
|
||||
$this->result[] = $adr_obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prueft die Variablen auf Gueltigkeit
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
protected function validate()
|
||||
{
|
||||
//Zahlenfelder pruefen
|
||||
if(!is_numeric($this->standort_id) && $this->standort_id!='')
|
||||
{
|
||||
$this->errormsg='Standort_id enthaelt ungueltige Zeichen';
|
||||
return false;
|
||||
}
|
||||
if(!is_numeric($this->adresse_id) && $this->adresse_id!='')
|
||||
{
|
||||
$this->errormsg='Adresse_id enthaelt ungueltige Zeichen';
|
||||
return false;
|
||||
}
|
||||
if(!is_numeric($this->firma_id) && $this->firma_id!='')
|
||||
{
|
||||
$this->errormsg='Firma_id enthaelt ungueltige Zeichen';
|
||||
return false;
|
||||
}
|
||||
|
||||
if(mb_strlen($this->kurzbz)>16)
|
||||
{
|
||||
$this->errormsg = 'Plz darf nicht länger als 10 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
if(mb_strlen($this->bezeichnung)>255)
|
||||
{
|
||||
$this->errormsg = 'bezeichnung darf nicht länger als 255 Zeichen sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$this->errormsg = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert den aktuellen Datensatz in die Datenbank
|
||||
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
|
||||
* andernfalls wird der Datensatz mit der ID in $standort_id aktualisiert
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
//Variablen pruefen
|
||||
if(!$this->validate())
|
||||
return false;
|
||||
|
||||
if($this->new)
|
||||
{
|
||||
//Neuen Datensatz einfuegen
|
||||
$qry='BEGIN;INSERT INTO public.tbl_standort (adresse_id,kurzbz, bezeichnung, insertamum, insertvon
|
||||
, updateamum, updatevon, ext_id, firma_id) VALUES('.
|
||||
($this->adresse_id!=null?$this->addslashes($this->adresse_id):'null').', '.
|
||||
$this->addslashes($this->kurzbz).', '.
|
||||
$this->addslashes($this->bezeichnung).', now(), '.
|
||||
$this->addslashes($this->insertvon).', now(), '.
|
||||
$this->addslashes($this->updatevon).', '.
|
||||
($this->ext_id!=null?$this->addslashes($this->ext_id):'null').', '.
|
||||
($this->firma_id!=null?$this->addslashes($this->firma_id):'null').');';
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(!is_numeric($this->standort_id))
|
||||
{
|
||||
$this->errormsg = 'standort_id muss eine gültige Zahl sein: '.$this->standort_id."\n";
|
||||
return false;
|
||||
}
|
||||
$qry='UPDATE public.tbl_standort SET'.
|
||||
' adresse_id='.$this->addslashes($this->adresse_id).', '.
|
||||
' kurzbz='.$this->addslashes($this->kurzbz).', '.
|
||||
' bezeichnung='.$this->addslashes($this->bezeichnung).', '.
|
||||
' firma_id='.$this->addslashes($this->firma_id).','.
|
||||
' updateamum= now(), '.
|
||||
' updatevon='.$this->addslashes($this->updatevon).' '.
|
||||
'WHERE standort_id='.$this->standort_id.';';
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($this->new)
|
||||
{
|
||||
//naechste ID aus der Sequence holen
|
||||
$qry="SELECT currval('public.tbl_standort_standort_id_seq') as id;";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object())
|
||||
{
|
||||
$this->standort_id = $row->id;
|
||||
$this->db_query('COMMIT');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = "Fehler beim Auslesen der Sequence";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->db_query('ROLLBACK');
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern des Adress-Datensatzes';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loescht den Datenensatz mit der ID die uebergeben wird
|
||||
* @param $standort_id ID die geloescht werden soll
|
||||
* @return true wenn ok, false im Fehlerfall
|
||||
*/
|
||||
public function delete($standort_id)
|
||||
{
|
||||
//Pruefen ob standort_id eine gueltige Zahl ist
|
||||
if(!is_numeric($standort_id) || $standort_id == '')
|
||||
{
|
||||
$this->errormsg = 'standort_id muss eine gültige Zahl sein'."\n";
|
||||
return false;
|
||||
}
|
||||
//loeschen des Datensatzes
|
||||
$qry="DELETE FROM public.tbl_standort WHERE standort_id='".addslashes($standort_id)."';";
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Löschen der Daten'."\n";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user