Location: PHPKode > projects > phpMyPrepaid > phpmyprepaid/www/include/statistiques/AccessStats_html.php
<?php
echo "<form  name=\"center\" action=\"phpmyprepaid.php\" method=\"post\">";
echo "<span style=\"font-weight: bold; font-family: Arial;\"></span>
	<hr><small>";
$resultloc = getLocationName($oreon->user);
echo '<table style=text-align: left; width: 100%;><tr><td>Choose your Locations : </td><td>';
echo '<script type="text/javascript">  
function changeLocationStat(formulaire) { 
	document.location.href="phpmyprepaid.php?lsid="+formulaire.LocationChangeStat.value;
	}  
 </script>';
echo ('<select name="LocationChangeStat" onchange="changeLocationStat(this.form)">');
$loctmp=$loc;
if ($oreon->user->get_status()=='3') {
	if ($_GET['lsid']=="All")
	{
		echo ("<option  value=\"All\">All");
		$loctmp="-1";
	}
	else
	echo ("<option selected=\"selected\" value=\"All\">All");

}
while ($row = $oreon->database->database->fetch_object($resultloc)) {
      if($loctmp==$row->ID )
	      echo ("<option selected=\"selected\" value=\"".$row->LocationName."\">".$row->LocationName);
      else
	      echo ("<option  value=\"".$row->LocationName."\">".$row->LocationName);
}
echo "</td></tr></table></select><br><center>";
echo " <input type=\"hidden\" name=\"buttonID\" value=\"$buttonID\">
<table bgcolor=\"#666699\" width=400 cellpadding=2 cellspacing=0>
<tr>
	<table  border=0 cellspacing=0 cellpadding=2>
	<tr valign=bottom>
		<td><small><b>from date</td>
		<td><small><b>to date</td>
		<td><small><b>user</td>
		<td>&nbsp;</td>
		</tr>
	<tr valign=middle>
	<td valign=middle>";

	echo '
		<input type="text"  width="13" name="after" id="after" size="15" value="'.$startf.'"/><button type="reset" id="f_trigger_b1">...</button>
		</span></td>';
	echo '<script type="text/javascript">
		Calendar.setup({
			inputField     :    "after",      // id of the input field
				ifFormat       :    "'.cdateformat_calendar($dateFormat).'",       // format of the input field
				showsTime      :    true,            // will display a time selector
				button         :    "f_trigger_b1",   // trigger for the calendar (button ID)
				singleClick    :    true,           // double-click mode
				step           :    1                // show all years in drop-down boxes (instead of every other year as default)
});
</script>';
		echo "<td valign=middle>";
	echo '
		<input type="text"  width="13" name="before" id="before" size="15" value="'.$stopf.'"/><button type="reset" id="f_trigger_b2">...</button>
		</span></td>';
	echo '<script type="text/javascript">
		Calendar.setup({
			inputField     :    "before",      // id of the input field
				ifFormat       :    "'.cdateformat_calendar($dateFormat).'",       // format of the input field
				showsTime      :    true,            // will display a time selector
				button         :    "f_trigger_b2",   // trigger for the calendar (button ID)
				singleClick    :    true,           // double-click mode
				step           :    1                // show all years in drop-down boxes (instead of every other year as default)
});
</script>';
		echo "<td valign=middle><input type=\"text\" name=\"login\"  size=\"12\" value=$login ></td>
         </tr>
	 </tr></table>";
     
     
echo "<tr>
<td><hr size=1 noshade></td>
</tr>
<tr>
	<td valign=top>
	<table bgcolor=\"#666699\" width=\"90%\">
	<tr>	<td align=center valign=top width=\"45%\">
		<small>
		<font color=\"darkblue\"><b>$date</b></font>
		</td>
		<td align=center valign=top width=\"10%\">&nbsp;</td>
		<td align=center valign=top width=\"45%\"><small>
		statistics period:<br>

		<b>$startf</b> up to <b>$stopf</b>
		</td>
		</tr>
	</table>
	</td>
	</tr>
	<tr><table>
<br><td align=center><h2><b>General access statistics for the hotspot.</td>
</tr>
<tr>
	<td valign=top>
	<table width=\"100%\">
	<tr>
		<td colspan=2>
		<center>
		statistics for ";

if ($login =='')
     echo "<b><font >all</font></b> users";
     else
     echo "user <b><font >$login</font></b>
        </td>
	</tr>
	</td>
	<br>
	<br>
<tr>
	<td>
	<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">
	<tr>	<td colspan=2><hr size=1 noshade>
		</td>
		</tr>
		
	</table>
	</td>
	</tr>
<tr>
	<td align=\"center\">
	<table border=0 cellpadding=0 cellspacing=1 width=\"100%\">";
