<?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');
JHTML::_('behavior.modal');
JHTML::_('behavior.mootools');
?>
<form action="index.php?option=com_rsevents" method="post" name="adminForm">
<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">		
	<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
							echo JText::_( 'RSE_TICKETS_NAME' ); 
						?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_TICKETS_SEATS' ); 
						?>
					</th>
					<th>
						<?php
							echo JText::_( 'RSE_TICKETS_PRICE' ); 
						?>
					</th>
					<th>
						<?php
							$msg=JText::_('RSE_ORDER');
							echo JHTML::_('grid.sort',$msg,'#__rsevents_tickets.ordering',$this->sortOrder,$this->sortColumn);
							echo '&nbsp;&nbsp;';
							echo JHTML::_('grid.order',$this->data);
						?>
					</th>
					<th width="100">
						<?php
							echo JText::_( 'RSE_TICKETS_DELETE' ); 
						?>
					</th>
				</tr>
			</thead>
			<tbody>
	<?php
	$k = 0;
	for ($i=0,$n=count($this->data);$i<$n;$i++)
	{		
		$row =& $this->data[$i];
		$checked=JHTML::_('grid.id',$i,$row->RecordId);
	?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $row->RecordId; ?></td>
				<td><?php echo $checked; ?></td>
				<td><a href="index.php?option=com_rsevents&task=editticket&cid=<?php echo $row->RecordId; ?>"><?php echo $row->TicketName; ?></a></td>
				<td align="center"><?php echo $row->TicketMaxAudience; ?></td>
				<td align="center"><?php echo $row->TicketPrice; ?></td>
				<td class="order" align="center" width="100">
					<span><?php echo $this->pagination->orderUpIcon( $i, true, 'orderup', 'Move Up', 'ordering'); ?></span>
					<span><?php echo $this->pagination->orderDownIcon( $i, $n, true, 'orderdown', 'Move Down', 'ordering' ); ?></span>
					<input type="text" name="order[]" size="5" value="<?php echo $row->ordering; ?>" class="text_area" style="text-align:center;" />
				</td>
				<td align="center"><a href="index.php?option=com_rsevents&task=deleteticket&cid=<?php echo $row->RecordId; ?>&controller=tickets&IdEvent=<?php echo $row->IdEvent; ?>" onclick="javascript:if(!confirm('<?php echo JText::_('RSE_TICKETS_CONFIRM_DELETE'); ?>')) return false;"><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/delete.png'; ?>" title="Delete" alt="Delete file"></a></td>
			</tr>
	<?php	$k=1-$k;
	}
	?>
			</tbody>
				</table>
</div>				
			</td>
		</tr>
	</table>
<?php echo JHTML::_( 'form.token' ); ?>
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="task" value="listtickets" />
<input type="hidden" name="option" value="com_rsevents" />
<input type="hidden" name="IdEvent" value="<?php  echo $this->idEvent; ?>" />
<input type="hidden" name="view" value="tickets" />
<input type="hidden" name="controller" value="tickets" />
<input type="hidden" name="filter_order" value="<?php echo $this->sortColumn; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->sortOrder; ?>" />
</form>