<?php 
include('protector.php');
include('header.php');


?>
<style type="text/css">
<!--
.style1 {color: #6600CC}
.style2 {color: #000000}
-->
</style>

<blockquote>
  <p align="center" class="style1" style="margin-left: 20">&nbsp;</p>
  <p align="center" class="style1" style="margin-left: 20"><font face="Arial" size="4"><span class="style2">Bemvindo</span></font></p>
  <p align="center" style="margin-left: 20"><font face="Arial" size="2" color="#000000">Nesta secção tem acesso a algumas informaç&otilde;es do gbox e permite-lhe efectuar algumas alterações aos ficheiros de configuração.</font></p>
  <p align="center" style="margin-left: 20">
    <?php
if (file_exists($gbox_path.'share.info') && file_exists($gbox_path.'share.onl') )
{
$cards = read2array($gbox_path.'share.info');
unset($cards[count($cards)-1]);
foreach($cards as $card){
     $elms = explode(' ',$card);
	 $dists[$elms[8]]['dist'] = substr($elms[8],5);
	 $dists[$elms[8]]['cnt']=$dists[$elms[8]]['cnt']+1;
   }

$peer_list = read2array($gbox_path.'share.onl');
unset($peer_list[count($peer_list)-1]);
foreach ($peer_list as $peer){
     $p = explode(' ',$peer);
	 if ($p[0] == '1'){ 
	 $peers[$p[3]]['status'] = $p[0];
	 }	 
}


?>
</p>
<p>
  <!-- //

<center><table style="margin-top:0px;width:500px;height:5px;"><tr><td style="border:0px #AAAAAA solid;height:100%;background-color:#FFFFFF;padding:10px;text-align:left;" valign=top>

<br>
 <div align="center"><center>
<table border="0" cellpadding="0" cellspacing="0" width="100%"
bgcolor="#004080">
<tr>
<td width="10" valign="top" align="left">
<img src="images/ka_rundtab1.gif" width="10" height="10"></td>
<td width="100%" bgcolor="#004080">
<p align="center"><small><font color="#FFFFFF" face="Arial">
</font></small></td>
<td width="10" valign="top" align="right">
<img src="images/ka_rundtab2.gif" width="10" height="10"></td>
</tr>
<tr>
<td width="10"></td>
<td width="100%" align="left">
<p align="left"><small><font color="#FFFFFF" face="Arial">
<b>Informação</b>
<hr noshade size=1 width=100% color=#8080FF>
l1<br>
l2<br>
l3<br>
l4<br><br>
         </td>
<td width="10"></td>
</tr>
<tr>
<td width="10" valign="bottom" align="left">
<img src="images/ka_rundtab3.gif" width="10" height="10"></td>
<td width="100%"><p align="center">
<font color="#FFFFFF" face="Arial"><small></small></font></td>
<td width="10" valign="bottom" align="right">
<img src="images/ka_rundtab4.gif" width="10" height="10"></td>
</tr>
</table></center></div>
</center></td></tr></table><p style="margin:3px;text-align:center">
//
--></p>
<p>&nbsp;</p>
</blockquote>

      <table width="292"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td width="16"><img src="images/top_lef.gif" alt="f" width="16" height="16" /></td>
          <td height="16" background="images/top_mid.gif"><img src="images/top_mid.gif" alt="g" width="16" height="16" /></td>
          <td width="24"><img src="images/top_rig.gif" alt="h" width="24" height="16" /></td>
        </tr>
        <tr>
          <td width="16" background="images/cen_lef.gif"><img src="images/cen_lef.gif" alt="d" width="16" height="11" /></td>
          <td align="center" valign="middle" bgcolor="#FFFFFF"><font face="verdana" size="4">Centro de Informação</font><br><br>
<table cellspacing=1 cellpadding=2 border=0 bgcolor=#C0C0C0>
<tr>
  <td align=left bgcolor=#F4F4F4 >Vers&atilde;o Gbox :</td>
  <td bgcolor=#EEF4FB><font color=#000080>&nbsp;<strong><?=file_get_contents($gbox_path.'gbox.ver');?></strong></font></td></tr>
<tr><td align=left bgcolor=#F4F4F4 >Cards <font color="green">Online</font>:</td><td bgcolor=#EEF4FB ><font color=#000080>&nbsp;<strong><?=count($cards);?></strong></font></td></tr>
<tr><td align=left bgcolor=#F4F4F4 >Grupos <font color="green">Online</font>:</td><td bgcolor=#EEF4FB ><font color=#000080>&nbsp;<strong><?=count($peers);?></strong></font></td></tr>
</table><br />
<strong>Distância das cards </strong><br><br>
<?php
sort($dists);
foreach ($dists as $dist) {
echo "Distância <strong>".$dist['dist']."</strong> : <a href=\"cards.php?dist=".$dist['dist']."&peerselect=all&filter=OK\"><strong>".$dist['cnt']."</strong> cards.</a><br>";
}
?><br />
                </p></td><td width="24" background="images/cen_rig.gif"><img src="images/cen_rig.gif" alt="e" width="24" height="11" /></td>
        </tr>
        <tr>
          <td width="16" height="16"><img src="images/bot_lef.gif" alt="a" width="16" height="16" /></td>
          <td height="16" background="images/bot_mid.gif"><img src="images/bot_mid.gif" alt="b" width="16" height="16" /></td>
          <td width="24" height="16"><img src="images/bot_rig.gif" alt="c" width="24" height="16" /></td>
        </tr>
      </table>
<?
}
?>
</blockquote>
<p>&nbsp;</p>
      <p><font face="Arial" size="2" color="#000000">&nbsp;</font></p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <p><font face="Arial" size="2" color="#000000">&nbsp;&nbsp;</font></p>
      <p><font face="Arial" size="2" color="#000000">&nbsp;</font></p>
      
<?php 
include('footer.php'); 
?>