in this codes (<?php
// public/orders/view_order_customer.php

// Enable error reporting for debugging (disable in production)
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Start output buffering to prevent "headers already sent" errors
ob_start();

// Include authentication, database connection, and functions
require_once __DIR__ . '/../../includes/auth.php';
require_once __DIR__ . '/../../includes/db_connect.php';
require_once __DIR__ . '/../../includes/functions.php'; // Include the functions.php for sanitize_input()

// Helper Function: Generate WhatsApp link
/**
 * Generate a WhatsApp link from a contact number.
 *
 * @param string $contact The contact number.
 * @return string The WhatsApp URL.
 */
function generate_whatsapp_link($contact) {
    // Remove any non-digit characters
    $digits = preg_replace('/\D+/', '', $contact);
    
    // Assuming Kuwait country code (+965). Adjust as needed.
    if (substr($digits, 0, 3) !== '965') {
        $digits = '965' . $digits;
    }
    
    return "https://wa.me/" . $digits;
}

// Check if order_id is given
$order_id = isset($_GET['order_id']) ? intval($_GET['order_id']) : 0;

if ($order_id <= 0) {
    header("Location: view_orders.php?error=6"); // Invalid order ID
    exit();
}

// Fetch order details along with customer information
$order_sql = "
    SELECT 
        orders.id AS order_id,
        orders.status,
        orders.priority,
        orders.order_date,
        orders.delivery_datetime,
        customers.name AS customer_name,
        customers.contact,
        customers.delivery_address
    FROM 
        orders
    JOIN 
        customers ON orders.customer_id = customers.id
    WHERE 
        orders.id = ?
";
$order_stmt = $conn->prepare($order_sql);
if (!$order_stmt) {
    die("Prepare failed: (" . $conn->errno . ") " . $conn->error);
}
$order_stmt->bind_param("i", $order_id);
$order_stmt->execute();
$order_result = $order_stmt->get_result();
$order = $order_result->fetch_assoc();
$order_stmt->close();

if (!$order) {
    header("Location: view_orders.php?error=7"); // Order not found
    exit();
}

// Fetch order items with product details
$order_items_sql = "
    SELECT 
        order_items.id AS item_id,
        order_items.product_id,
        order_items.quantity,
        order_items.packaging_preferences,
        order_items.discount_percentage,
        order_items.discount_reason,
        products.name AS product_name,
        products.size AS product_size,
        products.price AS product_price
    FROM 
        order_items
    JOIN 
        products ON order_items.product_id = products.id
    WHERE 
        order_items.order_id = ?
";
$item_stmt = $conn->prepare($order_items_sql);
if (!$item_stmt) {
    die("Prepare failed: (" . $conn->errno . ") " . $conn->error);
}
$item_stmt->bind_param("i", $order_id);
$item_stmt->execute();
$order_items_result = $item_stmt->get_result();
$order_items = [];
while ($item = $order_items_result->fetch_assoc()) {
    $order_items[] = $item;
}
$item_stmt->close();

// Calculate totals
$total_before_discounts = 0;
$total_discounts = 0;
$final_total = 0;

foreach ($order_items as &$item) {
    $item_total = $item['quantity'] * $item['product_price'];
    $discount_amount = ($item['discount_percentage'] / 100) * $item_total;
    $item['discount_amount'] = $discount_amount;
    $item['total_after_discount'] = $item_total - $discount_amount;

    $total_before_discounts += $item_total;
    $total_discounts += $discount_amount;
}
unset($item); // Break reference
$final_total = $total_before_discounts - $total_discounts;

// Currency formatting
function format_currency($amount) {
    return "KWD " . number_format($amount, 2);
}

// Now include the header AFTER form handling
require_once '../../includes/header.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Order #<?= htmlspecialchars($order['order_id']) ?> Details - Kaak Alia Management System</title>
    
    <!-- Google Fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&display=swap" rel="stylesheet">
    
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="/kaak_alia_management_system/assets/bootstrap/css/bootstrap.min.css">
    
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
    
    <!-- Custom Styles -->
    <style>
        /* ---------------------------------------------------
           1. CSS Variables for Consistent Design
        ---------------------------------------------------- */
        :root {
            --dark-gray: #333333; /* Header and Footer Background */
            --button-add-order: #e2a20c; /* Light Golden-Yellow */
            --button-view-orders: #118AB2; /* Blue */
            --button-manage-products: #06D6A0; /* Green */
            --button-manage-users: #F4A261; /* Orange */
            --button-generate-reports: #EF476F; /* Red-Pink */

            --main-text: #333333;
            --secondary-text: #666666;
            --white: #FFFFFF;
            --background-gradient: linear-gradient(to bottom, #f5f7fa, #c3cfe2);
            --divider-color: #FFD166;

            --hover-shadow: rgba(0, 0, 0, 0.2);
            --critical-highlight: #FFF9C4; /* Light Yellow-Orange */
            --section-border: #e0e0e0;
        }

        /* ---------------------------------------------------
           2. Global Styles
        ---------------------------------------------------- */
        .container-body {
            font-family: 'Cairo', sans-serif;
            background: var(--background-gradient);
            margin: 0;
            padding: 20px;
            box-sizing: border-box;
        }

        h1, h2, h3, h4, h5, p {
            margin: 0;
        }

        /* ---------------------------------------------------
           3. Header Styles (Assuming header.php includes this)
        ---------------------------------------------------- */
        /* Already handled in header.php */

        /* ---------------------------------------------------
           4. Welcome Section
        ---------------------------------------------------- */
        .welcome-section {
            background-color: var(--white);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            border-radius: 12px;
            padding: 25px;
            text-align: center;
            margin-bottom: 30px;
        }

        .welcome-section h3 {
            font-size: 24px;
            color: var(--main-text);
            margin-bottom: 10px;
        }

        .welcome-section hr {
            width: 60px;
            height: 4px;
            background-color: var(--button-add-order);
            border: none;
            margin: 10px auto;
            border-radius: 2px;
        }

        /* ---------------------------------------------------
           5. Product Summary Section
        ---------------------------------------------------- */
        .product-summary-section {
            background-color: #ffe6e6; /* Light red background */
            border-left: 6px solid #ff4d4d; /* Red border */
            border-radius: 8px;
            padding: 20px;
            margin-bottom: 30px;
            box-shadow: 0 4px 8px rgba(255, 77, 77, 0.2);
        }

        .product-summary-section h4 {
            font-size: 24px;
            color: #cc0000; /* Darker red */
            margin-bottom: 20px;
            display: flex;
            align-items: center;
        }

        .product-summary-section h4 .bi {
            margin-right: 10px;
        }

        .product-summary-list {
            display: flex;
            flex-wrap: wrap;
            gap: 15px;
        }

        .product-item {
            background-color: #fff;
            border: 1px solid #ffcccc;
            border-radius: 6px;
            padding: 15px;
            width: calc(33.333% - 10px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            display: flex;
            align-items: center;
        }

        .product-item .bi {
            font-size: 24px;
            color: #ff4d4d;
            margin-right: 15px;
        }

        .product-details {
            flex-grow: 1;
        }

        .product-details p {
            font-size: 16px;
            margin-bottom: 5px;
            color: var(--main-text);
        }

        /* Adjust for smaller screens */
        @media (max-width: 768px) {
            .product-item {
                width: calc(50% - 10px);
            }
        }

        @media (max-width: 576px) {
            .product-item {
                width: 100%;
            }
        }

        /* ---------------------------------------------------
           6. Order Information Section
        ---------------------------------------------------- */
        .order-info-section {
            background-color: var(--white);
            border-radius: 12px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            padding: 25px;
            margin-bottom: 30px;
            display: flex;
            flex-direction: column;
        }

        .order-info-header {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .order-info-header .bi {
            font-size: 24px;
            color: #ff4d4d;
            margin-right: 10px;
        }

        .order-info-header h4 {
            font-size: 22px;
            color: var(--main-text);
            font-weight: bold;
        }

        .order-info-content {
            display: flex;
            flex-wrap: wrap;
        }

        .order-info-item {
            width: 50%;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }

        .order-info-item .bi {
            font-size: 20px;
            color: #118AB2;
            margin-right: 10px;
        }

        .order-info-item .info-text {
            font-size: 16px;
            color: var(--main-text);
        }

        /* ---------------------------------------------------
           7. Order Items Table
        ---------------------------------------------------- */
        .recent-orders-section {
            background-color: var(--white);
            border-radius: 12px;
            padding: 25px;
            box-shadow: 0 4px 8px rgba(0,0,0,0.1);
            margin-bottom: 30px;
        }

        .recent-orders-section h4 {
            font-size: 22px;
            font-weight: bold;
            color: var(--main-text);
            margin-bottom: 20px;
        }

        /* Make table responsive */
        .table-responsive {
            overflow-x: auto;
        }

        .recent-orders-section table {
            width: 100%;
            border-collapse: collapse;
            min-width: 800px;
        }

        .recent-orders-section th, 
        .recent-orders-section td {
            padding: 15px;
            text-align: left;
            font-size: 16px;
            vertical-align: middle;
        }

        .recent-orders-section th {
            background-color: #333333;
            color: var(--white);
            font-weight: bold;
            position: sticky;
            top: 0;
            z-index: 1;
        }

        .recent-orders-section tr:nth-child(even) {
            background-color: #F9F9F9;
        }

        .recent-orders-section tr:hover {
            background-color: #e6f7ff;
        }

        .recent-orders-section td {
            font-size: 14px;
            color: #333333;
        }

        .recent-orders-section td.number {
            text-align: center;
        }

        .recent-orders-section td.price, 
        .recent-orders-section td.quantity, 
        .recent-orders-section td.discount_percentage, 
        .recent-orders-section td.discount_amount, 
        .recent-orders-section td.total_after_discount {
            text-align: center;
            font-weight: bold;
        }

        /* ---------------------------------------------------
           8. Order Summary Section
        ---------------------------------------------------- */
        .total-section {
            text-align: right;
            margin-top: 20px;
        }

        .total-section p {
            font-size: 18px;
            color: var(--main-text);
            margin-bottom: 8px;
        }

        .total-section p strong {
            font-size: 20px;
        }

        /* ---------------------------------------------------
           9. Action Buttons
        ---------------------------------------------------- */
        .action-buttons {
            display: flex;
            gap: 15px;
            justify-content: flex-end;
            margin-bottom: 40px;
        }

        .action-button {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: bold;
            color: var(--white);
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: transform 0.2s, box-shadow 0.2s;
            text-decoration: none;
        }

        .action-button.print-order { background-color: var(--button-view-orders); }
        .action-button.edit-order { background-color: var(--button-add-order); }

        .action-button:hover {
            transform: scale(1.02);
            box-shadow: 0 6px 12px var(--hover-shadow);
        }

        .action-button .bi {
            margin-right: 8px;
            font-size: 20px;
        }

        /* ---------------------------------------------------
           10. Footer Styles
        ---------------------------------------------------- */
        .footer {
            background-color: var(--dark-gray);
            color: var(--white);
            padding: 15px;
            text-align: center;
            border-radius: 8px;
            font-size: 14px;
            line-height: 20px;
            margin-top: 40px;
        }

        /* ---------------------------------------------------
           11. Responsive Design Enhancements
        ---------------------------------------------------- */
        @media (max-width: 768px) {
            .order-info-item {
                width: 100%;
            }

            .product-item {
                width: calc(50% - 10px);
            }
        }

        @media (max-width: 480px) {
            .welcome-section h3 {
                font-size: 20px;
            }

            .product-summary-section h4 {
                font-size: 20px;
            }

            .order-info-header h4 {
                font-size: 20px;
            }

            .order-info-item .bi {
                font-size: 18px;
            }

            .order-info-item .info-text {
                font-size: 14px;
            }

            .recent-orders-section th, 
            .recent-orders-section td {
                padding: 10px;
                font-size: 12px;
            }

            .recent-orders-section h4 {
                font-size: 18px;
            }

            .action-button {
                font-size: 14px;
                padding: 10px 15px;
            }

            .action-button .bi {
                font-size: 18px;
                margin-right: 5px;
            }

            /* Adjust Product Summary Items */
            .product-item {
                width: 100%;
            }
        }
    </style>

    <!-- Additional JavaScript for Print Functionality -->
    <script>
        function printOrder() {
            window.print();
        }
    </script>
</head>
<body class="container-body">
    <!-- Header Already Included via header.php -->

    <main class='container-body'>
        <!-- Welcome Section -->
        <div class="welcome-section">
            <h3>Order #<?= htmlspecialchars($order['order_id']) ?></h3>
            <hr>
        </div>

        <!-- Product Summary Section -->
        <div class="product-summary-section">
            <h4><i class="bi bi-bag-fill"></i> Product Summary</h4>
            <div class="product-summary-list">
                <?php foreach ($order_items as $item): ?>
                    <div class="product-item d-flex align-items-center">
                        <i class="bi bi-box-seam-fill"></i>
                        <div class="product-details">
                            <p><strong><?= htmlspecialchars($item['product_name']) ?></strong></p>
                            <p><i class="bi bi-arrows-angle-contract"></i> Size: <?= htmlspecialchars($item['product_size']) ?></p>
                            <p><i class="bi bi-people-fill"></i> Quantity: <?= htmlspecialchars($item['quantity']) ?></p>
                        </div>
                    </div>
                <?php endforeach; ?>
            </div>
        </div>

        <!-- Enhanced Order Information Section -->
        <div class="order-info-section">
            <div class="order-info-header">
                <i class="bi bi-info-circle-fill"></i>
                <h4>Order Information</h4>
            </div>
            <div class="order-info-content">
                <div class="order-info-item">
                    <i class="bi bi-tag-fill"></i>
                    <div class="info-text"><strong>Status:</strong> 
                        <?php
                            switch($order['status']) {
                                case 'Pending':
                                    echo '<span class="badge-status-pending critical-info">' . htmlspecialchars($order['status']) . '</span>';
                                    break;
                                case 'In Progress':
                                    echo '<span class="badge-status-in-progress critical-info">' . htmlspecialchars($order['status']) . '</span>';
                                    break;
                                case 'Completed':
                                    echo '<span class="badge-status-completed critical-info">' . htmlspecialchars($order['status']) . '</span>';
                                    break;
                                case 'Delivered':
                                    echo '<span class="badge-status-delivered critical-info">' . htmlspecialchars($order['status']) . '</span>';
                                    break;
                                default:
                                    echo htmlspecialchars($order['status']);
                            }
                        ?>
                    </div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-exclamation-triangle-fill"></i>
                    <div class="info-text"><strong>Priority:</strong> <?= htmlspecialchars($order['priority']) ?></div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-calendar-event-fill"></i>
                    <div class="info-text"><strong>Order Date:</strong> <?= date("d M Y, h:i A", strtotime($order['order_date'])) ?></div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-clock-fill"></i>
                    <div class="info-text"><strong>Delivery Date & Time:</strong> <?= $order['delivery_datetime'] ? date("d M Y, h:i A", strtotime($order['delivery_datetime'])) : 'N/A' ?></div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-person-fill"></i>
                    <div class="info-text"><strong>Customer Name:</strong> <?= htmlspecialchars($order['customer_name']) ?></div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-whatsapp"></i>
                    <div class="info-text"><strong>Contact:</strong> 
                        <a href="<?= generate_whatsapp_link($order['contact']) ?>" target="_blank" class="d-inline-flex align-items-center">
                            <i class="bi bi-whatsapp text-success"></i>
                            <span class="ms-2"><?= htmlspecialchars($order['contact']) ?></span>
                        </a>
                    </div>
                </div>
                <div class="order-info-item">
                    <i class="bi bi-geo-alt-fill"></i>
                    <div class="info-text"><strong>Delivery Address:</strong> <?= nl2br(htmlspecialchars($order['delivery_address'])) ?></div>
                </div>
            </div>
        </div>

        <!-- Order Items Table Section -->
        <div class="recent-orders-section">
            <h4>Order Items</h4>
            <div class="table-responsive">
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Product</th>
                            <th>Size</th>
                            <th>Price per Unit (KWD)</th>
                            <th>Quantity</th>
                            <th>Packaging Preferences</th>
                            <th>Discount (%)</th>
                            <th>Discount Amount (KWD)</th>
                            <th>Total (KWD)</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($order_items as $index => $item): ?>
                            <tr>
                                <td class="number"><?= $index + 1 ?></td>
                                <td><?= htmlspecialchars($item['product_name']) ?></td>
                                <td><?= htmlspecialchars($item['product_size']) ?></td>
                                <td class="price"><?= format_currency($item['product_price']) ?></td>
                                <td class="quantity"><?= htmlspecialchars($item['quantity']) ?></td>
                                <td><?= htmlspecialchars($item['packaging_preferences']) ?: 'N/A' ?></td>
                                <td class="discount_percentage"><?= number_format($item['discount_percentage'], 2) ?>%</td>
                                <td class="discount_amount"><?= format_currency($item['discount_amount']) ?></td>
                                <td class="total_after_discount"><?= format_currency($item['total_after_discount']) ?></td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>

            <!-- Order Summary -->
            <div class="total-section">
                <p><strong>Total Before Discounts:</strong> <?= format_currency($total_before_discounts) ?></p>
                <p><strong>Total Discounts:</strong> <?= format_currency($total_discounts) ?></p>
                <hr>
                <p><strong>Final Total:</strong> <?= format_currency($final_total) ?></p>
            </div>
        </div>

        <!-- Action Buttons -->
        <div class="action-buttons">
            <button class="action-button print-order" onclick="printOrder()">
                <i class="bi bi-printer-fill"></i> Print Order
            </button>
            <a href="edit_order.php?id=<?= htmlspecialchars($order['order_id']) ?>" class="action-button edit-order">
                <i class="bi bi-pencil-square"></i> Edit Order
            </a>
        </div>

        <!-- Footer -->
        <div class="footer">
            &copy; <?= date("Y") ?> Kaak Alia Bakery. All rights reserved.
        </div>
    </main>

    <!-- Bootstrap JS Bundle -->
    <script src="/kaak_alia_management_system/assets/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>
<?php
// Flush the output buffer
ob_end_flush();
// No closing PHP tag to prevent unwanted output
?>) make it cool please make the status chagneablea  and use the info exist on databae (-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 09, 2024 at 01:37 PM
-- Server version: 10.11.9-MariaDB
-- PHP Version: 7.2.34

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `u406552082_kaakalia`
--

-- --------------------------------------------------------

--
-- Table structure for table `customers`
--

CREATE TABLE `customers` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `contact` varchar(50) DEFAULT NULL,
  `delivery_address` text DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `orders`
--

CREATE TABLE `orders` (
  `id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `status` enum('Pending','In Progress','Completed','Delivered') DEFAULT 'Pending',
  `priority` enum('Normal','Important','Quick') DEFAULT 'Normal',
  `order_date` datetime DEFAULT current_timestamp(),
  `delivery_datetime` datetime DEFAULT NULL,
  `delivery_date` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `order_items`
--

CREATE TABLE `order_items` (
  `id` int(11) NOT NULL,
  `order_id` int(11) NOT NULL,
  `product_id` int(11) NOT NULL,
  `quantity` int(11) NOT NULL DEFAULT 1,
  `packaging_preferences` varchar(255) DEFAULT NULL,
  `discount_percentage` decimal(5,2) DEFAULT 0.00,
  `discount_reason` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `size` varchar(50) DEFAULT NULL,
  `price` decimal(10,2) NOT NULL,
  `category` varchar(50) DEFAULT NULL,
  `thumbnail` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `username` varchar(50) NOT NULL,
  `password` varchar(255) NOT NULL,
  `role` enum('admin','staff') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `customers`
--
ALTER TABLE `customers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
  ADD PRIMARY KEY (`id`),
  ADD KEY `customer_id` (`customer_id`),
  ADD KEY `idx_orders_customer_id` (`customer_id`);

--
-- Indexes for table `order_items`
--
ALTER TABLE `order_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `order_id` (`order_id`),
  ADD KEY `product_id` (`product_id`),
  ADD KEY `idx_order_items_order_id` (`order_id`),
  ADD KEY `idx_order_items_product_id` (`product_id`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `username` (`username`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `customers`
--
ALTER TABLE `customers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `order_items`
--
ALTER TABLE `order_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `orders`
--
ALTER TABLE `orders`
  ADD CONSTRAINT `fk_orders_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `order_items`
--
ALTER TABLE `order_items`
  ADD CONSTRAINT `fk_order_items_order_id` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `fk_order_items_product_id` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `order_items_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `order_items_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `products` (`id`) ON DELETE CASCADE;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;) and don't add in progress, and add copy button to copy info of address make it like this (🔴 Order for Tomorrow Morning at 9 AM 🔴
* Item: 3 boxes (0.5 kilo each) - Shaboura
* Delivery Address: Al-Salam, Block 4, Street 417, House 41 (Opposite Al-Shafaq Kindergarten)
* Contact Number: <PRESIDIO_ANONYMIZED_PHONE_NUMBER>) and use last styles codes and make it cool design plz and type full codes