<?php
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 and (Yii::app()->controller->action->id != 'changepassword' and Yii::app()->controller->action->id != 'buscasite')) {
        header("location:".Yii::app()->request->baseUrl."/index.php?r=funcionarios/changepassword");
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt-br" lang="pt-br">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta name="content-language" content="pt-br" />
        <meta http-equiv="Pragma" content="no-cache" />
        <meta http-equiv="Expires" content="-1" />
        <meta http-equiv="X-UA-Compatible" content="IE=7">
        <meta name="viewport" content="width=1366, initial-scale=0.7">
        <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
        <link rel="icon" href="<?php echo Yii::app()->getBaseUrl(true); ?>/favicon.ico" type="image/x-icon">
        <meta name="bingbot" content="noindex">
        <meta name="bingbot" content="nofollow">
        <!--[if lt IE 8]>
        <link rel="stylesheet" type="text/css" href="<?php echo FaHtml::getCssUrl('ie.css'); ?>" media="screen, projection" />
        <![endif]-->
        <?php
        $cs = Yii::app()->getClientScript();
        $cs->registerCssFile(FaHtml::getCssUrl('print.css'), 'print');

        $cs->registerCssFile(FaHtml::getJsUrl('bootstrap/css/bootstrap.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('bootstrap/css/bootstrap-theme.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('uibootstrap/css/bootstrap.min.css'));

        $cs->registerCssFile(FaHtml::getJsUrl('uibootstrap/css/font-awesome.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('uibootstrap/css/font-awesome-ie7.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('uibootstrap/css/font-awesome.min4.3.0.css'));
        $cs->registerCssFile(FaHtml::getCssUrl('login/font-awesome/css/font-awesome.min.css'));

        $cs->registerCssFile(FaHtml::getJsUrl('jquery-ui-1.11.4/jquery-ui.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('jquery-ui-1.11.4/jquery-ui.structure.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('jquery-ui-1.11.4/themes/smoothness/jquery-ui.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('jquery-ui-1.11.4/themes/smoothness/theme.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('gallery/css/blueimp-gallery.min.css'));
        $cs->registerCssFile(FaHtml::getJsUrl('gallery/css/bootstrap-image-gallery.min.css'));

        $cs->registerCssFile(FaHtml::getCssUrl('main.css'));

        $cs->registerScriptFile(FaHtml::getJsUrl('jquery-2.2.3.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('jquery-ui-1.11.4/jquery-ui.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('jquery-ui-1.11.4/jquery-ui-i18n.min.js'));

        $cs->registerScriptFile(FaHtml::getJsUrl('browser.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('valida/valida.2.1.7.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('jquery.stickytableheaders.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('jquery.mask.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('jquery.maskMoney.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('bootstrap/js/bootstrap.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('gallery/js/jquery.blueimp-gallery.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('gallery/js/bootstrap-image-gallery.min.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('funcoes.js'));
        $cs->registerScriptFile(FaHtml::getJsUrl('ckeditor/ckeditor.js'));

        Yii::app()->clientScript->registerScript('enterkey', '
            $("input").keypress(function (e) {
                var code = null;
                code = (e.keyCode ? e.keyCode : e.which);
                var search = $(".search-form").length <= 0;
                var focus = $(".datepicker").is(":focus");
                return (code == 13 && (search || focus)) ? false : true;
            });
        ');
        ?>
        <style type="text/css">
            .ui-multiselect ul.connected-list {
                min-height: 100px;
            }
        </style>
        <title>CRM Delvale <?php echo VERSAO ?></title>
    </head>

    <body>
        <div id="loading" style="display:none"><img scr="<?php echo FaHtml::getImgUrl('loading.gif'); ?>" /></div>
        <button id="divLeftFrameSwitcher" type="button" class="navbar-toggle" onClick="SwitchLeftFrame();" title="Mostrar/Ocultar menu">
              <span class="sr-only">Ocultar/Mostrar menu</span>
              <i class="fa fa-compress"></i>
              <i class="fa fa-expand"></i>
        </button>
        <div class="container" id="page">
            <?php echo $content;?>
        </div>

        <input type='hidden' name="frame_src" value="<?php echo Yii::app()->request->url; ?>" />
        <input type='hidden' name="base_uri" value="<?php echo Yii::app()->getBaseUrl(true); ?>/" />
        <input type='hidden' name="base_urn" value="<?php echo Yii::app()->baseUrl; ?>/" />

        <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-use-bootstrap-modal="false">
        <div class="slides"></div>
        <h3 class="title"></h3>
        <a class="prev" aria-label="Next"><span aria-hidden="true">&laquo;</span></a>
        <a class="next" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
        <a class="close">x</a>
        <a class="play-pause"></a>
        <ol class="indicator"></ol>
        <div class="modal fade">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header"><button type="button" class="close" aria-hidden="true">&times;</button><h4 class="modal-title"></h4></div>
                    <div class="modal-body next"></div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default pull-left prev"><i class="glyphicon glyphicon-chevron-left"></i>Próximo</button>
                        <button type="button" class="btn btn-primary next">Anterior<i class="glyphicon glyphicon-chevron-right"></i></button>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php $this->renderPartial('/layouts/partial/ckeditor.config'); ?>
    </body>
</html>
