<?php
session_start();
?>
<!doctype html>
<html lang="pt-br">
    <head>
        <?php
        //session_start();
        //session_unset();
        include './adm_header.php';
        ?>
        <title>Painel Administrativo</title>
    </head>
    <body id="login">
        <header>
			<div id="logo">
				<a href="login.html">whitelabel</a>
			</div>
		</header>
		<section id="content">
                    <form action="adm_loginCMD.php" id="loginform" method="post">
			<fieldset>
				<section><label for="username">Usuário</label>
					<div><input required type="text" id="username" name="username" autofocus></div>
				</section>
				<section><label for="password">Senha <!--<a href="#">lost password?</a>--></label>
					<div><input required type="password" id="password" name="password"></div>
				</section>
				<section>
					<div><button class="fr submit">Entrar</button></div>
				</section>
			</fieldset>
		</form>
		</section>
        <?php include 'adm_rodape.php';?>
    </body>
    <script>
        $('#password').wl_Password({confirm: false,
	showStrength: false,
	words: ['Muito curta', 'Ruim', 'Regular', 'Bom', 'Ótimo', 'Excelente!!!'],
	minLength: 3,
	text: {
		confirm: 'Por favor confirme',
		nomatch: 'Senha não confere'
	}
    });
            $('#loginform').ready(function()
            {

                $('#loginform').wl_Form(
                    {
                        onSuccess: function(data, status){
                        $.msg(data,{header:'Informação',sticky:true});
                        var str = new String(data); 
                        str = str.substr(0,3);
                        if (str == 'Bem')
                            {
                                window.location = './adm_index.php';
                            }
                    },
                    onError: function(status, error, jqXHR)
                    {
                        $.msg("Falha ao enviar formulário\nStatus do erro: " + status + "\nMensagem do erro: "+error,{header:'AVISO!OPS!:(', sticky:true});
                    }
                });
            });
    </script>
        
</html>    