97 أسطر
5.2 KiB
HTML
97 أسطر
5.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Student Information</title>
|
|
<!-- Tailwind CSS for styling -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<!-- Google Fonts: Inter -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
<style>
|
|
/* Use Inter as the default font */
|
|
body {
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body class="bg-gray-50 text-gray-800">
|
|
|
|
<div class="container mx-auto p-4 sm:p-6 lg:p-8 max-w-4xl">
|
|
|
|
<!-- Header -->
|
|
<header class="text-center mb-8">
|
|
<h1 class="text-3xl sm:text-4xl font-bold text-gray-900">Student Management System</h1>
|
|
<p class="text-gray-600 mt-2">Enter and view student details below.</p>
|
|
</header>
|
|
|
|
<!-- Student Entry Form -->
|
|
<div class="bg-white p-6 rounded-xl shadow-md mb-8">
|
|
<h2 class="text-2xl font-semibold mb-4 text-gray-800">Add New Student</h2>
|
|
<form action="/add" method="POST">
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
<!-- Student Name -->
|
|
<div>
|
|
<label for="name" class="block text-sm font-medium text-gray-700 mb-1">Student Name</label>
|
|
<input type="text" name="name" id="name" placeholder="e.g., Jane Doe" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition">
|
|
</div>
|
|
<!-- Parent's Name -->
|
|
<div>
|
|
<label for="parent_name" class="block text-sm font-medium text-gray-700 mb-1">Parent's Name</label>
|
|
<input type="text" name="parent_name" id="parent_name" placeholder="e.g., John Doe" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition">
|
|
</div>
|
|
<!-- Phone Number -->
|
|
<div>
|
|
<label for="phone_number" class="block text-sm font-medium text-gray-700 mb-1">Phone Number</label>
|
|
<input type="tel" name="phone_number" id="phone_number" placeholder="e.g., (123) 456-7890" required
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition">
|
|
</div>
|
|
</div>
|
|
<div class="mt-6 text-right">
|
|
<button type="submit"
|
|
class="px-6 py-2 bg-blue-600 text-white font-semibold rounded-lg shadow-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200">
|
|
Add Student
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Student List Table -->
|
|
<div class="bg-white p-6 rounded-xl shadow-md">
|
|
<h2 class="text-2xl font-semibold mb-4 text-gray-800">Registered Students</h2>
|
|
<div class="overflow-x-auto">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Student Name</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Parent's Name</th>
|
|
<th scope="col" class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Phone Number</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
<!-- Jinja2 loop to populate table rows -->
|
|
{% for student in students %}
|
|
<tr>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ student['name'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['parent_name'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['phone_number'] }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<!-- Message shown if there are no students -->
|
|
<tr>
|
|
<td colspan="3" class="text-center py-4 text-gray-500">No students have been added yet.</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|