Tul xxx Tul
User / IP
:
216.73.216.146
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
dondedy
/
admin
/
Viewing: add_delivery.php
<?php include '../components/connect.php'; session_start(); $admin_id = $_SESSION['admin_id']; if(!isset($admin_id)){ header('location:admin_login.php'); } // Obtener categorías y productos $select_categories = $conn->prepare("SELECT * FROM `categories` ORDER BY name ASC"); $select_categories->execute(); $categorias = $select_categories->fetchAll(PDO::FETCH_ASSOC); $select_products = $conn->prepare("SELECT p.*, c.name as category_name FROM `products` p LEFT JOIN `categories` c ON p.category = c.id ORDER BY c.name, p.name"); $select_products->execute(); $productos = $select_products->fetchAll(PDO::FETCH_ASSOC); // Función para normalizar nombres de categorías function normaliza_categoria($str) { $str = strtolower($str); $str = str_replace(['á','à','ä','â','ª','Á','À','Â','Ä'], 'a', $str); $str = str_replace(['é','è','ë','ê','É','È','Ê','Ë'], 'e', $str); $str = str_replace(['í','ì','ï','î','Í','Ì','Î','Ï'], 'i', $str); $str = str_replace(['ó','ò','ö','ô','Ó','Ò','Ô','Ö'], 'o', $str); $str = str_replace(['ú','ù','ü','û','Ú','Ù','Û','Ü'], 'u', $str); $str = str_replace(['ñ','Ñ','ç','Ç'], ['n','N','c','C'], $str); $str = str_replace([' ', '(', ')'], ['-', '', ''], $str); return $str; } if(isset($_POST['submit'])){ $customer_name = $_POST['customer_name']; $phone = $_POST['phone']; $address = $_POST['address']; $payment_method = $_POST['payment_method']; $notes = $_POST['notes']; $order_items = $_POST['order_items']; $total_amount = $_POST['total_amount']; $insert_order = $conn->prepare("INSERT INTO `delivery_orders` (customer_name, phone, address, payment_method, notes, order_items, total_amount) VALUES(?,?,?,?,?,?,?)"); $insert_order->execute([$customer_name, $phone, $address, $payment_method, $notes, $order_items, $total_amount]); $order_id = $conn->lastInsertId(); // Insertar items individuales $items = json_decode($order_items, true); if(is_array($items)) { foreach($items as $item) { $insert_item = $conn->prepare("INSERT INTO `delivery_order_items` (order_id, product_id, product_name, quantity, price, subtotal) VALUES(?,?,?,?,?,?)"); $insert_item->execute([$order_id, $item['id'], $item['nombre'], $item['cantidad'], $item['precio'], $item['precio'] * $item['cantidad']]); } } header('location:delivery_orders.php'); exit(); } ?> <!DOCTYPE html> <html lang="es"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Agregar Pedido a Domicilio | DONDEEDY</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"> <link rel="stylesheet" href="../css/admin_style.css"> <style> :root { --color-primary: #b30000; --color-success: #28a745; --color-warning: #ffc107; } .form-container { max-width: 1200px; margin: 2rem auto; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius: 20px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.1); } .form-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 2px solid #f0f0f0; } .form-title { font-size: 2rem; font-weight: 800; color: var(--color-primary); display: flex; align-items: center; gap: 1rem; } .form-group { margin-bottom: 1.5rem; } .form-label { display: block; font-weight: 600; color: #333; margin-bottom: 0.5rem; font-size: 1.1rem; } .form-control { width: 100%; padding: 1rem; border: 2px solid #e0e0e0; border-radius: 10px; font-size: 1rem; transition: border-color 0.3s ease; font-family: inherit; } .form-control:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(179,0,0,0.1); } .form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 1rem center; background-size: 16px 12px; padding-right: 2.5rem; } .category-filter { background: linear-gradient(135deg, var(--color-primary) 0%, #7a0000 100%); color: white; margin-bottom: 2rem; padding: 1rem; border-radius: 10px; } .products-container { max-height: 500px; overflow-y: auto; border: 2px solid #e0e0e0; border-radius: 10px; padding: 1rem; background: #f8f9fa; } .category-block { margin-bottom: 2rem; background: white; border-radius: 10px; padding: 1rem; } .category-title { color: var(--color-primary); font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 2px solid #f0f0f0; } .products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; } .product-card { background: white; border: 1px solid #e0e0e0; border-radius: 10px; padding: 1rem; display: flex; align-items: center; gap: 1rem; transition: box-shadow 0.3s ease; } .product-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); } .product-image { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; } .product-info { flex: 1; } .product-name { font-weight: 600; color: #333; margin-bottom: 0.3rem; } .product-price { color: var(--color-success); font-weight: 500; } .product-quantity { display: flex; align-items: center; gap: 0.5rem; } .btn-quantity { width: 30px; height: 30px; border: 1px solid #ddd; background: white; border-radius: 5px; cursor: pointer; transition: background 0.2s ease; font-weight: 600; } .btn-quantity:hover { background: #f0f0f0; } .btn-quantity.btn-minus { color: #dc3545; } .btn-quantity.btn-plus { color: var(--color-success); } .quantity-display { min-width: 30px; text-align: center; font-weight: 600; } .cart-section { margin-top: 2rem; padding: 1.5rem; background: #f8f9fa; border-radius: 10px; border: 2px solid var(--color-success); } .cart-title { font-size: 1.3rem; font-weight: 700; color: #333; margin-bottom: 1rem; } .cart-items { max-height: 200px; overflow-y: auto; margin-bottom: 1rem; } .cart-item { display: flex; justify-content: space-between; padding: 0.5rem 0; border-bottom: 1px solid #e0e0e0; } .cart-item:last-child { border-bottom: none; } .cart-total { font-size: 1.5rem; font-weight: 800; color: var(--color-success); text-align: right; padding-top: 1rem; border-top: 2px solid var(--color-success); } .form-actions { display: flex; gap: 1rem; margin-top: 2rem; } .btn { flex: 1; padding: 1rem 2rem; border: none; border-radius: 10px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; display: flex; align-items: center; justify-content: center; gap: 0.5rem; } .btn:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); } .btn-primary { background: linear-gradient(135deg, var(--color-success) 0%, #1e7e34 100%); color: white; } .btn-secondary { background: #6c757d; color: white; } .btn-back { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.8rem 1.5rem; background: #f0f0f0; color: #333; text-decoration: none; border-radius: 10px; transition: background 0.2s ease; } .btn-back:hover { background: #e0e0e0; } </style> </head> <body> <?php include '../components/admin_header.php' ?> <section class="dashboard"> <div class="form-container"> <div class="form-header"> <h1 class="form-title"> <i class="fas fa-plus-circle"></i> Agregar Pedido a Domicilio </h1> <a href="delivery_orders.php" class="btn-back"> <i class="fas fa-arrow-left"></i> Volver </a> </div> <form method="POST" id="deliveryForm"> <div class="row" style="display: grid; grid-template-columns: 1fr 1fr; gap: 2rem;"> <!-- Información del Cliente --> <div> <div class="form-group"> <label class="form-label">Nombre y Apellido</label> <input type="text" name="customer_name" class="form-control" required> </div> <div class="form-group"> <label class="form-label">Teléfono Celular</label> <input type="tel" name="phone" class="form-control" required> </div> <div class="form-group"> <label class="form-label">Dirección</label> <textarea name="address" class="form-control" rows="3" required></textarea> </div> <div class="form-group"> <label class="form-label">Método de Pago</label> <select name="payment_method" class="form-control form-select" required> <option value="">Seleccione un método</option> <option value="efectivo">Efectivo</option> <option value="transferencia">Transferencia</option> </select> </div> <div class="form-group"> <label class="form-label">Notas Adicionales (Opcional)</label> <textarea name="notes" class="form-control" rows="2"></textarea> </div> </div> <!-- Selección de Productos --> <div> <div class="form-group"> <label class="form-label">Filtrar por Categoría</label> <select id="categoryFilter" class="form-control form-select"> <option value="">Todas las categorías</option> <?php foreach($categorias as $cat): ?> <option value="<?= normaliza_categoria($cat['name']) ?>"><?= htmlspecialchars($cat['name']) ?></option> <?php endforeach; ?> </select> </div> <div class="form-group"> <label class="form-label">Selecciona los productos</label> <div class="products-container"> <?php $productosPorCategoria = []; foreach ($productos as $producto) { $cat = normaliza_categoria($producto['category_name']); if (!isset($productosPorCategoria[$cat])) $productosPorCategoria[$cat] = []; $productosPorCategoria[$cat][] = $producto; } foreach ($categorias as $cat): $catKey = normaliza_categoria($cat['name']); if (!isset($productosPorCategoria[$catKey])) continue; ?> <div class="category-block categoria-<?= $catKey ?>" data-category="<?= $catKey ?>"> <h3 class="category-title"><?= htmlspecialchars($cat['name']) ?></h3> <div class="products-grid"> <?php foreach ($productosPorCategoria[$catKey] as $producto): ?> <div class="product-card"> <img src="../uploaded_img/<?= htmlspecialchars($producto['image']) ?>" alt="<?= htmlspecialchars($producto['name']) ?>" class="product-image"> <div class="product-info"> <div class="product-name"><?= htmlspecialchars($producto['name']) ?></div> <div class="product-price">COP <?= number_format($producto['price'], 0, ',', '.') ?></div> </div> <div class="product-quantity"> <button type="button" class="btn-quantity btn-minus" onclick="updateQuantity(<?= $producto['id'] ?>, -1, '<?= htmlspecialchars($producto['name']) ?>', <?= $producto['price'] ?>)"> - </button> <span class="quantity-display" id="qty-<?= $producto['id'] ?>">0</span> <button type="button" class="btn-quantity btn-plus" onclick="updateQuantity(<?= $producto['id'] ?>, 1, '<?= htmlspecialchars($producto['name']) ?>', <?= $producto['price'] ?>)"> + </button> </div> </div> <?php endforeach; ?> </div> </div> <?php endforeach; ?> </div> </div> </div> </div> <!-- Resumen del Pedido --> <div class="cart-section"> <h3 class="cart-title"><i class="fas fa-shopping-cart"></i> Resumen del Pedido</h3> <div class="cart-items" id="cartItems"> <p style="text-align: center; color: #999;">No hay productos seleccionados</p> </div> <div class="cart-total"> Total: COP <span id="totalAmount">0</span> </div> </div> <input type="hidden" name="order_items" id="orderItems"> <input type="hidden" name="total_amount" id="totalAmountInput"> <div class="form-actions"> <button type="submit" name="submit" class="btn btn-primary" id="submitBtn" disabled> <i class="fas fa-check"></i> Guardar Pedido </button> <a href="delivery_orders.php" class="btn btn-secondary"> <i class="fas fa-times"></i> Cancelar </a> </div> </form> </div> </section> <script> let cart = {}; let total = 0; // Filtrar categorías document.getElementById('categoryFilter').addEventListener('change', function() { const selectedCategory = this.value; const categoryBlocks = document.querySelectorAll('.category-block'); categoryBlocks.forEach(block => { if (selectedCategory === '' || block.dataset.category === selectedCategory) { block.style.display = 'block'; } else { block.style.display = 'none'; } }); }); function updateQuantity(productId, change, productName, productPrice) { const qtyDisplay = document.getElementById('qty-' + productId); let currentQty = parseInt(qtyDisplay.textContent); let newQty = Math.max(0, currentQty + change); qtyDisplay.textContent = newQty; if (newQty === 0) { delete cart[productId]; } else { cart[productId] = { id: productId, nombre: productName, precio: productPrice, cantidad: newQty }; } updateCart(); } function updateCart() { const cartItemsDiv = document.getElementById('cartItems'); const totalSpan = document.getElementById('totalAmount'); const submitBtn = document.getElementById('submitBtn'); if (Object.keys(cart).length === 0) { cartItemsDiv.innerHTML = '<p style="text-align: center; color: #999;">No hay productos seleccionados</p>'; totalSpan.textContent = '0'; submitBtn.disabled = true; total = 0; } else { let html = ''; total = 0; for (let productId in cart) { const item = cart[productId]; const subtotal = item.precio * item.cantidad; total += subtotal; html += ` <div class="cart-item"> <span>${item.cantidad}x ${item.nombre}</span> <span>COP ${subtotal.toLocaleString('es-CO')}</span> </div> `; } cartItemsDiv.innerHTML = html; totalSpan.textContent = total.toLocaleString('es-CO'); submitBtn.disabled = false; } // Actualizar campos ocultos document.getElementById('orderItems').value = JSON.stringify(Object.values(cart)); document.getElementById('totalAmountInput').value = total; } // Validar formulario antes de enviar document.getElementById('deliveryForm').addEventListener('submit', function(e) { if (Object.keys(cart).length === 0) { e.preventDefault(); alert('Debe seleccionar al menos un producto'); } }); </script> </body> </html>
Coded With 💗 by
0x6ick