<div class="er_rows" style="padding-bottom: 0;">
    <div class="breadcrumbs">
        <div class="breadcrumbs">
            <span><a href="/" title="Главная">Главная</a>&nbsp;/&nbsp;</span><!--
         --><span><a href="<?php echo url_for('@catalog') ?>">Каталог</a></span><!--
         --><span>&nbsp;/&nbsp;Новые поступления</span>

        </div>
    <h1>Новые поступления</h1>
    <style type="text/css">
        .er_content__main__search{display: block;}
        .js_cat_view__ct__tr td {
            height: 63px;
        }
    </style>
    </div>
</div>

<div style="position:absolute;right:20px;margin-top:-30px;">
    Отображать
    <select onchange="$.cookie('js_cat_view', $(this).val());js_cat.init();" style="display:inline-block;width:100px;" class="small_select">
        <option value="div">блоками</option>
        <option value="tr" selected="selected">списком</option>
    </select>
</div>
<i class="br20"></i>


<table class="std_table js_cat_view" cellspacing="0" cellpadding="0">
    <thead>
    <tr valign="bottom" align="left">
        <th colspan="2" width="100%">Название</th>
        <th>Код</th>
        <th>Цена</th>
        <th>Мин.&nbsp;п</th>
        <th>В&nbsp;наличии</th>
        <th>&nbsp;</th>
        <th>&nbsp;</th>
    </tr>
    </thead>

    <tbody>
    <?php

    $productsIdsInBasket = $this->context->getUser()->getProductsIdsInBasket();

    foreach ($products as $product)
    {
        echo "<tr class='js_cat_view__ct__tr'>";
            echo "<td style='position: relative'>";
                echo '<img class="js_cat_view__img image_view" src="' . url_for('@get_image?id=' . $product['id']) . '?small">';
            echo "</td>";
            echo "<td>";
                echo "<a href='" . url_for('@catalog_show_prod?prod_id=' . $product['id']) . "'>" . $product['title'] . "</a>";
            echo "</td>";
            echo "<td>";
                echo $product['product_code'];
            echo "</td>";
            echo "<td><b>";
                if ($product['price'])
                {
                    echo $product['price'] . '<span class="rub_b" style="position:relative;top:0px;">a</span>';
                }
            echo "</b></td>";
            echo "<td>";
                echo $product['min_order'];
            echo "</td>";
            echo "<td>";
                echo round($product['stockCount']);
            echo "</td>";
            ?>

            <td>
                <ul class="counter" data-product-id="<?php echo $product['id'] ?>">
                    <li onclick="basket.remove($(this))"  class="btn_all counter__button counter_button_minus red_button2"></li>
                    <li class="counter__num">
                        <?php

                        $value = 0;
                        if (key_exists($product['id'], $productsIdsInBasket))
                        {
                            $value = $productsIdsInBasket[$product['id']];
                        }

                        ?>
                        <input data-min-p="<?php echo $product['min_order'] ?>" data-stock="<?php echo round($product['stockCount']); ?>" onchange="basket.handWrite($(this));basket.check($(this))" name="" value="<?php echo $value ?>" autocomplete="off" type="text">
                    </li>
                    <li onclick="basket.add($(this))" class="btn_all counter__button counter_button_plus green_button2"></li>
                </ul>
            </td>
            <td></td>

            <?php
        echo "</tr>";
    }

    ?>
    </tbody>


</table>

<i class="br20"></i>

