<div class="right">
	<form method="post" action="<?php echo php_self(); ?>" onsubmit="return confirm('Souhaitez vous réellement vider les stats ?');" class="right" style="margin: 0px; padding: 0px; border: 0px none; width: 100px;">
		<input type="submit" name="submit" value="Vider !" class="right awesome red" />
	</form>
	<?php echo href('rafraichir',array('controleur'=>'admin','action'=>'monitoring','class'=>'awesome green')); ?>
	
</div>
<?php $Pages = v('Pages'); 
if ( sizeof((array)$Pages) == 0 ){
	echo 'Aucune statistique';
} else { ?>
<h2>Statistiques de votre zKup</h2>
<style type="text/css">
	#monitoring {
		margin: 0px auto;
	}	
	#monitoring td,#monitoring th {
		padding: 5px 10px;
	}
	#monitoring .good {
		
	}
	#monitoring .bad {
		background: orange;
	}
	#monitoring .critic {
		background: red;
	}
</style>
<table id="monitoring" class="lister" style="font-size: 12px">
	
	<tr>
		<th>Moyenne</th>
		<th align="center"><?php echo v('moyenne_temps'); ?></th>
		<th align="center"><?php echo v('moyenne_nb_appels'); ?></th>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
	</tr>
	<tr>
		<th>Total</th>
		<th>&nbsp;</th>
		<th align="center"><?php echo v('appels'); ?></th>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
	</tr>
	<tr>
		<th>Page</th>
		<th>Temps (sec)</th>
		<th>Nb Affichage</th>
		<th>Ratio</th>
		<th>Debug</th>
	</tr>
	<?php 
	$i = 0;
	foreach((array)$Pages as $Page){ 
		$ratio = v('moyenne_temps')>0?100*round($Page['LOG_TEMPS']/v('moyenne_temps'),2):100;
		?>
		<tr class="<?php echo ++$i%2==0?'pair':'impair'; ?>">
			<td><?php echo $Page['LOG_TITRE']; ?></td>
			<td align="center"><?php echo $Page['LOG_TEMPS']; ?></td>
			<td align="center"><?php echo $Page['LOG_CPT']; ?></td>
			<td align="center" class="<?php echo $ratio>100?($ratio>180?'critic':'bad'):'good';?>"><?php echo $ratio; ?>%</td>
			<td align="center"><a href="<?php echo WWW_ROOT.$Page['LOG_TITRE'];?>&FORCEDEBUG=1" title="afficher le debuger"><?php echo img('icons/eye.png'); ?></a></td>
		</tr>
	<?php } ?>
	
</table>
<?php } ?>