<?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'); ?>
<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_catid').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['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 width="5"><?php echo JText::_( 'Code' ); ?>
					</th>
					<th><?php echo JText::_('State'); ?>
					</th>
					<th><?php echo JText::_('Country'); ?>
					</th>
					<th style="width: 20px;"><?php echo JHTML::_('grid.sort',   'Published', 'c.published', @$lists['order_Dir'], @$lists['order'] ); ?>
					</th>
					<th style="width: 20px;"><?php echo JHTML::_('grid.sort', 'Id', 'c.id', @$lists['order_Dir'], @$lists['order'] );?>
					</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=state&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><?php echo $row->code; ?>
				</td>
				<td><a href="<?php echo $link; ?>"><?php echo $row->state_name;?> </a>
				</td>
				<td><?php echo $row->country; ?>
				</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="state" /> <input type="hidden"
		name="task" value="" /> <input type="hidden" name="boxchecked"
		value="0" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
