-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhistorial.php
205 lines (179 loc) · 9.92 KB
/
historial.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
<?php
require_once("control/validarusuario.php");
if (!isset($_SESSION['nombre_usuario'])) {
header("Location:login.php");
}
$usuario = $_SESSION["nombre_usuario"];
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Histrorial - Pedidos</title>
<!-- Google Web Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=Roboto:wght@500;700&display=swap" rel="stylesheet">
<!-- Icon Font Stylesheet -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.0/css/all.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css" rel="stylesheet">
<link href="img/favicon.ico" rel="icon">
<!-- Libraries Stylesheet -->
<link href="lib/owlcarousel/assets/owl.carousel.min.css" rel="stylesheet">
<link href="lib/tempusdominus/css/tempusdominus-bootstrap-4.min.css" rel="stylesheet" />
<!-- Customized Bootstrap Stylesheet -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Template Stylesheet -->
<link href="css/style.css" rel="stylesheet">
<link href="css/login.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid position-relative d-flex p-0">
<?php
$usuario = $_SESSION['nombre_usuario'];
require_once('control/conexion.php');
$tipo = "SELECT tipo_usuario FROM Usuarios WHERE nombre_usuario='$usuario';";
$nivel = mysqli_query($conexion, $tipo);
$fila = mysqli_fetch_array($nivel);
if ($fila['tipo_usuario'] == "Admin") {
include('modulos/nav-admin.php');
} elseif ($fila['tipo_usuario'] == "Colaborador") {
include('modulos/nav-colab.php');
}
?>
<div class="content">
<nav class="navbar navbar-expand rojizo navbar-dark sticky-top px-4 py-0">
<a href="index.php" class="navbar-brand d-flex d-lg-none d-sm-block me-4">
<h2 class="text-primary mb-0"> <img src="img/Logo.png" width="200" height="80"><i class="fa "></i></h2>
</a>
<a href="#" class="sidebar-toggler flex-shrink-0">
<i class="fa fa-bars"></i>
</a>
<div class="navbar-nav align-items-center ms-auto">
<div class="nav-item dropdown">
<a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown">
<img class="rounded-circle me-lg-2" src="<?php
$usuario = $_SESSION['nombre_usuario'];
$img = "SELECT imagen FROM Trabajadores, Usuarios WHERE Trabajadores.id=Usuarios.id_trabajador AND Usuarios.nombre_usuario='$usuario';";
$imagen = mysqli_query($conexion, $img);
$src = mysqli_fetch_array($imagen);
$url = $src['imagen'];
echo $url; ?>" alt="" style="width: 40px; height: 40px;">
<span class="d-none d-lg-inline-flex"><?php echo $usuario; ?></span>
</a>
<div class="dropdown-menu dropdown-menu-end cafeoscuro border-0 rounded-0 rounded-bottom m-0">
<a href="ajustes.php" class="dropdown-item">Ajustes</a>
<a href="control/cerrar.php" class="dropdown-item">Cerrar Sesión</a>
</div>
</div>
</div>
</nav>
<!-- Container Start -->
<div class="container-fluid pt-3 px-3">
<div class="cafeclaro rounded p-4">
<div class="container-fluid pt-3 px-4 ">
<!-- Barra de acceso rapido Start-->
<div class=" naranja rounded p-1 text-center row">
<h5 class="text-center pt-2 px-4">HISTORIAL DE PEDIDOS</h5>
</div>
<div class="cafeoscuro rounded p-1 row">
<div class=" col-sm-6 container-fluid pt-2 ">
<form class=" d-md-flex ">
<input class="col-sm-12 col-lg-12 text-center searchSize search grispan border-0 rounded" type="search" id="searchInput" placeholder="Buscar un pedido">
</form>
</div>
</div>
</div>
<!-- Barra de acceso rapido End -->
<!-- Recent Sales Start -->
<div class="container-fluid pt-3 px-4">
<div class="cafeoscuro text-center rounded p-4">
<div class="table-responsive rounded">
<div class="scrollBarr" style="height: 350px;">
<table class="table text-start align-middle table-bordered table-hover mb-0 ">
<thead class="text-center naranja text-white ">
<tr>
<th scope="col">Fecha Registro</th>
<th scope="col">Fecha Entrega</th>
<th scope="col">Folio</th>
<th scope="col">Cliente</th>
<th scope="col">Productos</th>
<th scope="col">Descripcion</th>
<th scope="col">Costo Total</th>
<th scope="col">Estatus Pedido</th>
</tr>
</thead>
<tbody class="CursorPointerTabla text-center">
<?php
require('control/conexion.php');
$sql = mysqli_query($conexion, "SELECT *, Pedidos.id AS pedidosID FROM Pedidos,Clientes WHERE Pedidos.id_cliente=Clientes.id AND Pedidos.estatus='Entregado';");
while ($fila = mysqli_fetch_array($sql)) {
printf(
"<tr>
<td>%s</td>
<td>%s</td>
<td>%s%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
<td>%s</td>
</tr>",
$fila["fecha_realizacion"],
$fila["fecha_entrega"],
$fila["id"],
$fila["pedidosID"],
$fila["nombre"],
$fila["productos"],
$fila["descripcion_pedido"],
$fila["costo_total"],
$fila["estatus"]
);
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Recent Sales End -->
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="lib/chart/chart.min.js"></script>
<script src="lib/easing/easing.min.js"></script>
<script src="lib/waypoints/waypoints.min.js"></script>
<script src="lib/owlcarousel/owl.carousel.min.js"></script>
<script src="lib/tempusdominus/js/moment.min.js"></script>
<script src="lib/tempusdominus/js/moment-timezone.min.js"></script>
<script src="lib/tempusdominus/js/tempusdominus-bootstrap-4.min.js"></script>
<script>
$(document).ready(function() {
// Trigger the function when the search input changes
$('#searchInput').on('input', function() {
var searchText = $(this).val().toLowerCase();
// Iterate through each row in the table
$('tbody tr').filter(function() {
// Check if the row contains the search text
$(this).toggle($(this).text().toLowerCase().indexOf(searchText) > -1);
});
});
});
</script>
<!-- Template Javascript -->
<script src="js/main.js"></script>
<script>
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function() {
$(this).remove();
window.location.href = 'historial.php';
});
}, 3000);
</script>
</body>
</html>