info ping sur formulaire machine
This commit is contained in:
parent
1db332b8e5
commit
580fb25003
@ -31,10 +31,12 @@ function Machines() {
|
|||||||
//$machines = array() ;
|
//$machines = array() ;
|
||||||
$db = db_connect();
|
$db = db_connect();
|
||||||
|
|
||||||
$req = 'SELECT machine_id, salle, os, os_sp, os_version, adresse_ip, marque, modele, type_systeme, mac, mac_description, ram, procSpeed, diskSize, freeSpace FROM machines ORDER BY salle, machine_id';
|
global $mode_ping;
|
||||||
|
|
||||||
|
$req = 'SELECT machines.machine_id, salle, os, os_sp, os_version, adresse_ip, marque, modele, type_systeme, mac, mac_description, ram, procSpeed, diskSize, freeSpace, ping_timestamp FROM machines LEFT OUTER JOIN ping ON machines.machine_id = ping.machine_id ORDER BY salle, machine_id';
|
||||||
$res = db_query($db, $req);
|
$res = db_query($db, $req);
|
||||||
while ($mac = db_fetch_row($res)) {
|
while ($mac = db_fetch_row($res)) {
|
||||||
$machines[$mac[0]] = array($mac[1], $mac[2], $mac[3], $mac[4], $mac[5], $mac[6], $mac[7], $mac[8], $mac[9], $mac[10], $mac[11], $mac[12], $mac[13], $mac[14]);
|
$machines[$mac[0]] = array($mac[1], $mac[2], $mac[3], $mac[4], $mac[5], $mac[6], $mac[7], $mac[8], $mac[9], $mac[10], $mac[11], $mac[12], $mac[13], $mac[14], $mac[15]);
|
||||||
}
|
}
|
||||||
db_free($res);
|
db_free($res);
|
||||||
return $machines;
|
return $machines;
|
||||||
|
@ -37,6 +37,7 @@ $ram = $machine[10];
|
|||||||
$procSpeed = $machine[11];
|
$procSpeed = $machine[11];
|
||||||
$diskSize = $machine[12];
|
$diskSize = $machine[12];
|
||||||
$freeSpace = $machine[13];
|
$freeSpace = $machine[13];
|
||||||
|
$ping_timestamp = $machine[14];
|
||||||
|
|
||||||
$mac_json = json_encode(array($mac_addr));
|
$mac_json = json_encode(array($mac_addr));
|
||||||
|
|
||||||
@ -60,6 +61,19 @@ $mac_json = json_encode(array($mac_addr));
|
|||||||
sp : <?php echo($os_sp); ?><br/>
|
sp : <?php echo($os_sp); ?><br/>
|
||||||
version <?php echo($os_version) ?>
|
version <?php echo($os_version) ?>
|
||||||
</td>
|
</td>
|
||||||
|
<td>
|
||||||
|
<?php
|
||||||
|
if ($mode_ping) {
|
||||||
|
if (is_null($ping_timestamp)) {
|
||||||
|
echo("Ping : indisponible<br/>");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo("Dernier ping : $ping_timestamp<br/>");
|
||||||
|
echo("Heure actuelle : " . date("Y-m-d H:i:s") ."<br/>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="materiel_ligne2">
|
<tr class="materiel_ligne2">
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user