Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Add Student | EduTrack Naija</title> | |
| <link rel="stylesheet" href="style.css"> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="components/navbar.js"></script> | |
| <script src="components/footer.js"></script> | |
| </head> | |
| <body class="bg-gray-50"> | |
| <custom-navbar></custom-navbar> | |
| <main class="container mx-auto px-4 py-8"> | |
| <div class="flex items-center mb-8"> | |
| <a href="teacher-dashboard.html" class="mr-4 text-green-600 hover:text-green-800"> | |
| <i data-feather="arrow-left"></i> | |
| </a> | |
| <h1 class="text-3xl font-bold text-green-700">Add New Student</h1> | |
| </div> | |
| <div class="bg-white p-6 rounded-lg shadow-md"> | |
| <form id="studentForm"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="firstName">First Name</label> | |
| <input type="text" id="firstName" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="lastName">Last Name</label> | |
| <input type="text" id="lastName" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="gender">Gender</label> | |
| <select id="gender" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| <option value="">Select Gender</option> | |
| <option value="male">Male</option> | |
| <option value="female">Female</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="dob">Date of Birth</label> | |
| <input type="date" id="dob" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="admissionNumber">Admission Number</label> | |
| <input type="text" id="admissionNumber" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="class">Class</label> | |
| <select id="class" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" required> | |
| <option value="">Select Class</option> | |
| <option value="primary1">Primary 1</option> | |
| <option value="primary2">Primary 2</option> | |
| <option value="primary3">Primary 3</option> | |
| <option value="primary4">Primary 4</option> | |
| <option value="primary5">Primary 5</option> | |
| <option value="primary6">Primary 6</option> | |
| <option value="jss1">JSS 1</option> | |
| <option value="jss2">JSS 2</option> | |
| <option value="jss3">JSS 3</option> | |
| <option value="ss1">SS 1</option> | |
| <option value="ss2">SS 2</option> | |
| <option value="ss3">SS 3</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="arm">Arm (if applicable)</label> | |
| <select id="arm" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"> | |
| <option value="">Select Arm</option> | |
| <option value="a">A</option> | |
| <option value="b">B</option> | |
| <option value="c">C</option> | |
| <option value="science">Science</option> | |
| <option value="arts">Arts</option> | |
| <option value="commercial">Commercial</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-gray-700 mb-2" for="parentContact">Parent Contact</label> | |
| <input type="tel" id="parentContact" class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"> | |
| </div> | |
| </div> | |
| <div class="mb-6"> | |
| <label class="block text-gray-700 mb-2">Passport Photo</label> | |
| <div class="flex items-center"> | |
| <div class="mr-4"> | |
| <div class="w-24 h-24 bg-gray-200 rounded-full flex items-center justify-center overflow-hidden"> | |
| <img id="previewPhoto" src="http://static.photos/people/200x200" alt="Passport preview" class="w-full h-full object-cover hidden"> | |
| <i data-feather="user" class="text-gray-400 w-12 h-12"></i> | |
| </div> | |
| </div> | |
| <div> | |
| <input type="file" id="passportPhoto" accept="image/*" class="hidden"> | |
| <button type="button" onclick="document.getElementById('passportPhoto').click()" class="bg-gray-200 text-gray-700 px-4 py-2 rounded-md hover:bg-gray-300 transition duration-300"> | |
| <i data-feather="upload" class="mr-2"></i> Upload Photo | |
| </button> | |
| <p class="text-sm text-gray-500 mt-1">Max size: 2MB (JPG/PNG)</p> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="flex justify-end"> | |
| <button type="button" class="bg-gray-200 text-gray-700 px-6 py-2 rounded-md mr-4 hover:bg-gray-300 transition duration-300"> | |
| Cancel | |
| </button> | |
| <button type="submit" class="bg-green-600 text-white px-6 py-2 rounded-md hover:bg-green-700 transition duration-300 flex items-center"> | |
| <i data-feather="save" class="mr-2"></i> Save Student | |
| </button> | |
| </div> | |
| </form> | |
| </div> | |
| </main> | |
| <custom-footer></custom-footer> | |
| <script> | |
| feather.replace(); | |
| // Preview passport photo | |
| document.getElementById('passportPhoto').addEventListener('change', function(e) { | |
| const file = e.target.files[0]; | |
| if (file) { | |
| const reader = new FileReader(); | |
| reader.onload = function(event) { | |
| const preview = document.getElementById('previewPhoto'); | |
| preview.src = event.target.result; | |
| preview.classList.remove('hidden'); | |
| preview.nextElementSibling.classList.add('hidden'); | |
| } | |
| reader.readAsDataURL(file); | |
| } | |
| }); | |
| // Form submission | |
| document.getElementById('studentForm').addEventListener('submit', function(e) { | |
| e.preventDefault(); | |
| // In a real app, this would submit to the server | |
| alert('Student profile saved successfully!'); | |
| window.location.href = 'teacher-dashboard.html'; | |
| }); | |
| </script> | |
| <script src="script.js"></script> | |
| </body> | |
| </html> |