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

defined('_JEXEC') or die('Restricted access');
?>
<form action="index.php?option=com_rsevents&task=eventelement&tmpl=component" method="post" name="adminForm">
	<table class="adminform">
		<tr>
			<td width="100%"><?php echo JText::_('RSE_FILTER'); ?> <input type="text" name="rs_filter" class="text_area" value="<?php echo $this->filter;?>">
			</td>
		</tr>
	</table>
	<div id="editcell1">
		<table class="adminlist">
			<thead>
			<tr>
				<th width="5">
					<?php echo JText::_( 'RSE_#' ); ?>
				</th>
				<th width="20">
					<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count($this->data); ?>);"/>
				</th>
				<th>
					<?php
						$msg=JText::_('RSE_EVENT_NAME_DEFAULT');
						echo JHTML::_('grid.sort',$msg,'e.EventName',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th>
					<?php
						$msg=JText::_('RSE_EVENT_START_DATE_DEFAULT');
						echo JHTML::_('grid.sort',$msg,'e.EventStartDate',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th>
					<?php
						$msg=JText::_('RSE_EVENT_END_DATE_DEFAULT');
						echo JHTML::_('grid.sort',$msg,'e.EventEndDate',$this->sortOrder,$this->sortColumn);
					?>
				</th>
				<th width="80">
					<?php
						$msg=JText::_('RSE_PUBLISHED');
						echo JHTML::_('grid.sort',$msg,'e.published',$this->sortOrder,$this->sortColumn);
					?>
				</th>
			</tr>
			</thead>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->data);$i<$n;$i++)
	{
		
		$row =& $this->data[$i];		
		$checked=JHTML::_('grid.id',$i,$row->RecordId);
		$publish=JHTML::_('grid.published',$row,$i);
		

		
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $row->RecordId; ?></td>
				<td><?php echo $checked; ?></td>
				<td>
				<span class="editlinktip hasTip" title="<?php echo JText::_( 'RSE_SELECT' );?>::<?php echo $row->EventName; ?>">
				<a style="cursor:pointer" onclick="window.parent.elSelectEvent('<?php echo $row->RecordId; ?>', '<?php echo str_replace( array("'", "\""), array("\\'", ""), $row->EventName ); ?>');">
					<?php echo htmlspecialchars($row->EventName, ENT_QUOTES, 'UTF-8'); ?>
				</a></span>
				</td>
				<td align="center"><?php echo date('Y-m-d',$row->EventStartDate); ?></td>
				<td align="center"><?php echo date('Y-m-d',$row->EventEndDate); ?></td>
				<td align="center"><?php echo $publish; ?></td>
			</tr>
	<?php
		$k=1-$k;
	}
	?>
		</table>
	</div>
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="option" value="com_rsevents" />
	<input type="hidden" name="task" value="eventelement" />
	<input type="hidden" name="controller" value="eventsElement" />
	<input type="hidden" name="tmpl" value="component">
	<input type="hidden" name="filter_order" value="<?php echo $this->sortColumn; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->sortOrder; ?>" />
	</form>