diff --git a/assets/uploads/marketing_images/6a0b55fd26f29.webp b/assets/uploads/marketing_images/6a0b55fd26f29.webp new file mode 100644 index 00000000..c94a54b5 Binary files /dev/null and b/assets/uploads/marketing_images/6a0b55fd26f29.webp differ diff --git a/assets/uploads/marketing_images/6a0b5afa602ec.jpg b/assets/uploads/marketing_images/6a0b5afa602ec.jpg new file mode 100644 index 00000000..bf2ac7fc Binary files /dev/null and b/assets/uploads/marketing_images/6a0b5afa602ec.jpg differ diff --git a/assets/uploads/marketing_images/6a0b5beeda612.png b/assets/uploads/marketing_images/6a0b5beeda612.png new file mode 100644 index 00000000..496f3091 Binary files /dev/null and b/assets/uploads/marketing_images/6a0b5beeda612.png differ diff --git a/assets/uploads/marketing_images/6a0b5cee638da.jpg b/assets/uploads/marketing_images/6a0b5cee638da.jpg new file mode 100644 index 00000000..9df07cfd Binary files /dev/null and b/assets/uploads/marketing_images/6a0b5cee638da.jpg differ diff --git a/assets/uploads/marketing_images/6a0b5f7159bfc.jpg b/assets/uploads/marketing_images/6a0b5f7159bfc.jpg new file mode 100644 index 00000000..c2e45088 Binary files /dev/null and b/assets/uploads/marketing_images/6a0b5f7159bfc.jpg differ diff --git a/assets/uploads/vouchers/6a0b4c5a77bc9-Captura de pantalla 2026-05-18 122835.png b/assets/uploads/vouchers/6a0b4c5a77bc9-Captura de pantalla 2026-05-18 122835.png new file mode 100644 index 00000000..9a0ff82b Binary files /dev/null and b/assets/uploads/vouchers/6a0b4c5a77bc9-Captura de pantalla 2026-05-18 122835.png differ diff --git a/assets/uploads/vouchers/6a0b4e7e7d024-Captura de pantalla 2026-05-18 123737.png b/assets/uploads/vouchers/6a0b4e7e7d024-Captura de pantalla 2026-05-18 123737.png new file mode 100644 index 00000000..192182f9 Binary files /dev/null and b/assets/uploads/vouchers/6a0b4e7e7d024-Captura de pantalla 2026-05-18 123737.png differ diff --git a/assets/uploads/vouchers/6a0b569404ba3-177.png b/assets/uploads/vouchers/6a0b569404ba3-177.png new file mode 100644 index 00000000..c5386c2e Binary files /dev/null and b/assets/uploads/vouchers/6a0b569404ba3-177.png differ diff --git a/assets/uploads/vouchers/6a0b5828bd053-222.png b/assets/uploads/vouchers/6a0b5828bd053-222.png new file mode 100644 index 00000000..789d71dc Binary files /dev/null and b/assets/uploads/vouchers/6a0b5828bd053-222.png differ diff --git a/assets/uploads/vouchers/6a0b5a14deb46-627.png b/assets/uploads/vouchers/6a0b5a14deb46-627.png new file mode 100644 index 00000000..c98ab25b Binary files /dev/null and b/assets/uploads/vouchers/6a0b5a14deb46-627.png differ diff --git a/assets/uploads/vouchers/6a0b5c3a23251-847.png b/assets/uploads/vouchers/6a0b5c3a23251-847.png new file mode 100644 index 00000000..79594f58 Binary files /dev/null and b/assets/uploads/vouchers/6a0b5c3a23251-847.png differ diff --git a/assets/uploads/vouchers/6a0b5cf969b1f-9133.png b/assets/uploads/vouchers/6a0b5cf969b1f-9133.png new file mode 100644 index 00000000..273c03fa Binary files /dev/null and b/assets/uploads/vouchers/6a0b5cf969b1f-9133.png differ diff --git a/assets/uploads/vouchers/6a0b5daeb3d0f-103.png b/assets/uploads/vouchers/6a0b5daeb3d0f-103.png new file mode 100644 index 00000000..d843ed95 Binary files /dev/null and b/assets/uploads/vouchers/6a0b5daeb3d0f-103.png differ diff --git a/db/migrations/022_add_duplicados_to_estado.sql b/db/migrations/022_add_duplicados_to_estado.sql new file mode 100644 index 00000000..52da7748 --- /dev/null +++ b/db/migrations/022_add_duplicados_to_estado.sql @@ -0,0 +1,12 @@ +-- Add 'Duplicados' to the estado ENUM in the pedidos table +ALTER TABLE pedidos MODIFY COLUMN estado ENUM( + 'ROTULADO 📦', + 'EN TRANSITO 🚛', + 'EN DESTINO 🏬', + 'COMPLETADO ✅', + 'Gestion', + 'RUTA_CONTRAENTREGA', + 'ENTREGA EXITOSA', + 'RETORNADO', + 'Duplicados' +) DEFAULT 'ROTULADO 📦'; diff --git a/duplicados.php b/duplicados.php new file mode 100644 index 00000000..936fb3e5 --- /dev/null +++ b/duplicados.php @@ -0,0 +1,415 @@ +prepare($years_query); + $years_stmt->execute([$user_id]); +} else { + $years_stmt = $pdo->query($years_query); +} +$years = $years_stmt->fetchAll(PDO::FETCH_COLUMN); + + +// Filter logic +$selected_month = $_GET['mes'] ?? ''; +$selected_year = $_GET['año'] ?? ''; +$search_query = $_GET['q'] ?? ''; + +$sql = "SELECT p.*, u.nombre_asesor as asesor_nombre FROM pedidos p LEFT JOIN users u ON p.asesor_id = u.id WHERE p.estado = 'Duplicados'"; +$params = []; + +if ($user_role === 'Asesor') { + $sql .= " AND p.asesor_id = ?"; + $params[] = $user_id; +} + +if (!empty($search_query)) { + $sql .= " AND (p.nombre_completo LIKE ? OR p.dni_cliente LIKE ? OR p.celular LIKE ?)"; + $params[] = "%$search_query%"; + $params[] = "%$search_query%"; + $params[] = "%$search_query%"; +} + +if (!empty($selected_month)) { + $sql .= " AND MONTH(p.created_at) = ?"; + $params[] = $selected_month; +} +if (!empty($selected_year)) { + $sql .= " AND YEAR(p.created_at) = ?"; + $params[] = $selected_year; +} + +$sql .= " ORDER BY p.created_at DESC"; +$stmt = $pdo->prepare($sql); +$stmt->execute($params); +$pedidos = $stmt->fetchAll(); + +$months = [ + 1 => 'Enero', 2 => 'Febrero', 3 => 'Marzo', 4 => 'Abril', 5 => 'Mayo', 6 => 'Junio', + 7 => 'Julio', 8 => 'Agosto', 9 => 'Septiembre', 10 => 'Octubre', 11 => 'Noviembre', 12 => 'Diciembre' +]; + +?> + + + + + + + +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + Limpiar +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDClienteDNICelularAgenciaProductoSede de EnvíoMonto TotalMonto DebeNº De OrdenCodigo De OrdenCLAVEDESCARGOPENDIENTESEstadoAsesorFecha CreaciónMesAcciones
+ Oculto'; ?> + + + + + + + + format('m'); + echo htmlspecialchars($months[$monthNum] ?? 'N/A'); + ?> + + Editar + + Eliminar + +
+ +

