<?php

include '../config/db.php';

header('Content-Type: application/json');

$loaded = $conn->query("
SELECT COUNT(*) as total
FROM contracts
WHERE status='Loaded'
")->fetch_assoc()['total'];

$verified = $conn->query("
SELECT COUNT(*) as total
FROM contracts
WHERE status='Verified'
")->fetch_assoc()['total'];

$cancelled = $conn->query("
SELECT COUNT(*) as total
FROM contracts
WHERE status='Cancelled'
")->fetch_assoc()['total'];

echo json_encode([

    'loaded' => $loaded,
    'verified' => $verified,
    'cancelled' => $cancelled

]);