<?php
/*
 * @author     M2E Pro Developers Team
 * @copyright  M2E LTD
 * @license    Commercial use is forbidden
 */

// @codingStandardsIgnoreFile

/** @var $this Ess_M2ePro_Block_Adminhtml_ControlPanel_Inspection_Cron */

?>

<table class="form-list" cellspacing="0" cellpadding="0">

    <tr>
        <td class="value" style="min-width: 200px;">
            <label style="padding-right: 10px;"><?php echo Mage::helper('M2ePro')->__('Type'); ?>: </label>
            <?php echo $this->cronCurrentRunner; ?>

            <?php if ($this->isShownServiceDescriptionMessage()) : ?>
            <span>
                <img class="tool-tip-image" style="vertical-align: middle;" src="<?php echo $this->getSkinUrl('M2ePro/images/tool-tip-icon.png'); ?>" />&nbsp;
                <span class="tool-tip-message" style="display:none; text-align: left; width: 350px;">
                <img src="<?php echo $this->getSkinUrl('M2ePro/images/help.png'); ?>">
                <span>
                    <?php echo Mage::helper('M2ePro')->__(
                        'A background mechanism that provides permanent automatic synchronization. Find more details <a href="%url%" target="_blank">here</a>',
                        Mage::helper('M2ePro/Module_Support')->getSupportUrl('/support/solutions/articles/9000200886')
                    ); ?>
                </span>
            </span>
            <?php endif; ?>
        </td>

        <td class="value">
            <label style="padding-right: 10px;"><?php echo Mage::helper('M2ePro')->__('Last Run'); ?>: </label>
            <span <?php if ($this->cronIsNotWorking) : echo 'style="color: red;"'; endif; ?>><?php echo $this->cronLastRunTime ?></span>
            <?php if ($this->cronIsNotWorking) : ?>
                &nbsp;<a href="<?php echo Mage::helper('M2ePro/Module_Support')->getSupportUrl('/support/solutions/articles/9000200879'); ?>" target="_blank"><?php echo Mage::helper('M2ePro')->__('[read more]'); ?></a>
            <?php endif; ?>
        </td>
    </tr>

    <?php if (Mage::helper('M2ePro/Module_Cron')->isRunnerService() && !$this->getData('is_support_mode')) : ?>
        <tr>
            <td class="label">
                <label><?php echo Mage::helper('M2ePro')->__('Service Auth Key'); ?>: </label>
            </td>
            <td class="value">
                <?php echo $this->cronServiceAuthKey; ?>
            </td>
        </tr>
    <?php endif; ?>

    <?php if (!$this->getData('is_support_mode') && $this->isServiceCronDisabled) : ?>
        <tr>
            <td class="label">
                <label><?php echo Mage::helper('M2ePro')->__('Service Cron State'); ?>: </label>
            </td>
            <td class="value" style="color: red;">
                <?php echo Mage::helper('M2ePro')->__('Disabled by Developer'); ?>
            </td>
        </tr>
    <?php endif; ?>

    <?php if (!$this->getData('is_support_mode') && $this->isMagentoCronDisabled) : ?>
        <tr>
            <td class="label">
                <label><?php echo Mage::helper('M2ePro')->__('Magento Cron State'); ?>: </label>
            </td>
            <td class="value" style="color: red;">
                <?php echo Mage::helper('M2ePro')->__('Disabled by Developer'); ?>
            </td>
        </tr>
    <?php endif; ?>

    <?php if (!$this->getData('is_support_mode')) : ?>
        <tr>
            <td class="label">
                <label><?php echo Mage::helper('M2ePro')->__('Cron Schedule Table'); ?>: </label>
            </td>
            <td class="value">
                <a href="<?php echo $this->getUrl('*/adminhtml_controlPanel_inspection/cronScheduleTable'); ?>" target="_blank"><?php echo Mage::helper('M2ePro')->__('Show') ?></a>
            </td>
        </tr>
    <?php endif; ?>

</table>