second initial commit

This commit is contained in:
Jérôme Bousquié
2016-09-22 14:24:56 +02:00
parent 51d0c765b7
commit 45a0a47778
13 changed files with 862 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
Function bascule_salle($url) {
$salles_bloquees = array();
$r = new HttpRequest($url, HttpRequest::METH_GET);
try {
$r->send();
if ($r->getResponseCode() == 200) {
$r->getResponseBody();
$reponse = json_decode($r->getResponseBody());
}
}
catch (HttpException $ex) {
echo $ex;
}
return $r->getResponseCode();
}
$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"; }
if ($action != "" ) { bascule_salle($url); }
$precedent = $_SERVER["HTTP_REFERER"];
header("Location: $precedent");
?>