<?php
require 'config.php';

// Check order_items structure
echo "<h2>Order Items Table Structure:</h2>";
$result = $conn->query("DESCRIBE order_items");
echo "<pre>";
while ($row = $result->fetch_assoc()) {
    print_r($row);
}
echo "</pre>";

// Check menu_items structure
echo "<h2>Menu Items Table Structure:</h2>";
$result = $conn->query("DESCRIBE menu_items");
echo "<pre>";
while ($row = $result->fetch_assoc()) {
    print_r($row);
}
echo "</pre>";

// Check if there are any orders
echo "<h2>Orders in database:</h2>";
$result = $conn->query("SELECT id, order_number FROM orders LIMIT 5");
echo "<pre>";
while ($row = $result->fetch_assoc()) {
    print_r($row);
}
echo "</pre>";

// Check if order with ID 11 exists and its items
echo "<h2>Order ID 11 items:</h2>";
$result = $conn->query("SELECT * FROM order_items WHERE order_id = 11");
echo "<pre>";
while ($row = $result->fetch_assoc()) {
    print_r($row);
}
echo "</pre>";

// Check menu items
echo "<h2>Menu Items Sample:</h2>";
$result = $conn->query("SELECT id, name, image_path FROM menu_items LIMIT 5");
echo "<pre>";
while ($row = $result->fetch_assoc()) {
    print_r($row);
}
echo "</pre>";
?>
