<?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');
echo $this->layout[0];
if($this->data->EventRegistrationForm == 0 || !in_array($this->data->EventRegistrationForm,$this->formids))
{
?>

<div id="rsevents-action">
<h3><?php echo  JText::_('RSE_SUBSCRIBE_TITLE'); ?></h3>
<form action="<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&view=events&layout=subscribe&cid='.$this->data->IdEvent.$this->itemId)); ?>" method="post" name="adminForm">

	<table cellspacing="3">
		<tr>
			<td><?php echo JText::_('RSE_SUBSCRIBER_FIRST_NAME'); ?> </td>
			<td><input type="text" id="FirstName" name="FirstName" size="30" value="<?php echo $this->fName; ?>" /></td>
		</tr>
		<tr>
			<td><?php echo JText::_('RSE_SUBSCRIBER_LAST_NAME'); ?> </td>
			<td><input type="text" id="LastName" name="LastName" size="30" value="<?php echo $this->lName; ?>" /></td>
		</tr>
		<tr>
			<td><?php echo JText::_('RSE_SUBSCRIBER_EMAIL'); ?> </td>
			<td><input type="text" id="Email" name="Email" size="30" value="<?php echo $this->Email; ?>" /></td>
		</tr>
		<?php  if( !empty($this->ticketList) && (count($this->ticketList) > 1 || $this->ticketList[0]->TicketPrice != 0)) { ?>
		<tr>
			<td><?php echo JText::_('RSE_SUBSCRIBER_TICKET'); ?> </td>
			<td><?php  echo $this->lists['tickets']; ?></td>
		</tr>
		<tr id="numtick">
			<td><?php echo JText::_('RSE_SUBSCRIBER_TICKET_NR'); ?> </td>
			<td><select name="rse_numtickets" id="rse_numtickets"></select></td>
		</tr>
		<tr>
			<td><?php echo JText::_('RSE_SUBSCRIBER_TICKET_DESCRIPTION'); ?> </td>
			<td><?php  echo $this->ticket_descriptions; ?></td>
		</tr>
		<?php  } ?>
		<?php if((defined('RSEVENTS_PAYPAL') || defined('RSEVENTS_WIRE')) && $this->stop == 0 ) { ?>
		<tr id="rse_hidePayment">
			<td><?php echo JText::_('RSE_TRANSACTION_METHOD'); ?> </td>
			<td><?php  echo $this->lists['payments']; ?></td>
		</tr>
		<?php } ?>
		<tr>
			<td>&nbsp;</td>
			<td>
				<button type="submit"><?php echo JText::_('RSE_SUBSCRIBER_REGISTER');?></button>
				&nbsp;&nbsp;&nbsp;
				<button type="button" onclick="document.location='<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&view=events&layout=show&cid='.$this->data->IdEvent)); ?>'"><?php echo JText::_('RSE_CANCEL_BTN'); ?></button>
			</td>
		</tr>
	</table>
	<?php echo JHTML::_( 'form.token' ); ?>
	<input type="hidden" name="option" value="com_rsevents" />
	<input type="hidden" name="cid" value="<?php echo $this->data->IdEvent; ?>" />
	<input type="hidden" name="controller" value="events" />
	<input type="hidden" name="view" value="events" />
	<input type="hidden" name="layout" value="subscribe" />
	<?php if(count($this->ticketList) == 1 &&  $this->ticketList[0]->TicketPrice == 0)  { ?>
	<input type="hidden" name="IdTicket" id="IdTicket" value="<?php echo $this->ticketList[0]->IdTicket; ?>" />
	<?php } ?>
	<input type="hidden" name="task" value="saveregistration" />
</form>
</div>
<?php if(!empty($this->ticketList) && (count($this->ticketList) > 1 || $this->ticketList[0]->TicketPrice != 0))  { ?>
<script type="text/javascript">
rse_hidePayment(document.getElementById('IdTicket').value,0);
</script>
<?php 
}
}
else
{
	echo '<span style="clear:both;display:block;"></span>';
	echo rseventsViewEvents::rsform($this->data->EventRegistrationForm);
}
echo $this->layout[1];
?>