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

try {
    // Get today's date
    $today = date('Y-m-d');
    
    // Add a currently active holiday (started 2 days ago, ends 3 days from now)
    $start_date = date('Y-m-d', strtotime('-2 days'));
    $end_date = date('Y-m-d', strtotime('+3 days'));
    
    $stmt = $pdo->prepare('INSERT INTO academic_calendar (title, description, event_date, end_date, event_type, status) VALUES (?, ?, ?, ?, ?, ?)');
    $stmt->execute([
        'ডিমুজ ছুটি', 
        'ডিমুজ ছুটি (বর্তমানে চলছে)', 
        $start_date, 
        $end_date, 
        'holiday', 
        'active'
    ]);
    
    echo "Current active holiday added successfully!\n";
    echo "Holiday: ডিমুজ ছুটি\n";
    echo "Start date: $start_date\n";
    echo "End date: $end_date\n";
    echo "Today: $today\n";
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}