<?php $this->PageTitle = 'Trocar Senha';?>
<div class="form">

    <?php echo CHtml::beginForm(); ?>
    <?php
        $return = "<div class='col-xs-12'>";
        $return .= "<p class='color-blue note col-md-4'>";
        $return .= "Campos com <span class='required'>*</span> s&atilde;o obrigat&oacute;rios.";
        $return .= "</p>";
        $return .= "<div class='clearfix'></div>";
        $return .= "" . CHtml::errorSummary($form, null, null, array('class' => 'alert alert-danger alert-summary'));
        $return .= "</div>";

        echo $return;
        if(!BASE_TESTES) {
            $conditions = "PWD_IDFUNCIONARIO = '" . User::getId() . "' and PWD_DATA >= '" . date('Y-m-d', strtotime("-30 days")) . "'";
            $Senhas = Senhas::model()->findAll($conditions);
            if (count($Senhas) == 0) {
                echo '<div class="errorMessage alert alert-error" style="font-size: 13px;padding: 10px;width: 465px;">Sua senha não é alterada há mais de 30 dias.<br />Para prosseguir, altere a sua senha!</div>';
            }
        }
    ?>
    <div class="row">
        <?php echo CHtml::activeLabelEx($form, 'oldPassword');?>
        <?php echo CHtml::activePasswordField($form, 'oldPassword');?>
        <a href="<?php echo Yii::app()->createUrl('RecuperarSenha/solicitar');?>" target="_blank"><img src="<?php echo FaHtml::getImgUrl('ico-trocar-senha.png'); ?>" title="Recuperar senha de acesso"></a>
        <?php echo CHtml::error($form, 'oldPassword'); ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabelEx($form, 'FUN_SENHA');?>
        <?php echo CHtml::activePasswordField($form, 'FUN_SENHA');?>
        <?php echo CHtml::error($form, 'FUN_SENHA'); ?>
    </div>

    <div class="row">
        <?php echo CHtml::activeLabelEx($form, 'verifyPassword');?>
        <?php echo CHtml::activePasswordField($form, 'verifyPassword');?>
        <?php echo CHtml::error($form, 'verifyPassword'); ?>
    </div>

    <div class="clearfix"></div>
    <?php echo FaHtml::saveButton();?>
    <?php echo CHtml::endForm();?>
</div><!-- form -->