mirror of
https://gitlab.aliens-lyon.fr/savrillo/gpens.git
synced 2026-03-18 01:51:04 +01:00
Caché les mdp. Les données récupérées sont mainenant jolies.
This commit is contained in:
parent
4af54d3715
commit
bc6195600d
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
svg-pan-zoom.min.js
|
||||
tinycolor-min.js
|
||||
|
||||
bddpass.php
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
<?php
|
||||
|
||||
// Connection à la BDD:
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
|
||||
include 'bddpass.php';
|
||||
try {
|
||||
$conn = new PDO("mysql:host=localhost;dbname=savrillo", savrillo, "BHTvo0JfS");
|
||||
$conn = new PDO("mysql:host=localhost;dbname=savrillo", "savrillo", $bddpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
|
||||
// set the PDO error mode to exception
|
||||
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
} catch(PDOException $e) {
|
||||
@ -30,7 +35,7 @@ if($_GET["salle"] != NULL) {
|
||||
$resP = $stmt->fetchAll();
|
||||
|
||||
for($i=0;$i<count($resP);$i++)
|
||||
$locataires[$i] = $resP[$i]['nom'];
|
||||
$locataires[$i] = $resP[$i]['personne'];
|
||||
|
||||
|
||||
$stmt = $conn->prepare("SELECT id, nom, description FROM salles WHERE id=?");
|
||||
|
||||
45
viewer.html
45
viewer.html
@ -7,15 +7,20 @@
|
||||
<style>
|
||||
|
||||
#selectedSalleInfos {
|
||||
background-color: #888888;
|
||||
background-color: #BBBBBB;
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
|
||||
#selectedSalleInfos h2 {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script type="text/javascript" src="./svg-pan-zoom.min.js"></script>
|
||||
<script type="text/javascript" src="./tinycolor.min.js"></script>
|
||||
<script type="text/javascript" src="./tinycolor-min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
@ -30,6 +35,17 @@
|
||||
xmlHttp.send(null);
|
||||
}
|
||||
|
||||
function putWaitNetworkScreen()
|
||||
{
|
||||
outputDiv.innerHTML = "Récupération des informations auprès du serveur...";
|
||||
}
|
||||
|
||||
function salleInfosToHtml(salle) {
|
||||
titres = "<h2>"+salle.nom+"</h2>"+((salle.aliaz.length!=0)?(" ou <h2>"+salle.aliaz.join("</h2> ou <h2>")+"</h2>"):"");
|
||||
locataires = salle.locataires.join(", ");
|
||||
return titres + ((salle.description!=null)?("\n<br/>\n" + salle.description):"") + ((salle.locataires.length!=0)?("\n<br/>\n<b>Locataires</b>: " + locataires):"");
|
||||
}
|
||||
|
||||
function initSvgSupport() {
|
||||
|
||||
var plan = document.getElementById('plan');
|
||||
@ -48,13 +64,20 @@
|
||||
}
|
||||
|
||||
document.lastSelectedSalle = e.target;
|
||||
window.clearTimeout(document.wnsTimeout);
|
||||
document.wnsTimeout = window.setTimeout(putWaitNetworkScreen, 400);
|
||||
|
||||
httpGetAsync("https://perso.ens-lyon.fr/samy.avrillon/sallesQuery.php?salle="+e.target.id.substring("path-salle-".length),function (s,errcode){
|
||||
window.clearTimeout(document.wnsTimeout);
|
||||
try{
|
||||
if(s=="404"){
|
||||
outputDiv.innerHTML = "Aucune information disponible pour cette salle. Si vous en avez, indiquez-les à l'adresse <a href=mailto:samy.avrillon@ens-lyon.fr>samy.avrillon@ens-lyon.fr</a> en indiquant l'identifiant de la salle : "+document.lastSelectedSalle.id.substring("path-salle-".length);
|
||||
return;
|
||||
}
|
||||
ss = JSON.parse(s)
|
||||
if(document.lastSelectedSalle.id==("path-salle-"+ss["id"])){
|
||||
if(errcode==200){
|
||||
outputDiv.innerHTML = s;
|
||||
outputDiv.innerHTML = salleInfosToHtml(ss);
|
||||
}else
|
||||
outputDiv.innerHTML = "Erreur lors de l'appel à l'interface php: ERREUR "+errcode;
|
||||
}
|
||||
@ -95,7 +118,9 @@
|
||||
<option value="2">Deuxième étage</option>
|
||||
<option value="3">Troisième étage</option>
|
||||
<option value="4">Quatrième étage</option>
|
||||
</select>
|
||||
</select>
|
||||
|
|
||||
<input type="button" value="Vue d'ensemble" id="overviewButton" onclick="overviewButton"/>
|
||||
|
||||
</form>
|
||||
|
||||
@ -109,13 +134,15 @@
|
||||
Votre navigateur ne sait pas charger les objets HTML.... Je vais voir ce que je peux faire.
|
||||
|
||||
</object>
|
||||
|
||||
<form>
|
||||
<input name="searchString" type="text"/>
|
||||
</form>
|
||||
|
||||
<div id="selectedSalleInfos">
|
||||
Il faut que vous sélectionnez une salle.
|
||||
</div>
|
||||
|
||||
<form>
|
||||
<input name="searchString" type="text"/>
|
||||
</form>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user