<!-- START HTML -->
<!DOCTYPE html>
<html lang="pt-br">
<style>

    #top-button span {
        display: none;
      }
   #sm-top-button span {
     display: none;
   }
/*    top-button:after{
        content: 'Login' !important;
    }*/
/*google*/
@media only screen and (max-width: 768px) {
    span.abcRioButtonContents span {
        display: none;
      }
    span.abcRioButtonContents:after{
        content: 'Login com Google' !important;
    }
}
 span.abcRioButtonContents span {
        display: none;
      }
span.abcRioButtonContents:after{
        content: 'Login com Google' !important;
    }
.abcRioButton.abcRioButtonBlue {
        width: 100% !important;
    }
.abcRioButtonBlue {
    border: none;
    background-color: #DC3545 !important;
}
    /*/*/
</style>
<style>

    .btn-facil {
        color: #ffffff;
        background-color: #02cbba;
        background-image: linear-gradient(to bottom, #02cbba, #02cbba);
        border-color: #02cbba #02cbba #02cbba;
    }
    .block-facil {
        display: none;
    }
/*REC SENHA preloader*/
body{background:#ECF0F1}

.load{
    position:absolute;
    /*top:50%;*/
    left:50%;
    transform:translate(-50%, -50%);
  /*change these sizes to fit into your project*/
  width:100px;
  height:100px;
  display: none;
  z-index: 1;
}
.load hr{border:0;margin:0;width:40%;height:40%;position:absolute;border-radius:50%;animation:spin 2s ease infinite}

.load :first-child{background:#19A68C;animation-delay:-1.5s}
.load :nth-child(2){background:#193B48;animation-delay:-1s}
.load :nth-child(3){background:#19A68C;animation-delay:-0.5s}
.load :last-child{background:#193B48}

@keyframes spin{
  0%,100%{transform:translate(0)}
  25%{transform:translate(160%)}
  50%{transform:translate(160%, 160%)}
  75%{transform:translate(0, 160%)}
}
</style>
<style>
    a#fb-login:after{
         content: ' Login com Facebook';
    }

    i.fab.fa-facebook.fa-sm{
        position: absolute;
        left: 0;
        top: 6px;
        width: 36px;
        line-height: 34px;
        font-size: 1.6em;
        border-right: 1px solid rgba(0,0,0,.2);
    }
</style>
    <?php //$this->load->view('include/top'); ?>

    <div class="container-fluid px-0 my-3 text-center">
        <div class="container">
            <div class="row">
                <aside class="col-12 col-md-10 col-lg-9 col-xl-9 mx-auto">
                    <div class="card bg-light shadow border border-success">
                        <div class="card-header py-4">
                            <h5 class="card-title text-center my-1"><i class="fas fa-sign-in-alt"></i> Login | <i class="fas fa-user-plus"></i> Cadastro</h5>
                        </div>
                        <article class="card-body p-1 py-4" id="imz-card-body-login">
                            <div class="load">Enviando...
                                <hr/><hr/><hr/><hr/>
                            </div>
                            <form action="<?php echo base_url(); ?>Site/check_cadastro" id="imz-form-login-cadastro" method="POST">

                                <?php
                                    if (isset($_SESSION['feed_login_facil'])) {
                                        ?>
                                        <div class="alert alert-warning alert-dismissible" role="alert">
                                          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                          <strong><?php echo $_SESSION['feed_login_facil'] ?></strong>
                                        </div>
                                        <?php
                                    }
                                    ?>
                                        <?php
                                    if (isset($_SESSION['feed_indentificacao'])) {
                                        ?>
                                        <div class="alert alert-warning alert-dismissible" role="alert">
                                          <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                          <strong><?php echo $_SESSION['feed_indentificacao'] ?></strong>
                                        </div>
                                <?php
                                }
                                ?>

                                <div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0">
                                    <div class="input-group">
                                        <div class="input-group-prepend">
                                            <span class="input-group-text"><i class="fas fa-envelope-square fa-fw"></i> Email</span>
                                        </div>
                                        <input id="imz-user-email" type="email" class="form-control ui-autocomplete-input email-aluno" min="3" required="" value="" name="email_login_usuario_matricula" placeholder="Insira seu Email" autofocus="" autocomplete="off">
                                    </div>
                                </div>
                                <div id='imz-form-includes'></div>
                                <!-- INSERTED WITH JS -->
                                <!--                                <div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0">
                                                                    <div class="input-group">
                                                                        <div class="input-group-prepend"><span class="input-group-text"><i class="fas fa-lock fa-fw"></i> Senha</span></div><input class="form-control" placeholder="Insira sua Senha" type="password"></div>
                                                                </div>
                                                                                                <div class="col-xl-8 col-lg-8 col-12 mx-auto mb-0 mt-2 px-3 text-left">
                                                                                                    <label class="my-0">Contato:</label>
                                                                                                    <div class="row">
                                                                                                        <div class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 px-0"> <input required="" pattern="d{2}" title="Digite apenas dois digitos" min="2" maxlength="2" type="tel" class="form-control ddd-aluno" id="ddd-cadastro" name="ddd" placeholder="DDD"></div>
                                                                                                        <div class="col-xs-8 col-sm-8 col-md-9 col-lg-10 col-xl-10 px-0"> <input required="" pattern="d{9}" title="Digite 9 digitos" min="9" maxlength="9" type="tel" class="form-control tel-aluno" id="tel-cadastro" name="celular" placeholder="Número do Celular">
                                                                                                        </div>
                                                                                                    </div>
                                                                                                </div>
                                                                                                <div class="col-xl-8 col-lg-8 col-12 mx-auto mb-0 mt-2 px-0 text-left"><label class="mb-0 px-3">Código de Verificação: <b>2532</b></label><input placeholder="Digite o Código de Verificação" type="text" class="form-control" id="captcha" minlength="6" required="true"></div>
                                -->
                                <div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0 my-3">
                                    <button id="imz-btn-submit-form" type="submit" class="btn btn-info btn-block"> Continuar  <i class="fas fa-arrow-circle-right fa-lg"></i></button>
                                    <button style="display:none;" id="loading" class="btn btn-info btn-block" disabled="">
                                        <span class="spinner-border spinner-border-sm"></span>
                                        Aguarde...
                                    </button>
                                    <button type="button" class="badge badge-light p-1" onclick="recuperar_senha()"><i class="fas fa-question-circle"></i> Esqueci minha senha</button>
                                    <!--<a href="#" class="badge badge-light p-1"><i class="fas fa-question-circle"></i> Esqueci minha senha</a></p>-->
                                </div>
                            </form>
                        </article>
                        <div class="card-footer py-4">
                            <div class="row"><div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0"><a id="fb-login" href="<?php echo htmlspecialchars($loginUrl); ?>" class=" btn btn-block btn-primary mt-1"><i class="fab fa-facebook fa-sm"></i>  </a></div></div>

                            <!--<div class="g-signin2 social_signin" onclick="ClickLogin()" data-onsuccess="onSignIn" data-theme="dark">Login</div>-->
                            <!--<div class="row"><button class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0 g-signin2 social_signin" data-onsuccess="onSignIn" onclick="ClickLogin()"><i class="fab fa-google fa-lg"></i>  Login com Google</button></div>-->
                            <!--<div class="row"><div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0"><button id="meu-botao" href="" class="btn btn-block btn-danger mt-1"> <i class="fab fa-google fa-lg"></i>  Login com Google</button></div></div>-->
                            <div class="row"><div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0"><div class="g-signin2 social_signin" onclick="ClickLogin()" data-onsuccess="onSignIn" data-theme="dark">Login</div></div></div>


<!--                            <div class="row">
                                <div class="col-xl-8 col-lg-8 col-12 mx-auto my-1 px-0">
                                    <div id="meu-botao"></div>
                                </div>
                            </div>-->
<!--                            <div class="container body-content">
                                <div class="box-login">
                                <h2>Login</h2>

                                 html do botão
                                <div id="meu-botao"></div>
                              </div>
                            </div>-->

                           
                            

                        </div>
                    </div>
                </aside>
            </div>
        </div>
    </div>
    <?php //$this->load->view('include/footer'); ?>
    <script src="https://apis.google.com/js/platform.js?onload=renderButton" async defer></script>
    <script src="<?php echo ROOT_URL; ?>src/jq-ui/jquery-ui.min.js" type="text/javascript"></script>
    <link href="<?php echo ROOT_URL; ?>src/jq-ui/jquery-ui.min.css" rel="stylesheet" type="text/css"/>
    <link href="<?php echo ROOT_URL; ?>src/jq-ui/jquery-ui.structure.min.css" rel="stylesheet" type="text/css"/>
    <link href="<?php echo ROOT_URL; ?>src/jq-ui/jquery-ui.theme.min.css" rel="stylesheet" type="text/css"/>

<script>
$(function() {
    $("#imz-form-login-cadastro").submit(function(e) {

        $("#imz-btn-submit-form").hide();
        $("#loading").show();
    });

});
</script>
<script>
function recuperar_senha() {
    var URL_BASE = "<?php echo base_url(); ?>";

    var email = $(".email-aluno").val();

    if ( (email.trim()!=='') && (email.length >= 6) ) {

        $('form button[type="submit"]').prop("disabled", true);
        $('.btn.btn-link').prop("disabled", true);

        $(".load").show();
        $.post(URL_BASE + 'recuperar_senha', {email:email}, function (e) {


            var resposta = JSON.parse(e);
            if (typeof resposta.mensagem !== 'undefined')
            {
                if(resposta.situacao==1)
                {
                    //$(".load").show();
                    alert(resposta.mensagem);
                }
                else
                {
                    alert(resposta.mensagem);
                }
            }
            else
            {
                alert("Não foi possível enviar sua senha. Problema encontrado!");
            }
            window.location.reload();
        });
    }
    else {
        alert("Digite um email válido no campo de E-mail!");
        window.location.reload();
    }
}
</script>
<script>
                                /*document.addEventListener('keydown', function (event) {
                                    var key = event.key, keyCode = event.keyCode;
                                    if (keyCode == '229' || keyCode == 229 || key == '@') {
                                        $('#imz-user-email').on('keypress input', function () {
                                            var email_valid = $(this).val().replace('@', ''), domains = ["@gmail.com", "@hotmail.com", "@yahoo.com.br", "@yahoo.com", "@outlook.com", "@bol.com.br", "@live.com"], user_mail = [], i;
                                            for (i = 0; i < domains.length; i++) {
                                                user_mail[i] = email_valid + domains[i];
                                            }
                                            $("#imz-user-email").autocomplete({source: user_mail});
                                        });
                                    }
                                });
                                $(document).on("submit", '#imz-form-login-cadastro', function () {
                                    var email = $('#imz-user-email').val();
                                    if (imz_valid_mail(email) != true) {
                                        imz_alert('Email inválido. Verifique o email e tente novamente.', 'danger', '#imz-card-body-login');
                                        return false;
                                    }
                                    $.ajax({url: '<?php //base_url(); ?>verifica_cadastro', type: 'POST', data: {email: email}, dataType: 'json', beforeSend: function () {
                                            $('#imz-btn-submit-form').html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Aguarde...');
                                        }
                                    }).done(function (e) {
                                        $('#imz-btn-submit-form').html(' Continuar  <i class="fas fa-arrow-circle-right fa-lg">');
                                        if (e == "true") {
                                            // user exists
                                            $('#imz-form-login-cadastro').attr('id', 'imz-form-login');
                                        } else if (e == "Erro login bloqueado") {
                                            // blocked user
                                            imz_alert('Usuário Bloqueado.', 'danger', '#imz-card-body-login');
                                        } else if (e == 'email inválido') {
                                            // invalid mail
                                            imz_alert('<i class="fas fa-at"></i> Email inválido. Verifique o email e tente novamente.', 'danger', '#imz-card-body-login');
                                        } else {
                                            // regist
                                            imz_alert('<i class="fas fa-user-plus"></i> Continue o cadastro', 'info', '#imz-card-body-login');
                                            $('#imz-form-login-cadastro').attr('id', 'imz-form-cadastro');
                                        }
                                    }).fail(function () {
                                        $('#imz-btn-submit-form').html(' Continuar  <i class="fas fa-arrow-circle-right fa-lg">');
                                        imz_alert('Erro ao fazer requisição. Verifique sua conexão com a internet', 'light', '#imz-card-body-login');
                                    });
                                });
                                $(document).on("submit", '#imz-form-cadastro', function () {});
                                $(document).on("submit", '#imz-form-login', function () {});*/
    </script>
    <script>
$( function() {

    document.addEventListener('keydown', function (event) {


        function detectmob() {
            if( navigator.userAgent.match(/Android/i)
            || navigator.userAgent.match(/webOS/i)
            || navigator.userAgent.match(/iPhone/i)
            || navigator.userAgent.match(/iPad/i)
            || navigator.userAgent.match(/iPod/i)
            || navigator.userAgent.match(/BlackBerry/i)
            || navigator.userAgent.match(/Windows Phone/i)
            ){
               return true;
             }
            else {
               return false;
             }
           }


    function autoCompleteMobile()
    {
        var key = event.key;
        var keyCode = event.keyCode;
        if(keyCode=='229' || keyCode==229 || key=='@')
        {

            $('#imz-user-email').on('keypress input', function(){
            //$("#tags").keypress(function(event){

            var email_valid = $(this).val();

            var email_valid = email_valid.replace('@', '');

            var domains = [
              "@gmail.com",
              "@hotmail.com",
              "@yahoo.com",
              "@yahoo.com.br",
              "@outlook.com",
              "@bol.com.br",
              "@live.com"
            ];

            var user_mail = [];
            var i;

            for (i = 0; i < domains.length; i++) {
                user_mail[i] = email_valid+domains[i];
            }

            //console.log(user_mail);

            $( "#imz-user-email" ).autocomplete({
              source: user_mail
            });

        //}

        });
        }
    }

    function autoCompleteDesktop()
    {
        var key = event.key;
        var keyCode = event.keyCode;
        if(keyCode=='229' || keyCode==229 || key=='@')
        {

        //$('#tags').on('keypress input', function(){
        $("#imz-user-email").keypress(function(event){

            var email_valid = $(this).val();

            var email_valid = email_valid.replace('@', '');

            var domains = [
              "@gmail.com",
              "@hotmail.com",
              "@yahoo.com",
              "@yahoo.com.br",
              "@outlook.com",
              "@bol.com.br",
              "@live.com"
            ];

            var user_mail = [];
            var i;

            for (i = 0; i < domains.length; i++) {
                user_mail[i] = email_valid+domains[i];
            }

            //console.log(user_mail);

            $( "#imz-user-email" ).autocomplete({
              source: user_mail
            });

        //}

        });
        }
    }

    var isMobile = detectmob();

    if(isMobile)
    {
        autoCompleteMobile(event);
    }
    else
    {
        autoCompleteDesktop(event);
    }



    //}

    });


} );
</script>
</html>
<?php unset($_SESSION['feed_indentificacao']);?>
<script type="text/javascript">
    $("#login-facil").click( function(){
            $(".block-facil").fadeIn( "slow" );
        }
    );
</script>
