edutrack-naija / upload-results.html
ifeCode's picture
{
6669337 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Upload Results | 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">Upload Results</h1>
</div>
<div class="bg-white p-6 rounded-lg shadow-md mb-8">
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<div>
<label class="block text-gray-700 mb-2" for="academicSession">Academic Session</label>
<select id="academicSession" 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 Session</option>
<option value="2023-2024">2023/2024</option>
<option value="2022-2023">2022/2023</option>
<option value="2021-2022">2021/2022</option>
</select>
</div>
<div>
<label class="block text-gray-700 mb-2" for="term">Term</label>
<select id="term" 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 Term</option>
<option value="1">First Term</option>
<option value="2">Second Term</option>
<option value="3">Third Term</option>
</select>
</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="subject">Subject</label>
<select id="subject" 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 Subject</option>
<option value="mathematics">Mathematics</option>
<option value="english">English Language</option>
<option value="physics">Physics</option>
<option value="chemistry">Chemistry</option>
<option value="biology">Biology</option>
<option value="economics">Economics</option>
<option value="geography">Geography</option>
<option value="government">Government</option>
<option value="literature">Literature</option>
<option value="yoruba">Yoruba</option>
<option value="hausa">Hausa</option>
<option value="igbo">Igbo</option>
<option value="french">French</option>
<option value="crs">CRS</option>
<option value="irs">IRS</option>
</select>
</div>
<div>
<label class="block text-gray-700 mb-2" for="uploadMethod">Upload Method</label>
<select id="uploadMethod" 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 Method</option>
<option value="manual">Manual Entry</option>
<option value="csv">CSV/Excel Upload</option>
</select>
</div>
<div class="flex items-end">
<button type="button" id="loadStudentsBtn" class="bg-green-600 text-white px-4 py-2 rounded-md hover:bg-green-700 transition duration-300 w-full">
Load Students
</button>
</div>
</div>
<div id="csvUploadSection" class="hidden mb-6">
<div class="border-2 border-dashed border-gray-300 rounded-lg p-6 text-center">
<i data-feather="upload-cloud" class="w-12 h-12 text-gray-400 mx-auto mb-4"></i>
<p class="text-gray-600 mb-4">Drag and drop your CSV/Excel file here, or click to browse</p>
<input type="file" id="csvFile" accept=".csv,.xlsx,.xls" class="hidden">
<button type="button" onclick="document.getElementById('csvFile').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> Select File
</button>
<p class="text-sm text-gray-500 mt-2">Download <a href="#" class="text-green-600 hover:underline">template file</a></p>
</div>
</div>
</div>
<div id="resultsTableSection" class="hidden">
<div class="bg-white p-6 rounded-lg shadow-md mb-6">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Enter Scores for SS2 Science - Mathematics (2023/2024 - First Term)</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">Student Name</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Admission No.</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">CA 1 (10)</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">CA 2 (10)</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Exam (70)</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Total (100)</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
<tr>
<td class="px-6 py-4 whitespace-nowrap">Adeola Johnson</td>
<td class="px-6 py-4 whitespace-nowrap">SS/2023/001</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="8">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="9">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="70" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="65">
</td>
<td class="px-6 py-4 whitespace-nowrap font-semibold">82</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">Chinedu Okoro</td>
<td class="px-6 py-4 whitespace-nowrap">SS/2023/002</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="7">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="8">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="70" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="60">
</td>
<td class="px-6 py-4 whitespace-nowrap font-semibold">75</td>
</tr>
<tr>
<td class="px-6 py-4 whitespace-nowrap">Fatima Bello</td>
<td class="px-6 py-4 whitespace-nowrap">SS/2023/003</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="9">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="10" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="10">
</td>
<td class="px-6 py-4 whitespace-nowrap">
<input type="number" min="0" max="70" class="w-16 px-2 py-1 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" value="68">
</td>
<td class="px-6 py-4 whitespace-nowrap font-semibold">87</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="bg-white p-6 rounded-lg shadow-md mb-6">
<h2 class="text-xl font-semibold text-gray-800 mb-4">Teacher Comments</h2>
<textarea class="w-full px-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500" rows="4" placeholder="Enter general comments for the class..."></textarea>
</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">
Save Draft
</button>
<button type="button" 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="send" class="mr-2"></i> Submit for Approval
</button>
</div>
</div>
</main>
<custom-footer></custom-footer>
<script>
feather.replace();
// Toggle between manual and CSV upload
document.getElementById('uploadMethod').addEventListener('change', function() {
const method = this.value;
const csvSection = document.getElementById('csvUploadSection');
const tableSection = document.getElementById('resultsTableSection');
if (method === 'csv') {
csvSection.classList.remove('hidden');
tableSection.classList.add('hidden');
} else if (method === 'manual') {
csvSection.classList.add('hidden');
tableSection.classList.add('hidden');
}
});
// Simulate loading students
document.getElementById('loadStudentsBtn').addEventListener('click', function() {
const session = document.getElementById('academicSession').value;
const term = document.getElementById('term').value;
const classVal = document.getElementById('class').value;
const subject = document.getElementById('subject').value;
if (!session || !term || !classVal || !subject) {
alert('Please fill all required fields');
return;
}
// Show loading
this.innerHTML = '<i data-feather="loader" class="animate-spin mr-2"></i> Loading...';
this.disabled = true;
feather.replace();
// Simulate API call
setTimeout(() => {
this.innerHTML = 'Load Students';
this.disabled = false;
document.getElementById('resultsTableSection').classList.remove('hidden');
feather.replace();
}, 1500);
});
// Calculate totals when scores change
document.querySelectorAll('input[type="number"]').forEach(input => {
input.addEventListener('change', function() {
const row = this.closest('tr');
const ca1 = parseFloat(row.querySelector('td:nth-child(3) input').value) || 0;
const ca2 = parseFloat(row.querySelector('td:nth-child(4) input').value) || 0;
const exam = parseFloat(row.querySelector('td:nth-child(5) input').value) || 0;
const total = ca1 + ca2 + exam;
row.querySelector('td:nth-child(6)').textContent = total;
});
});
</script>
<script src="script.js"></script>
</body>
</html>