No hay pedidos que coincidan con el filtro.

+ +
+
+
+ + + + + + + + diff --git a/layout_header.php b/layout_header.php index 9b46dd31..d83123dc 100644 --- a/layout_header.php +++ b/layout_header.php @@ -220,11 +220,24 @@ $navItems = [ 'text' => 'Pedidos Duplicados', 'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico'] ], - 'gestiones' => [ - 'url' => 'gestiones.php', + 'gestiones_group' => [ 'icon' => 'fa-cogs', 'text' => 'Gestiones', - 'roles' => ['Administrador', 'admin', 'superadmin', 'Asesor', 'Control Logistico'] + 'roles' => ['Administrador', 'admin', 'superadmin', 'Asesor', 'Control Logistico'], + 'submenu' => [ + 'gestiones' => [ + 'url' => 'gestiones.php', + 'icon' => 'fa-cogs', + 'text' => 'Gestiones', + 'roles' => ['Administrador', 'admin', 'superadmin', 'Asesor', 'Control Logistico'] + ], + 'duplicados' => [ + 'url' => 'duplicados.php', + 'icon' => 'fa-clone', + 'text' => 'Duplicados', + 'roles' => ['Administrador', 'admin', 'Asesor', 'Control Logistico'] + ] + ] ], 'manage_users' => [ 'url' => 'manage_users.php', diff --git a/marketing_produccion.php b/marketing_produccion.php index 496a0e38..bd936c6c 100644 --- a/marketing_produccion.php +++ b/marketing_produccion.php @@ -265,8 +265,18 @@ $videos = $stmt_videos->fetchAll(PDO::FETCH_ASSOC);
- - + +
+
+ + +
+
- - + +
+ +