<?php 

/**
* @version 2.8.9
* @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 $eventListOrder;

$pageNav = $this->pageNav;

$tCategory = $this->getModel('category')->table;

$chd = $this->getModel('event')->table;

$i = $this->checkboxvalue;

$k = 0;

  foreach($this->event->childs as $child){

	  $i++;

	  $chd->load($child->slabId);
  
        if ($chd->category == 0 || !isset($chd->category) ){$chd->categoryName=JText::_( 'DT_NONE' );}else{

         $categoryName = "";
		 $categoryName_temp = array();
		 if(!empty($chd->category)) {
			 
		    foreach($chd->category as $category) {
			    $tCategory->load($category);
				$categoryName_temp[] = $tCategory->categoryName;
				break;
			}
		 }

		 $chd->categoryName = implode(' ',$categoryName_temp);

	  }

	  ?>

      <tr class="<?php echo "row$k"; ?> child" id="<?php echo $this->parent_id; ?>">

        <td>&nbsp;

        </td>

        <td width="20">

          <input type="checkbox" id="cb<?php echo $i;?>" name="cid[]" value="<?php echo $chd->slabId; ?>" onclick="Joomla.isChecked(this.checked);" />

        </td>

        <td align="left">

          <a href="index.php?option=com_dtregister#edit" onclick="return listItemTask('cb<?php echo $i;?>','edit')">

            <?php echo $chd->displayTitle(); ?>

          </a>

	    </td>
	
	    <td>

           <?php echo (int)$chd->slabId; ?>

        </td>

        <td align="left">

         <?php $task = $chd->publish?'unpublish':'publish'; ?>

         <a class="btn btn-micro active" title="'.$alt.'" href="index.php?option=com_dtregister#publish" onclick="return listItemTask('cb<?php echo $i;?>','<?php echo $task; ?>')">

        	 <i class="icon-<?php echo $task; ?>"></i>

		  </span>

         </a>

        </td>
	
        <td align="left"><?php echo $chd->categoryName; ?></td>

        <td align="left"><?php echo $chd->displaytimecolumn(); ?></td>

        <td align="left"><?php echo $chd->email; ?></td>

    <?php

     if($eventListOrder ==0){

	?>

	  <td align="left">

            <!--<span><?php echo $pageNav->orderUpIcon( $i, true,'orderup', 'Move Up' ); #echo $pageNav->orderUpIcon( $i, ($row->category == @$rows[$i-1]->category), 'orderup_event', 'Move Up' ); ?></span>-->

		</td>

		<td align="left" rowspan="<?php echo $rowspan; ?>">

			<!--span><?php echo $pageNav->orderDownIcon( $i, $k, true,'orderdown', 'Move Down');# echo $pageNav->orderDownIcon( $k, $n, ($row->category == @$rows[$k+1]->category),'orderdown_event', 'Move Down'); ?></span-->

		</td>

		<td align="left">

			<!--<input type="text" name="order[<?php echo $chd->slabId;?>]" size="5" value="<?php echo $chd->ordering; ?>" <?php //echo $disabled ?> class="text_area" style="text-align: center" />-->

		</td>

      <?php

    }

   ?>

     <td>

       <a class="colorbox" href="<?php echo JRoute::_('index.php?option=com_dtregister&controller=feeorder&no_html=1&task=view&eventId='.$chd->slabId) ?>" ><?php echo JText::_('DT_FEE_ORDERING')?></a>

     </td>

      <?php $k = 1 - $k; echo "</tr>"; 

	  }

?>