diff --git a/admin/bloque_salle.php b/admin/bloque_salle.php index ccede44..6007446 100644 --- a/admin/bloque_salle.php +++ b/admin/bloque_salle.php @@ -1,26 +1,38 @@ send(); - if ($r->getResponseCode() == 200) { - $r->getResponseBody(); - $reponse = json_decode($r->getResponseBody()); - } - } - catch (HttpException $ex) { - echo $ex; - } - return $r->getResponseCode(); + $response = $r->send(); + if (200 == $response->getStatus()) { + $body = $response->getBody(); + $reponse = json_decode($body); + } + } + catch (HTTP_Request2_Exception $ex) { + echo $$ex->getMessage(); + } + return $reponse; } + $action = $_GET["a"]; $salle = $_GET["s"]; $url = ""; -if ($action === "b") { $url = "http://cache.iut-rodez.fr/salles/bloque_salle.php?s=$salle"; } -if ($action === "d") { $url = "http://cache.iut-rodez.fr/salles/debloque_salle.php?s=$salle"; } +$param = "?s=$salle"; +if ($action === "b") { + $url = $url_bloque . $param; +} +if ($action === "d") { + $url = $url_debloque . $param; +} + +if ($action != "" ) { + bascule_salle($url); +} -if ($action != "" ) { bascule_salle($url); } $precedent = $_SERVER["HTTP_REFERER"]; header("Location: $precedent"); ?>