<?php
/**
 * @version		1.2 feedback $
 * @package		feedback
 * @copyright	Copyright © 2010 Mertonium. All rights reserved.
 * @license		GNU/GPL
 * @author		Mertonium
 * @author mail	john@mertonium.com
 * @website		http://mertonium.com
 *
 *
 * @MVC architecture generated by MVC generator tool at http://www.alphaplug.com
 */

	// no direct access
	defined('_JEXEC') or die('Restricted access');

	// Sort links   
	$links = array();
	$links['submitted_ts'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=submitted_ts&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));
	$links['submitter_name'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=submitter_name&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));
	$links['url'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=url&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));
	$links['browser'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=browser,browser_version&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));	
	$links['operating_system'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=operating_system&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));	
	$links['screen_resolution'] = JRoute::_( 'index.php?option=com_feedback&controller=feedback&order=screen_resolution&dir=' . ((JRequest::getVar('dir','asc') == 'asc') ? 'desc' : 'asc'));	
?>
<?php JToolBarHelper::preferences('com_feedback'); ?>
<form action="index.php" method="post" name="adminForm">
	<div id="editcell">
		<table class="adminlist">
		<thead>
			<tr>
				<th width="20">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->feedback ); ?>);" />
				</th>				
				<th><a href="<?php echo $links['submitted_ts']; ?>"><?php echo JText::_('Submitted timestamp'); ?></a></th>				
				<th><a href="<?php echo $links['submitter_name']; ?>"><?php echo JText::_('Submitted Name Email'); ?></a></th>	
				<th><a href="<?php echo $links['url']; ?>"><?php echo JText::_('URL'); ?></a></th>					
				<th><a href="<?php echo $links['browser']; ?>"><?php echo JText::_('Browser version'); ?></a></th>
				<th><a href="<?php echo $links['operating_system']; ?>"><?php echo JText::_('Operating System'); ?></a></th>
				<th><a href="<?php echo $links['screen_resolution']; ?>"><?php echo JText::_('Screen Resolution'); ?></a></th>
			</tr>
		</thead>
		<?php
		$k = 0;
		for ($i=0, $n=count( $this->feedback ); $i < $n; $i++)
		{
			$row =& $this->feedback[$i];
			$checked = JHTML::_( 'grid.id', $i, $row->id );
			$link = JRoute::_( 'index.php?option=com_feedback&controller=feedback&task=edit&cid[]='.$row->id.'&limitstart='.JRequest::getVar('limitstart') );
			?>
			<tr class="<?php echo "row$k"; ?>">
				<td>
					<?php echo $checked; ?>
				</td>
				<td>
					<a href="<?php echo $link; ?>"><?php echo date("j M Y @ H:i:s",strtotime($row->submitted_ts)); ?></a>
				</td>				
				<td>
					<?php echo $row->submitter_name; ?><br />
					<?php if($row->submitter_email != '') { ?>
						[<?php echo $row->submitter_email; ?>]
					<?php } ?>
				</td>
				<td>
					<a href="<?php echo $row->url; ?>" target="_blank"><?php echo $row->url; ?></a>
				</td>
				<td>
					<?php echo $row->browser .' '.$row->browser_version; ?>
				</td>
				<td>
					<?php echo $row->operating_system; ?>
				</td>
				<td>
					<?php echo $row->screen_resolution; ?>
				</td>
			</tr>
			<?php
			$k = 1 - $k;
		}
		?>
		<tfoot>
			<tr>
				<td colspan="7"><?php echo $this->pagination->getListFooter() ?></td>
			</tr>
		</tfoot>
		</table>
	</div>
	 
	<input type="hidden" name="option" value="com_feedback" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="controller" value="feedback" />
	<input type="hidden" name="order" value="<?php echo $this->order ?>" />
	<input type="hidden" name="dir" value="<?php echo $this->dir ?>" />
	 
</form>