{*
* 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='module:agilemultisellerpro/views/templates/front/layouts/selleraccount.tpl'}

{block name='page_content'}
  {if isset($isSeller) AND $isSeller}
    <h3>{l s='Shipping options' d='Modules.Agilemultisellerpro.Shopping'}</h3>

    <div class="table-responsive">
    <table class="table">
      <thead>
      <tr>

        <th class="text-xs-center">{l s='ID' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="">{l s='Name' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="text-xs-center">{l s='Logo' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="text-xs-center">{l s='Status' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="text-xs-center">{l s='Free shipping' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="">{l s='Delay' d='Modules.Agilemultisellerpro.Shipping'}</th>

        <th class="text-xs-center">{l s='Actions' d='Modules.Agilemultisellerpro.Shipping'}</th>
      </tr>
      </thead>

      <tbody>
      {foreach from=$carriers item=carrier name=myLoop}
        <tr>

          <td class="pointer text-xs-center">
            {$carrier.id_carrier|intval}
          </td>

          <td class="pointer left">
            {$carrier.name|escape:'htmlall':'UTF-8'}
          </td>

          <td class="pointer text-xs-center">
              {if $carrier.logo_url }
                <img width="50px" height="auto" src="{$carrier.logo_url|escape:'htmlall':'UTF-8'}" />
              {/if}
          </td>

          <td class="text-xs-center">
            {if $carrier.active_for_seller == 1}
              <a class="js-activate-carrier" style="cursor:pointer" data-setctiveto="0" data-idreference="{$carrier.id_reference|intval}">
                <i class="material-icons btn-outline-success" aria-hidden="true">done</i>
              </a>
            {else}
              <a class="js-activate-carrier" style="cursor:pointer" data-setctiveto="1" data-idreference="{$carrier.id_reference|intval}">
                <i class="material-icons btn-outline-danger" aria-hidden="true">close</i>
              </a>
            {/if}
          </td>

          <td class="text-xs-center">
            {if $carrier.is_free == 1}
                <i class="material-icons text-success" aria-hidden="true">done</i>
            {else}
                <i class="material-icons text-danger" aria-hidden="true">close</i>
            {/if}
          </td>

          <td class="pointer left">{$carrier.delay|escape:'htmlall':'UTF-8'}</td>

          <td class="text-xs-center">
            <a href="{$sellerCarrierEditUrl|escape:'htmlall':'UTF-8'}{$carrier.id_reference|intval}" style="cursor:pointer">
              <i class="material-icons btn-outline-primary" aria-hidden="true">edit</i>
            </a>
          </td>

        </tr>
      {/foreach}
      {if count($carriers) < 1}
        <tr>
          <td colspan="10">
            <p class="alert alert-warning">
              {l s='You do not have any carriers meet your search criteria' d='Modules.Agilemultisellerpro.Shipping'}
            </p>
          </td>
        </tr>
      {/if}
      </tbody>
    </table>
    </div>
  {/if}
{/block}
