From 697dbbf92b62c09b15aaca7b450c5a4526a1d2f2 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 12 Feb 2026 03:55:52 +0000 Subject: [PATCH] Autosave: 20260212-035552 --- assets/css/style.css | 50 ++++++++++++++++++- get_product_details.php | 36 +++++++++----- imprimir_etiquetas.php | 86 ++++++++++++++++++++++++++++++++ layout_footer.php | 14 ++++++ layout_header.php | 10 +++- productos.php | 108 +++++++++++++++++++++++++--------------- registro_entrada.php | 98 +++++++++++++++++++++++++++++++++++- registro_salida.php | 98 +++++++++++++++++++++++++++++++++++- 8 files changed, 442 insertions(+), 58 deletions(-) create mode 100644 imprimir_etiquetas.php diff --git a/assets/css/style.css b/assets/css/style.css index 15ea737..ba06515 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -4,6 +4,7 @@ body { font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif; display: flex; color: #333; + transition: margin-left 0.3s; } /* Sidebar Styles */ @@ -17,6 +18,8 @@ body { color: #ecf0f1; padding-top: 20px; box-shadow: 2px 0 15px rgba(0,0,0,0.1); + transition: transform 0.3s ease; + z-index: 1000; } .sidebar .navbar-brand { @@ -61,8 +64,49 @@ body { padding: 30px; width: calc(100% - 260px); overflow-y: auto; + transition: margin-left 0.3s ease; } +/* Hamburger Menu Button */ +.sidebar-toggle { + display: none; + position: fixed; + top: 15px; + left: 15px; + z-index: 1001; + background: #34495e; + color: #fff; + border: none; + padding: 10px 15px; + border-radius: 5px; + cursor: pointer; +} + +/* Responsive Styles */ +@media (max-width: 992px) { + .sidebar { + transform: translateX(-100%); + } + + .sidebar.active { + transform: translateX(0); + } + + .content { + margin-left: 0; + width: 100%; + } + + .sidebar-toggle { + display: block; + } + + body.sidebar-active .content { + margin-left: 260px; + } +} + + h1, .h1 { color: #333 !important; /* Color oscuro para los títulos */ } @@ -109,8 +153,12 @@ h1, .h1 { } /* Table Styles */ +.table-responsive { + overflow-x: auto; +} .table { margin-bottom: 0; + min-width: 600px; /* Prevent table from collapsing too much */ } .table thead th { @@ -245,4 +293,4 @@ h1, .h1 { .sidebar .submenu .nav-link.active { color: #fff; /* White color for active sub-item */ font-weight: bold; -} +} \ No newline at end of file diff --git a/get_product_details.php b/get_product_details.php index 056a8bd..ae4c97d 100644 --- a/get_product_details.php +++ b/get_product_details.php @@ -1,21 +1,31 @@ prepare("SELECT id, nombre, provincia FROM products WHERE id = ?"); - $stmt->execute([$id]); - $product = $stmt->fetch(PDO::FETCH_ASSOC); +$response = ['success' => false, 'message' => 'ID de producto no proporcionado.']; - if ($product) { - header('Content-Type: application/json'); - echo json_encode($product); +if (isset($_GET['id'])) { + $product_id = filter_input(INPUT_GET, 'id', FILTER_VALIDATE_INT); + + if ($product_id) { + try { + $pdo = db(); + $stmt = $pdo->prepare("SELECT id, nombre, sku FROM products WHERE id = :id"); + $stmt->execute(['id' => $product_id]); + $product = $stmt->fetch(PDO::FETCH_ASSOC); + + if ($product) { + $response = ['success' => true, 'product' => $product]; + } else { + $response['message'] = 'Producto no encontrado.'; + } + } catch (PDOException $e) { + $response['message'] = 'Error en la base de datos: ' . $e->getMessage(); + } } else { - http_response_code(404); - echo json_encode(['error' => 'Producto no encontrado']); + $response['message'] = 'ID de producto inválido.'; } -} else { - http_response_code(400); - echo json_encode(['error' => 'ID de producto no proporcionado']); } + +echo json_encode($response); ?> \ No newline at end of file diff --git a/imprimir_etiquetas.php b/imprimir_etiquetas.php new file mode 100644 index 0000000..57f0bc8 --- /dev/null +++ b/imprimir_etiquetas.php @@ -0,0 +1,86 @@ +prepare("SELECT id, nombre FROM products WHERE id IN ($placeholders)"); +foreach ($product_ids as $k => $id) { + $stmt->bindValue(($k + 1), $id, PDO::PARAM_INT); +} +$stmt->execute(); +$products = $stmt->fetchAll(PDO::FETCH_ASSOC); + +?> + + + + + Imprimir Etiquetas de Códigos de Barras + + + + + + +
+ +
+
+ Barcode for product ID <?php echo $product['id']; ?> +
+ +
+ + + diff --git a/layout_footer.php b/layout_footer.php index 3c219df..6d84298 100644 --- a/layout_footer.php +++ b/layout_footer.php @@ -26,5 +26,19 @@ } }); + \ No newline at end of file diff --git a/layout_header.php b/layout_header.php index bebfd3d..18a15aa 100644 --- a/layout_header.php +++ b/layout_header.php @@ -126,6 +126,12 @@ $navItems = [ 'icon' => 'fa-plus', 'text' => 'Agregar Producto', 'roles' => ['Administrador', 'admin', 'Control Logistico'] + ], + 'productos' => [ + 'url' => 'productos.php', + 'icon' => 'fa-box', + 'text' => 'Productos', + 'roles' => ['Administrador', 'admin', 'Control Logistico'] ] ] ], @@ -202,7 +208,9 @@ $navItems = [ - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +
IDNombreSKUCostoPrecio VentaUnidades VendidasGanancia/UnidadIngreso TotalGanancia TotalAcciones
-
- -
+
+ + + @@ -93,6 +110,15 @@ $products = $stmt->fetchAll(PDO::FETCH_ASSOC); + + diff --git a/registro_entrada.php b/registro_entrada.php index 8a5b73c..111a28a 100644 --- a/registro_entrada.php +++ b/registro_entrada.php @@ -98,6 +98,9 @@ try {
+ @@ -137,4 +140,97 @@ try {
- + + + + + + + \ No newline at end of file