<?php
require_once 'config/db_config.php';
$db = getDbConnection();
$order_id = $_GET['order_id'] ?? '';
$status = '';
if ($order_id) {
    $stmt = $db->prepare("SELECT status FROM payment_proofs WHERE order_id = :order_id ORDER BY proof_id DESC LIMIT 1");
    $stmt->bindParam(':order_id', $order_id);
    $stmt->execute();
    if ($proof = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $status = $proof['status'];
    }
}
header('Content-Type: application/json');
echo json_encode(['status' => $status]); 