136 أسطر
9.6 KiB
HTML
136 أسطر
9.6 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-6xl">
|
|
|
|
<!-- 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-8 rounded-xl shadow-lg mb-8">
|
|
<h2 class="text-2xl font-semibold mb-6 text-gray-800 border-b pb-4">Add New Student</h2>
|
|
<form action="/add" method="POST">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-6">
|
|
<!-- Column 1 -->
|
|
<div>
|
|
<label for="student_name" class="block text-sm font-medium text-gray-700 mb-1">Student Name</label>
|
|
<input type="text" name="student_name" id="student_name" placeholder="Full Name" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="age" class="block text-sm font-medium text-gray-700 mb-1">Age</label>
|
|
<input type="number" name="age" id="age" placeholder="e.g., 15" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<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="Parent's Full Name" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="parent_phone_1" class="block text-sm font-medium text-gray-700 mb-1">Parent Phone 1 (Required)</label>
|
|
<input type="tel" name="parent_phone_1" id="parent_phone_1" placeholder="e.g., 09xxxxxxxx" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="parent_phone_2" class="block text-sm font-medium text-gray-700 mb-1">Parent Phone 2 (Optional)</label>
|
|
<input type="tel" name="parent_phone_2" id="parent_phone_2" placeholder="e.g., 09xxxxxxxx" class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<!-- Column 2 -->
|
|
<div>
|
|
<label for="student_phone" class="block text-sm font-medium text-gray-700 mb-1">Student Phone (Optional)</label>
|
|
<input type="tel" name="student_phone" id="student_phone" placeholder="e.g., 09xxxxxxxx" class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="grade" class="block text-sm font-medium text-gray-700 mb-1">Grade</label>
|
|
<input type="text" name="grade" id="grade" placeholder="e.g., 10th Grade" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="school_name" class="block text-sm font-medium text-gray-700 mb-1">School Name</label>
|
|
<input type="text" name="school_name" id="school_name" placeholder="e.g., Future Generation High" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="address" class="block text-sm font-medium text-gray-700 mb-1">Address</label>
|
|
<input type="text" name="address" id="address" placeholder="Street, City" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
<div>
|
|
<label for="memorizing" class="block text-sm font-medium text-gray-700 mb-1">Memorizing</label>
|
|
<input type="text" name="memorizing" id="memorizing" placeholder="e.g., Quran, Part 30" required class="w-full px-4 py-2 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500">
|
|
</div>
|
|
</div>
|
|
<div class="mt-8 text-right">
|
|
<button type="submit" class="px-8 py-3 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-all duration-200 ease-in-out">
|
|
Add Student Record
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- Student List Table -->
|
|
<div class="bg-white p-6 rounded-xl shadow-lg">
|
|
<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 class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">ID</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Student Name</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Age</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Parent</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Contact Numbers</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Grade</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">School</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Address</th>
|
|
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Memorizing</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
{% for student in students %}
|
|
<tr class="hover:bg-gray-50 transition-colors duration-200">
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-bold text-gray-700">{{ student['id'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ student['student_name'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['age'] }}</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">
|
|
<div class="flex flex-col">
|
|
<span>P1: {{ student['parent_phone_1'] }}</span>
|
|
{% if student['parent_phone_2'] %}<span>P2: {{ student['parent_phone_2'] }}</span>{% endif %}
|
|
{% if student['student_phone'] %}<span>S: {{ student['student_phone'] }}</span>{% endif %}
|
|
</div>
|
|
</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['grade'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['school_name'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['address'] }}</td>
|
|
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-600">{{ student['memorizing'] }}</td>
|
|
</tr>
|
|
{% else %}
|
|
<tr>
|
|
<td colspan="9" class="text-center py-6 text-gray-500">No students have been added yet.</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|