From eccfe1c370489401f199b53e6c6a1628b182a793 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Fri, 9 Sep 2011 09:58:35 +0000 Subject: [PATCH] =?UTF-8?q?getPhaseRessourcen()=20hinzugef=C3=BCgt=20l?= =?UTF-8?q?=C3=A4dt=20alle=20Ressourcen=20zu=20einer=20Phase?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/ressource.class.php | 50 ++++++++++++++++++++++++++++++++++--- 1 file changed, 47 insertions(+), 3 deletions(-) diff --git a/include/ressource.class.php b/include/ressource.class.php index 4709be2c6..d23c0b1dd 100644 --- a/include/ressource.class.php +++ b/include/ressource.class.php @@ -138,14 +138,58 @@ class ressource extends basis_db /** * - * Enter description here ... - * @param unknown_type $project_kurzbz + * Lädt alle Ressourcen zu einem Projekt + * @param $project_kurzbz + * @return true wenn ok, false im Fehlerfall */ public function getProjectRessourcen($project_kurzbz) { $qry = "SELECT ressource.* FROM fue.tbl_ressource as ressource JOIN fue.tbl_projekt_ressource project ON(project.projekt_ressource_id = ressource.ressource_id) - WHERE project.projekt_kurzbz ='".addslashes($projekt_kurzbz)."';"; + WHERE project.projekt_kurzbz ='".addslashes($project_kurzbz)."';"; + + $this->result=array(); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $obj = new ressource(); + + $obj->ressource_id = $row->ressource_id; + $obj->bezeichnung = $row->bezeichnung; + $obj->beschreibung = $row->beschreibung; + $obj->mitarbeiter_uid = $row->mitarbeiter_uid; + $obj->student_uid = $row->student_uid; + $obj->betriebsmittel_id = $row->betriebsmittel_id; + $obj->firma_id = $row->firma_id; + $obj->insertamum = $row->insertamum; + $obj->insertvon = $row->insertvon; + $obj->updateamum = $row->updateamum; + $obj->updatevon = $row->updatevon; + $this->result[] = $obj; + } + //var_dump($this->result); + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * + * Lädt alle Ressourcen zu einer Phase + * @param $project_kurzbz + * @return true wenn ok, false im Fehlerfall + */ + public function getPhaseRessourcen($projektphase_id) + { + $qry = "SELECT ressource.* FROM fue.tbl_ressource as ressource + JOIN fue.tbl_projekt_ressource project ON(project.projekt_ressource_id = ressource.ressource_id) + WHERE project.projektphase_id ='".addslashes($projektphase_id)."';"; $this->result=array();