new method for application form

This commit is contained in:
Robert Hofer
2015-03-20 10:44:56 +01:00
parent dde1fc6daf
commit 61dca94bf2
+458 -402
View File
@@ -1,402 +1,458 @@
<?php <?php
/* Copyright (C) 2011 FH Technikum-Wien /* Copyright (C) 2011 FH 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and * Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
*/ */
require_once(dirname(__FILE__).'/basis_db.class.php'); require_once(dirname(__FILE__).'/basis_db.class.php');
class notiz extends basis_db class notiz extends basis_db
{ {
public $new; public $new;
public $result=array(); public $result=array();
//Tabellenspalten //Tabellenspalten
public $notiz_id; public $notiz_id;
public $titel; public $titel;
public $text; public $text;
public $verfasser_uid; public $verfasser_uid;
public $bearbeiter_uid; public $bearbeiter_uid;
public $start; public $start;
public $ende; public $ende;
public $erledigt; public $erledigt;
public $insertamum; public $insertamum;
public $insertvon; public $insertvon;
public $updateamum; public $updateamum;
public $updatevon; public $updatevon;
/** public $projekt_kurzbz;
* Konstruktor public $projektphase_id;
* @param $notiz_id public $projekttask_id;
*/ public $uid;
public function __construct($notiz_id = null) public $person_id;
{ public $prestudent_id;
parent::__construct(); public $bestellung_id;
public $lehreinheit_id;
if($notiz_id != null) public $anrechnung_id;
$this->load($notiz_id);
} /**
* Konstruktor
/** * @param $notiz_id
* Laedt eine Notiz */
* @param $notiz_id public function __construct($notiz_id = null)
* @return true wenn ok, false im Fehlerfall {
*/ parent::__construct();
public function load($notiz_id)
{ if($notiz_id != null)
if(!is_numeric($notiz_id)) $this->load($notiz_id);
{ }
$this->errormsg = 'NotizID ist ungueltig';
return false; /**
} * Laedt eine Notiz
* @param $notiz_id
$qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); * @return true wenn ok, false im Fehlerfall
*/
if($this->db_query($qry)) public function load($notiz_id)
{ {
if($row = $this->db_fetch_object()) if(!is_numeric($notiz_id))
{ {
$this->notiz_id=$row->notiz_id; $this->errormsg = 'NotizID ist ungueltig';
$this->titel=$row->titel; return false;
$this->text=$row->text; }
$this->verfasser_uid=$row->verfasser_uid;
$this->bearbeiter_uid=$row->bearbeiter_uid; $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER);
$this->start=$row->start;
$this->ende=$row->ende; if($this->db_query($qry))
$this->erledigt=$this->db_parse_bool($row->erledigt); {
$this->insertamum=$row->insertamum; if($row = $this->db_fetch_object())
$this->insertvon=$row->insertvon; {
$this->updateamum=$row->updateamum; $this->notiz_id=$row->notiz_id;
$this->updatevon=$row->updatevon; $this->titel=$row->titel;
$this->text=$row->text;
return true; $this->verfasser_uid=$row->verfasser_uid;
} $this->bearbeiter_uid=$row->bearbeiter_uid;
else $this->start=$row->start;
{ $this->ende=$row->ende;
$this->errormsg = 'Datensatz wurde nicht gefunden'; $this->erledigt=$this->db_parse_bool($row->erledigt);
return false; $this->insertamum=$row->insertamum;
} $this->insertvon=$row->insertvon;
} $this->updateamum=$row->updateamum;
else $this->updatevon=$row->updatevon;
{
$this->errormsg = 'Fehler beim Laden der Daten'; return true;
return false; }
} else
} {
$this->errormsg = 'Datensatz wurde nicht gefunden';
/** return false;
* Löscht eine Notiz }
* @param $notiz_id }
* @return true wenn ok, false im Fehlerfall else
*/ {
public function delete($notiz_id) $this->errormsg = 'Fehler beim Laden der Daten';
{ return false;
if(!is_numeric($notiz_id)) }
{ }
$this->errormsg = 'NotizID ist ungueltig';
return false; /**
} * Löscht eine Notiz
* @param $notiz_id
$qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); * @return true wenn ok, false im Fehlerfall
*/
if(!$this->db_query($qry)) public function delete($notiz_id)
{ {
$this->errormsg = 'Fehler beim Loeschen der Daten'; if(!is_numeric($notiz_id))
return false; {
} $this->errormsg = 'NotizID ist ungueltig';
return true; return false;
} }
/** $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER);
* Prueft die Daten vor dem Speichern
* auf Gueltigkeit if(!$this->db_query($qry))
*/ {
public function validate() $this->errormsg = 'Fehler beim Loeschen der Daten';
{ return false;
return true; }
} return true;
}
/**
* Speichert den aktuellen Datensatz in die Datenbank /**
* Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt * Prueft die Daten vor dem Speichern
* andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert * auf Gueltigkeit
* @return true wenn ok, false im Fehlerfall */
*/ public function validate()
public function save($new=null) {
{ return true;
if($new==null) }
$new=$this->new;
/**
if(!$this->validate()) * Speichert den aktuellen Datensatz in die Datenbank
return false; * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt
* andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert
if($new) * @return true wenn ok, false im Fehlerfall
{ */
//Neuen Datensatz einfuegen public function save($new=null)
$qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, {
bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, if($new==null)
updateamum, updatevon) VALUES('. $new=$this->new;
$this->db_add_param($this->titel).', '.
$this->db_add_param($this->text).', '. if(!$this->validate())
$this->db_add_param($this->verfasser_uid).','. return false;
$this->db_add_param($this->bearbeiter_uid).','.
$this->db_add_param($this->start).','. if($new)
$this->db_add_param($this->ende).','. {
$this->db_add_param($this->erledigt,FHC_BOOLEAN).','. //Neuen Datensatz einfuegen
$this->db_add_param($this->insertamum).','. $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid,
$this->db_add_param($this->insertvon).','. bearbeiter_uid, start, ende, erledigt, insertamum, insertvon,
$this->db_add_param($this->updateamum).','. updateamum, updatevon) VALUES('.
$this->db_add_param($this->updatevon).');'; $this->db_add_param($this->titel).', '.
} $this->db_add_param($this->text).', '.
else $this->db_add_param($this->verfasser_uid).','.
{ $this->db_add_param($this->bearbeiter_uid).','.
$qry='UPDATE public.tbl_notiz SET '. $this->db_add_param($this->start).','.
'titel='.$this->db_add_param($this->titel).', '. $this->db_add_param($this->ende).','.
'text='.$this->db_add_param($this->text).', '. $this->db_add_param($this->erledigt,FHC_BOOLEAN).','.
'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. $this->db_add_param($this->insertamum).','.
'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. $this->db_add_param($this->insertvon).','.
'start='.$this->db_add_param($this->start).', '. $this->db_add_param($this->updateamum).','.
'ende='.$this->db_add_param($this->ende).', '. $this->db_add_param($this->updatevon).');';
'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. }
'updateamum='.$this->db_add_param($this->updateamum).', '. else
'updatevon='.$this->db_add_param($this->updatevon).' '. {
'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; $qry='UPDATE public.tbl_notiz SET '.
} 'titel='.$this->db_add_param($this->titel).', '.
'text='.$this->db_add_param($this->text).', '.
if($this->db_query($qry)) 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '.
{ 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '.
if($new) 'start='.$this->db_add_param($this->start).', '.
{ 'ende='.$this->db_add_param($this->ende).', '.
$qry="SELECT currval('seq_notiz_notiz_id') as id;"; 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '.
if($result = $this->db_query($qry)) 'updateamum='.$this->db_add_param($this->updateamum).', '.
{ 'updatevon='.$this->db_add_param($this->updatevon).' '.
if($row = $this->db_fetch_object($result)) 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';';
{ }
$this->notiz_id = $row->id;
$this->db_query('COMMIT;'); if($this->db_query($qry))
return true; {
} if($new)
else {
{ $qry="SELECT currval('seq_notiz_notiz_id') as id;";
$this->errormsg = 'Fehler beim Lesen der Sequence'; if($result = $this->db_query($qry))
$this->db_query('ROLLBACK'); {
return false; if($row = $this->db_fetch_object($result))
} {
} $this->notiz_id = $row->id;
else $this->db_query('COMMIT;');
{ return true;
$this->errormsg = 'Fehler beim Lesen der Sequence'; }
$this->db_query('ROLLBACK'); else
return false; {
} $this->errormsg = 'Fehler beim Lesen der Sequence';
} $this->db_query('ROLLBACK');
return true; return false;
} }
else }
{ else
$this->errormsg = 'Fehler beim Speichern des Datensatzes'; {
return false; $this->errormsg = 'Fehler beim Lesen der Sequence';
} $this->db_query('ROLLBACK');
} return false;
}
/** }
* Speichert die Zuordnung einer Notiz return true;
* }
*/ else
public function saveZuordnung() {
{ $this->errormsg = 'Fehler beim Speichern des Datensatzes';
$qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, return false;
uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". }
$this->db_add_param($this->notiz_id, FHC_INTEGER).','. }
$this->db_add_param($this->projekt_kurzbz).','.
$this->db_add_param($this->projektphase_id, FHC_INTEGER).','. /**
$this->db_add_param($this->projekttask_id, FHC_INTEGER).','. * Speichert die Zuordnung einer Notiz
$this->db_add_param($this->uid).','. *
$this->db_add_param($this->person_id, FHC_INTEGER).','. */
$this->db_add_param($this->prestudent_id, FHC_INTEGER).','. public function saveZuordnung()
$this->db_add_param($this->bestellung_id, FHC_INTEGER).','. {
$this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id,
$this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(".
$this->db_add_param($this->notiz_id, FHC_INTEGER).','.
if($this->db_query($qry)) $this->db_add_param($this->projekt_kurzbz).','.
{ $this->db_add_param($this->projektphase_id, FHC_INTEGER).','.
return true; $this->db_add_param($this->projekttask_id, FHC_INTEGER).','.
} $this->db_add_param($this->uid).','.
else $this->db_add_param($this->person_id, FHC_INTEGER).','.
{ $this->db_add_param($this->prestudent_id, FHC_INTEGER).','.
$this->errormsg = 'Fehler beim Speichern der Daten'; $this->db_add_param($this->bestellung_id, FHC_INTEGER).','.
return false; $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','.
} $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');';
}
if($this->db_query($qry))
/** {
* return true;
* Laedt die Notizen }
* @param $erledigt else
* @param $projekt_kurzbz {
* @param $projektphase_id $this->errormsg = 'Fehler beim Speichern der Daten';
* @param $projekttask_id return false;
* @param $uid }
* @param $person_id }
* @param $prestudent_id
* @param $bestellung_id /**
* @param $user *
* @param $lehreinheit_id * Laedt die Notizen
* @param $anrechnung_id * @param $erledigt
* @return boolean * @param $projekt_kurzbz
*/ * @param $projektphase_id
public function getNotiz($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $stundenplandev_id=null, $anrechnung_id=null) * @param $projekttask_id
{ * @param $uid
$qry = "SELECT * @param $person_id
* * @param $prestudent_id
FROM * @param $bestellung_id
public.tbl_notiz * @param $user
LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) * @param $lehreinheit_id
WHERE 1=1"; * @param $anrechnung_id
* @return boolean
if(!is_null($erledigt)) */
{ public function getNotiz($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $stundenplandev_id=null, $anrechnung_id=null)
if($erledigt) {
$qry.=" AND erledigt=true"; $qry = "SELECT
else *
$qry.=" AND erledigt=false"; FROM
} public.tbl_notiz
if($projekt_kurzbz!='') LEFT JOIN public.tbl_notizzuordnung USING(notiz_id)
$qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); WHERE 1=1";
if($projektphase_id!='')
$qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); if(!is_null($erledigt))
if($projekttask_id!='') {
$qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); if($erledigt)
if($uid!='') $qry.=" AND erledigt=true";
$qry.=" AND uid=".$this->db_add_param($uid); else
if($person_id!='') $qry.=" AND erledigt=false";
$qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); }
if($prestudent_id!='') if($projekt_kurzbz!='')
$qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz);
if($bestellung_id!='') if($projektphase_id!='')
$qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER);
if($user!='') if($projekttask_id!='')
$qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER);
if($lehreinheit_id!='') if($uid!='')
$qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); $qry.=" AND uid=".$this->db_add_param($uid);
if($anrechnung_id!='') if($person_id!='')
$qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER);
if($prestudent_id!='')
$qry.=' ORDER BY start, ende, titel'; $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER);
if($bestellung_id!='')
if($result = $this->db_query($qry)) $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER);
{ if($user!='')
while($row = $this->db_fetch_object($result)) $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")";
{ if($lehreinheit_id!='')
$obj = new notiz(); $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER);
if($anrechnung_id!='')
$obj->notiz_id=$row->notiz_id; $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER);
$obj->titel=$row->titel;
$obj->text=$row->text; $qry.=' ORDER BY start, ende, titel';
$obj->verfasser_uid=$row->verfasser_uid;
$obj->bearbeiter_uid=$row->bearbeiter_uid; if($result = $this->db_query($qry))
$obj->start=$row->start; {
$obj->ende=$row->ende; while($row = $this->db_fetch_object($result))
$obj->erledigt=$this->db_parse_bool($row->erledigt); {
$obj->insertamum=$row->insertamum; $obj = new notiz();
$obj->insertvon=$row->insertvon;
$obj->updateamum=$row->updateamum; $obj->notiz_id=$row->notiz_id;
$obj->updatevon=$row->updatevon; $obj->titel=$row->titel;
$obj->text=$row->text;
$this->result[] = $obj; $obj->verfasser_uid=$row->verfasser_uid;
} $obj->bearbeiter_uid=$row->bearbeiter_uid;
return true; $obj->start=$row->start;
} $obj->ende=$row->ende;
else $obj->erledigt=$this->db_parse_bool($row->erledigt);
{ $obj->insertamum=$row->insertamum;
$this->errormsg = 'Fehler beim Laden der Daten'; $obj->insertvon=$row->insertvon;
return false; $obj->updateamum=$row->updateamum;
} $obj->updatevon=$row->updatevon;
}
$this->result[] = $obj;
/** }
return true;
* }
else
* Laedt die Notizen {
* @param $erledigt $this->errormsg = 'Fehler beim Laden der Daten';
* @param $projekt_kurzbz return false;
* @param $projektphase_id }
* @param $projekttask_id }
* @param $uid
* @param $person_id /**
* @param $prestudent_id *
* @param $bestellung_id * Laedt die Notizen vom Bewerbungstool
* @param $user * @param $person_id int
* @param $lehreinheit_id * @return boolean
* @param $anrechnung_id */
* @return boolean public function getBewerbungstoolNotizen($person_id)
*/ {
public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) $qry = 'SELECT
{ *
$qry = "SELECT FROM
count(*) as anzahl public.tbl_notiz
FROM LEFT JOIN public.tbl_notizzuordnung USING(notiz_id)
public.tbl_notiz WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) .
LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) ' AND insertvon = ' . $this->db_add_param('Bewerbungstool') .
WHERE 1=1"; ' ORDER BY notiz_id';
if(!is_null($erledigt)) if($result = $this->db_query($qry))
{ {
if($erledigt) while($row = $this->db_fetch_object($result))
$qry.=" AND erledigt=true"; {
else $obj = new notiz();
$qry.=" AND erledigt=false";
} $obj->notiz_id=$row->notiz_id;
if($projekt_kurzbz!='') $obj->titel=$row->titel;
$qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); $obj->text=$row->text;
if($projektphase_id!='') $obj->verfasser_uid=$row->verfasser_uid;
$qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); $obj->bearbeiter_uid=$row->bearbeiter_uid;
if($projekttask_id!='') $obj->start=$row->start;
$qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); $obj->ende=$row->ende;
if($uid!='') $obj->erledigt=$this->db_parse_bool($row->erledigt);
$qry.=" AND uid=".$this->db_add_param($uid); $obj->insertamum=$row->insertamum;
if($person_id!='') $obj->insertvon=$row->insertvon;
$qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); $obj->updateamum=$row->updateamum;
if($prestudent_id!='') $obj->updatevon=$row->updatevon;
$qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER);
if($bestellung_id!='') $this->result[] = $obj;
$qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); }
if($user!='') return true;
$qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; }
if($lehreinheit_id!='') else
$qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); {
if($anrechnung_id!='') $this->errormsg = 'Fehler beim Laden der Daten';
$qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); return false;
}
if($result = $this->db_query($qry)) }
{
if($row = $this->db_fetch_object($result)) /**
return $row->anzahl;
else *
{
$this->errormsg='Fehler beim Laden der Daten'; * Laedt die Notizen
return false; * @param $erledigt
} * @param $projekt_kurzbz
} * @param $projektphase_id
else * @param $projekttask_id
{ * @param $uid
$this->errormsg = 'Fehler beim Laden der Daten'; * @param $person_id
return false; * @param $prestudent_id
} * @param $bestellung_id
} * @param $user
} * @param $lehreinheit_id
?> * @param $anrechnung_id
* @return boolean
*/
public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null)
{
$qry = "SELECT
count(*) as anzahl
FROM
public.tbl_notiz
LEFT JOIN public.tbl_notizzuordnung USING(notiz_id)
WHERE 1=1";
if(!is_null($erledigt))
{
if($erledigt)
$qry.=" AND erledigt=true";
else
$qry.=" AND erledigt=false";
}
if($projekt_kurzbz!='')
$qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz);
if($projektphase_id!='')
$qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER);
if($projekttask_id!='')
$qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER);
if($uid!='')
$qry.=" AND uid=".$this->db_add_param($uid);
if($person_id!='')
$qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER);
if($prestudent_id!='')
$qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER);
if($bestellung_id!='')
$qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER);
if($user!='')
$qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")";
if($lehreinheit_id!='')
$qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER);
if($anrechnung_id!='')
$qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER);
if($result = $this->db_query($qry))
{
if($row = $this->db_fetch_object($result))
return $row->anzahl;
else
{
$this->errormsg='Fehler beim Laden der Daten';
return false;
}
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}