This commit is contained in:
Gerald Simane
2009-07-09 11:09:57 +00:00
parent 449d443962
commit 12abdb4ba7
4 changed files with 1161 additions and 1161 deletions
File diff suppressed because it is too large Load Diff
+128 -128
View File
@@ -1,129 +1,129 @@
<?php <?php
/* Copyright (C) 2007 Technikum-Wien /* Copyright (C) 2007 Technikum-Wien
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as * it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
* *
* Authors: Christian Paminger <[email protected]>, * Authors: Christian Paminger <[email protected]>,
* Andreas Oesterreicher <[email protected]> and * Andreas Oesterreicher <[email protected]> and
* Rudolf Hangl <[email protected]>. * Rudolf Hangl <[email protected]>.
*/ */
/** /**
* Klasse aufmerksamdurch * Klasse aufmerksamdurch
* @create 02-01-2007 * @create 02-01-2007
*/ */
require_once(dirname(__FILE__).'/basis_db.class.php'); require_once(dirname(__FILE__).'/basis_db.class.php');
class aufmerksamdurch extends basis_db class aufmerksamdurch extends basis_db
{ {
public $new; public $new;
public $result = array(); public $result = array();
//Tabellenspalten //Tabellenspalten
public $aufmerksamdurch_kurzbz; public $aufmerksamdurch_kurzbz;
public $beschreibung; public $beschreibung;
public $ext_id; public $ext_id;
/** /**
* Konstruktor * Konstruktor
* @param $aufmerksamdurch_kurzbz = ID (Default=null) * @param $aufmerksamdurch_kurzbz = ID (Default=null)
*/ */
public function __construct($aufmerksamdurch_kurzbz=null) public function __construct($aufmerksamdurch_kurzbz=null)
{ {
parent::__construct(); parent::__construct();
if(!is_null($aufmerksamdurch_kurzbz)) if(!is_null($aufmerksamdurch_kurzbz))
$this->load($aufmerksamdurch_kurzbz); $this->load($aufmerksamdurch_kurzbz);
} }
/** /**
* Laedt einen Datensatz * Laedt einen Datensatz
* @param $aufmerksam_kurzbz ID * @param $aufmerksam_kurzbz ID
* @return true wenn ok, false im Fehlerfall * @return true wenn ok, false im Fehlerfall
*/ */
public function load($aufmerksam_kurzbz) public function load($aufmerksam_kurzbz)
{ {
//noch nicht implementiert //noch nicht implementiert
return false; return false;
} }
/** /**
* Laedt alle Datansaetze * Laedt alle Datansaetze
* @return true wenn ok, false im Fehlerfall * @return true wenn ok, false im Fehlerfall
*/ */
public function getAll($orderby='aufmerksamdurch_kurzbz') public function getAll($orderby='aufmerksamdurch_kurzbz')
{ {
$qry = "SELECT * FROM public.tbl_aufmerksamdurch"; $qry = "SELECT * FROM public.tbl_aufmerksamdurch";
if($orderby!='') if($orderby!='')
$qry .= " ORDER BY ".$orderby; $qry .= " ORDER BY ".$orderby;
if($this->db_query($qry)) if($this->db_query($qry))
{ {
while($row = $this->db_fetch_object()) while($row = $this->db_fetch_object())
{ {
$obj = new aufmerksamdurch(); $obj = new aufmerksamdurch();
$obj->aufmerksamdurch_kurzbz = $row->aufmerksamdurch_kurzbz; $obj->aufmerksamdurch_kurzbz = $row->aufmerksamdurch_kurzbz;
$obj->beschreibung = $row->beschreibung; $obj->beschreibung = $row->beschreibung;
$this->result[] = $obj; $this->result[] = $obj;
} }
return true; return true;
} }
else else
{ {
$this->errormsg = 'Fehler beim Laden'; $this->errormsg = 'Fehler beim Laden';
return false; return false;
} }
} }
/** /**
* Speichert den aktuellen Datensatz in die Datenbank * Speichert den aktuellen Datensatz in die Datenbank
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
* andernfalls wird der Datensatz mit der ID in $schluessel_id aktualisiert * andernfalls wird der Datensatz mit der ID in $schluessel_id aktualisiert
* @return true wenn ok, false im Fehlerfall * @return true wenn ok, false im Fehlerfall
*/ */
public function save() public function save()
{ {
if($this->new) if($this->new)
{ {
//Neuen Datensatz einfuegen //Neuen Datensatz einfuegen
$qry='INSERT INTO public.tbl_aufmerksamdurch (aufmerksamdurch_kurzbz, beschreibung, ext_id) VALUES('. $qry='INSERT INTO public.tbl_aufmerksamdurch (aufmerksamdurch_kurzbz, beschreibung, ext_id) VALUES('.
$this->addslashes($this->aufmerksamdurch_kurzbz).', '. $this->addslashes($this->aufmerksamdurch_kurzbz).', '.
$this->addslashes($this->beschreibung).', '. $this->addslashes($this->beschreibung).', '.
$this->addslashes($this->ext_id).');'; $this->addslashes($this->ext_id).');';
} }
else else
{ {
$qry='UPDATE public.tbl_aufmerksamdurch SET '. $qry='UPDATE public.tbl_aufmerksamdurch SET '.
'beschreibung='.$this->addslashes($this->beschreibung).', '. 'beschreibung='.$this->addslashes($this->beschreibung).', '.
'ext_id='.$this->addslashes($this->ext_id).' '. 'ext_id='.$this->addslashes($this->ext_id).' '.
'WHERE aufmerksamdurch_kurzbz='.$this->addslashes($this->aufmerksamdurch_kurzbz).';'; 'WHERE aufmerksamdurch_kurzbz='.$this->addslashes($this->aufmerksamdurch_kurzbz).';';
} }
if(pg_query($this->conn, $qry)) if($this->db_query($qry))
{ {
return true; return true;
} }
else else
{ {
$this->errormsg = 'Fehler beim Speichern der Daten'; $this->errormsg = 'Fehler beim Speichern der Daten';
return false; return false;
} }
} }
} }
?> ?>
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -299,7 +299,7 @@ class lehrstunde extends basis_db
if (!$result_einheit=$this->db_query($sql_query)) if (!$result_einheit=$this->db_query($sql_query))
{ {
$this->errormsg=pg_last_error($this->conn); $this->errormsg=$this->db_last_error($this->conn);
return false; return false;
} }
else else