Subversion Repositories ALCASAR

Rev

Rev 1956 | Rev 2858 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log

<?php
        # Choice of language
        $Language = 'en';
        if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
        {
                $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
                $Language = strtolower(substr(chop($Langue[0]),0,2)); 
        }
        if($Language == 'fr')
        {
                $l_Pagename = "Usage journalier";
        }
        else
        {
                $l_Pagename = "Daily use";
        }
?>

<form action="stats.php" method="get">
<table width="100%" border=0 cellspacing=0 cellpadding=2>
        <tbody>         
                <tr>
                        <th class="thBasicACC">
                                <?echo "$l_Pagename";?>
                        </th>
                </tr>
        </tbody>
        <tr bgcolor="#FFCC66">
                <td>
                        <img src="/images/pix.gif" width="1" height="2">
                </td>
        </tr>
</table>

<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
        <tr>
                <td colspan="2"  align=center>
                <table  border=0 cellspacing=2 cellpadding=2>
                        <tr valign=bottom>
                                <td><small><b>De </td>
                                <td><small><b>&agrave; </td>
                                <td><small><b>usager</td>
                                <td><small><b>sur le serveur</td>
                                <td>&nbsp;</td>
                                </tr>
                        <tr valign=middle>
                                <?php
                                if(!isset($login))
                                {
                                        $login = "";
                                }
                                ?>
                                <td valign=middle><input type="text" name="after"  size="12" value="<?php echo $after; ?>" ></td>
                                <td valign=middle><input type="text" name="before" size="12" value="<?php echo $before; ?>"></td>
                                <td valign=middle><input type="text" name="login"  size="12" value="<?php echo $login; ?>" ></td>
                                <td valign=middle>
                                        <select name="server" size=1>
                                        <?php foreach($servers as $key => $val): ?>
                                                <option value="<?php echo $val; ?>"><?php echo $key; ?>
                                        <?php endforeach; ?>
                                </select>
                                </td>
                                        <td  valign=middle><input type="submit" class=button value="Go"></td>
                        </tr>
                </table>
                </td>
        </tr>

        <tbody >        

<tr>
        <tr>
                <small>
                <td align=center valign=top width="40%">
                        <font color="darkblue" ><b><?php echo $date ?></b></font>
                        </td>
                </small>
                        <td align= center  width="10%">&nbsp;
                P&eacute;riode observ&eacute;e :<br>
<?php
echo <<<EOM
                <b>$after</b>  &agrave;  <b>$before</b>
EOM;
?>
                </td>
                </tr>
        </td>
</tr>
        
 </tbody>
</table>
<br>
<tr >
        <td align=center><h1><b>Statistiques d'utilisation journali&egrave;re</td>
</tr>
<tr>
        <td valign=top>
        <table border=0 width="100%">
        <tr>
                <td colspan=2>
                <center>
                Statistiques pour 
<?php
if ($login == '')
        echo <<<EOM
<b><font color="darkblue">tous</font></b> les usagers
EOM;
else
        echo <<<EOM
l'usager <b><font color="darkblue">$login</font></b>
EOM;
?>
        </td>
        </tr>
        </table>
        </td>
</tr>

<tr>
        <td>

        <tr>    <td colspan=2>
                </td>
                </tr>
        </td>
        </tr>
</table>
<tr>
        <td align="center">

        <tr>
                <td>Champs affich&eacute;s :</td><td colspan=10 align=center nowrap><select name="column1">
                <option <?php if(isset($selected1['sessions'])){print($selected1['sessions']);} ?> value="sessions">Nbre de sessions
                <option <?php if(isset($selected1['usage'])){print($selected1['usage']);} ?> value="usage">Temps d'utilisation total
                <option value="upload">------------------
                <option <?php if(isset($selected1['upload'])){print($selected1['upload']);} ?> value="upload">uploads
                <option <?php if(isset($selected1['download'])){print($selected1['download']);} ?> value="download">downloads
        </select> <select name="column2">
                <option <?php if(isset($selected2['sessions'])){print($selected2['sessions']);} ?> value="sessions">Nbre de sessions
                <option <?php if(isset($selected2['usage'])){print($selected2['usage']);} ?> value="usage">Temps d'utilisation total
                <option value="upload">------------------
                <option <?php if(isset($selected2['upload'])){print($selected2['upload']);} ?> value="upload">uploads
                <option <?php if(isset($selected2['download'])){print($selected2['download']);} ?> value="download">downloads
        </select> <select name="column3">
                <option <?php if(isset($selected3['sessions'])){print($selected3['sessions']);} ?> value="sessions">Nbre de sessions
                <option <?php if(isset($selected3['usage'])){print($selected3['usage']);} ?> value="usage">Temps d'utilisation total
                <option value="upload">------------------
                <option <?php if(isset($selected3['upload'])){print($selected3['upload']);} ?> value="upload">uploads
                <option <?php if(isset($selected3['download'])){print($selected3['download']);} ?> value="download">downloads

                </select>
                </td>
        </tr>
        <hr size=1 noshade>

        <tr>
                <td colspan=10 align=center valign=middle>
                <table border=0 width="100%">
                <tr>
                        <td width=100% align=left>
                        <table border=0 cellpadding=0 cellspacing=0>
                        <tr>
                        <td align=right><input type="submit" class=button value="Rafra&icirc;chir"></td>
                        </tr>
                        </table>
                        </td>
                </tr>
                </table>
                </td>
        </tr>
        </table>
        </td>
        <tr>
        <td colspan=10 height=20><img src="images/pixel.gif"></td>
        </tr>
