<?php
/**
 * Marketplace - Component Marketplace 
 * ******************************************************************
 *
 * PHP version 7.0
 *
 * @category   Component
 * @package    Joomla
 * @author     WebKul software private limited <support@webkul.com>
 * @copyright  2010 WebKul software private limited
 * @license    http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
 * @version    GIT:5.2
 * @filesource http://store.webkul.com
 * @link       Technical Support:  webkul.uvdesk.com
 * ******************************************************************
 */
// no direct access
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHTML::_('behavior.tooltip');
$lang=JFactory::getLanguage();
$lang->load(JPATH_SITE, 'com_virtuemart', 'en-GB', true);
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('bootstrap.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('behavior.modal');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', 'select');
$user  = JFactory::getUser();
$userId  = $user->get('id');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
if (!class_exists('VmConfig')) {
    include JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' .
    DIRECTORY_SEPARATOR . 'com_virtuemart'.DIRECTORY_SEPARATOR.'helpers'
    .DIRECTORY_SEPARATOR.'config.php';
}
VmConfig::loadConfig();
$doc=JFactory::getDocument();
$style="
.icon-reviews {
    background-image: url('components/com_marketplace/assets/images/sprite-icon.png');
    background-repeat: no-repeat;
    background-position: -39px -124px !important;
    vertical-align: middle;
    width: 20px;
    height: 20px;
    margin-right: 0px!important;
}
";
$doc->addStyleDeclaration($style);
?>
<script type="text/javascript">
</script>
<form action="<?php
    echo 'index.php?option=com_marketplace&view=feedback';
    ?>" method="post" name="adminForm" id="adminForm">
    <?php if (!empty($this->sidebar)) : ?>
    <div id="j-sidebar-container" class="span2">
        <?php echo $this->sidebar; ?>
    </div>
    <div id="j-main-container" class="span10">
        <?php else : ?>
        <div id="j-main-container">
        <?php
        endif;
        ?>
            <?php
            echo JLayoutHelper::render(
                'joomla.searchtools.default', array('view' => $this)
            );
            ?>
            <table class="table table-striped table-bordered">
                <thead>
                    <tr bgcolor="#6994C4" style="color:#FFFFFF;vertical-align:top">
                        
                        <th width="1%" class="center">
                            <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />
                        </th>
                        <th  width="10%" class="center">
                            <?php echo JHTML::_(
                                'searchtools.sort',  'BUYER_NAME', 'g.name',
                                $listDirn, $listOrder
                            ); ?>
                        </th>
                        <th width="10%" class="center">
                            <?php echo JText::_('CUSTOMER_NAME'); ?>
                        </th>
                        
                        <th width="5%" class="center">
                            <?php echo JHtml::_('searchtools.sort', 'FEED_PRICE', 'a.feed_price', $listDirn, $listOrder); ?>
                        </th>
                        <th class="center" width="5%">
                            <?php echo JHtml::_('searchtools.sort', 'FEED_VALUE', 'a.feed_value', $listDirn, $listOrder); ?>
                        </th>
                        <th class="center" width="5%">
                            <?php echo JHtml::_('searchtools.sort', 'FEED_QUALITY', 'a.feed_quality', $listDirn, $listOrder); ?>
                        </th>
                        <th class="center" width="10%" class="description">
                            <?php echo JHtml::_('searchtools.sort', 'FEED_SUMMARY', 'a.feed_summary', $listDirn, $listOrder);?>
                        </th>
                        <th class="center" width="30%" class="description" style="word-wrap:break-word;">
                            <?php echo JText::_('FEED_REVIEW'); ?>
                        </th>
                        
                        <th class="center" width="10%">
                            <?php echo JHtml::_('searchtools.sort', 'CREATED_AT', 'a.create_date', $listDirn, $listOrder); ?>
                        </th>
                        
                        <th class="center" width="5%">
                            <?php echo JHtml::_('searchtools.sort', 'STATUS', 'a.status', $listDirn, $listOrder); ?>
                        </th>
                        <th width="1%" class="center">
                            <?php echo JHTML::_('searchtools.sort',  'ID', 'a.feed_id', $listDirn, $listOrder); ?>
                        </th>
                    </tr>
                </thead>
                <tfoot>
                    <tr>
                        <td colspan="11">
                            <?php  echo $this->pagination->getListFooter(); ?>
                        </td>
                    </tr>
                </tfoot>
                <tbody>
                    <?php
                    $k = 0;
                    if (count($this->items)) {
                        for ($i=0, $n=count($this->items); $i < $n; $i++) {
                            $item = &$this->items[$i];
                            $checked    = JHTML::_('grid.id', $i, $item->feed_id);
                    ?>
                    <tr class="<?php echo "row" . $k; ?>">
                        <td>
                            <?php  echo $checked; ?>
                        </td>
                        <td>
                            <?php echo $this->escape($item->b_name); ?>
                        </td>
                        <td >
                            <a href="index.php?option=com_marketplace&amp;view=marketplace&amp;layout=edit_seller&amp;seller_id=<?php echo $item->seller_id;?>" >
                            <?php
                            echo JFactory::getUser($item->seller_id)->username;
                            ?>
                            </a>
                        </td>
                        <td>
                            <?php
                            echo $item->feed_price; ?>
                        </td>
                        <td>
                            <?php echo $item->feed_value; ?>
                        </td>
                        <td>
                            <?php echo $item->feed_quality; ?>
                        </td>
                        <td>
                            <?php  echo $item->feed_summary; ?>
                        </td>
                        <td class="center" style="word-wrap:break-word;">
                            <?php  echo $item->feed_review; ?>
                        </td>
                        <td>
                            <?php echo JHtml::_('date', $item->create_date, 'Y-m-d'); ?>
                        </td>
                        <td>
                        <?php
                        if ($item->status==1) {
                            echo JText::_('APPROVED');
                        } elseif ($item->status==-1) {
                            echo JText::_('REJECT');
                        } else {
                            echo JText::_('PENDING');
                        }
                        ?>
                        </td>
                        <td>
                            <?php echo (int) $item->feed_id; ?>
                        </td>
                    </tr>
                    <?php
                    $k = 1 - $k;
                        }
                    } else {
                        echo "<tr ><td colspan='11'><div class='alert alert-info'>
                        <strong>Info!</strong>".JText::_('NO_RECORD_FOUND')."</div></td></tr>";
                    }
                    ?>
                </tbody>
            </table>
            <input type="hidden" name="task" value="" />
            <input type="hidden" name="boxchecked" value="0" />
            <?php echo JHTML::_('form.token'); ?>
        </form>
        