<?php
/**
 * OpenMage
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available at https://opensource.org/license/afl-3-0-php
 *
 * @category    design
 * @package     default_default
 * @copyright   Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
 * @copyright   Copyright (c) 2021-2024 The OpenMage Contributors (https://www.openmage.org)
 * @license     https://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/** @see Mage_Adminhtml_Block_Dashboard_Tab_Amounts */
/** @see Mage_Adminhtml_Block_Dashboard_Tab_Orders */
/** @var Mage_Adminhtml_Block_Dashboard_Graph $this */
?>

<div style="margin:20px;">
    <p class="switcher a-right" style="padding:5px 10px;"><?php echo $this->__('Select Range') ?>:
    <select name="period" id="order_<?php echo $this->getHtmlId() ?>_period" onchange="changeDiagramsPeriod(this);">
        <?php foreach ($this->helper('adminhtml/dashboard_data')->getDatePeriods() as $_value=>$_label): ?>
            <?php if(in_array($_value, ['custom'])) continue; ?>
            <option value="<?php echo $_value ?>" <?php if($this->getRequest()->getParam('period')==$_value): ?> selected="selected"<?php endif ?>><?php echo $_label ?></option>
        <?php endforeach ?>
    </select></p><br/>
    <?php
    $_containerStyle = "width:{$this->getWidth()}px;height:{$this->getHeight()}px; margin:0 auto;";
    ?>
    <?php if($this->getCount()): ?>
    <p style="<?php echo $_containerStyle?>"><img src="<?php echo $this->getChartUrl(false) ?>" alt="chart" title="chart" /></p>
    <?php else: ?>
    <p class="a-center" style="<?php echo $_containerStyle?>"><?php echo $this->__('No Data Found') ?></p>
    <?php endif ?>
</div>
