-
Notifications
You must be signed in to change notification settings - Fork 0
/
editar.php
66 lines (61 loc) · 2.88 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 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 id = ?;");
$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">Nombres: </label>
<input type="text" class="form-control" name="txtNombres" required
value="<?php echo $persona->nombres; ?>">
</div>
<div class="mb-3">
<label class="form-label">Apellido Paterno: </label>
<input type="text" class="form-control" name="txtApPaterno" autofocus required
value="<?php echo $persona->apellido_paterno; ?>">
</div>
<div class="mb-3">
<label class="form-label">Apellido Materno: </label>
<input type="text" class="form-control" name="txtApMaterno" autofocus required
value="<?php echo $persona->apellido_materno; ?>">
</div>
<div class="mb-3">
<label class="form-label">Fecha de Nacimiento: </label>
<input type="date" class="form-control" name="txtFechaNacimiento" autofocus required
value="<?php echo $persona->fecha_nacimiento; ?>">
</div>
<div class="mb-3">
<label class="form-label">Celular: </label>
<input type="number" class="form-control" name="txtCelular" autofocus required
value="<?php echo $persona->celular; ?>">
</div>
<div class="mb-3">
<label class="form-label">DNI: </label>
<input type="number" class="form-control" name="txtDni" autofocus required
value="<?php echo $persona->dni; ?>">
</div>
<div class="d-grid">
<input type="hidden" name="codigo" value="<?php echo $persona->id; ?>">
<input type="submit" class="btn btn-primary" value="Editar">
</div>
</form>
</div>
</div>
</div>
</div>
<?php include 'template/footer.php' ?>