-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcadastrar_usuario.php
68 lines (58 loc) · 2.59 KB
/
cadastrar_usuario.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<?php include_once("head.php"); ?>
<title>Cadastro de usuário</title>
<body>
<?php include_once 'menu.php';?>
<div class="container" style="padding:20px 0;max-width: 800px;">
<form action="inserir_usuario.php" method="POST">
<h4 style="padding:0 0 20px 0;margin-bottom:35px;" class="border-bottom">Cadastro de usuário</h4>
<div class="form-group">
<label>Nome</label>
<input class="form-control" type="text" name="nome" placeholder="Digite o seu nome"
autocomplete="off" />
</div>
<div class="form-group">
<label>Sobrenome</label>
<input class="form-control" type="text" name="sobrenome" placeholder="Digite o seu sobrenome" />
</div>
<div class="form-group">
<label>E-mail</label>
<input class="form-control" type="email" name="email"
placeholder="Digite o seu e-mail para acessar o sistema" />
</div>
<div class="form-group">
<label>Senha</label>
<input class="form-control" type="password" id="senha" name="senha" placeholder="Digite uma senha" />
</div>
<div class="form-group">
<label>Repetir senha</label>
<input class="form-control" type="password" id="senha2" name="senha2"
placeholder="Digite sua senha novamente" oninput="validaSenha(this)" />
<small style="display:none" id="msg-erro">A senha precisa ser igual a senha digitada acima.</small>
</div>
<div class="form-group">
<label>Nível de acesso</label>
<select class="form-control" name="nivelUsuario">
<option value="1">Administrador</option>
<option value="2">Funcionário</option>
<option value="3">Conferente</option>
</select>
</div>
<button type="submit" class="btn btn-success btn-sm btn-block">Cadastrar</button>
</form>
</div>
<?php include_once("footer.php"); ?>
<script>
function validaSenha(input) {
if (input.value != document.getElementById('senha').value) {
input.setCustomValidity('Repita a senha corretamente!');
document.getElementById('msg-erro').style.display = "block"
} else {
input.setCustomValidity('');
document.getElementById('msg-erro').style.display = "none"
}
}
</script>
</body>
</html>