case 'raum': if (key_exists('update', $_POST)) { // alle aktiven updaten foreach ($_POST as $key => $value) { if (substr($key, 0, 4) == 'raum') { $raum_id = substr($key, 4); $r = new Raum(); $r->load($raum_id); $r->setName($_POST[$key]); $r->save(); } } } else { // aus †bergabevariablen zu deaktivierende klasse_id bestimmen foreach ($_POST as $key => $value) { if (substr($key, 0, 7) === 'deaktiv') { $raum_id = substr($key, 7); } } $r = new Raum(); $r->load($raum_id); $r->setAktiv("FALSE"); $r->save(); } $action = 'show'; $what = 'raum'; include 'controller/show.php'; break; default: break; }
case 'raum': if (key_exists('update', $_POST)) { // alle aktiven updaten foreach ($_POST as $key => $value) { if (substr($key, 0, 4) == 'raum') { $raum_id = substr($key, 4); $r = new Raum(); $r->load($raum_id); $r->setName($_POST[$key]); $r->save(); } } } else { // aus †bergabevariablen zu deaktivierende klasse_id bestimmen foreach ($_POST as $key => $value) { if (substr($key, 0, 7) === 'deaktiv') { $raum_id = substr($key, 7); } } $f = new Raum(); $f->load($raum_id); $f->setAktiv("TRUE"); $f->save(); } $action = 'show'; $what = 'raum'; include 'controller/show.php'; break; default: break; }