Connexions_wifi()

This commit is contained in:
jbousquie 2016-12-13 10:51:56 +01:00
parent 8059c048e9
commit 31395c7ed5

View File

@ -227,6 +227,7 @@ function PremiereConnexion() {
// Fonction Connexions_wifi()
// Ferme les connexions antérieures au jour courant
// Renvoie les connexions wifi non marquées "close" en base
// Retourne un array indexé de connexions :
// con_wifi[i]["id"] : id de connexion wifi
@ -239,7 +240,10 @@ function Connexions_wifi() {
$connexions_wifi = array();
$db = db_connect();
$req = 'select wifi_id, wifi_username, wifi_ip, wifi_browser, unix_timestamp(wifi_deb_conn) from wifi where close=0 and (to_days(now())-to_days(wifi_deb_conn)<1) order by wifi_deb_conn';
$req_close = "UPDATE wifi SET close = 1 WHERE DATE(wifi_deb_conn) < CURDATE()";
$req = "SELECT wifi_id, wifi_username, wifi_ip, wifi_browser, wifi_deb_conn FROM wifi WHERE close = 0 ORDER BY wifi_deb_conn";
db_query($db, $req_close);
$res = db_query($db, $req);
$i = 0;
while ($con = db_fetch_row($res)) {
@ -310,4 +314,5 @@ function ArchiveConnexions() {
return $nb_archivables;
}
?>