<?php
/**
 * @version		3.0.0
 * @package		JomLand TicketCenter
 * @copyright	Copyright (C) 2010 JomLand.com. All rights reserved.
 * @link 		www.jomland.com
 * @license		GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
 */
defined('_JEXEC') or die('Restricted access');
$ordering = ($this->lists['order'] == 'p.ordering');?>

<form action="index.php" method="post" name="adminForm" id="adminForm">
	<table>
		<tr>
			<td align="left" width="100%"><?php echo JText::_( 'Filter' ); ?>: <input
				type="text" name="search" id="search"
				value="<?php echo htmlspecialchars($this->lists['search']);?>"
				class="text_area" onchange="document.adminForm.submit();" />
				<button onclick="this.form.submit();">
				<?php echo JText::_( 'Go' ); ?>
				</button>
				<button
					onclick="document.getElementById('search').value='';this.form.getElementById('filter_category').value='0';this.form.getElementById('filter_state').value='';this.form.submit();">
					<?php echo JText::_('Filter Reset'); ?>
				</button>
			</td>
			<td nowrap="nowrap"><?php
			//echo $this->lists['catid'];
			echo $this->lists['state'];
			?>
			</td>
		</tr>
	</table>


	<div id="editcell">
		<table class="table table-striped">
			<thead>
				<tr>
					<th width="20"><input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this)" />
					</th>
					<th><?php echo JHTML::_('grid.sort',JText::_('Performer'),'p.performer_name',@$this->lists['order_Dir'], @$this->lists['order']);?>
					</th>
					<th><?php echo JHTML::_('grid.sort',JText::_('Category'),'cat.title',@$this->lists['order_Dir'], @$this->lists['order']);?>
					</th>
					<th nowrap="nowrap" width="8%">
						<div align="center">
						<?php echo JHTML::_('grid.sort',JText::_('ORDERING'),'p.ordering',@$this->lists['order_Dir'], @$this->lists['order']); ?>
						<?php echo JHTML::_('grid.order',  $this->items ); ?>
						</div>
					</th>

					<th style="width: 20px;"><?php echo JHTML::_('grid.sort',JText::_('Published'),'p.published',@$this->lists['order_Dir'], @$this->lists['order']);?>
					</th>
					<th width="5"><?php echo JText::_('ID'); ?>
					</th>

				</tr>
			</thead>
			<?php
			$k = 0;
			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=com_jlticketcenter&controller=performer&task=edit&cid[]='. $row->id );

				$row->published = $row->published;
				$published		= JHTML::_('grid.published', $row, $i );
				$checked		= JHTML::_('grid.checkedout',   $row, $i );

				?>
			<tr class="<?php echo "row$k"; ?>">
				<td><?php echo $checked; ?>
				</td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->performer_name; ?>
				</a>
				</td>
				<td><?php echo $row->cat_title; ?>
				</td>

				<td class="order"><span><?php echo $this->pagination->orderUpIcon( $i, ($row->cat_id == @$this->items[$i-1]->catid),'orderup', 'Move Up', $ordering ); ?>
				</span> <span><?php echo $this->pagination->orderDownIcon( $i, $n, ($row->cat_id == @$this->items[$i+1]->catid),'orderdown', 'Move Down', $ordering );?>
				</span> <?php $disabled = $ordering ?  '' : 'disabled="disabled"'; ?>
					<input type="text" name="order[]" size="5"
					value="<?php echo $row->ordering;?>">
				</td>

				<td><?php echo $published; ?>
				</td>
				<td><?php echo $row->id;?>
				</td>
			</tr>
			<?php
			$k = 1 - $k;
			}
			?>
			<tfoot>
				<tr>
					<td colspan="9"><?php echo $this->pagination->getListFooter(); ?></td>
				</tr>
			</tfoot>

		</table>
	</div>

	<input type="hidden" name="option" value="com_jlticketcenter" /> <input
		type="hidden" name="controller" value="performer" /> <input
		type="hidden" name="task" value="" /> <input type="hidden"
		name="boxchecked" value="0" /> <input type="hidden"
		name="filter_order" value="<?php echo $this->lists['order']; ?>" /> <input
		type="hidden" name="filter_order_Dir"
		value="<?php echo $this->lists['order_Dir']; ?>" />

		<?php echo JHTML::_( 'form.token' ); ?>
</form>
