<?php

/**
* @version 2.8.0
* @package Joomla 2.5
* @subpackage DT Register
* @copyright Copyright (C) 2006 DTH Development
* @copyright contact dthdev@dthdevelopment.com
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

global $Itemid;
$tEvent = $this->tEvent;
?>
<div class="dt_member_box">

<dl>
 <dt class="dtlabel memheading">
   #
 </dt>

 <dd class="dtfield memheading">
   <?php echo JText::_('DT_MEMBER_NAME')?>
 </dd>
 
 <dd class="dtaction memheading">
   <?php echo JText::_('DT_ACTION')?>
 </dd>
</dl>
<?php //pr($this->member_list);
 $i = 1;
 foreach($this->member_list as $key=>$member) {
?>
   <dl>
    <dt class="dtlabel">
      <?php echo JText::_( 'DT_MEMBER' )." ".($i); ?>
    </dt>
    <dd class="dtfield">
      <?php echo trim($member['firstname']." ".$member['lastname']); ?>
    </dd>
    <dd class="dtaction">
     <?php $index = $key -1 ;
	  
	  if(DT_Session::get('Setting.User.memtot') > $tEvent->min_group_size) {
	  ?>
      <a href="<?php echo JRoute::_("index.php?option=com_dtregister&task=remove_member&index=$index&Itemid=".$Itemid);?>">
      <img src="<?php echo Juri::root(); ?>/components/com_dtregister/assets/images/publish_x.png" border="0" height="16" width="16" alt="'.JText::_( 'DT_REMOVE').'"></a>
      &nbsp;
      <?php } ?>
      <a href="<?php echo  JRoute::_("index.php?option=com_dtregister&task=edit_member&index=$index&Itemid=".$Itemid);?>">
       <?php echo '<img border="0"  src="'.JURI::root(true).'/components/com_dtregister/assets/images/edit.png" alt="'.JText::_( 'DT_EDIT').'" />'; ?></a>
      
    </dd>
   </dl>     
<?php
 $i++;
 }

$tEvent->registered = $tEvent->getTotalregistered($tEvent->slabId);

$show_add_member_button = true;

if(intval($tEvent->max_registrations) > 0) {
	if(($tEvent->registered + DT_Session::get('Setting.User.memtot')) >= $tEvent->max_registrations) {
		$show_add_member_button =  false;
	}
}

?>
<div style="clear:both">

<?php if(($tEvent->max_group_size > DT_Session::get('Setting.User.memtot') || $tEvent->max_group_size == 0 || $tEvent->max_group_size == "") && $show_add_member_button) {?>
   <a class="up_button" style="margin: 4px 0 10px 0" href="<?php echo JRoute::_("index.php?option=com_dtregister&task=add_member&Itemid=".$Itemid);?>"><?php echo JText::_('DT_ADD_MEMBER');?></a>
<?php } ?>
</div>

</div>