From c7db68bdb9dc30e30530e76cfa50d29916dd32c1 Mon Sep 17 00:00:00 2001 From: Karl Burkhart Date: Mon, 22 Oct 2012 14:08:50 +0000 Subject: [PATCH] =?UTF-8?q?Umfragenbeteiligte=20kann=20den=20Coodletermin?= =?UTF-8?q?=20best=C3=A4tigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/public/coodle.php | 210 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100755 cis/public/coodle.php diff --git a/cis/public/coodle.php b/cis/public/coodle.php new file mode 100755 index 000000000..c840b43f5 --- /dev/null +++ b/cis/public/coodle.php @@ -0,0 +1,210 @@ + + */ + + + +require_once('../../config/cis.config.inc.php'); +require_once('../../include/phrasen.class.php'); +require_once('../../include/functions.inc.php'); +require_once('../../include/coodle.class.php'); + +if(isset($_GET['lang'])) + setSprache($_GET['lang']); + +$sprache = getSprache(); +$p=new phrasen($sprache); + +$message = ''; + +$coodle_id = (isset($_GET['coodle_id'])?$_GET['coodle_id']:''); + +$coodle = new coodle(); +if(!$coodle->load($coodle_id)) + die($coodle->errormsg); + +// authentifizierung +if(!isset($_GET['zugangscode'])) + $uid = get_uid(); + +// checkboxen speichern +if(isset ($_POST['save'])) +{ + $coodle_help = new coodle(); + + // Ressource ID von Zugangscode oder UID holen und Beiträge löschen + if(isset($_GET['zugangscode'])) + { + + $coodle_help->getRessourceFromUser($coodle_id, '', $_GET['zugangscode']); + $coodle_ressource_termin= $coodle_help->deleteRessourceTermin($coodle_help->coodle_ressource_id, $coodle_id); + } + else + { + if($coodle_help->RessourceExists($coodle_id, $uid)) + { + $coodle_help->getRessourceFromUser($coodle_id, $uid); + $coodle_ressource_termin= $coodle_help->deleteRessourceTermin($coodle_help->coodle_ressource_id, $coodle_id); + } + } + + // Einträge speichern + foreach($_POST as $key=>$value) + { + if(mb_substr($key, 0, 5) =='check') + { + $termin = explode('_', $key); + $ressource_id = $termin[1]; + $termin_id = $termin[2]; + + $coodle_ressource_termin = new coodle(); + $coodle_ressource_termin->coodle_ressource_id = $ressource_id; + $coodle_ressource_termin->coodle_termin_id = $termin_id; + $coodle_ressource_termin->new = true; + + if(!$coodle_ressource_termin->saveRessourceTermin()) + $message= "Fehler beim Speichern aufgetreten"; + else + $message = "Erfolgreich gespeichert"; + } + } +} + +?> + + + + +Coodle Übersicht + + + + +
+ +
+
+ getRessourcen($coodle_id); + + // alle termine der coodle umfrage holen + $coodle_termine = new coodle(); + $coodle_termine->getTermine($coodle_id); + + echo " +
+
+
+ + + "; + foreach($coodle_termine->result as $termin) + echo ""; + + echo ""; + + // ressourcen durchlaufen + foreach($coodle_ressourcen->result as $ressource) + { + $name = ''; + if($ressource->uid != '') + $name = $ressource->uid; + + if($ressource->zugangscode !='') + $name = $ressource->name; + + echo ""; + // termine zu ressourcen anzeigen + foreach($coodle_termine->result as $termin) + { + $checked =''; + $disabled=''; + if($coodle_termine->checkTermin($termin->coodle_termin_id, $ressource->coodle_ressource_id)) + $checked = 'checked'; + + $coodle_help = new coodle(); + if(isset($_GET['zugangscode'])) + { + $coodle_help->getRessourceFromUser($coodle_id, '', $_GET['zugangscode']); + if($ressource->coodle_ressource_id != $coodle_help->coodle_ressource_id) + $disabled = 'disabled'; + }else + { + $coodle_help->getRessourceFromUser($coodle_id, $uid); + if($ressource->coodle_ressource_id != $coodle_help->coodle_ressource_id) + $disabled = 'disabled'; + } + + echo ""; + } + + echo ""; + } + + echo " + + +
".$termin->datum.' '.$termin->uhrzeit."
".$name."
+
"; + + ?> +
+ + + + + +