<?php if (!empty($items)): ?>
    <div class="market">
        <h2 class="title margin-top"><?= __('Items for sale') ?></h2>
        <div class="market-items">
            <?php foreach ($items as $item): ?>
                <div class="item">
                    <div class="name"><?= util('Item')->getFullName($item['item']) ?></div>
                    <div class="image" data-tooltip data-tooltip-url="<?= tooltip_url($item['item']->getHex()) ?>">
                        <img src="<?= util('Item')->image($item['item']->getSection(), $item['item']->getIndex()) ?>" />
                    </div>
                    <div class="info">
                        <?= util('Market.Market')->price($item['price'], $item['payment_type']) ?> <?= util('Market.Market')->paymentName($item['payment_type'], $item['coin']) ?>
                    </div>
                    <?php if ($item['allowed']): ?>
                        <div class="buy">
                            <a data-ajax-action href="<?= url_to('/market/buy/' . $item['id']) ?>" class="btn"><?= __('Buy') ?></a>
                        </div>
                    <?php endif ?>
                </div>
            <?php endforeach ?>
        </div>
    </div>
<?php endif ?>