<?php
/**
 * @version 7.10 [rev.7.10.03]
 */

/* @var bool $live */
/* @var \Ppb\Db\Table\Row\Listing $listing */
$this->listingDetails($listing);
/* @var \Ppb\Db\Table\Row\User $seller */
$this->userDetails($seller);
?>

<div itemscope itemtype="http://schema.org/Product" class="product" id="print-area">
    <meta itemprop="url" content="<?php echo $this->url($listing->link()); ?>">

    <div class="row">
        <div class="col-sm-7">
            <?php $mainCategory = $this->categories()->getCategories()->getBreadcrumbs($listing['category_id']); ?>

            <ul class="breadcrumb">
                <li>
                    <a class="home"
                       href="<?php echo $this->url(null, 'app-home'); ?>"><?php echo $this->_('Home'); ?></a>
                    <span></span>
                </li>
                <?php foreach ($mainCategory as $id => $name) { ?>
                    <li>
                        <a href="<?php echo $this->url(array('category_name' => $name, 'parent_id' => $id),
                            'listings-browse-category'); ?>"><?php echo $name; ?></a>
                    </li>
                <?php } ?>
            </ul>
        </div>

        <div class="col-sm-5 manage-buttons no-print">
            <div class="manage-listing-btn-group pull-right">
                <?php echo $this->partial('partials/details-manage-buttons.phtml',
                    array('listing' => $listing,
                          'live'    => $live,
                    )); ?>
            </div>
        </div>
    </div>

    <?php if (($vacationMode = $this->userDetails()->vacationMode()) !== false) { ?>
        <div class="alert alert-warning alert-dismissable">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <?php echo $vacationMode; ?>
        </div>
    <?php } ?>


    <div class="row">
        <div class="col-sm-5">
            <?php $media = $listing->getMedia(array('image', 'video')); ?>
            <?php
            $counter = 0;
            $mediaCount = count($media);

            if ($mediaCount > 0) { ?>

                <div id="jq-mainImage" class="jq-loading-slider">
                    <?php foreach ($media as $file) { ?>
                        <div class="item jq-slide hidden">
                            <?php
                            if ($file['type'] == \Ppb\Service\ListingsMedia::TYPE_VIDEO) {
                                echo $this->videoPlayer($file);
                            }
                            else {
                                echo $this->thumbnail($file['value'], 500, true,
                                    array(
                                        'alt'             => $listing['name'],
                                        'type'            => $file['type'],
                                        'data-gallery-id' => $counter++,
                                        'itemprop'        => 'image',
                                    ));
                            } ?>

                        </div>
                    <?php } ?>
                </div>

                <?php if ($mediaCount > 1) { ?>
                    <div id="jq-thumbnails" class="jq-loading-slider">
                        <?php foreach ($media as $file) { ?>
                            <div class="item jq-slide hidden">
                                <?php echo $this->thumbnail($file['value'], 100, true,
                                    array('alt' => $listing['name'], 'type' => $file['type'])); ?>
                            </div>
                        <?php } ?>
                    </div>
                <?php } ?>

                <?php foreach ($media as $file) {
                    if ($file['type'] == \Ppb\Service\ListingsMedia::TYPE_IMAGE) { ?>
                        <a class="jq-gallery"
                           href="<?php echo $this->thumbnail()->generateImagePath($file['value']); ?>"></a>
                    <?php }
                } ?>
            <?php } ?>
            <div class="clearfix"></div>
        </div>

        <div class="col-sm-7">
            <h1 class="title" itemprop="name"><?php echo $listing['name']; ?></h1>
            <?php if ($live === true) { ?>
                <div>
                    <small>[ <?php echo $this->_('ID:') . ' ' . $listing['id']; ?> ]</small>
                </div>
            <?php } ?>
            <div class="spacer"></div>
            <?php if (!empty($listing['subtitle'])) { ?>
                <h2 class="subtitle"><?php echo $listing['subtitle']; ?></h2>
            <?php } ?>

            <?php if ($this->settings['enable_social_network_links'] && !$listing->isDraft() && $live === true) { ?>
                <div class="listing-social no-print">
                    <?php echo $this->social($listing)->display(); ?>
                </div>

                <div class="clearfix"></div>

            <?php } ?>

            <div class="tabbable actions">
                <ul class="nav nav-tabs details-tabs no-print">
                    <li class="active"><a href="#pane1" data-toggle="tab"><?php echo $this->_('Details'); ?></a>
                    </li>
                    <li class=""><a href="#pane2" data-toggle="tab"><?php echo $this->_('Seller Info'); ?></a></li>
                    <?php if ($live === true) { ?>
                        <li class=""><a href="#pane3" data-toggle="tab"><?php echo $this->_('History'); ?></a></li>
                    <?php } ?>
                </ul>
                <div class="tab-content details-content">
                    <div id="pane1" class="tab-pane active">
                        <?php if ($listing['listing_type'] == 'auction') { ?>
                            <h5 class="current-price">
                                <?php echo $this->_('Current Bid:'); ?>
                                <?php echo $this->amount($listing->currentBid(true), $listing['currency']); ?>

                                <?php if ($listing['reserve_price'] > 0) { ?>
                                    <?php if ($live === true) { ?>
                                        <?php if ($listing->currentBid() < $listing['reserve_price']) { ?>
                                            <span class="label label-danger">
                                            <?php echo $this->_('Reserve Not Met'); ?></span>
                                            <?php
                                        }
                                        else {
                                            ?>
                                            <span class="label label-success">
                                            <?php echo $this->_('Reserve Met'); ?></span>
                                        <?php } ?>
                                        <?php
                                    }
                                    else {
                                        ?>
                                        <span class="label label-default">
                                        <?php echo $this->_('Reserve Price:'); ?>
                                        <?php echo $this->amount($listing['reserve_price'], $listing['currency']); ?>
                                    </span>
                                    <?php } ?>
                                <?php } ?>

                                <span class="number-bids">
                                <?php echo $this->_('Bids'); ?>:
                                    <?php echo $listing->countDependentRowset('\Ppb\Db\Table\Bids'); ?>
                            </span>
                            </h5>
                            <?php
                            if (!empty($this->loggedInUser['id'])) {
                                if (($yourBid = $listing->yourBid($this->loggedInUser['id'])) !== null) { ?>
                                    <h5 class="your-bid">
                                        <?php echo $this->_('Your Bid:'); ?>
                                        <?php echo $this->amount($yourBid['amount'], $listing['currency']); ?>
                                        <?php if ($this->settings['proxy_bidding']) { ?>
                                            <small>
                                                (<?php echo $this->_('Proxy Bid'); ?>
                                                <?php echo $this->amount($yourBid['maximum_bid'],
                                                    $listing['currency']); ?>)
                                            </small>
                                        <?php } ?>
                                        <?php echo $this->bidStatus($yourBid); ?>
                                    </h5>
                                <?php }
                            } ?>
                            <div class="spacer"></div>
                        <?php } ?>

                        <div class="purchase">
                            <?php if ($listing['listing_type'] == 'auction') { ?>
                                <form
                                        action="<?php echo $this->url(array('action' => 'confirm', 'id' => $listing['id']),
                                            'listings-bid'); ?>" method="post">
                                    <dl class="dl-horizontal">
                                        <dt class="bid">
                                            <?php echo $this->_('Place Bid'); ?>
                                        </dt>
                                        <dd>
                                            <?php
                                            echo $this->formElement('text', 'amount')
                                                ->setAttributes(array(
                                                    'class'       => 'form-control input-mini',
                                                    'placeholder' => $listing['currency'],
                                                ))
                                                ->render();

                                            $attributes = array(
                                                'class' => 'btn btn-primary',
                                            );

                                            if (!$listing->isActiveAndOpen()) {
                                                $attributes['disabled'] = 'disabled';
                                            }


                                            echo $this->formElement('button', 'bid')
                                                ->setType('submit')
                                                ->setAttributes($attributes)
                                                ->setValue('Place Bid')
                                                ->render();
                                            ?>
                                        </dd>
                                        <dd>
                                            <?php echo $this->_('Minimum Bid:'); ?>
                                            <?php echo $this->amount($listing->minimumBid(), $listing['currency']); ?>
                                        </dd>
                                    </dl>
                                </form>
                                <div class="spacer"></div>
                            <?php } ?>

                            <form action="" method="post">
                                <?php if ($listing->isBuyOut()) { ?>
                                    <dl class="dl-horizontal">
                                        <dt class="buy">
                                            <?php echo $this->_('Price'); ?>
                                        </dt>
                                        <dd class="desc" itemprop="offers" itemscope
                                            itemtype="http://schema.org/Offer">
                                            <meta itemprop="priceCurrency"
                                                  content="<?php echo $listing['currency']; ?>">

                                            <span id="product-price" itemprop="price">
                                                <?php echo $this->amount($listing['buyout_price'], $listing['currency']); ?>
                                            </span>

                                            <?php if ($listing['listing_type'] == 'product') {
                                                echo $this->partial('partials/product-attributes.phtml', array(
                                                    'listing' => $listing,
                                                ));
                                            } ?>

                                            <?php if ($listing['quantity'] == -1 || $listing['quantity'] > 1 || $listing->getData('stock_levels')) { ?>
                                        </dd>
                                        <dd>
                                            <?php
                                            echo $this->formElement('text', 'quantity')
                                                ->setAttributes(array(
                                                    'class'       => 'form-control input-mini',
                                                    'placeholder' => $this->_('Quantity'),
                                                ))
                                                ->render();
                                            ?>
                                            <?php } ?>

                                            <?php
                                            $purchaseBtnValue = ($listing->canAddToCart() === true) ? $this->_('Add to Cart') : $this->_('Buy Out');

                                            $attributes = array(
                                                'class'      => 'btn btn-success',
                                                'formaction' => $this->url($listing->purchaseLink()),
                                            );

                                            if (!$listing->isActiveAndOpen() || $seller->isVacation()) {
                                                $attributes['disabled'] = 'disabled';
                                            }

                                            echo $this->formElement('button', 'buy')
                                                ->setType('submit')
                                                ->setAttributes($attributes)
                                                ->setValue($purchaseBtnValue)
                                                ->render();
                                            ?>
                                        </dd>
                                    </dl>
                                    <div class="spacer"></div>
                                <?php } ?>
                                <?php if ($listing->isMakeOffer()) { ?>
                                    <dl class="dl-horizontal">
                                        <dt class="offer"><?php echo $this->_('Make An Offer'); ?></dt>
                                        <dd>
                                            <?php
                                            echo $this->formElement('text', 'amount')
                                                ->setAttributes(array(
                                                    'class'       => 'form-control input-mini',
                                                    'placeholder' => $listing['currency'],
                                                ))
                                                ->render();

                                            $attributes = array(
                                                'class'      => 'btn btn-warning',
                                                'formaction' => $this->url(array('action' => 'confirm', 'id' => $listing['id']), 'listings-offer'),
                                            );

                                            if (!$listing->isActiveAndOpen()) {
                                                $attributes['disabled'] = 'disabled';
                                            }

                                            echo $this->formElement('button', 'offer')
                                                ->setType('submit')
                                                ->setAttributes($attributes)
                                                ->setValue('Make Offer')
                                                ->render();
                                            ?>
                                        </dd>
                                        <?php if ($seller->displayMakeOfferRanges() || $live != true) { ?>
                                            <dd>
                                                <?php echo $this->offerRanges($listing); ?>
                                            </dd>
                                        <?php } ?>
                                    </dl>
                                    <div class="spacer"></div>
                                <?php } ?>
                            </form>


                            <?php if ($listing['quantity'] > 0 || $listing['listing_type'] == 'product') { ?>
                                <dl class="dl-horizontal">
                                    <dt><?php echo $this->_('Quantity'); ?></dt>
                                    <dd>
                                    <span id="quantity-available">
                                        <?php echo $this->listingDetails()->availableQuantity(); ?>
                                    </span>
                                    </dd>
                                </dl>
                                <div class="spacer"></div>
                            <?php } ?>

                            <?php if (($taxType = $listing->getTaxType()) !== false) { ?>
                                <span
                                        class="label label-default"><?php echo $this->taxType($taxType)->display(); ?></span>
                                <div class="spacer"></div>
                            <?php } ?>


                            <dl class="dl-horizontal">
                                <dt><?php echo $this->_('Status'); ?></dt>
                                <dd>
                                    <?php echo $this->listingDetails()->status(false); ?>
                                </dd>
                                <?php if ($listing->isScheduled()) { ?>
                                    <dt><?php echo $this->_('Starts in'); ?></dt>
                                    <dd><?php echo $this->countdown($listing['start_time'])->display(); ?></dd>
                                    <?php
                                }
                                else if ($listing->isOpen() && $listing['end_time'] != null && !$listing['draft']) {
                                    ?>
                                    <dt><?php echo $this->_('Time Left'); ?></dt>
                                    <dd class="time"><?php echo $this->countdown($listing['end_time'])->display(); ?></dd>

                                <?php } ?>
                            </dl>

                            <?php if ($live === true) { ?>
                                <div class="text-center">
                                    <?php if ($seller->getGlobalSettings('visitors_counter')) { ?>
                                        <span class="label label-info">
                                        <?php echo sprintf(
                                            $this->_('Listing viewed %s times'),
                                            $listing['nb_clicks']); ?>
                                    </span>
                                    <?php } ?>
                                    <?php if ($seller->getGlobalSettings('listing_watched_by_box')) { ?>
                                        <span class="label label-success">
                                        <?php echo sprintf(
                                            $this->_('Listing watched by %s users'),
                                            $listing->countWatchers()); ?>
                                    </span>
                                    <?php } ?>
                                </div>

                            <?php } ?>
                        </div>


                    </div>
                    <?php /* @var \Ppb\Db\Table\Row\User $seller */ ?>
                    <div id="pane2" class="tab-pane">
                        <h4 class="headline print-only mgt-20">
                            <span><?php echo $this->_('Seller Info'); ?></span>
                        </h4>

                        <dl class="dl-horizontal">
                            <dt><?php echo $this->_('Seller'); ?></dt>
                            <dd><?php echo $this->userDetails()->display(); ?></dd>

                            <dt><?php echo $this->_('Registered Since'); ?></dt>
                            <dd><?php echo $this->date($seller->getData('created_at')); ?></dd>

                            <dt><?php echo $this->_('Feedback'); ?></dt>
                            <dd><?php echo $this->fieldDisplay($seller->getReputationPercentage(), null, $this->_('n/a')); ?></dd>

                            <dd>
                                <a href="<?php echo $this->url($seller->otherItemsLink()); ?>">
                                    <?php echo $this->_('View Other Items'); ?>
                                </a>
                            </dd>
                            <?php if ($seller->getData('store_active')) { ?>
                                <dt><?php echo $this->_('Store'); ?></dt>
                                <dd>
                                    <a href="<?php echo $this->url($seller->storeLink()); ?>">
                                        <?php echo $seller->storeName(); ?>
                                    </a>
                                </dd>
                            <?php } ?>
                        </dl>
                    </div>

                    <?php if ($live === true) {
                        $historyTabs = array();

                        if ($listing['listing_type'] == 'auction') {
                            $historyTabs['bids'] = array(
                                'name'     => $this->_('Bids'),
                                'headline' => $this->_('Bids History'),
                                'content'  => $this->partial('listings/history/bids.phtml',
                                    array('listing' => $listing)),
                            );
                        }

                        if ($listing->isMakeOffer()) {
                            $historyTabs['offers'] = array(
                                'name'     => $this->_('Offers'),
                                'headline' => $this->_('Offers History'),
                                'content'  => $this->partial('listings/history/offers.phtml',
                                    array('listing' => $listing)),
                            );
                        }

                        $historyTabs['sales'] = array(
                            'name'     => $this->_('Sales'),
                            'headline' => $this->_('Sales History'),
                            'content'  => $this->partial('listings/history/sales.phtml',
                                array('listing' => $listing)),
                        );
                        ?>
                        <div id="pane3" class="tab-pane no-print">
                            <?php if (count($historyTabs) > 1) {
                                $activeTab = ' class="active"'; ?>
                                <ul class="nav nav-pills">
                                    <?php foreach ($historyTabs as $tabId => $historyTab) { ?>
                                        <li <?php echo $activeTab; ?>>
                                            <a href="#<?php echo $tabId; ?>"
                                               data-toggle="tab"><?php echo $historyTab['name']; ?></a>
                                        </li>
                                        <?php $activeTab = null; ?>
                                        <?php
                                    } ?>
                                </ul>
                            <?php } ?>

                            <div class="tab-content">
                                <?php $activeTab = ' active'; ?>
                                <?php foreach ($historyTabs as $tabId => $historyTab) { ?>
                                    <div class="tab-pane<?php echo $activeTab; ?>" id="<?php echo $tabId; ?>">
                                        <h4><?php echo $historyTab['headline']; ?></h4>
                                        <?php echo $historyTab['content']; ?>
                                    </div>
                                    <?php $activeTab = null; ?>
                                    <?php
                                } ?>
                            </div>

                        </div>
                    <?php } ?>
                </div>
            </div>
        </div>
    </div>

    <?php $customFields = $listing->getCustomFields(); ?>

    <div class="description-tabs">
        <ul class="nav nav-tabs no-print">
            <li class="active">
                <a href="#desc" data-toggle="tab"><?php echo $this->_('Description'); ?></a>
            </li>
            <?php if (count($customFields) > 0) { ?>
                <li>
                    <a href="#spec" data-toggle="tab"><?php echo $this->_('Specifications'); ?></a>
                </li>
            <?php } ?>
            <li>
                <a href="#pay" data-toggle="tab"><?php echo $this->_('Payments & Returns'); ?></a>
            </li>
            <?php if ($this->settings['enable_shipping']) { ?>
                <li>
                    <a href="#post" data-toggle="tab"><?php echo $this->_('Postage & Shipping'); ?></a>
                </li>
            <?php } ?>
            <?php if ($live === true) { ?>
                <?php if ($this->settings['enable_messaging']) { ?>
                    <li>
                        <a href="#ques" data-toggle="tab"><?php echo $this->_('Questions & Answers'); ?></a>
                    </li>
                <?php } ?>
                <?php if ($this->settings['other_items_seller']) { ?>
                    <li>
                        <a href="#other" data-toggle="tab"><?php echo $this->_("Seller's Other Items"); ?></a>
                    </li>
                <?php } ?>
            <?php } ?>
        </ul>
        <div class="tab-content">
            <div class="tab-pane active" id="desc" itemprop="description">
                <h3 class="headline print-only">
                    <span><?php echo $this->_('Description'); ?></span>
                </h3>
                <?php echo $this->renderHtml($listing['description'], false, false); ?>
            </div>

            <?php if (count($customFields) > 0) { ?>
                <div class="tab-pane" id="spec">
                    <h3 class="headline print-only mgt-30">
                        <span><?php echo $this->_('Specifications'); ?></span>
                    </h3>
                    <dl class="dl-horizontal">
                        <?php foreach ($customFields as $field) { ?>
                            <dt><?php echo $this->_($field['label']); ?></dt>
                            <dd><?php echo $this->fieldDisplay($field['display'], null, '-'); ?></dd>
                        <?php } ?>
                    </dl>
                </div>
            <?php } ?>

            <div class="tab-pane" id="pay">
                <h3 class="headline print-only mgt-30">
                    <span><?php echo $this->_('Payments & Returns'); ?></span>
                </h3>

                <dl class="dl-horizontal">
                    <dt><?php echo $this->_('Payment Methods'); ?></dt>
                    <dd><?php
                        $object = $this;
                        echo $this->fieldDisplay(array_map(function ($array) use (&$object) {
                            return $object->_($array['name']);
                        }, $listing->getPaymentMethods()), null, 'N/A'); ?></dd>
                    <dt><?php echo $this->_('Returns Accepted'); ?></dt>
                    <dd><?php echo $this->fieldDisplay($listing['accept_returns'], $this->_('Yes'), $this->_('No')); ?></dd>
                    <?php if (!empty($listing['returns_policy'])) { ?>
                        <dt><?php echo $this->_('Returns Policy'); ?></dt>
                        <dd><?php echo $listing['returns_policy']; ?></dd>
                    <?php } ?>
                </dl>
            </div>

            <?php if ($this->settings['enable_shipping']) {
                $shipsTo = $this->listingDetails()->shipsTo($seller->getShipping());
                ?>
                <div class="tab-pane" id="post">
                    <h3 class="headline print-only mgt-30">
                        <span><?php echo $this->_('Postage & Shipping'); ?></span>
                    </h3>

                    <dl class="dl-horizontal">
                        <dt><?php echo $this->_('Item Location'); ?></dt>
                        <dd><?php echo $this->fieldDisplay($this->listingDetails()->location(), null,
                                $this->_('n/a')); ?></dd>

                        <?php if (!$listing->pickUpOnly()) { ?>
                            <dt><?php echo $this->_('Ships To'); ?></dt>
                            <dd><?php echo $this->fieldDisplay($shipsTo, null, $this->_('No shipping available.')); ?></dd>
                        <?php } ?>
                    </dl>

                    <?php if ($live === true && !$listing->pickUpOnly() && !empty($listing['country']) && count($shipsTo)) { ?>
                        <div class="shipping-calculator no-print">
                            <h4 class="headline">
                                <span><?php echo $this->_('Postage Calculator'); ?></span>
                            </h4>
                            <?php echo $this->partial('partials/shipping-calculator.phtml', array(
                                'quantity'  => 1,
                                'listingId' => $listing['id'],
                                'user'      => $seller)); ?>
                        </div>
                    <?php } ?>

                    <dl class="dl-horizontal">
                        <?php if ($this->settings['enable_pickups']) { ?>
                            <dt><?php echo $this->_('Pick-ups'); ?></dt>
                            <dd>
                                <?php echo $this->_(
                                    $this->fieldDisplay(\Ppb\Model\Shipping::getPickupOptions($listing->getData(\Ppb\Model\Shipping::FLD_PICKUP_OPTIONS)),
                                        null, 'n/a')); ?>
                            </dd>
                        <?php } ?>
                        <?php if (!$listing->pickUpOnly()) { ?>
                            <?php if ($listing[\Ppb\Model\Shipping::FLD_INSURANCE]) { ?>
                                <dt><?php echo $this->_('Insurance'); ?></dt>
                                <dd>
                                    <?php echo $this->amount($listing[\Ppb\Model\Shipping::FLD_INSURANCE],
                                        $listing['currency']); ?>
                                </dd>
                            <?php } ?>
                            <?php if (\Ppb\Model\Shipping::POSTAGE_TYPE_CARRIERS == $seller->getShipping()->getPostageType()) { ?>
                                <dt><?php echo $this->_('Item Weight'); ?></dt>
                                <dd><?php echo $this->listingDetails()->weight(); ?></dd>

                                <dt><?php echo $this->_('Dimensions'); ?></dt>
                                <dd><?php echo $this->fieldDisplay($this->listingDetails()->dimensions()); ?></dd>
                            <?php } ?>
                            <dt><?php echo $this->_('Shipping Instructions'); ?></dt>
                            <dd>
                                <?php echo $this->fieldDisplay($this->renderText($listing[\Ppb\Model\Shipping::FLD_SHIPPING_DETAILS], true), null,
                                    '-'); ?>
                            </dd>
                        <?php } ?>
                    </dl>
                </div>
            <?php } ?>

            <?php if ($live === true) { ?>
                <?php if ($this->settings['enable_messaging']) { ?>
                    <div class="tab-pane no-print" id="ques">
                        <h4 class="headline">
                            <span><?php echo $this->_('Public Questions'); ?></span>
                        </h4>
                        <?php echo $this->partial('partials/messages.phtml', array(
                            'listing' => $listing)); ?>

                        <?php if (empty($this->loggedInUser['id'])) { ?>
                            <div class="text-center">
                                <?php echo $this->_('You need to be logged in to ask the seller a question.'); ?>
                                <br>
                                <a class="btn btn-link dialog-box"
                                   href="<?php echo $this->url(array('module' => 'members', 'controller' => 'user', 'action' => 'login-modal')); ?>"
                                   title="<?php echo $this->_('Log In'); ?>">
                                    <?php echo $this->_('Click here to login'); ?>
                                </a>
                            </div>

                            <?php
                        }
                        else if ($this->loggedInUser['id'] != $listing['user_id']) {
                            ?>
                            <?php echo $this->action('create', 'messaging', 'members', array(
                                'receiver_id'             => $listing['user_id'],
                                'listing_id'              => $listing['id'],
                                'topic_type'              => \Ppb\Service\Messaging::PRIVATE_QUESTION,
                                'accept_public_questions' => $seller->acceptPublicQuestions(),
                            )); ?>
                        <?php } ?>
                    </div>
                <?php } ?>

                <?php if ($this->settings['other_items_seller']) { ?>
                    <div class="tab-pane no-print" id="other">
                        <?php echo $this->action('listings', 'browse', 'listings',
                            array('type' => 'seller-other-items', 'user_id' => $listing['user_id'], 'current_listing_id' => $listing['id'])); ?>
                    </div>
                <?php } ?>
            <?php } ?>
        </div>
    </div>
</div>