</table>
                <table width="100%" border=0 cellspacing=0 cellpadding=0>
                        <tbody style='font-family: "DejaVu Sans";font-size: small;color: #666666;'>     
                <td colspan=10 height=20 align=center>
                                        <table border=0 width=100% cellpadding=2 cellspacing=0>
                                                <tbody>
                                                        <tr bgcolor="#666660" align=center valign=top><th>
                                                                        <font color="white">Analyse journali&egrave;re</font>&nbsp;
                                                                </th>
                                                        </tr>
                                                        <tr bgcolor="#FFCC66">
                                                                <td>
                                                                        <img src="/images/pix.gif" width="1" height="2">
                                                                </td>
                                                        </tr>                   
                                                </tbody>
                                        </table>
                <tr valign=top>
                        <tr>
                                <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ffffe0" valign=top>
                                <tr bgcolor="#d0ddb0">
                                        <th>date</th>
<?php
echo <<<EOM
        <th colspan=3>$message[$column1]</th>
        <th colspan=3>$message[$column2]</th>
        <th colspan=3>$message[$column3]</th>
EOM;
?>
                                </tr>
<?php
        for($i = 0; $i <= $num_days; $i++){
                $day = $days[$i];
                $trcolor = ($i % 2) ? "#f7f7e4" : "#efefe4";
                echo <<<EOM
        <tr align=center bgcolor="$trcolor">
                <td>$day</td>
                <td>{$data[$day][1]}</td>
                <td>{$perc[$day][1]}</td>
                <td align=left height=14>
                        <table border=0 cellpadding=0>
                        <tr>
                                <td bgcolor="{$color[$day][1]}" width={$width[$day][1]}><img border=0 height=14 width={$width[$day][1]} src="images/pixel.gif" alt="the $message[$column1] for $day is {$data[$day][1]}"></td>
                        </tr>
                        </table>
                </td>
                <td>{$data[$day][2]}</td>
                <td>{$perc[$day][2]}</td>
                <td align=left height=14>
                        <table border=0 cellpadding=0>
                        <tr>
                                <td bgcolor="{$color[$day][2]}" width={$width[$day][2]}><img border=0 height=14 width={$width[$day][2]} src="images/pixel.gif" alt="the $message[$column3] for $day is {$data[$day][2]}"></td>
                        </tr>
                        </table>
                </td>
                <td>{$data[$day][3]}</td>
                <td>{$perc[$day][3]}</td>
                <td align=left height=14>
                        <table border=0 cellpadding=0>
                        <tr>
                        <td bgcolor="{$color[$day][3]}" width={$width[$day][3]}><img border=0 height=14 width={$width[$day][3]} src="images/pixel.gif" alt="the $message[$column3] for $day is {$data[$day][3]}"></td>
                        </tr>
                        </table>
                </td>

                </tr>
EOM;
}
?>
</table>
</tbody>
</table>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr valign=top>
<td width=440></td>
        <tr bgcolor="#666660" align=center valign=top><th>
        <font color="white">R&eacute;capitulatif journalier</font>&nbsp;
        </th></tr>
        <tr bgcolor="#FFCC66">
        <td>
                <img src="/images/pix.gif" width="1" height="3">
        </td>
        </tr>   
        </table>
</td></tr>
<tr valign=top><td colspan=2>
        <tr><td>
        <table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor="#ff
ffe0" valign=top>
        <tr bgcolor="#d0ddb0">
        <th>&nbsp;</th>
<?php
echo <<<EOM
        <th>$message[$column1]</th>
        <th>$message[$column2]</th>
        <th>$message[$column3]</th>
EOM;
?>
        </tr>
<?php
echo <<<EOM
                <tr align=center bgcolor="#efefe4">
                        <td>maximum</td>
                        <td>{$data['max'][1]}</td>
                        <td>{$data['max'][2]}</td>
                        <td>{$data['max'][3]}</td>
                        </tr>
                <tr align=center bgcolor="#f7f7e4">
                        <td>moyenne</td>
                        <td>{$data['avg'][1]}</td>
                        <td>{$data['avg'][2]}</td>
                        <td>{$data['avg'][3]}</td>
                        </tr>
                <tr align=center bgcolor="#efefe4">
                        <td>r&eacute;capitulatif</td>
                        <td>{$data['sum'][1]}</td>
                        <td>{$data['sum'][2]}</td>
                        <td>{$data['sum'][3]}</td>
                        </tr>
EOM;
?>
                </td></tr>
        </td></tr>
</table>
</form>
</center>
</body>
</html>