<?php
/**
 * ThunderSnarf
 *
 * @author Ricardo H.F. Sette P. <ricardohfsp@gmail.com>
 * @link http://www.freebsdbrasil.com.br/
 * @copyright Copyright &copy; 2010 - FreeBSD Brasil LTDA
 * @license licença GNU/GPL v2.0 http://www.gnu.org/licenses/gpl-2.0.html
 */
?>
<?php
$this->breadcrumbs=array(
	'Resumo'=>array('index'),
	substr($model->id_data,6,2)."/".substr($model->id_data,4,2)."/".substr($model->id_data,0,4),
);
function formatBytes($bytes, $precision = 2) {
	    $units = array('B', 'KB', 'MB', 'GB', 'TB');
	  
	    $bytes = max($bytes, 0);
	    $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
	    $pow = min($pow, count($units) - 1);
	  
	    $bytes /= pow(1024, $pow);
	  
	    return round($bytes, $precision) . '' . $units[$pow];
	} 
?>

<h1>Relatório do dia <?php echo substr($model->id_data,6,2)."/".substr($model->id_data,4,2)."/".substr($model->id_data,0,4); ?></h1>
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		array(
	        'name'=>'id_data',
	        'value'=>substr($model->id_data,6,2)."/".substr($model->id_data,4,2)."/".substr($model->id_data,0,4),
	    ),
		array(
	        'name'=>'cache_static',
	        'value'=>formatBytes($model->cache_static),
	    ),
		array(
	        'name'=>'cache_dynamic',
	        'value'=>formatBytes($model->cache_dynamic),
	    ),
		array(
	        'name'=>'traffic_static',
	        'value'=>formatBytes($model->traffic_static),
	    ),
		array(
	        'name'=>'traffic_dynamic',
	        'value'=>formatBytes($model->traffic_dynamic),
	    ),
		'hit_static',
		'hit_dynamic',
		'miss_static',
		'miss_dynamic',
		'requested',
	),
)); ?>

