<?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');
?>

<script language="javascript" type="text/javascript">

function validation()
	{
		var form = document.adminForm;
		var ret = true;
		
		if(form.TicketName.value=='') { form.TicketName.className = 'rserror'; ret=false; } else { form.TicketName.className = '';  }	
		if(form.TicketPrice.value=='') { form.TicketPrice.className = 'rserror'; ret=false; } else { form.TicketPrice.className = '';  }	
		
		return ret;
	}
</script>
<style>
.rserror 
{
	border:1px solid red;
}
</style>
<form action="index.php" method="post" name="adminForm" id="adminForm">
<button onclick="document.location = '<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&view=tickets&cid='.$this->data->IdEvent.$this->itemId)); ?>';"><?php echo JText::_('RSE_CANCEL_BTN'); ?></button>
<button type="submit" onclick="return validation();"><?php echo JText::_('RSE_SAVE_BTN'); ?></button>

	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td valign="top">
				<table  class="adminform">
					<tr>
						<td>
							<label for="name">
								<?php echo JText::_( 'RSE_TICKETS_NAME' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="TicketName" value="<?php echo $this->data->TicketName; ?>" size="50" maxlength="100" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="price">
								<?php echo JText::_( 'RSE_TICKETS_PRICE' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="TicketPrice" value="<?php echo $this->data->TicketPrice; ?>" size="50" maxlength="100" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="maxSeats">
								<?php echo JText::_( 'RSE_TICKETS_SEATS' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="TicketMaxAudience" value="<?php echo $this->data->TicketMaxAudience; ?>" size="50" maxlength="100" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="maxPerUser">
								<?php echo JText::_( 'RSE_MAX_TICKETS_PER_USER' ).':'; ?>
							</label>
						</td>
						<td>						
							<input name="TicketsPerUser" value="<?php echo $this->data->TicketsPerUser; ?>" size="50" />
						</td>
					</tr>
					<tr>
						<td>
							<label for="description">
								<?php echo JText::_( 'RSE_TICKETS_DESCRIPTION' ).':'; ?>
							</label>
						</td>
						<td>
							<?php $editor=& JFactory::getEditor();
							echo $editor->display('TicketDescription',$this->data->TicketDescription,550,400,70,10); ?>						
						</td>
					</tr>
				</table>
			</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->IdTicket; ?>" />
<input type="hidden" name="IdTicket" value="<?php echo $this->data->IdTicket; ?>" />
<input type="hidden" name="IdEvent" value="<?php echo $this->data->IdEvent; ?>" />
<input type="hidden" name="controller" value="tickets" />
<input type="hidden" name="view" value="tickets" />
<input type="hidden" name="layout" value="edit" />
<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>" />
<input type="hidden" name="task" value="save" />
</form>

<?php
//keep session alive while editing
JHTML::_('behavior.keepalive');
?>