<?php
require_once 'config/database.php';

try {
    // Fetch and display the event
    $stmt = $pdo->query("SELECT * FROM academic_calendar WHERE title = 'মে মাসের ছুটি' ORDER BY id DESC LIMIT 1");
    $event = $stmt->fetch(PDO::FETCH_ASSOC);
    
    if ($event) {
        echo "Event details:\n";
        echo "Title: " . $event['title'] . "\n";
        echo "Start Date: " . $event['event_date'] . "\n";
        echo "End Date: " . ($event['end_date'] ?? 'N/A') . "\n";
        echo "All data: ";
        print_r($event);
    } else {
        echo "No event found\n";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>