<?php
$this->pageTitle = "Auditoria &raquo; Fechamentos Comercial &raquo;  Controle de Vendas e Cancelamentos";
    $this->menu = array(
        array('label' => FaHtml::iconSetaClose(), 'url' => '#', 'linkOptions' => array('class' => 'search-button')),
        array('label' => FaHtml::iconRefresh(), 'url' => 'javascript:void(0);', 'linkOptions' => array('onclick' => 'reloadFrame();', 'class' => 'refresh-button'))
    );
?>

<div class="search-form" style="display: block;">
    <div class="wide form">
        <?php
            $form = $this->beginWidget('GxActiveForm', array(
                'action' => Yii::app()->createUrl($this->route),
                'method' => 'get',
            ));
        ?>
            <div class="row">
                <?= $form->label($model, 'FILTRO_ANO'); ?>
                <?php
                    $anos = array();
                    for ($i=2017; $i <= date('Y'); $i++) {
                        $anos[$i] = $i;
                    }
                    echo $form->dropDownList($model, 'FILTRO_ANO', $anos, array('prompt' => 'Selecione'));
                ?>
                <?= $form->error($model, 'FILTRO_ANO'); ?>
            </div>

            <div class="row buttons">
                <?= FaHtml::searchButton("Exportar"); ?>
            </div>

        <?php $this->endWidget(); ?>
    </div>
</div>

<?php
$script = <<<JAVASCRIPT
    $(document).ready(function() {
        $("#search_button").click(function(event) {
            $("#loading").fadeIn(400);
            setTimeout(function() {
                $("#loading").fadeOut(400);
            }, 20*1000);
        });
    });
JAVASCRIPT;

Yii::app()->getClientScript()->registerScript(Util::uid(), $script);
