<?php

/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author				Germinal Camps
# copyright 			Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights Reserved.
# @license				http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: 			http://www.joomlathat.com
# Technical Support:	Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/

//no direct access
defined('_JEXEC') or die('Restricted access.'); ?>

<?php include(JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'invoices'.DS.'tmpl'.DS.'default_menu.php'); ?>

<div id="" class="wrap push shrink invoice-manager">

    <form action="index.php" method="post" name="adminForm" id="adminForm">
    
    <?php echo $this->loadTemplate('filter'); ?>
    
    <table class="table table-striped">
      <thead>
        <tr>
          <th width="5"> <?php echo JHTML::_( 'grid.sort', 'ID', 'te.id', $this->lists['order_Dir'], $this->lists['order']); ?> </th>
          <th width="20"> <input type="checkbox" name="toggle" value="" onclick="Joomla.checkAll(this);" />
          </th>
          <th> <?php echo JHTML::_( 'grid.sort', 'NAME', 'te.name', $this->lists['order_Dir'], $this->lists['order']); ?> </th>
          <th> <?php echo JText::_('PLAIN_TEXT'); ?> </th>
          <th> <?php echo JText::_('HTML_EDITOR'); ?> </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_invoices&controller=template&task=edit&cid[]='. $row->id );
		$link_editor 		= JRoute::_( 'index.php?option=com_invoices&controller=template&task=edit&cid[]='. $row->id .'&layout=editor');
		?>
      <tr class="<?php echo "row$k"; ?>">
        <td><?php echo $row->id; ?></td>
        <td><?php echo $checked; ?></td>
        <td><?php echo $row->name; ?></td>
        <td><a href="<?php echo $link; ?>"><?php echo JText::_('CLICK_TO_EDIT'); ?></a></td>
        <td><a href="<?php echo $link_editor; ?>"><?php echo JText::_('CLICK_TO_EDIT_EDITOR'); ?></a></td>
      </tr>
      <?php
		$k = 1 - $k;
	}
	?>
      <tfoot>
        <tr>
          <td colspan="5"><?php echo $this->pagination->getListFooter(); ?></td>
        </tr>
      </tfoot>
    </table>
  </div>
  <input type="hidden" name="option" value="com_invoices" />
  <input type="hidden" name="task" value="" />
  <input type="hidden" name="boxchecked" value="0" />
  <input type="hidden" name="controller" value="template" />
  <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']; ?>" />
</form>
