A modal bootstrap appears before HTML

0

I have a page from which after 3 attempts the page access is blocked. However I would like if the page is blocked, when trying to access, a modal bootstrap with a message appears:

  

Locked page. Please contact your administrator to   request unlocking.

And that this modal was activated within this condition in PHP:

if($visualizarVerificar->Bloqueado == "S"){
        // Entraria aqui a ativação do modal Boostrap
        echo "<script>window.location.href='index.php';</script>";
        exit;
}

Is this possible?

    
asked by anonymous 30.07.2017 / 02:49

1 answer

1

Library

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script><scriptsrc="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>

Modal HTML

<div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">Página bloqueada</h4>
            </div>
            <div class="modal-body">
                <p>Favor entrar em contato com o administrador para solicitar o desbloqueio.</p>
                <p class="text-warning"><small>contato</small></p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Fechar</button>
            </div>
        </div>
    </div>
</div>

Script

if($visualizarVerificar->Bloqueado == "S"){
    echo "<script>
        $(\"#myModal\").modal('show');
    </script>"; 

    exit();
}
  

The script after Modal HTML

Test - Blocked page

    
30.07.2017 / 04:21