<?php
require_once 'config.php';
$order_id = $_GET['order_id'] ?? '';
if (!$order_id) {
    echo json_encode(['success' => false, 'message' => 'Order ID required']);
    exit;
}
$stmt = $conn->prepare("SELECT status, status_updated_at FROM orders WHERE id = ?");
$stmt->bind_param("i", $order_id);
$stmt->execute();
$result = $stmt->get_result();
$order = $result->fetch_assoc();
$stmt->close();
echo json_encode(['success' => true, 'order' => $order]);
