<?php
  session_start();

  if (isset($_SESSION['username'])) {
      session_start();
      session_destroy();
  }


?>
<!DOCTYPE html>
<html lang="pt-br">
  <head>
    <meta charset="utf-8">
    <title>Criar Conta</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- Bootstrap -->
    <link href="../css/bootstrap.css" rel="stylesheet" media="screen">
    <!-- <link href="../css/main.css" rel="stylesheet" media="screen"> -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.10/jquery.mask.min.js"></script>
    <script type="text/javascript" src="js/mask.js"></script>
  </head>

  <body>

    <nav class="navbar navbar-light bg-light">
      <span class="navbar-brand mb-0 h1">POISSON</span>
      <a href="main_login.php" style="float: right;" class="btn btn-primary">Voltar para Login</a>
    </nav>

    <div class="container">

      <img style="display: block; margin-left: auto; margin-right: auto; margin-top: 50px;" src="images/signup.png">
      <form class="form-signup" id="usersignup" name="usersignup" method="post" action="createuser.php">
        <h2 class="form-signup-heading">Criar Conta</h2>
        <input name="newuser" id="newuser" type="text" class="form-control" placeholder="CPF sem traços ou pontos" onkeydown="javascript: fMasc( this, mCPF );" autofocus><br/>
        <input name="fullname" id="fullname" type="text" class="form-control" placeholder="Nome completo"><br/>
        <input name="email" id="email" type="text" class="form-control" placeholder="Email"><br/>
        <input name="tel1" id="tel1" type="tel" class="form-control" placeholder="Telefone 1 (obrigatório) com DDD" onkeydown="javascript: fMasc( this, mTel );"><br/>
        <input name="tel2" id="tel2" type="tel" class="form-control" placeholder="Telefone 2 (opcional) com DDD" onkeydown="javascript: fMasc( this, mTel );"><br/>
        <input name="password1" id="password1" type="password" class="form-control" placeholder="Senha"><br/>
        <input name="password2" id="password2" type="password" class="form-control" placeholder="Repetir a senha"><br/>

        <button name="Submit" id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Criar</button>

        <div id="message"></div>
      </form>

    </div> <!-- /container -->

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="//code.jquery.com/jquery.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script type="text/javascript" src="js/bootstrap.js"></script>

    <script src="js/signup.js"></script>


    <script src="http://jqueryvalidation.org/files/dist/jquery.validate.min.js"></script>
<script src="http://jqueryvalidation.org/files/dist/additional-methods.min.js"></script>
<script>


$('.cpf').mask('000.000.000-00', {reverse: true});


$( "#usersignup" ).validate({
  rules: {
	email: {
		email: true,
		required: true
	},
    password1: {
      required: true,
      minlength: 4
	},
    password2: {
      equalTo: "#password1"
    }
  }
});
</script>

  </body>
</html>
