<?php defined('_JEXEC') or die('Restricted access'); ?>

		<form action="index.php" method="post" name="adminForm" id="adminForm">
		<table class="adminheading">
		<tr>
            <th class='billets_users'>
            <?php echo _BILLETS_SELECTUSER; ?>
            </th>            
          <td class='right'><?php echo _BILLETS_FILTER; ?>:</td>
          <td class="input">
            <input type="text" name="search" value="<?php echo htmlspecialchars( $this->search );?>" class="text_area" onchange='submitform("<?php echo $task; ?>")' />
          </td>
			<td class='right'>
            <?php echo $this->types; ?>
			</td>
		</tr>
		</table>

		<table class="adminlist">
		<thead>
            <tr>
                <th class="title">
                <?php echo JHTML::_('grid.sort', _BILLETS_ID, "id", $this->order_dir, $this->order, $task ); ?>
                </th>                
                <th class="title">
                <?php echo JHTML::_('grid.sort', _BILLETS_NAME, "name", $this->order_dir, $this->order, $task ); ?>
                </th>
                <th class="title">
                <?php echo JHTML::_('grid.sort', _BILLETS_USERNAME, "username", $this->order_dir, $this->order, $task ); ?>
                </th>
                <th class="title">
                <?php echo JHTML::_('grid.sort', _BILLETS_EMAIL, "email", $this->order_dir, $this->order, $task ); ?>
                </th>
                <th class="title">
	            <?php echo _BILLETS_ACTION; ?>
                </th>
            </tr>
		</thead>
        <tbody>
		<?php
        $k = 0;
		$today 			= date( "Y-m-d" );
		$yesterday_time	= time() - (24 * 60 * 60); // timestamp - 24 hours * 60 mins * 60secs
		$yesterday		= date( "Y-m-d", $yesterday_time ); 
		$database = &JFactory::getDBO();
        for ($i=0, $n=count( $this->items ); $i < $n; $i++)
        {
            $row =& $this->items[$i];
			$checked    = JHTML::_( 'grid.id', $i, $row->id );
			$link = JRoute::_( 'index.php?option='.$option.'&controller=ticket&task=new&userid='. $row->id );
			?>
				<tr class="<?php echo "row$k"; ?>">
					<td>
						<?php echo $row->id; ?>
					</td>
					<td>
						<a href="index.php?option=com_users&task=view&search=<?php echo $row->username; ?>" title="<?php echo _BILLETS_EDIT; ?>">
						<?php echo $row->name; ?>
						</a>
					</td>
					<td>
						<a href='index.php?option=com_users&task=view&search=<?php echo $row->username; ?>'>
						<?php echo $row->username; ?>
						</a>
					</td>
					<td>
						<?php echo $row->email; ?>
					</td>
					<td>
						<a href='<?php echo $link; ?>'>
						<img src="images/next_f2.png" border="0" width="18" height="18" alt="<?php echo _BILLETS_SELECT; ?>" title="<?php echo _BILLETS_SELECT; ?>" name="<?php echo _BILLETS_SELECT; ?>" />
						</a>
					</td>
				</tr>
        <?php 
        $k = 1 - $k;
        }
        ?>
        </tbody>
        <tfoot>
        	<tr>
                <td colspan='10'>
                    <div class="pagination">
                    <?php echo $this->pagination->getListFooter(); ?>
                    </div>            
                </td>
            </tr>
        </tfoot>

		</table>
                
		<input type="hidden" name="option" value="<?php echo $option; ?>" />
		<input type="hidden" name="controller" value="<?php echo $this->_name; ?>" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="id" value="" />
		<input type="hidden" name="order" value="<?php echo $this->order; ?>" />
		<input type="hidden" name="order_dir" value="<?php echo $this->order_dir; ?>" />

		</form>        
        
 