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

// @codingStandardsIgnoreFile

/** @var $this Ess_M2ePro_Block_Adminhtml_ControlPanel_Info_Actual */

?>

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

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('System | Current Time'); ?>: </label>
        </td>
        <td class="value">
            <?php echo "{$this->systemName} | {$this->systemTime}"; ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Magento'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->magentoInfo ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Module [Public]'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->publicVersion ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Module [Setup]'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->setupVersion ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Module Environment'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->moduleEnvironment ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Maintenance'); ?>: </label>
        </td>
        <td class="value">
            <table class="form-list" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <span style="<?php echo $this->maintenanceMode ? 'color: green;' : 'color: red;'; ?>"><?php echo $this->maintenanceMode ? Mage::helper('M2ePro')->__('enabled') : Mage::helper('M2ePro')->__('disabled'); ?></span>
                    </td>
                    <td>
                        <span style="color: orange;">
                            &nbsp;<a href="<?php echo $this->getUrl('*/adminhtml_controlPanel_inspection/changeMaintenanceMode'); ?>" onclick="return confirm('Are you sure?');">[<?php echo Mage::helper('M2ePro')->__('change'); ?>]</a>
                        </span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Core Resource'); ?>: </label>
        </td>
        <td class="value">
            <table class="form-list" cellspacing="0" cellpadding="0">
                <tr>
                    <td>
                        <span <?php if ($this->setupVersion != $this->coreResourceVersion || $this->setupVersion != $this->coreResourceDataVersion) : echo ' style="color: red;" '; endif; ?>>
                            <?php echo ($this->coreResourceVersion ? $this->coreResourceVersion : 'N/A') . ' / ' . ($this->coreResourceDataVersion ? $this->coreResourceDataVersion : 'N/A') ?>
                        </span>
                    </td>
                    <td>
                        <span style="color: orange;">
                            &nbsp;<a href="javascript:void(0);" onclick="return setupManagementActionHandler.askAdditionalParametersForAction('Repeat upgrade from the following version:', '<?php echo $this->getUrl('*/adminhtml_controlPanel_inspection/setMagentoCoreSetupValue', array('_query' => array('version' => '#version#'))); ?>', 'version');">[<?php echo Mage::helper('M2ePro')->__('set'); ?>]</a>
                        </span>
                    </td>
                </tr>
            </table>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('PHP'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->phpVersion ?>
            <a href="<?php echo $this->getUrl('*/adminhtml_controlPanel_inspection/phpInfo'); ?>" target="_blank" style="padding-left: 10px;">[info]</a>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Server API'); ?>: </label>
        </td>
        <td class="value">
            <?php echo$this->phpApi ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Memory Limit'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->memoryLimit . ' Mb'?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('Max Execution Time'); ?>: </label>
        </td>
        <td class="value">
             <?php echo $this->maxExecutionTime == 0 ? Mage::helper('M2ePro')->__('Unlimited') : $this->maxExecutionTime . ' sec'; ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('MySQL'); ?>: </label>
        </td>
        <td class="value">
            <?php echo $this->mySqlVersion ?>
        </td>
    </tr>

    <tr>
        <td class="label">
            <label><?php echo Mage::helper('M2ePro')->__('MySQL Database | Tables Prefix'); ?>: </label>
        </td>
        <td class="value">
            <?php echo "{$this->mySqlDatabaseName} | {$this->mySqlPrefix}"; ?>
        </td>
    </tr>

</table>