<?php
header('Content-Type: application/json');
require 'config/db.php';
$res = [];
$res['cod_sum'] = $pdo->query("SELECT SUM(cod_amount) FROM tbl_bookings")->fetchColumn();
$res['sample_data'] = $pdo->query("SELECT id, last_status, cod_amount, payment_mode FROM tbl_bookings LIMIT 5")->fetchAll(PDO::FETCH_ASSOC);
echo json_encode($res);
?>