mirror of
https://gitlab.aliens-lyon.fr/savrillo/gpens.git
synced 2026-03-18 06:01:02 +01:00
Ajout des requetes PHP/SQL pour rechercher.
This commit is contained in:
parent
bc6195600d
commit
9406374cbe
@ -15,7 +15,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($_GET["salle"] != NULL) {
|
if(isset($_GET["salle"])) {
|
||||||
|
|
||||||
$idSalle = $_GET["salle"];
|
$idSalle = $_GET["salle"];
|
||||||
|
|
||||||
@ -50,6 +50,36 @@ if($_GET["salle"] != NULL) {
|
|||||||
echo (json_encode($out));
|
echo (json_encode($out));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else if (isset($_GET["salleNameSearch"])){
|
||||||
|
|
||||||
|
$salleNameSearch = $_GET["salleNameSearch"];
|
||||||
|
|
||||||
|
$stmt = $conn->prepare("(SELECT id, nom FROM `salles` WHERE MATCH nom AGAINST (? IN BOOLEAN MODE)) UNION (SELECT salleID, nom FROM salleAlias WHERE MATCH nom AGAINST (? IN BOOLEAN MODE))");
|
||||||
|
$stmt->execute([$salleNameSearch, $salleNameSearch]);
|
||||||
|
$res = $stmt->fetchAll();
|
||||||
|
|
||||||
|
$out = array();
|
||||||
|
|
||||||
|
for($i=0;$i<count($res);$i++)
|
||||||
|
$out[$i] = array("id" => $res[$i]['id'], "nom" => $res[$i]["nom"]);
|
||||||
|
|
||||||
|
echo (json_encode($out));
|
||||||
|
|
||||||
|
} else if (isset($_GET["salleLocSearch"])) {
|
||||||
|
|
||||||
|
$salleLocSearch = $_GET["salleLocSearch"];
|
||||||
|
|
||||||
|
$stmt = $conn->prepare("SELECT salle, personne FROM `locataires` WHERE MATCH personne AGAINST (? IN BOOLEAN MODE)");
|
||||||
|
$stmt->execute([$salleLocSearch]);
|
||||||
|
$res = $stmt->fetchAll();
|
||||||
|
|
||||||
|
$out = array();
|
||||||
|
|
||||||
|
for($i=0;$i<count($res);$i++)
|
||||||
|
$out[$i] = array("salle" => $res[$i]['salle'], "personne" => $res[$i]["personne"]);
|
||||||
|
|
||||||
|
echo (json_encode($out));
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
echo "Je ne connais pas cette commande ...";
|
echo "Je ne connais pas cette commande ...";
|
||||||
}
|
}
|
||||||
|
|||||||
13
viewer.html
13
viewer.html
@ -6,6 +6,10 @@
|
|||||||
<title>perdu.html</title>
|
<title>perdu.html</title>
|
||||||
<style>
|
<style>
|
||||||
|
|
||||||
|
#searchResultInfos {
|
||||||
|
background-color: #BBBBBB;
|
||||||
|
}
|
||||||
|
|
||||||
#selectedSalleInfos {
|
#selectedSalleInfos {
|
||||||
background-color: #BBBBBB;
|
background-color: #BBBBBB;
|
||||||
line-height: 150%;
|
line-height: 150%;
|
||||||
@ -139,10 +143,17 @@
|
|||||||
Il faut que vous sélectionnez une salle.
|
Il faut que vous sélectionnez une salle.
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<input name="searchString" type="text"/>
|
<label for="salleNameSearch">Rechercher par nom de salle : </label> <input name="salleNameSearch" type="text" id="salleNameSearch"/> <input name=salleNameButton" type=button value="Rechercher" onclick="salleNameSearch" />
|
||||||
|
<br/>
|
||||||
|
<label for="salleLocSearch">Rechercher par locataire : </label> <input name="salleLocSearch" type="text" id="salleLocSearch"/> <input name=salleLocButton" type=button value="Rechercher" onclick="salleLocSearch" />
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<div id="searchResultInfos">
|
||||||
|
Il faut que vous fassiez une recherche.
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user