File size: 2,781 Bytes
e06e142
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Dashboard | KV Student Data</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gray-50 min-h-screen font-sans">

    <nav class="bg-blue-600 text-white p-4 flex justify-between items-center shadow-md">
        <h1 class="text-xl font-semibold">KV Student Dashboard</h1>
        <div>
            <a href="{{ url_for('download') }}"
               class="bg-white text-blue-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-100 mr-2">
                ⬇ Download Excel
            </a>
            <a href="{{ url_for('logout') }}"
               class="bg-red-500 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-red-600">
                Logout
            </a>
        </div>
    </nav>

    <main class="p-6">
        {% if data %}
        <div class="overflow-x-auto rounded-lg shadow">
            <table class="min-w-full bg-white">
                <thead class="bg-blue-100 text-gray-700">
                    <tr>
                        <th class="py-3 px-4 text-left">Name</th>
                        <th class="py-3 px-4 text-left">DOB</th>
                        <th class="py-3 px-4 text-left">UBI ID</th>
                        <th class="py-3 px-4 text-left">Class</th>
                        <th class="py-3 px-4 text-left">School</th>
                        <th class="py-3 px-4 text-left">Enrolled</th>
                    </tr>
                </thead>
                <tbody>
                    {% for student in data %}
                    <tr class="border-t hover:bg-gray-50">
                        <td class="py-2 px-4">{{ student.name }}</td>
                        <td class="py-2 px-4">{{ student.dob }}</td>
                        <td class="py-2 px-4">{{ student.ubiId }}</td>
                        <td class="py-2 px-4">{{ student.class }}</td>
                        <td class="py-2 px-4">{{ student.school }}</td>
                        <td class="py-2 px-4">
                            {% if student.enrolled == "Yes" %}
                                <span class="text-green-600 font-semibold">Yes</span>
                            {% else %}
                                <span class="text-red-500 font-semibold">No</span>
                            {% endif %}
                        </td>
                    </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
        {% else %}
        <p class="text-center text-gray-500 mt-10 text-lg">No student data available yet. Please wait while it's being collected.</p>
        {% endif %}
    </main>

</body>
</html>