{*
* 2007-2022 ETS-Soft
*
* NOTICE OF LICENSE
*
* This file is not open source! Each license that you purchased is only available for 1 wesite only.
* If you want to use this file on more websites (or projects), you need to purchase additional licenses.
* You are not allowed to redistribute, resell, lease, license, sub-license or offer our resources to any third party.
*
* 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 contact us for extra customization service at an affordable price
*
*  @author ETS-Soft <etssoft.jsc@gmail.com>
*  @copyright  2007-2022 ETS-Soft
*  @license    Valid for 1 website (or project) for each purchase of license
*  International Registered Trademark & Property of ETS-Soft
*}

<table class="table">
    <thead>
    <tr>
        <th>{l s='ID' mod='ets_helpdesk'}</th>
        <th>{l s='Logo' mod='ets_helpdesk'}</th>
        <th>{l s='Product' mod='ets_helpdesk'}</th>
        <th>{l s='Staff' mod='ets_helpdesk'}</th>
        <th>{l s='Recent tickets' mod='ets_helpdesk'}</th>
        <th>{l s='Actions' mod='ets_helpdesk'}</th>
    </tr>
    </thead>
    <tbody>
        {if isset($top_modules) && $top_modules}
            {assign var="ik" value=0}
            {foreach from=$top_modules item='row'}
                <tr class="{if $ik%2==0}odd{/if}">
                    <td class="id">{$row.id_product|intval}</td>
                    <td class="logo">
                        {if $row.product_logo !== ''}
                            <img src="{$row.product_logo nofilter}" title="{$row.product_name|escape:'html':'UTF-8'}">
                        {else}--{/if}
                    </td>
                    <td class="product-name">
                        <a href="{$row.product_link nofilter}" title="{$row.product_name|escape:'html':'UTF-8'}" target="_blank">
                            <span>{$row.product_name|escape:'html':'UTF-8'}</span>
                        </a>
                    </td>
                    <td class="staff">{if $row.staff|trim !== ''}{$row.staff|escape:'html':'UTF-8'}{else}--{/if}</td>
                    <td class="recent-ticket">
                        {if $row.recent_ticket}
                            {foreach from=$row.recent_ticket key='key' item='id_ticket'}
                                <a href="{$link->getAdminLink('AdminEtsHDTickets')}&id_ets_hd_ticket={$id_ticket|intval}">{$id_ticket|intval}</a>{if $key <Count($row.recent_ticket)-1}, {/if}
                            {/foreach}
                        {/if}
                    </td>
                    <td class="action">
                        <a href="{$row.product_link nofilter}" target="_blank" title="{l s='View product' mod='ets_helpdesk'}">
                            <svg class="w_14 h_14" width="14" height="14" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1088 800v64q0 13-9.5 22.5t-22.5 9.5h-224v224q0 13-9.5 22.5t-22.5 9.5h-64q-13 0-22.5-9.5t-9.5-22.5v-224h-224q-13 0-22.5-9.5t-9.5-22.5v-64q0-13 9.5-22.5t22.5-9.5h224v-224q0-13 9.5-22.5t22.5-9.5h64q13 0 22.5 9.5t9.5 22.5v224h224q13 0 22.5 9.5t9.5 22.5zm128 32q0-185-131.5-316.5t-316.5-131.5-316.5 131.5-131.5 316.5 131.5 316.5 316.5 131.5 316.5-131.5 131.5-316.5zm512 832q0 53-37.5 90.5t-90.5 37.5q-54 0-90-38l-343-342q-179 124-399 124-143 0-273.5-55.5t-225-150-150-225-55.5-273.5 55.5-273.5 150-225 225-150 273.5-55.5 273.5 55.5 225 150 150 225 55.5 273.5q0 220-124 399l343 343q37 37 37 90z"/></svg>
                        </a>
                    </td>
                </tr>
                {assign var="ik" value=$ik++}
            {/foreach}
        {else}
            <tr>
                <td colspan="6">
                    <p class="no_data">{l s='No data' mod='ets_helpdesk'}</p>
                </td>
            </tr>
        {/if}
    </tbody>
</table>
