-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.php
82 lines (68 loc) · 3.53 KB
/
index.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>CRUD de Empleados en PHP, MySQL utilizando MODALES</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.min.css" />
<link rel="stylesheet" href="assets/css/home.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/5.3.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/2.0.2/css/dataTables.bootstrap5.css">
<!-- Libreria para alertas ----->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.css" />
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"></script>
</head>
<body>
<?php
include("config/config.php");
include("acciones/acciones.php");
$empleados = obtenerEmpleados($conexion);
$totalEmpleados = $empleados->num_rows;
?>
<h1 class="text-center mt-5 mb-5 fw-bold">CRUD completo con PHP, MySQL y Bootstrap 5 usando Modales</h1>
<div class="container">
<div class="row justify-content-md-center">
<div class="col-md-12">
<h1 class="text-center">
<span class="float-start">
<a href="#" onclick="modalRegistrarEmpleado()" class="btn btn-success" title="Registrar Nuevo Empleado">
<i class="bi bi-person-plus"></i>
</a>
</span>
Lista de empleados (<?php echo $totalEmpleados ?>)
<span class="float-end">
<a href="acciones/exportar.php" class="btn btn-success" title="Exportar a CSV" download="empleados.csv"><i class="bi bi-filetype-csv"></i></a>
</span>
<hr>
</h1>
<?php
include("empleados.php"); ?>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="assets/js/detallesEmpleado.js"></script>
<script src="assets/js/addEmpleado.js"></script>
<script src="assets/js/editarEmpleado.js"></script>
<script src="assets/js/eliminarEmpleado.js"></script>
<script src="assets/js/refreshTableAdd.js"></script>
<script src="assets/js/refreshTableEdit.js"></script>
<script src="assets/js/alertas.js"></script>
<!-------------------------Librería datatable para la tabla -------------------------->
<script src="https://cdn.datatables.net/2.0.2/js/dataTables.js"></script>
<script src="https://cdn.datatables.net/2.0.2/js/dataTables.bootstrap5.js"></script>
<script>
$(document).ready(function() {
$("#table_empleados").DataTable({
pageLength: 5,
language: {
url: "https://cdn.datatables.net/plug-ins/1.10.25/i18n/Spanish.json",
},
});
});
</script>
</body>
</html>