|
Revision 76, 1.8 kB
(checked in by syrus, 2 years ago)
|
corrections du nombre de nodes
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
require_once(dirname(__FILE__) . '/include/common.php'); |
|---|
| 17 |
|
|---|
| 18 |
require_once('include/common_interface.php'); |
|---|
| 19 |
require_once('classes/MainUI.php'); |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
$network_array = Network::getAllNetworks(); |
|---|
| 23 |
|
|---|
| 24 |
$All_DeployedNodes=0; |
|---|
| 25 |
$All_OnlineNodes=0; |
|---|
| 26 |
|
|---|
| 27 |
foreach ($network_array as $network) |
|---|
| 28 |
{ |
|---|
| 29 |
$All_DeployedNodes +=$network->getNumDeployedNodes(); |
|---|
| 30 |
$All_OnlineNodes +=$network->getNumOnlineNodes(); |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
$body_html = '<h4>Noeuds WifiDog</h4>'; |
|---|
| 35 |
$body_html .= '<ul>'; |
|---|
| 36 |
$body_html .= '<li>Déployés : <b>'.$All_DeployedNodes.'</b></li>'; |
|---|
| 37 |
$body_html .= '<li>En fonctionnement : <b>'.$All_OnlineNodes.'</b></li>'; |
|---|
| 38 |
$body_html .= '</ul>'; |
|---|
| 39 |
|
|---|
| 40 |
$body_html .= '<h4>Utilisateurs connectés</h4>'; |
|---|
| 41 |
$body_html .= '<ul class="users">'; |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
global $db; |
|---|
| 45 |
$online_users = null; |
|---|
| 46 |
$db->execSql("SELECT username,nodes.node_id,nodes.name FROM connections,users,nodes WHERE token_status='".TOKEN_INUSE."' AND users.user_id=connections.user_id AND nodes.node_id=connections.node_id ORDER BY account_origin, timestamp_in DESC", $online_users); |
|---|
| 47 |
|
|---|
| 48 |
if ($online_users != null){ |
|---|
| 49 |
|
|---|
| 50 |
foreach ($online_users as $online_user){ |
|---|
| 51 |
$body_html .= '<img src="http://www.puteaux-wireless.org/themes/puteaux-wireless/images/smile.png" alt="'.$online_user["node_id"].'"/> '.$online_user["username"].' ('.$online_user["name"].')<br>'; |
|---|
| 52 |
} |
|---|
| 53 |
|
|---|
| 54 |
}else { |
|---|
| 55 |
$body_html .= "<li>Aucune personne</li>"; |
|---|
| 56 |
} |
|---|
| 57 |
|
|---|
| 58 |
$body_html .= '</ul>'; |
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
$ui = new MainUI(); |
|---|
| 62 |
$ui->addContent('main_area_middle', $body_html ); |
|---|
| 63 |
$ui->display(); |
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
?> |
|---|
| 76 |
|
|---|