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

try {
    // Check students with session "2025" in class_id 10 (Ten)
    $stmt = $pdo->prepare("SELECT * FROM students WHERE class_id = ? AND session = ? AND status = 'active'");
    $stmt->execute([10, '2025']);
    $students = $stmt->fetchAll();
    
    echo "Students in class 10 (Ten) with session '2025': " . count($students) . "\n";
    
    if (count($students) > 0) {
        echo "Students found:\n";
        foreach ($students as $student) {
            echo "- " . $student['first_name'] . " " . $student['last_name'] . " (Roll: " . $student['roll_number'] . ")\n";
        }
    } else {
        echo "No students found with class_id 10 and session '2025'\n";
    }
    
    // Check students with session "2025-2026" in class_id 10 (Ten)
    $stmt = $pdo->prepare("SELECT * FROM students WHERE class_id = ? AND session = ? AND status = 'active'");
    $stmt->execute([10, '2025-2026']);
    $students = $stmt->fetchAll();
    
    echo "\nStudents in class 10 (Ten) with session '2025-2026': " . count($students) . "\n";
    
    if (count($students) > 0) {
        echo "Students found:\n";
        foreach ($students as $student) {
            echo "- " . $student['first_name'] . " " . $student['last_name'] . " (Roll: " . $student['roll_number'] . ")\n";
        }
    }
    
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>