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); + +?> + + +
+ +