* Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at > * Rudolf Hangl < rudolf.hangl@technikum-wien.at > * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > */ require_once('../../config/vilesci.config.inc.php'); require_once('../../include/globals.inc.php'); require_once('../../include/functions.inc.php'); require_once('../../include/ort.class.php'); require_once('../../include/benutzerberechtigung.class.php'); require_once('../../include/ortraumtyp.class.php'); require_once('../../include/raumtyp.class.php'); require_once('../../include/standort.class.php'); if (!$db = new basis_db()) die('Es konnte keine Verbindung zum Server aufgebaut werden.'); $user = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); if(!$rechte->isBerechtigt('basis/ort',null,'s')) die('Sie haben keine Berechtigung fuer diese Seite'); $reloadstr = ''; // neuladen der liste im oberen frame $htmlstr = ''; $errorstr = ''; //fehler beim insert $sel = ''; $chk = ''; $sg_var = new ort(); $ort_kurzbz = ''; $bezeichnung = ''; $planbezeichnung = ''; $max_person = ''; $lehre = "t"; $reservieren = "f"; $aktiv = "t"; $lageplan = ''; $dislozierung = ''; $kosten = ''; $ausstattung = ''; $stockwerk = ''; $standort_id = ''; $telefonklappe = ''; $content_id=''; $ort_kurzbz_old = ''; $oe_kurzbz=''; $gebteil=''; $m2=''; $arbeitsplaetze=''; $neu = "true"; if(isset($_POST["schick"]) || isset($_POST["kopieren"])) { if(!$rechte->isBerechtigt('basis/ort', null, 'suid')) die('Sie haben keine Berechtigung fuer diese Aktion'); $ort_kurzbz = $_POST["ort_kurzbz"]; $bezeichnung = $_POST["bezeichnung"]; $planbezeichnung = $_POST["planbezeichnung"]; $max_person = $_POST["max_person"]; $lageplan = $_POST["lageplan"]; $dislozierung = $_POST["dislozierung"]; $kosten = $_POST["kosten"]; $ausstattung = $_POST["ausstattung"]; $stockwerk = $_POST["stockwerk"]; $standort_id = $_POST["standort_id"]; $telefonklappe = $_POST["telefonklappe"]; $content_id = $_POST['content_id']; $ort_kurzbz_old = $_POST["ort_kurzbz_old"]; $m2 = str_replace(',','.',$_POST["m2"]); $oe_kurzbz = $_POST["oe_kurzbz"]; $gebteil = $_POST["gebteil"]; $arbeitsplaetze = $_POST["arbeitsplaetze"]; $sg_update = new ort(); $sg_update->ort_kurzbz = $ort_kurzbz; $sg_update->bezeichnung = $bezeichnung; $sg_update->planbezeichnung = $planbezeichnung; $sg_update->max_person = $max_person; $sg_update->lehre = isset($_POST["lehre"]); $sg_update->reservieren = isset($_POST["reservieren"]); $sg_update->aktiv = isset($_POST["aktiv"]); $sg_update->lageplan = $lageplan; $sg_update->dislozierung = $dislozierung; $sg_update->kosten = $kosten; $sg_update->ausstattung = $ausstattung; $sg_update->stockwerk = $stockwerk; $sg_update->telefonklappe = $telefonklappe; $sg_update->standort_id = $standort_id; $sg_update->content_id = $content_id; $sg_update->ort_kurzbz_old = $ort_kurzbz_old; $sg_update->m2 = $m2; $sg_update->gebteil = $gebteil; $sg_update->oe_kurzbz = $oe_kurzbz; $sg_update->arbeitsplaetze = $arbeitsplaetze; $sg_update->updateamum = date('Y-m-d H:i:s'); $sg_update->updatevon = $user; if ($_POST["neu"] == "true" || isset($_POST["kopieren"])) { $sg_update->insertamum = date('Y-m-d H:i:s'); $sg_update->insertvon = $user; $sg_update->new = 1; } if(!$sg_update->save()) { $errorstr .= $sg_update->errormsg; } $reloadstr .= "\n"; } if ((isset($_REQUEST['ort_kurzbz'])) && ((!isset($_REQUEST['neu'])) || ($_REQUEST['neu']!= "true"))) { $ort_kurzbz = $_REQUEST["ort_kurzbz"]; $sg = new ort($ort_kurzbz); if ($sg->errormsg!='') die($sg->errormsg); $ort_kurzbz = $sg->ort_kurzbz; $bezeichnung = $sg->bezeichnung; $planbezeichnung = $sg->planbezeichnung; $max_person = $sg->max_person; $lehre = $sg->lehre; $reservieren = $sg->reservieren; $aktiv = $sg->aktiv; $lageplan = $sg->lageplan; $dislozierung = $sg->dislozierung; $kosten = $sg->kosten; $ausstattung = $sg->ausstattung; $stockwerk = $sg->stockwerk; $standort_id = $sg->standort_id; $telefonklappe = $sg->telefonklappe; $content_id = $sg->content_id; $gebteil = $sg->gebteil; $m2 = $sg->m2; $oe_kurzbz = $sg->oe_kurzbz; $arbeitsplaetze = $sg->arbeitsplaetze; $neu = "false"; } if(isset($_GET['type']) && $_GET['type']=='raumtyp') { if($ort_kurzbz=='') die('OrtKurzbz fehlt'); $ort = new ort(); if(!$ort->load($ort_kurzbz)) die($ort->errormsg); if(isset($_GET['method'])) { if(!$rechte->isBerechtigt('basis/ort',null,'suid')) die('Sie haben keine Berechtigung fuer diese Seite'); switch($_GET['method']) { case 'delete': //Zuordnung zu einem Raumtyp entfernen $ortraumtyp = new ortraumtyp(); $ortraumtyp->delete($ort_kurzbz, $_GET['raumtyp_kurzbz']); break; case 'add': //Zuordnung zu einem Raumtyp hinzufuegen $ortraumtyp = new ortraumtyp(); $ortraumtyp->ort_kurzbz = $ort_kurzbz; $ortraumtyp->raumtyp_kurzbz = $_POST['raumtyp_kurzbz']; $ortraumtyp->hierarchie = $_POST['hierarchie']; $ortraumtyp->new=true; if(!$ortraumtyp->save()) $htmlstr.='Fehler beim Speichern '.$ortraumtyp->errormsg; break; case 'neu': // Anlegen eines neuen Raumtyps $raumtyp=new raumtyp(); $raumtyp->new=true; $raumtyp->raumtyp_kurzbz=$_POST['raumtyp_kurzbz']; $raumtyp->beschreibung = $_POST['beschreibung']; $raumtyp->save(); break; } } $htmlstr.='
| Raumtyp | Kurzbz | Hierarchie | '; $hierarchiemax=0; foreach($ortraumtyp->result as $row) { if($row->hierarchie>$hierarchiemax) $hierarchiemax=$row->hierarchie; $htmlstr.= ' |
|---|---|---|---|
| '.$row->beschreibung.' | '.$row->raumtyp_kurzbz.' | '.$row->hierarchie.' | Entfernen |