<?php
$view->extend('MarketZodacoBundle::base_admin.html.php');
?>
<div class="col-lg-12">
    <div class="panel panel-default">
        <div class="panel-heading"><?php echo $view['translator']->trans("List Reviewing") . " - " . $view['translator']->trans("Total") . " ( " . number_format($total) . " )"; ?></div>
        <div class="panel-body">
            <?php
            if (count($list) <= 0) {
                echo $view['translator']->trans("No Data");
            } else {
                ?>
                <table data-toggle="table"  data-show-refresh="false" data-show-toggle="false" data-show-columns="false" data-search="true" data-select-item-name="toolbar1" data-pagination="false">
                    <thead>
                        <tr>
                            <th data-field="id" data-sortable="true"><?php echo $view['translator']->trans("ID"); ?></th>
                            <th data-field="Title" data-sortable="false"><?php echo $view['translator']->trans("Title"); ?></th>
                            <th data-field="Sale"  data-sortable="true"><?php echo $view['translator']->trans("Author"); ?></th>
                            <th data-field="Price" data-sortable="true"><?php echo $view['translator']->trans("Price"); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($list as $key => $value) { ?>
                            <tr data-index="<?php echo $value->getId(); ?>">
                                <td style="">
                                    <?php echo $value->getId(); ?>
                                </td>
                                <td style="">
                                    <a href="<?php echo $view['router']->generate('review_products', array('id' => $value->getId()), true); ?>"><img src="<?php echo (($value->getStatus() == 1 && $value->getUpdateIcon() != "") || $value->getActive() == 0)?$view->escape('/uploads/tmp/'):$view->escape('/uploads/items/'); ?><?php echo ($value->getStatus() == 1 && $value->getUpdateIcon() != "") ? $value->getUpdateIcon() : $value->getIcon(); ?>" style="display: inline; width: 36px; min-height: 36px; height: 36px; margin-bottom: 0px;"> <?php echo $value->getTitle(); ?></a>
                                </td>
                                <td style=""><?php echo $value->getUsers()->getUsername(); ?></td>
                                <td style=""><?php echo number_format($value->getPrice(), 2); ?></td>
                            </tr>
                        <?php } ?>
                    </tbody> 
                </table>
                <?php
                if ($page["NextPage"] > 1):
                    $urlNext = $view['router']->generate($urlN, array(), true);
                    ?>
                    <div class="pull-right pagination" style="width: 100%; display: block;">
                        <ul class="pagination">
                            <?php if ($page["PreviousPage"] != $page["Page"]): ?>
                                <li class="page-pre"><a href="<?php echo $urlNext . '?p=' . $page["PreviousPage"]; ?>">&lt;</a></li>
                            <?php endif; ?>
                            <li class="page-number"><a href="javascript:void(0)"><?php echo $page["Page"] ?></a></li>
                            <?php if ($page["LastPage"] > $page["Page"]): ?>
                                <li class="page-next"><a href="<?php echo $urlNext . '?p=' . $page["NextPage"]; ?>">&gt;</a></li>
                                <?php endif; ?>
                        </ul>
                    </div>
                <?php endif; ?>
            <?php } ?>
        </div>
    </div>
</div>