-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcadastrarAdmin.php
59 lines (50 loc) · 2.27 KB
/
cadastrarAdmin.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
<?php
include_once('includes/logica/conecta.php');
include_once('includes/logica/functions.php');
include_once('includes/componentes/cabecalho.php');
session_start();
$stmt = $conexao->prepare("SELECT * FROM categorias");
$stmt->execute();
$categorias = $stmt->fetchAll();
$administradores = listarAdmin($conexao);
if(empty($administradores)){
?>
<section>
<p>Não há administradores cadastrados.</p>
</section>
<?php
}
foreach($administradores as $administrador){
?>
<section>
<p> <img src="imagens/<?php echo $administrador['foto_perfil'];?>" width='100px' height='100px'/></p>
<p>Nome: <?php echo $administrador['nome']; ?></p>
<p>Email: <?php echo $administrador['email']; ?></p>
<div class="Adm">
<form action="includes/logica/controller.php" method="post">
<input type="hidden" name="id" value="<?php echo $administrador['id']; ?>">
<button type="submit" class="alteraPagina" name="editarAdmin" value="<?php echo $administrador['id']; ?>"> Editar </button>
<button type="submit" name="deletarAdmin" value="<?php echo $administrador['id']; ?>" onclick = "return confirma_excluir()"> Deletar </button>
</form>
</div>
<br><br>
</section>
<?php
}
/*if(!isset($_SESSION['logado']))
{
header('location:loginAdm.php');
}
*/
?>
<section>
<h2>Cadastrar novo administrador</h2>
<form action="includes/logica/controller.php" method="post" enctype="multipart/form-data">
<p><label for="nome">Nome: </label><input type="text" name="nome" id="nome"></p>
<p><label for="email">email: </label><input type="text" name="email" id="email"></p>
<p><label for="senha">Senha: </label> <input type="password" name="senha" id="senha"></p>
<p><label for="imagem">Imagem: </label><input type="file" name="imagemAdm" accept="image/*"></p>
<p><button type="submit" name='cadastrarAdm' value="CadastrarAdm"> Cadastrar Administrador </button> </p>
</form>
</section>
<script type="text/javascript" src="js/scripts.js"></script>