echo "<tr>
		<td colspan=10 align=center nowrap><select name=\"column1\">
		<option ".$selected1['sessions']." value=\"sessions\">sessions
		<option ".$selected1['usage']." value=\"usage\">total usage time
		<option value=\"upload\">------------------
		<option ".$selected1['upload']." value=\"upload\">uploads
		<option ".$selected1['download']." value=\"download\">downloads
	</select> <select name=\"column2\">
		<option ".$selected2['sessions']." value=\"sessions\">sessions
		<option ".$selected2['usage']." value=\"usage\">total usage time
		<option	value=\"upload\">------------------
		<option ".$selected2['upload']." value=\"upload\">uploads
		<option ".$selected2['download']." value=\"download\">downloads
	</select> <select name=\"column3\">
		<option ".$selected3['sessions']." value=\"sessions\">sessions
		<option ".$selected3['usage']." value=\"usage\">total usage time
		<option value=\"upload\">------------------
		<option ".$selected3['upload']." value=\"upload\">uploads
		<option ".$selected3['download']." value=\"download\">downloads
		</select>
		</td>
	</tr>
	<tr>
		<td colspan=10 align=center valign=middle>
		<table border=0 width=\"100%\">
		<tr>
			<td width=50% align=left>
			<table border=0 cellpadding=0 cellspacing=0>
			<tr>
			<td align=right><input type=\"submit\" class=\"smallButton\" value=\"Refresh\"></td>
			</tr>
			</table>
			</td>
		</tr>
		</table>
		</td>
	</tr>
	</table>
	</td>
	<tr>
	<td colspan=10 height=20><img src=\"images/pixel.gif\"></td>
	</tr>
	<tr>
		<td colspan=10 height=20 align=center>
		<table border=0 width=580 cellpadding=1 cellspacing=1>
		<tr valign=top>
				<td width=440></td>
				<td bgcolor=\"black\" width=200>
					<table border=0 width=100% cellpadding=2 cellspacing=0>
					<tr bgcolor=\"#666699\" align=right valign=top><th>
							<font color=\"white\">Daily Analysis</font>&nbsp;
					</th></tr>
					</table>
				</td></tr>
		<tr valign=top><td colspan=2>
			<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor=\"#ffffd0\" valign=top>
			<tr><td>
				<p>
				<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ffffe0\" valign=top>
				<tr bgcolor=\"#666699\">
				<th>date</th>";

echo "<th colspan=3>$message[$column1]</th>
      <th colspan=3>$message[$column2]</th>
      <th colspan=3>$message[$column3]</th>
</tr>";

for($i = 0; $i <= $num_days; $i++){
  $day = $days[$i];
  $trcolor = ($i % 2) ? "#f7f7e4" : "#efefe4";
  echo "<tr align=center bgcolor=\"$trcolor\">
  <td><small>$day</td>
		<td><small>{$data[$day][1]}</td>
		<td><small>{$perc[$day][1]}</td>
		<td align=left height=14>
			<table border=1 cellpadding=0>
			<tr bgcolor=\"f9351a\" >
				<td class=\"statresult\" 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><small>{$data[$day][2]}</td>
		<td><small>{$perc[$day][2]}</td>
		<td align=left height=14>
			<table border=1 cellpadding=0>
			<tr bgcolor=\"f9351a\" >
				<td class=\"statresult\" 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><small>{$data[$day][3]}</td>
		<td><small>{$perc[$day][3]}</td>
		<td align=left height=14>
			<table border=1 cellpadding=0>
			<tr>
			<td class=\"statresult\" 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>";

}

echo "</table>
</td></tr>
</table>
</td></tr>
</table>
</td></tr>
</table>
<p>
<table border=0 width=540 cellpadding=1 cellspacing=1>
<tr valign=top>
<td width=440></td>
<td bgcolor=\"black\" width=200>
<table border=0 width=100% cellpadding=2 cellspacing=0>
<tr bgcolor=\"#666699\" align=right valign=top><th>
<font color=\"white\">Daily Summary</font>&nbsp;
</th></tr>
</table>
</td></tr>
<tr bgcolor=\"black\" valign=top><td colspan=2>
<table border=0 width=100% cellpadding=12 cellspacing=0 bgcolor=\"#ffffd0\" valign=top>
<tr><td>
<p>
<table border=1 bordercolordark=#ffffe0 bordercolorlight=#000000 width=100% cellpadding=2 cellspacing=0 bgcolor=\"#ff
ffe0\" valign=top>
<tr bgcolor=\"#666699\">
<th>&nbsp;</th>";
echo"
<th>$message[$column1]</th>
<th>$message[$column2]</th>
<th>$message[$column3]</th>
</tr>
<tr align=center bgcolor=\"#efefe4\">
<td><small>maximum</td>
<td class=\"statresult\"><small>{$data['max']['1']}</td>
<td class=\"statresult\"><small>{$data['max']['2']}</td>
<td class=\"statresult\"><small>{$data['max']['3']}</td>
</tr>
<tr align=center bgcolor=\"#f7f7e4\">
<td><small>average</td>
<td class=\"statresult\"><small>{$data['avg']['1']}</td>
<td class=\"statresult\"><small>{$data['avg']['2']}</td>
<td class=\"statresult\"><small>{$data['avg']['3']}</td>
</tr>
<tr align=center bgcolor=\"#efefe4\">
<td><small>sum</td>
<td class=\"statresult\"><small>{$data['sum']['1']}</td>
<td class=\"statresult\"><small>{$data['sum']['2']}</td>
<td class=\"statresult\"><small>{$data['sum']['3']}</td>
</tr>

</table>
</table>
</td></tr>
</table>
</td></tr>
</table>
</form>
</center>
</body>";

?>
Return current item: phpMyPrepaid