From 74b7316fc62d878f89c76b00ce366a885bfccd64 Mon Sep 17 00:00:00 2001 From: jbousquie Date: Tue, 27 Sep 2016 10:59:15 +0200 Subject: [PATCH] ajout fonction Salles() --- admin/connexions.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/admin/connexions.php b/admin/connexions.php index ccf3a2b..54c3434 100644 --- a/admin/connexions.php +++ b/admin/connexions.php @@ -30,10 +30,10 @@ function Machines() { //$machines = array() ; $db = db_connect(); - $req = 'select machine_id, salle, os, os_sp, os_version, ip_fixe from machines order by salle, machine_id'; + $req = 'select machine_id, salle, os, os_sp, os_version from machines order by salle, machine_id'; $res = db_query($db, $req); while ($mac = db_fetch_row($res)) { - $machines[$mac[0]] = array($mac[1], $mac[2], $mac[3], $mac[4], $mac[5]); + $machines[$mac[0]] = array($mac[1], $mac[2], $mac[3], $mac[4]); } db_free($res); return $machines; @@ -175,6 +175,21 @@ function Connexion_doyenne_salle($machines_de_la_salle) { return $nb_jours; } +// Fonction Salles() +// Renvoie un tableau de la liste des salles +function Salles() { + $salles = array(); + $db = db_connect(); + $req = 'select salle_id from salles'; + $res = db_query($db, $req); + $i = 0; + while ($sal = db_fetch_row($res)) { + $salles[$i] = $sal[0]; + $i++; + } + return $salles; +} + // Fonction Connexions_wifi() // Renvoie les connexions wifi non marquées "close" en base // Retourne un array indexé de connexions :