<?php
require_once 'config.php';
require_once 'includes/Database.php';

$db = new Database();

echo "<h2>Outgoing Calls Table Structure</h2>";
$structure = $db->fetchAll("DESCRIBE outgoing_calls");
echo "<pre>";
print_r($structure);
echo "</pre>";

echo "<h2>Sample Data (First 5 rows)</h2>";
$data = $db->fetchAll("SELECT * FROM outgoing_calls LIMIT 5");
echo "<pre>";
print_r($data);
echo "</pre>";

echo "<h2>Total Records</h2>";
$count = $db->fetchOne("SELECT COUNT(*) as total FROM outgoing_calls");
echo "Total records: " . $count['total'];

echo "<h2>Date Range</h2>";
$dateRange = $db->fetchOne("SELECT MIN(call_date) as min_date, MAX(call_date) as max_date FROM outgoing_calls");
echo "<pre>";
print_r($dateRange);
echo "</pre>";

echo "<h2>Incoming Calls Table Structure (for comparison)</h2>";
$incomingStructure = $db->fetchAll("DESCRIBE incoming_calls");
echo "<pre>";
print_r($incomingStructure);
echo "</pre>";
?>
