<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="iso-8859-1">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="-1" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="icon" href="favicon.ico" type="image/x-icon">
    <meta name="bingbot" content="noindex">
    <meta name="bingbot" content="nofollow">
    <meta name="robots" content="noindex">
    <meta name="robots" content="nofollow">
    <?php if(!BASE_TESTES) { ?>
    <!-- Google Tag Manager -->
        <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
        new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
        j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
        'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
        })(window,document,'script','dataLayer','GTM-MHG9FM7');</script>
    <!-- End Google Tag Manager -->
    <?php } ?>
    <title>CRM Delvale <?php echo VERSAO ?></title>

    <?php
        $cs = Yii::app()->getClientScript();
        $cs->registerCssFile(FaHtml::getCssUrl('login/bootstrap/css/bootstrap.min.css'));
        $cs->registerCssFile(FaHtml::getCssUrl('login/font-awesome/css/font-awesome.min.css'));
        $cs->registerCssFile(FaHtml::getCssUrl('login/AdminLTE.min.css'));
        $cs->registerCssFile(FaHtml::getCssUrl('login/skin-blue.min.css'));
        $cs->registerCssFile(FaHtml::getCssUrl('login/custom.css'));

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

        $cs->registerScript('custom', '
            window.onload = (function(){
                notificacoes_request_permission();
            });
            notificacoes_check = function() {
                if (window.Notification) {
                    return true;
                } else {
                    console.log("Hum... navegador sem suporte a notificações!.");
                    return false;
                }
            }
            notificacoes = function(title, opt) {
                if (notificacoes_check()) {
                    if (window.Notification.permission != "granted") {
                        console.log("aqui");
                        window.Notification.requestPermission(function(){
                            new Notification(title, opt);
                        });
                    } else {
                        new Notification(title, opt);
                    }
                }
            }
            notificacoes_request_permission = function(callback) {
                if (notificacoes_check()) {
                    if (window.Notification.permission != "granted") {
                        window.Notification.requestPermission();
                    }
                }
            }');
        ?>

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body class="hold-transition skin-windel login-page" id="background-<?php echo rand(1, 7); ?>">
    <!-- Google Tag Manager (noscript) -->
    <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MHG9FM7"
    height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
    <!-- End Google Tag Manager (noscript) -->
    <div id="body-background"></div>
    <div id="obfuscate"></div>
    <div class="login-box">
      <div class="login-logo"><b>CRM</b> Delvale Informática</div>
        <div class="login-box-body">
            <?php echo $content; ?>
            <input type='hidden' name="base_url" value="<?php echo Yii::app()->getBaseUrl(true); ?>" />
        </div>
    </div>
    <div class="text-center nav navbar-fixed-bottom"><span>CRM versão <?php echo VERSAO; ?></span><span>Windel Sistemas &bull; Todos os direitos reservados</span></div>
  </body>
</html>
