{*
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}
{extends file='page.tpl'}

{block name='page_content'}

    <h2>{l s='Sellers List' d='Modules.Agilemultisellerpro.Agilesellers'}</h2>
    <br>

    <form id="frmAgileSellers" action="{$formAction|escape:'htmlall':'UTF-8'}" method="post">

        <div class="form-group row ">
            <label class="col-md-3 form-control-label">
                {l s='Name Filter:' d='Modules.Agilemultisellerpro.Agilesellers'}
            </label>
            <div class="col-md-9 js-input-column form-control-label">
                {foreach from=$filters item=letter}
                    {$letter = mb_convert_case($letter, MB_CASE_TITLE, 'UTF-8')}
                    {if $filter==$letter}
                        <span class="filter_letter filter_letter_selected" style="">{$letter|escape:'htmlall':'UTF-8'}</span>
                    {else}
                        <a href="#" class="filter_letter" data-letter="{$letter|escape:'htmlall':'UTF-8'}">
                            {$letter|escape:'htmlall':'UTF-8'}
                        </a>
                    {/if}
                {/foreach}
            </div>
        </div>

        <div class="form-group row ">
            <label class="col-md-3 form-control-label" for="seller_location">
                {l s='Location:' d='Modules.Agilemultisellerpro.Agilesellers'}
            </label>
            <div class="col-md-6 js-input-column">
                <select class="form-control form-control-select" name="seller_location" id="seller_location">
                    <option value="0">{l s=' - All Locations -' d='Modules.Agilemultisellerpro.Agilesellers'}</option>
                    {foreach from=$countriesList item=sellerloc}
                        {if !empty({$sellerloc.name})}
                            <option value="{$sellerloc.id|escape:'htmlall':'UTF-8'}" {if $sellerloc.id == $seller_location}selected{/if}>{$sellerloc.name|escape:'htmlall':'UTF-8'}</option>
                        {/if}
                    {/foreach}
                </select>
            </div>
            <div class="col-md-3 form-control-comment">
            </div>
        </div>

        {* To show TYPE filter uncomment this blok
        <div class="form-group row ">
            <label class="col-md-3 form-control-label" for="seller_type">
                {l s='Type:' d='Modules.Agilemultisellerpro.Agilesellers'}
            </label>
            <div class="col-md-6 js-input-column">
                <select class="form-control form-control-select" name="seller_type" id="seller_type">
                    <option value="0">{l s='- All Types -' d='Modules.Agilemultisellerpro.Agilesellers'}</option>
                    {foreach from=$sellerTypesList item=sellertype}
                        <option value="{$sellertype.id|escape:'htmlall':'UTF-8'}" {if $sellertype.id == $seller_type}selected{/if}>{$sellertype.name|escape:'htmlall':'UTF-8'}</option>
                    {/foreach}
                </select>
            </div>
            <div class="col-md-3 form-control-comment">
            </div>
        </div>
        *}

        <div class="form-group row ">
            <label class="col-md-3 form-control-label" for="nameq">
                {l s='Name Search:' d='Modules.Agilemultisellerpro.Agilesellers'}
            </label>
            <div class="col-md-6 js-input-column">
                <input class="form-control" type="text" name="nameq" id="nameq" value="{$nameq|escape:'htmlall':'UTF-8'}"}>
            </div>
            <div class="col-md-3 form-control-comment">
            </div>
        </div>

        <div class="form-group row  text-xs-center">
            <div class="col-xs-12 js-input-column">
                <input class="btn btn-primary form-control-submit" type="submit" name="btnsearchname" id="btnsearchname" value="{l s='Search' d='Modules.Agilemultisellerpro.Agilesellers'}">
            </div>
        </div>

        <div class="row">
            <div class="col-xs-12 pt-2">
                {if $selers_nb > 0}
                    {if $selers_nb > 1}
                        <p class="alert alert-info">{l s='There are' d='Modules.Agilemultisellerpro.Agilesellers'} {$selers_nb|escape:'htmlall':'UTF-8'} {l s='sellers.' d='Modules.Agilemultisellerpro.Agilesellers'}</p>
                    {else}
                        <p class="alert alert-info">{l s='There is' d='Modules.Agilemultisellerpro.Agilesellers'} {$selers_nb|escape:'htmlall':'UTF-8'} {l s='seller.' d='Modules.Agilemultisellerpro.Agilesellers'}</p>
                    {/if}
                {else}
                    <p class="alert alert-warning">{l s='There is no sellers found meets your search criteria.' d='Modules.Agilemultisellerpro.Agilesellers'}</p>
                {/if}
            </div>
        </div>

        <input type="hidden" name="filter" id="filter" value="{$filter|escape:'htmlall':'UTF-8'}"}>
    </form>

    <div class="row pt-3 sellers-list">
        <div class="col-xs-12 col-md-6">
            <div class="row">
                <div class="col-xs-4 text-xs-left">
                    <h3>{l s='Logo/Photo' d='Modules.Agilemultisellerpro.Agilesellers'}</h3>
                </div>
                <div class="col-xs-8 text-xs-left">
                    <h3>{l s='Description' d='Modules.Agilemultisellerpro.Agilesellers'}</h3>
                </div>
            </div>
        </div>
        <div class="col-xs-12 col-md-6 hidden-sm-down">
            {if count($seller_list) > 1}
                <div class="row">
                    <div class="col-xs-4 text-xs-left">
                        <h3>{l s='Logo/Photo' d='Modules.Agilemultisellerpro.Agilesellers'}</h3>
                    </div>
                    <div class="col-xs-8 text-xs-left">
                        <h3>{l s='Description' d='Modules.Agilemultisellerpro.Agilesellers'}</h3>
                    </div>
                </div>
            {/if}
        </div>

        {foreach from=$seller_list item=seller}
            <div class="col-xs-12 col-md-6">
                <div class="row">
                    <div class="col-xs-4 pt-1 pb-1">
                        <div class="logo">
                            <a href="{$seller.sellerLink|escape:'htmlall':'UTF-8'}">
                                {if empty($seller.logoImageUrl)}
                                    {* No Logo *}
                                    <img src="{$urls.base_url|escape:'htmlall':'UTF-8'}modules/agilemultisellerpro/views/img/no.jpg" width="100%" title="{$seller.company|escape:'htmlall':'UTF-8'}" alt="{$seller.company|escape:'htmlall':'UTF-8'}" />
                                {else}
                                    <img src="{$seller.logoImageUrl|escape:'htmlall':'UTF-8'}" width="100%" title="{$seller.company|escape:'htmlall':'UTF-8'}" alt="{$seller.company|escape:'htmlall':'UTF-8'}" />
                                {/if}
                            </a>
                        </div>
                    </div>
                    <div class="col-xs-8 pt-1 pb-1">
                        <h4>
                            <a href="{$seller.sellerLink|escape:'htmlall':'UTF-8'}">{$seller.company|escape:'htmlall':'UTF-8'}</a>
                        </h4>
                        <span>{$seller.countryName|escape:'htmlall':'UTF-8'}</span>
                        <br>
                        {$seller.description|cleanHtml nofilter}
                    </div>
                </div>
            </div>
        {/foreach}
    </div>

{/block}


