<?php
/**
 * Mageplaza
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Mageplaza.com license that is
 * available through the world-wide-web at this URL:
 * https://www.mageplaza.com/LICENSE.txt
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade this extension to newer
 * version in the future.
 *
 * @category    Mageplaza
 * @package     Mageplaza_AbandonedCart
 * @copyright   Copyright (c) Mageplaza (https://www.mageplaza.com/)
 * @license     https://www.mageplaza.com/LICENSE.txt
 */

use Mageplaza\AbandonedCart\Helper\Data as HelperData;

$gridName       = $block->getGridName();
$date           = $block->getDateRange();
$menu           = $block->getMenuUrls() ? $block->getMenuUrls() : [];
$storeFilterUrl = $block->getUrl('abandonedcart/details/storefilter', ['form_key' => $block->getFormKey()]);
$clearUrl       = $this->getUrl('abandonedcart/index/clear')
?>
<div id="menu" class="mp_menu"
     data-mage-init='{"Mageplaza_AbandonedCart/js/menu_report":
     {"gridName":"<?=/* @noEscape */ $gridName ?>",
     "date":<?= /* @noEscape */ HelperData::jsonEncode($date) ?>,
     "storeUrl":"<?=/* @noEscape */ $storeFilterUrl ?>"}}'>
    <div class="admin__action-dropdown-wrap menu-select">
        <a href="#" class="admin__action-dropdown"
           title="Menu"
           data-mage-init='{"dropdown":{"autoPosition":true}}'
           data-toggle="dropdown">
            <i class="fa fa-bars"></i>
        </a>
        <ul class="admin__action-dropdown-menu">
            <?php foreach ($menu as $item): ?>
                <li><a href="<?= $block->escapeUrl($item['path']) ?>"><?= $block->escapeHtml($item['label']) ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
    <h2 class="scroll-title" style="display: none">Report</h2>
    <div class="mp-rp-store-switcher">
        <span class="mp-menu-label">Scope: </span>
        <?= $block->getChildHtml() ?>
    </div>
    <div class="customer-group">
        <label for="customer-group-id"> </label>
        <select id="customer-group-id">
            <?php foreach ($block->getCustomerGroup() as $group): ?>
                <option value="<?=  /* @noEscape */ $group['value'] ?>">
                    <?= $block->escapeHtml($group['label']) ?>
                </option>
            <?php endforeach; ?>
        </select>
    </div>
    <div class="date-range-picker">
        <span class="mp-menu-label">Time: </span>
        <div id="daterange">
            <i class="fa fa-calendar"></i>
            <span></span>
            <i class="fa fa-caret-down"></i>
        </div>
    </div>
    <div class="period">
        <span><strong><?= $block->escapeHtml(__('Group By')) ?></strong></span>
        <label for="period"></label>
        <select id="period">
            <option value="day"><?= $block->escapeHtml(__('Day')) ?></option>
            <option value="week"><?= $block->escapeHtml(__('Week')) ?></option>
            <option value="month"><?= $block->escapeHtml(__('Month')) ?></option>
            <option value="year"><?= $block->escapeHtml(__('Year')) ?></option>
        </select>
    </div>
    <div class="page-actions-buttons" data-mage-init='{"Mageplaza_AbandonedCart/js/clear":
      {"clearUrl": "<?= /* @noEscape */$clearUrl ?>"}}'>
        <button id="clear" title="Clear Logs" type="button" class="action-default scalable clear primary">
            <span>Clear Emails Logs</span>
        </button>
    </div>
    <div id="mp-loader" class="mp-loader">
        <div class="loader">
            <img src="<?= /** @noEscape */
            $block->getViewFileUrl('images/loader-1.gif') ?>" alt="Loading...">
        </div>
    </div>
</div>




