<?php
/**
* @version 2.0.0
* @package RSTickets! Pro 2.0.0
* @copyright (C) 2010 www.rsjoomla.com
* @license GPL, http://www.gnu.org/licenses/gpl-2.0.html
*/

defined('_JEXEC') or die('Restricted access');

if (empty($this->data['units'])) { ?>
	<h2><?php echo JText::_('RST_NO_DATA'); ?></h2>
	<?php return; } ?>
<div align="center">
	<h2><?php echo JText::_('RST_REPORT_5'); ?></h2>
</div>

<div id="rst_report_container">
	<table id="rst_reports_table">
		<thead>
			<tr>
				<th scope="col"></th>
				<?php foreach ($this->data['viewby'] as $viewby => $values) { ?><th scope="col"><?php echo $viewby; ?></th><?php } ?>
			</tr>
		</thead>
		<tbody>
		<?php foreach ($this->data['units'] as $unit) { ?>
		<tr>
			<th scope="row"><?php echo $unit; ?></th>
			<?php foreach ($this->data['viewby'] as $viewby => $value) { ?>
				<?php if (isset($this->data['viewby'][$viewby][$unit])) { ?>
				<td><?php echo number_format($this->data['viewby'][$viewby][$unit], 2, '.', ''); ?></td>
				<?php } else { ?>
				<td>0</td>
				<?php } ?>
			<?php } ?>
		</tr>
		<?php } ?>
		</tbody>
	</table>
</div>

<table class="adminlist table table-striped">
	<thead>
	<tr>
		<th width="5"><?php echo JText::_('RST_MIN'); ?></th>
		<th width="5"><?php echo JText::_('RST_AVG'); ?></th>
		<th width="5"><?php echo JText::_('RST_MAX'); ?></th>
	</tr>
	</thead>
	<tr class="row0">
		<td align="center"><?php echo $this->min; ?></td>
		<td align="center"><?php echo $this->avg; ?></td>
		<td align="center"><?php echo $this->max; ?></td>
	</tr>
</table>