esta pagina nao abre nao sei o que é:<?php
// Ativa a exibição de erros para debug
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

// Inicia a sessão
session_start();

// Verifica se o usuário está logado e se é um professor
if (!isset($_SESSION['user']) || $_SESSION['user']['role_id'] != 2) {
    header("Location: dashteacher.php");
    exit;
}

$user = $_SESSION['user'];

// Configurações do banco de dados
$host = 'localhost';
$db = 'u942734124_webapp2025';
$userDB = 'u942734124_webapp2025';
$passDB = '11M07ae36@';
$charset = 'utf8mb4';

$dsn = "mysql:host=$host;dbname=$db;charset=$charset";
$options = [
    PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
    PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
];

try {
    $pdo = new PDO($dsn, $userDB, $passDB, $options);

    // Busca alunos do professor
    $stmt = $pdo->prepare("SELECT id, name, email FROM users WHERE role_id = 1 AND teacher_id = ?");
    $stmt->execute([$user['id']]);
    $students = $stmt->fetchAll();

    // Busca turmas do professor
    $stmt2 = $pdo->prepare("SELECT id, name, description FROM classes WHERE teacher_id = ?");
    $stmt2->execute([$user['id']]);
    $classes = $stmt2->fetchAll();

} catch (PDOException $e) {
    die("Erro ao conectar ao banco de dados: " . $e->getMessage());
}
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Dashboard | EnglishHub</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" />
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            display: flex;
            height: 100vh;
        }
        .sidebar {
            width: 250px;
            background-color: #1a1a1a;
            padding-top: 20px;
            display: flex;
            flex-direction: column;
        }
        .tab-link {
            padding: 15px 20px;
            cursor: pointer;
            color: #ccc;
            text-decoration: none;
            border-left: 5px solid transparent;
            transition: 0.3s;
        }
        .tab-link:hover {
            background-color: #292929;
            color: #fff;
        }
        .tab-link.active {
            color: #fff;
            background-color: #333;
            border-left: 5px solid #ff4500;
            font-weight: bold;
        }
        .content {
            flex: 1;
            padding: 40px;
            background-color: #121212;
            overflow-y: auto;
        }
        .tab-content {
            display: none;
        }
        .tab-content.active {
            display: block;
        }
        h1 {
            color: #ff4500;
        }
        p {
            color: #ccc;
            line-height: 1.6;
        }
        .btn-remove {
            background-color: #e53e3e;
            color: white;
            padding: 0.35rem 0.75rem;
            border-radius: 0.375rem;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
        }
        .btn-remove:hover {
            background-color: #c53030;
        }
    </style>
</head>
<body>

    <div class="sidebar">
        <a class="tab-link active" data-tab="overview">Overview</a>
        <a class="tab-link" data-tab="students">Students</a>
        <a class="tab-link" data-tab="progress">Progress</a>
        <a class="tab-link" data-tab="certificates">Certificates</a>
        <a class="tab-link" data-tab="settings">Settings</a>
    </div>

    <div class="content">
        <section id="overview" class="tab-content active">
            <h1>Visão Geral</h1>
            <p>Bem-vindo ao painel! Aqui você pode acompanhar o desempenho dos seus cursos, ver o progresso dos alunos e muito mais.</p>
        </section>

        <section id="students" class="tab-content">
            <h1>Alunos</h1>
            <table class="min-w-full bg-white rounded shadow overflow-hidden">
                <thead class="bg-gray-100">
                    <tr>
                        <th class="py-3 px-6 text-left text-gray-700 font-semibold">Nome</th>
                        <th class="py-3 px-6 text-left text-gray-700 font-semibold">Email</th>
                        <th class="py-3 px-6 text-left text-gray-700 font-semibold">Ações</th>
                    </tr>
                </thead>
                <tbody>
                    <?php foreach ($students as $s): ?>
                        <tr class="hover:bg-gray-50">
                            <td class="px-6 py-3 border-b"><?= htmlspecialchars($s['name']) ?></td>
                            <td class="px-6 py-3 border-b"><?= htmlspecialchars($s['email']) ?></td>
                            <td class="px-6 py-3 border-b flex items-center gap-2">
                                <a href="student_detail.php?id=<?= $s['id'] ?>" class="text-blue-600 hover:underline">Ver</a>
                                <form method="POST" action="remove_student.php" onsubmit="return confirm('Tem certeza que deseja remover este aluno?');">
                                    <input type="hidden" name="student_id" value="<?= $s['id'] ?>">
                                    <button type="submit" class="btn-remove">Remover</button>
                                </form>
                            </td>
                        </tr>
                    <?php endforeach; ?>
                </tbody>
            </table>
        </section>

        <section id="progress" class="tab-content">
            <h1>Progresso</h1>
            <p>Visualize estatísticas detalhadas de desempenho e progresso por curso.</p>
        </section>

        <section id="certificates" class="tab-content">
            <h1>Certificados</h1>
            <p>Acompanhe a emissão de certificados por curso, aluno e data.</p>
        </section>

        <section id="settings" class="tab-content">
            <h1>Configurações</h1>
            <p>Gerencie suas preferências, notificações e opções de personalização da plataforma.</p>
        </section>
    </div>

    <script>
        document.addEventListener("DOMContentLoaded", () => {
            const tabs = document.querySelectorAll(".tab-link");
            const contents = document.querySelectorAll(".tab-content");

            tabs.forEach(tab => {
                tab.addEventListener("click", () => {
                    tabs.forEach(t => t.classList.remove("active"));
                    contents.forEach(c => c.classList.remove("active"));

                    tab.classList.add("active");
                    const target = tab.getAttribute("data-tab");
                    document.getElementById(target).classList.add("active");
                });
            });
        });
    </script>

</body>
</html>