-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathasignacion_material.php
421 lines (402 loc) · 16.7 KB
/
asignacion_material.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
<?php
session_start(); // Inicia la sesión PHP
// Comprueba si el usuario está logueado
if (!isset($_SESSION['usuario_logueado'])) {
header('Location: index.php'); // Redirige al usuario al inicio de sesión si no está logueado
exit; // Termina la ejecución del script
}
include 'php/info.php';
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Asignacion de Material</title>
<link rel="website icon" type="png" href="assets/icons/icon.barra.png">
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/material.min.css">
<link rel="stylesheet" href="css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="css/jquery.mCustomScrollbar.css">
<link rel="stylesheet" href="css/main.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="js/jquery-1.11.2.min.js"><\/script>')
</script>
<script src="js/material.min.js"></script>
<script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
<script src="js/main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" />
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head>
<body>
<!-- navBar -->
<div class="full-width navBar">
<div class="full-width navBar-options">
<i class="zmdi zmdi-long-arrow-left btn-menu rotate-icon" id="btn-menu" style="margin: 1%; font-size: 24px;"></i>
<div class="mdl-tooltip" for="btn-menu">Menu</div>
<nav class="navBar-options-list">
<ul class="list-unstyle">
<li class="btn-exit" id="btn-exit">
<i class="zmdi zmdi-power"></i>
<div class="mdl-tooltip" for="btn-exit">Cerrar Sesion</div>
</li>
<?php echo htmlspecialchars($nombreCompleto); ?>
<li class="noLink">
<figure>
<img src="assets/img/avatar-male.png" alt="Avatar" class="img-responsive">
</figure>
</li>
</ul>
</nav>
</div>
</div>
<script>
document.getElementById('btn-exit').addEventListener('click', function() {
Swal.fire({
title: '¿Estás seguro?',
text: "¿Deseas cerrar la sesión?",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Sí, cerrar sesión',
cancelButtonText: 'No'
}).then((result) => {
if (result.isConfirmed) {
window.location.href = 'php/logout.php'; // Redirige a logout.php si el usuario confirma
}
});
});
var rotateIcon = document.getElementById('btn-menu');
rotateIcon.addEventListener('click', function() {
this.classList.toggle('rotate180');
});
</script>
<!-- navLateral -->
<section class="full-width navLateral">
<div class="full-width navLateral-bg btn-menu"></div>
<div class="full-width navLateral-body">
<div class="full-width navLateral-body-logo text-center tittles">
<i class="zmdi zmdi-close btn-menu"></i> MuebleTech
</div>
<!-- Sección del nombre y rol del usuario -->
<figure class="full-width" style="height: 77px;">
<div class="navLateral-body-cl">
<img src="assets/img/avatar-male.png" alt="Avatar" class="img-responsive">
</div>
<figcaption class="navLateral-body-cr hide-on-tablet">
<span>
<?php echo htmlspecialchars($nombreCompleto); ?>
<br>
<small><?php echo htmlspecialchars($rol); ?></small>
</span>
</figcaption>
</figure>
<div class="full-width tittles navLateral-body-tittle-menu">
<i class="zmdi zmdi-desktop-mac"></i><span class="hide-on-tablet"> Tablero</span>
</div>
<nav class="full-width">
<ul class="full-width list-unstyle menu-principal">
<li class="full-width">
<a href="home.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-view-dashboard mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
HOME
</div>
</a>
</li>
<li class="full-width divider-menu-h"></li>
<li class="full-width">
<a href="#!" class="full-width btn-subMenu">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-washing-machine mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
ORDENES DE TRABAJO
</div>
<span class="zmdi zmdi-chevron-left"></span>
</a>
<ul class="full-width menu-principal sub-menu-options">
<li class="full-width">
<a href="crear_ot.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-accounts mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
CREACION DE OT
</div>
</a>
</li>
<li class="full-width">
<a href="editar.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi material-symbols-outlined mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
EDITAR OT
</div>
</a>
</li>
<li class="full-width">
<a href="asignacion_material.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-store mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
ASIGNACION DE MATERIAL
</div>
</a>
</li>
</ul>
</li>
<li class="full-width divider-menu-h"></li>
<li class="full-width">
<a href="#!" class="full-width btn-subMenu">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-store mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
INVENTARIO
</div>
<span class="zmdi zmdi-chevron-left"></span>
</a>
<ul class="full-width menu-principal sub-menu-options">
<li class="full-width">
<a href="Salida.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-truck mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
SALIDA DE MATERIAL
</div>
</a>
</li>
<li class="full-width">
<a href="Ingreso.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-truck reverso mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
INGRESO DE MATERIAL
</div>
</a>
</li>
<li class="full-width">
<a href="stock.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-widgets"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
STOCK
</div>
</a>
</li>
<li class="full-width">
<a href="crear.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-label mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
CREAR MATERIAL - FAMILIA
</div>
</a>
</li>
</ul>
</li>
<li class="full-width divider-menu-h"></li>
<li class="full-width">
<a href="cotizacion.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-shopping-cart mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
COTIZACION
</div>
</a>
</li>
<li class="full-width divider-menu-h"></li>
<li class="full-width">
<a href="Solicitud_compra.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-balance mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
SOLICITUD DE COMPRA
</div>
</a>
</li>
<li class="full-width divider-menu-h"></li>
<li class="full-width">
<a href="#!" class="full-width btn-subMenu">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-face mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
ADMINISTRADOR
</div>
<span class="zmdi zmdi-chevron-left"></span>
</a>
<ul class="full-width menu-principal sub-menu-options">
<li class="full-width">
<a href="admin.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-account mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
NUEVO USUARIO
</div>
</a>
</li>
<li class="full-width">
<a href="reportes.php" class="full-width">
<div class="navLateral-body-cl">
<i class="zmdi zmdi-label mover"></i>
</div>
<div class="navLateral-body-cr hide-on-tablet">
REPORTES
</div>
</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
</section>
<!-- pageContent -->
<section class="full-width pageContent">
<section class="full-width header-well">
<div class="full-width header-well-icon">
<i class="zmdi zmdi-truck"></i>
</div>
<div class="full-width header-well-text">
<p class="text-condensedLight">
Aquí se realizarán las asignaciones de materiales necesarios para cada orden de trabajo segun
corresponda.
</p>
</div>
</section>
<div class="mdl-tabs mdl-js-tabs mdl-js-ripple-effect">
<div class="mdl-tabs__tab-bar"></div>
<div class="mdl-tabs__panel is-active" id="tabNewIngreso">
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--8-col-desktop mdl-cell--2-offset-desktop">
<div class="full-width panel mdl-shadow--2dp">
<div class="full-width panel-tittle bg-primary text-center tittles">
Asignacion de Materiales
</div>
<div class="full-width panel-content">
<form id="formulario-movimiento-material">
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<!-- Campos para la búsqueda de OT -->
<div style="display: flex; align-items: flex-start;">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="number" pattern="^[0-9]+$" id="id_ot" name="id_ot">
<label class="mdl-textfield__label" for="id_ot">Num. OT</label>
<span class="mdl-textfield__error">Ingrese solo números</span>
</div>
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored bg-primary" id="buscar-ot-btn" style="margin: 3%;">Buscar OT</button>
</div>
</div>
</div>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<p>Nombre Mueble: <strong><u><span id="nombrelMueble" style="font-size: 17px;"></u></strong></span></p>
</div>
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<p>Nombre Cliente: <strong><u><span id="nombreCliente" style="font-size: 17px;"></u></strong></span></p>
</div>
</div>
<p style="text-align: center;">
*************************************************************************************************************
</p>
<h5 class="text-condensedLight" style="text-align: center;"><strong>Detalle de la
Asignacion</strong></h5>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<!-- Campos para la búsqueda de OT -->
<div style="display: flex; align-items: flex-start;">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="id_material" name="id_material">
<label class="mdl-textfield__label" for="id_material">Codigo del Material</label>
</div>
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored bg-primary" id="buscar-material-btn" style="margin: 3%;">Buscar Material</button>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<input class="mdl-textfield__input" type="text" id="nombre_material" name="nombre_material">
<label class="mdl-textfield__label" for="nombre_material">Nombre del Material</label>
</div>
<div id="listaResultados" style="position: absolute; z-index: 1000; background: white; width: 300px;">
<!-- Los resultados de búsqueda se mostrarán aquí -->
</div>
</div>
</div>
<div class="mdl-grid">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<p>Material: <strong><u><span id="nombreMaterial" style="font-size: 16px;"></u></strong></span></p>
</div>
<div class="mdl-cell mdl-cell--12-col-tablet mdl-cell--12-col-desktop">
<div style="display: flex;">
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label" style="flex: 1;">
<input class="mdl-textfield__input" type="number" step="1" id="cantidad" name="cantidad">
<label class="mdl-textfield__label" for="cantidad">Cantidad</label>
<span class="mdl-textfield__error">Por favor, ingrese un número
entero.</span>
</div>
<button type="button" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored bg-primary" id="agregar-material-btn" style="margin: 3%;">Agregar</button>
</div>
</div>
</div>
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<div class="mdl-cell mdl-cell--4-col-phone mdl-cell--8-col-tablet mdl-cell--6-col-desktop">
<p>Unidad de Medida: <strong><u><span id="unidadMedida" style="font-size: 15px;"></u></strong></span></p>
</div>
</div>
</div>
<p><span id="unidadMedida"></span></p>
<p style="text-align: center;">
*************************************************************************************************************
</p>
<!-- Tabla para mostrar los materiales agregados -->
<div style="text-align: center;">
<h5 class="text-condensedLight"><strong>Materiales Agregados</strong></h5>
<div style="overflow-x: auto;">
<table border="1" class="mdl-data-table mdl-js-data-table mdl-shadow--2dp" id="materiales-table" style="margin: 0 auto; width: 60%;">
<thead style="text-align: center;">
<tr>
<th style="font-size: 13px;">Código de Material</th>
<th style="font-size: 13px;">Nombre</th>
<th style="font-size: 13px;">Unidad</th>
<th style="font-size: 13px;">Cantidad</th>
<th style="text-align: center;">Acciones</th>
</tr>
</thead>
<tbody id="materialesUtilizadosTableBody">
<!-- Aquí se llenarán los datos de la tabla mediante JavaScript -->
</tbody>
</table>
</div>
<br>
<!-- Botón para guardar el movimiento -->
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored bg-primary" id="guardar-movimiento-btn">
Guardar
</button>
</div>
<!-- Información Enviada al PHP -->
<div id="mensaje"></div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="js/asignacionMateriales.js"></script>
</body>
</html>