<?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');
?>
<h3><?php echo JText::_('RSE_SUBSCRIPTIONS_FOR') . ' "' .$this->eventName.'"';?></h3>
<form action="<?php echo JRoute::_('index.php?option=com_rsevents&view=subscriptions&IdEvent='.$this->idEvent.'&Itemid'.$this->itemId); ?>" method="post" name="adminForm" id="adminForm">
	<table>
		<tr>
			<td width="100%">
			</td>
			<td nowrap="nowrap">
				<?php echo $this->lists1['tickets'];	?>
			</td>
			<td nowrap="nowrap">
				<?php  echo $this->lists['state'];	?>
			</td>
		</tr>
	</table>
	
	<table  class="rsevents-table-list" width="100%">
		<thead>
			<tr>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_NAME');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_USERNAME');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_EMAIL');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_SUBSCRIBED');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_ACCEPTED');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_PENDING');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_DENIED');
					?>
				</th>
				<th style="text-align:center">
					<?php
						echo JText::_('RSE_SUBSCRIBER_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 style="text-align:center"><a href="<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&view=subscriptions&layout=edit&cid='.$row->RecordId.'&IdEvent='.$this->idEvent.$this->itemId)); ?>"><?php echo $row->FirstName.' '.$row->LastName; ?></a></td>
				<td style="text-align:center"><?php echo empty($row->username) ? JText::_('RSE_GUEST') : $row->username ; ?></td>
				<td style="text-align:center"><?php echo $row->Email; ?></td>
				<td style="text-align:center"><?php echo date('Y-m-d',$row->SubscriptionDate); ?></td>
				<td style="text-align:center"><?php echo ($row->SubscriptionState!=1) ? '<a href="'.html_entity_decode(JRoute::_('index.php?option=com_rsevents&task=accepted&controller=subscriptions&cid='.$row->RecordId.'&IdEvent='.$this->idEvent.$this->itemId)).'">' : ''; ?><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/'.($row->SubscriptionState==1 ? 'tick.png' : 'delete.png');?>"><?php echo ($row->SubscriptionState==1) ? '</a>' : ''; ?></td>
				<td style="text-align:center"><?php echo ($row->SubscriptionState!=0) ? '<a href="'.html_entity_decode(JRoute::_('index.php?option=com_rsevents&task=pending&controller=subscriptions&cid='.$row->RecordId.'&IdEvent='.$this->idEvent.$this->itemId)).'">' : ''; ?><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/'.($row->SubscriptionState==0 ? 'tick.png' : 'delete.png');?>"><?php echo ($row->SubscriptionState==1) ? '</a>' : ''; ?></td>
				<td style="text-align:center"><?php echo ($row->SubscriptionState!=-1) ? '<a href="'.html_entity_decode(JRoute::_('index.php?option=com_rsevents&task=denied&controller=subscriptions&cid='.$row->RecordId.'&IdEvent='.$this->idEvent.$this->itemId)).'">' : ''; ?><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/'.($row->SubscriptionState==-1 ? 'tick.png' : 'delete.png');?>"><?php echo ($row->SubscriptionState==1) ? '</a>' : ''; ?></td>
				<td style="text-align:center"><a href="<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&task=delete&controller=subscriptions&cid='.$row->RecordId.'&IdEvent='.$this->idEvent.$this->itemId)); ?>"><img src="<?php echo JURI::root().'administrator/components/com_rsevents/images/icons/delete.png' ;?>"></a></td>
			</tr>
	<?php
		$k=1-$k;
	}
	?>
		</tbody>
		</table>
		<br/>
		<div class="rsevents-pagination">
		<div class="pageslinks">
		<?php echo $this->pagination->getPagesLinks(); ?>
		</div>
		</div>
		<br/>
	<button type="button" onclick="document.location='<?php echo html_entity_decode(JRoute::_('index.php?option=com_rsevents&view=events&layout=show&cid='.$this->idEvent.$this->itemId)); ?>'"><?php echo JText::_('RSE_BACK_BTN'); ?></button>
	<?php echo JHTML::_( 'form.token' ); ?>
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="layout" value="" />
	<input type="hidden" name="option" value="com_rsevents" />
	<input type="hidden" name="view" value="subscriptions" />
	<input type="hidden" name="IdEvent" value="<?php echo $this->idEvent ; ?>" />
	<input type="hidden" name="Itemid" value="<?php echo $this->Itemid ; ?>" />
	<input type="hidden" name="controller" value="subscriptions" />
	<input type="hidden" name="task" value="listsubscriptions" />
	</form>