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"; + } + } +} + +?> + + +
+ +