<?php
/**
* @version 1.0.0
* @package RSFiles! 1.0.0
* @copyright (C) 2009 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/

defined('_JEXEC') or die('Restricted access');
?>
<script language="javascript" type="text/javascript">
	function createFilter(filter)
	{
		document.getElementById('filter').value = filter;
		submitform();
	}
	
	function eraseFilter()
	{
		document.getElementById('filter').value = '';
		submitform();
	}
</script>
<form action="index.php?option=com_rsfiles&task=statistics" method="post" name="adminForm">
	<table class="adminform">
		<tr>
			<td>
				<input type="text" name="jFilter" id="jFilter" class="text_area" value="<?php echo $this->jFilter; ?>"/> <input type="button" value="<?php echo JText::_('RSFL_SEARCH'); ?>" onclick="createFilter(document.getElementById('jFilter').value);return false;" /> <input type="button" onclick="eraseFilter();" value="<?php echo JText::_('RSFL_CLEAR_SEARCH'); ?> " />
			</td>
		</tr>
	</table>
	<div id="editcell1">
		<table class="adminlist" width="100%">
			<thead>
			<tr>
				<th width="1%">#</th>
				<th width="50%">
					<?php echo JText::_('RSFL_FILE_PATH'); ?>
				</th>
				<th width="2%">
					<?php echo JText::_('RSFL_STATISTICS_HITS'); ?>
				</th>
			</tr>
			</thead>
			<tbody>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->data);$i<$n;$i++)
	{
		$row =& $this->data[$i];
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td align="center"><?php echo $this->pagination->getRowOffset($i); ?></td>
				<td><?php echo '<a href="index.php?option=com_rsfiles&task=viewstatistic&cid='.$row->IdFile.'">'.$row->FilePath.'</a>'; ?></td>
				<td align="center"><?php echo $row->hits; ?></td>
			</tr>
	<?php
		$k=1-$k;
	}
	?>
		</tbody>
		<tfoot>
			<tr>
				<td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
			</tr>
		</tfoot>
		</table>
	</div>
	
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="statistics" />
<input type="hidden" name="option" value="com_rsfiles" />
<input type="hidden" name="view" value="statistics" />
<input type="hidden" name="controller" value="statistics" />
<input type="hidden" name="jFilter" value="" id="filter" />
</form>