/
editar.php
66 lines (54 loc) · 2.74 KB
/
editar.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
<?php session_start() ?>
<?php include_once 'includes/header.inc.php' ?>
<?php include_once 'includes/menu.inc.php' ?>
<div class="row container">
<div class="col s12">
<h5 class="light">Edição de Registros</h5><hr>
</div>
<?php
include_once 'banco_de_dados/conexao.php';
$id = filter_input( INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT );
$_SESSION['id'] = $id;
$querySelect = $link -> query( "select * from tb_clientes where id='$id'" );
while( $registro = $querySelect -> fetch_assoc() ) {
$nome = $registro['nome'];
$email = $registro['email'];
$telefone = $registro['telefone'];
}
?>
<!-- Formulário de Cadastro -->
<div class="row container">
<p> </p>
<form action="banco_de_dados/update.php" method="post" class="col s12">
<fieldset class="formulario" style="padding: 15px">
<legend><img src="image/avatar-2.png" alt="[imagem]" width="100"></legend>
<h5 class="light center">Alteração</h5>
<!-- CAMPO NOME -->
<div class="input-field col s12">
<i class="material-icons prefix">account_circle</i>
<input type="text" name="nome" id="nome" value="<?php echo $nome ?>" maxlength="40" required autofocus>
<label class="active" for="nome">Nome do Cliente</label>
</div>
<!-- CAMPO EMAIL -->
<div class="input-field col s12">
<i class="material-icons prefix">email</i>
<input type="email" name="email" id="email" value="<?php echo $email ?>" maxlength="50" required>
<label class="active" for="email">Email do Cliente</label>
</div>
<!-- CAMPO TEL -->
<div class="input-field col s12">
<i class="material-icons prefix">phone</i>
<input type="tel" name="telefone" id="telefone" value="<?php echo $telefone ?>" maxlength="15" required>
<label class="active" for="telefone">Telefone do Cliente</label>
</div>
<!-- Button -->
<div class="input-field col 12">
<button class="btn waves-effect waves-light blue" type="submit" name="action">alterar
<i class="material-icons right">save</i>
</button>
<a href="consultas.php" class="waves-effect waves-light btn red"><i class="material-icons right">clear</i>cancelar</a>
</div>
</fieldset>
</form>
</div>
<?php include_once 'includes/footer.inc.php' ?>