root/wifidog/wifidog-auth/wifidog/listnodes.php

Revision 76, 1.8 kB (checked in by syrus, 2 years ago)

corrections du nombre de nodes

Line 
1 <?php
2
3 /**
4  * Node Liste page
5  *
6  * @package    WiFiDogAuthServer
7  * @author     Philippe April
8  * @copyright  2005-2006 Philippe April
9  * @version    Subversion $Id: faq.php 1030 2006-05-09 20:01:17Z benoitg $
10  * @link       http://www.wifidog.org/
11  */
12
13 /**
14  * Load required files
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&eacute;ploy&eacute;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&eacute;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  * Local variables:
69  * tab-width: 4
70  * c-basic-offset: 4
71  * c-hanging-comment-ender-p: nil
72  * End:
73  */
74
75 ?>
76
Note: See TracBrowser for help on using the browser.