-
Notifications
You must be signed in to change notification settings - Fork 0
/
editar.php
51 lines (46 loc) · 1.97 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
<?php include 'template/header.php' ?>
<?php
if(!isset($_GET['codigo'])){
header('Location: index.php?mensaje=error');
exit();
}
include_once 'model/conexion.php';
$codigo = $_GET['codigo'];
$sentencia = $bd->prepare("select * from persona where codigo = ?;");
$sentencia->execute([$codigo]);
$persona = $sentencia->fetch(PDO::FETCH_OBJ);
//print_r($persona);
?>
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-4">
<div class="card">
<div class="card-header">
Editar datos:
</div>
<form class="p-4" method="POST" action="editarProceso.php">
<div class="mb-3">
<label class="form-label">Nombre: </label>
<input type="text" class="form-control" name="txtNombre" required
value="<?php echo $persona->nombre; ?>">
</div>
<div class="mb-3">
<label class="form-label">Edad: </label>
<input type="number" class="form-control" name="txtEdad" autofocus required
value="<?php echo $persona->edad; ?>">
</div>
<div class="mb-3">
<label class="form-label">Signo: </label>
<input type="text" class="form-control" name="txtSigno" autofocus required
value="<?php echo $persona->signo; ?>">
</div>
<div class="d-grid">
<input type="hidden" name="codigo" value="<?php echo $persona->codigo; ?>">
<input type="submit" class="btn btn-primary" value="Editar">
</div>
</form>
</div>
</div>
</div>
</div>
<?php include 'template/footer.php' ?>