<?php
/**
 * JE GroupBuy package
 * @author J-Extension <contact@jextn.com>
 * @link http://www.jextn.com
 * @copyright (C) 2011 - 2012 J-Extension
 * @license GNU/GPL, see LICENSE.php for full license.
**/

// No direct access to this file
defined('_JEXEC') or die('Restricted Access');
$listOrder	= $this->state->get('list.ordering');
$listDirn	= $this->state->get('list.direction');
$canOrder	= $this->user->authorise('core.edit.state', 'com_jegroupbuy.stores');
$saveOrder	= $listOrder == 'p.ordering';
$n = count($this->items);
?>
<?php  foreach($this->items as $i => $item): ?>
<?php
				$saveOrder	= $listOrder == 'p.ordering';
				$ordering	= $listOrder == 'p.ordering';
				$canCreate 	= $this->user->authorise('core.create', 'com_jegroupbuy');
				$canEdit 	= $this->user->authorise('core.edit', 'com_jegroupbuy');
				$canEditOwn = $this->user->authorise('core.edit.own', 'com_jegroupbuy');
				$canChange 	= $this->user->authorise('core.edit.state', 'com_jegroupbuy');

?>
        <tr class="row<?php echo $i % 2; ?>">
                <td class="center hidden-phone">
                        <?php echo JHtml::_('grid.id', $i, $item->id); ?>
                </td>
				<td>
					<?php if ($canEdit || $canEditOwn) : ?>
						<a href="<?php echo JRoute::_('index.php?option=com_jegroupbuy&task=store.edit&id='.(int) $item->id); ?>">
							<?php echo $this->escape($item->shop_name); ?></a>
					<?php else : ?>
						<?php echo $this->escape($item->shop_name); ?>
					<?php endif; ?>
				</td>
       			<td class="center">
					<?php echo $this->escape($item->owner); ?>
				</td>
       			<td class="center">
					<?php echo $this->escape($item->email); ?>
				</td>
       			<td class="center">
					<?php echo $this->escape($item->contact_number); ?>
				</td>
                <td class="center">
					<?php echo JHtml::_('jgrid.published', $item->published, $i, 'stores.', $canChange, 'cb'); ?>
                </td>
				<td align="center">
					<?php echo $item->access_level; ?>
				</td>
				<td class="center">
					<?php if ($item->language=='*'):?>
						<?php echo JText::alt('JALL','language'); ?>
					<?php else:?>
						<?php echo $item->language_title ? $this->escape($item->language_title) : JText::_('JUNDEFINED'); ?>
					<?php endif;?>
				</td>
                <td class="center">
                    <?php echo $item->id; ?>
                </td>
        </tr>
<?php endforeach;  ?>
