<?php
/**
 * @version		$Id: modal.php 132 2009-06-23 07:25:22Z eddieajau $
 * @package		TAOJ.Quanta
 * @subpackage	com_quanta
 * @copyright	Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
 * @link		http://www.theartofjoomla.com
 */

// no direct access
defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT.DS.'helpers'.DS.'html');
JHtml::_('behavior.tooltip');
JHtml::stylesheet('default.css', 'administrator/components/com_quanta/media/css/');

$function = JRequest::getVar('function');
?>
<form action="<?php echo JRoute::_('index.php?option=com_quanta&view=charts');?>" method="post" name="adminForm">
	<fieldset class="filter clearfix">
		<div class="left">
			<label for="filter_search">
				<?php echo JText::_('Quanta_Filter_Search_Label'); ?>
			</label>
			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" size="30" title="<?php echo JText::_('Quanta_Filter_Search_Desc'); ?>" />

			<button type="submit">
				<?php echo JText::_('Quanta_Button_Go'); ?></button>
			<button type="button" onclick="document.getElementById('filter_search').value='';this.form.submit();">
				<?php echo JText::_('Quanta_Button_Clear'); ?></button>
		</div>
		<div class="right">
			<select name="filter_published" id="filter_published" class="inputbox" onchange="this.form.submit()">
				<?php echo JHtml::_('quanta.publishedOptions', $this->state->get('filter.published')); ?>
			</select>
		</div>
	</fieldset>
	<table class="adminlist">
		<thead>
			<tr>
				<th class="title">
					<?php echo JHtml::_('grid.sort', 'Quanta_Heading_Title', 'a.title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
				</th>
				<th width="10%">
					<?php echo JText::_('Quanta_Heading_Width_Height'); ?>
				</th>
				<th width="15%">
					<?php echo JHtml::_('grid.sort', 'Quanta_Heading_Category', 'a.category_id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
				</th>
				<th width="5%">
					<?php echo JHtml::_('grid.sort', 'Quanta_Heading_Published', 'a.published', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
				</th>
				<th width="1%">
					<?php echo JHtml::_('grid.sort', 'Quanta_Heading_ID', 'a.id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="15">
					<?php echo $this->pagination->getListFooter(); ?>
				</td>
			</tr>
		</tfoot>
		<tbody>
		<?php
			foreach ($this->items as $i => $item) : ?>
			<tr class="row<?php echo $i % 2; ?>">
				<td>
					<a style="cursor: pointer;" onclick="window.parent.<?php echo $function;?>('<?php echo $item->id; ?>', '<?php echo str_replace(array("'", "\""), array("\\'", ""),$item->title); ?>');">
						<?php echo htmlspecialchars($item->title, ENT_QUOTES, 'UTF-8'); ?></a>
					<br /><small>(<?php echo $item->alias; ?>)</small>
				</td>
				<td align="center">
					<?php echo JText::sprintf('Quanta_Width_X_Height', $item->chart_width, $item->chart_height); ?>
				</td>
				<td align="center">
					<?php echo $item->category_title; ?>
				</td>
				<td align="center">
				</td>
				<td align="center">
					<?php echo $item->id; ?>
				</td>
			</tr>
		<?php endforeach; ?>
		</tbody>
	</table>

	<input type="hidden" name="task" value="" />
	<input type="hidden" name="boxchecked" value="0" />
	<input type="hidden" name="filter_order" value="<?php echo $this->state->get('list.ordering'); ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->get('list.direction'); ?>" />
	<?php echo JHtml::_('form.token'); ?>
</form>
