Spaces:
Running
Running
make the remove and add studebts ino one category but make it into options to choose add or remove
Browse files- admin-dashboard.html +21 -68
admin-dashboard.html
CHANGED
|
@@ -60,48 +60,21 @@
|
|
| 60 |
<h2 class="text-xl font-semibold mb-4 text-gray-800">Student & Class Management</h2>
|
| 61 |
|
| 62 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 63 |
-
<!--
|
| 64 |
<div class="bg-gray-50 p-4 rounded-lg">
|
| 65 |
-
<
|
| 66 |
-
|
| 67 |
-
<div class="mb-3">
|
| 68 |
-
<label class="block text-gray-700 mb-1">Class</label>
|
| 69 |
-
<select class="w-full px-3 py-2 border rounded" id="add-student-class" required>
|
| 70 |
-
<option value="">Select Class</option>
|
| 71 |
-
<option value="BUDI">BUDI</option>
|
| 72 |
-
<option value="USAHA">USAHA</option>
|
| 73 |
-
<option value="MAJU">MAJU</option>
|
| 74 |
-
<option value="JAYA">JAYA</option>
|
| 75 |
-
</select>
|
| 76 |
-
</div>
|
| 77 |
-
<div class="mb-3">
|
| 78 |
-
<label class="block text-gray-700 mb-1">Form</label>
|
| 79 |
-
<select class="w-full px-3 py-2 border rounded" id="add-student-form" required>
|
| 80 |
-
<option value="">Select Form</option>
|
| 81 |
-
<option value="1">Form 1</option>
|
| 82 |
-
<option value="2">Form 2</option>
|
| 83 |
-
<option value="3">Form 3</option>
|
| 84 |
-
<option value="4">Form 4</option>
|
| 85 |
-
<option value="5">Form 5</option>
|
| 86 |
-
</select>
|
| 87 |
-
</div>
|
| 88 |
-
<div class="mb-3">
|
| 89 |
-
<label class="block text-gray-700 mb-1">Student Name</label>
|
| 90 |
-
<input type="text" class="w-full px-3 py-2 border rounded" id="add-student-name" required>
|
| 91 |
-
</div>
|
| 92 |
-
<button type="submit" class="w-full bg-blue-600 text-white py-2 rounded hover:bg-blue-700">
|
| 93 |
Add Student
|
| 94 |
</button>
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
<
|
| 101 |
-
<form id="remove-student-form">
|
| 102 |
<div class="mb-3">
|
| 103 |
<label class="block text-gray-700 mb-1">Class</label>
|
| 104 |
-
<select class="w-full px-3 py-2 border rounded" id="
|
| 105 |
<option value="">Select Class</option>
|
| 106 |
<option value="BUDI">BUDI</option>
|
| 107 |
<option value="USAHA">USAHA</option>
|
|
@@ -111,7 +84,7 @@
|
|
| 111 |
</div>
|
| 112 |
<div class="mb-3">
|
| 113 |
<label class="block text-gray-700 mb-1">Form</label>
|
| 114 |
-
<select class="w-full px-3 py-2 border rounded" id="
|
| 115 |
<option value="">Select Form</option>
|
| 116 |
<option value="1">Form 1</option>
|
| 117 |
<option value="2">Form 2</option>
|
|
@@ -120,18 +93,22 @@
|
|
| 120 |
<option value="5">Form 5</option>
|
| 121 |
</select>
|
| 122 |
</div>
|
| 123 |
-
<div class="mb-3">
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
<label class="block text-gray-700 mb-1">Student</label>
|
| 125 |
-
<select class="w-full px-3 py-2 border rounded" id="
|
| 126 |
<option value="">Select Student</option>
|
| 127 |
</select>
|
| 128 |
</div>
|
| 129 |
-
<button type="submit" class="w-full bg-
|
| 130 |
-
|
| 131 |
</button>
|
| 132 |
</form>
|
| 133 |
</div>
|
| 134 |
-
|
| 135 |
|
| 136 |
<!-- School Structure Management -->
|
| 137 |
<div class="mt-6">
|
|
@@ -388,31 +365,7 @@
|
|
| 388 |
showManagementMessage(`Class ${classToRemove} and all its students removed successfully!`);
|
| 389 |
this.reset();
|
| 390 |
});
|
| 391 |
-
|
| 392 |
-
// Load students for removal dropdown
|
| 393 |
-
function loadStudentsForRemoval() {
|
| 394 |
-
const classVal = document.getElementById('remove-student-class').value;
|
| 395 |
-
const formVal = document.getElementById('remove-student-form').value;
|
| 396 |
-
const studentSelect = document.getElementById('remove-student-name');
|
| 397 |
-
|
| 398 |
-
studentSelect.innerHTML = '<option value="">Select Student</option>';
|
| 399 |
-
studentSelect.disabled = true;
|
| 400 |
-
|
| 401 |
-
if (classVal && formVal) {
|
| 402 |
-
const key = `${classVal}-${formVal}`;
|
| 403 |
-
if (students[key]) {
|
| 404 |
-
students[key].forEach(student => {
|
| 405 |
-
const option = document.createElement('option');
|
| 406 |
-
option.value = student;
|
| 407 |
-
option.textContent = student;
|
| 408 |
-
studentSelect.appendChild(option);
|
| 409 |
-
});
|
| 410 |
-
studentSelect.disabled = false;
|
| 411 |
-
}
|
| 412 |
-
}
|
| 413 |
-
}
|
| 414 |
-
|
| 415 |
-
// Show management message
|
| 416 |
function showManagementMessage(message, type = 'success') {
|
| 417 |
const messageDiv = document.getElementById('management-message');
|
| 418 |
messageDiv.textContent = message;
|
|
|
|
| 60 |
<h2 class="text-xl font-semibold mb-4 text-gray-800">Student & Class Management</h2>
|
| 61 |
|
| 62 |
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 63 |
+
<!-- Student Management Form -->
|
| 64 |
<div class="bg-gray-50 p-4 rounded-lg">
|
| 65 |
+
<div class="flex mb-4 border-b">
|
| 66 |
+
<button class="px-4 py-2 font-medium border-b-2 border-blue-600 text-blue-600" id="add-student-tab">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
Add Student
|
| 68 |
</button>
|
| 69 |
+
<button class="px-4 py-2 font-medium text-gray-500" id="remove-student-tab">
|
| 70 |
+
Remove Student
|
| 71 |
+
</button>
|
| 72 |
+
</div>
|
| 73 |
+
|
| 74 |
+
<form id="student-management-form">
|
|
|
|
| 75 |
<div class="mb-3">
|
| 76 |
<label class="block text-gray-700 mb-1">Class</label>
|
| 77 |
+
<select class="w-full px-3 py-2 border rounded" id="student-class" required>
|
| 78 |
<option value="">Select Class</option>
|
| 79 |
<option value="BUDI">BUDI</option>
|
| 80 |
<option value="USAHA">USAHA</option>
|
|
|
|
| 84 |
</div>
|
| 85 |
<div class="mb-3">
|
| 86 |
<label class="block text-gray-700 mb-1">Form</label>
|
| 87 |
+
<select class="w-full px-3 py-2 border rounded" id="student-form" required>
|
| 88 |
<option value="">Select Form</option>
|
| 89 |
<option value="1">Form 1</option>
|
| 90 |
<option value="2">Form 2</option>
|
|
|
|
| 93 |
<option value="5">Form 5</option>
|
| 94 |
</select>
|
| 95 |
</div>
|
| 96 |
+
<div class="mb-3" id="student-name-container">
|
| 97 |
+
<label class="block text-gray-700 mb-1">Student Name</label>
|
| 98 |
+
<input type="text" class="w-full px-3 py-2 border rounded" id="student-name" required>
|
| 99 |
+
</div>
|
| 100 |
+
<div class="mb-3 hidden" id="student-select-container">
|
| 101 |
<label class="block text-gray-700 mb-1">Student</label>
|
| 102 |
+
<select class="w-full px-3 py-2 border rounded" id="student-select" disabled>
|
| 103 |
<option value="">Select Student</option>
|
| 104 |
</select>
|
| 105 |
</div>
|
| 106 |
+
<button type="submit" id="submit-btn" class="w-full bg-blue-600 text-white py-2 rounded hover:bg-blue-700">
|
| 107 |
+
Add Student
|
| 108 |
</button>
|
| 109 |
</form>
|
| 110 |
</div>
|
| 111 |
+
</div>
|
| 112 |
|
| 113 |
<!-- School Structure Management -->
|
| 114 |
<div class="mt-6">
|
|
|
|
| 365 |
showManagementMessage(`Class ${classToRemove} and all its students removed successfully!`);
|
| 366 |
this.reset();
|
| 367 |
});
|
| 368 |
+
// Show management message
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 369 |
function showManagementMessage(message, type = 'success') {
|
| 370 |
const messageDiv = document.getElementById('management-message');
|
| 371 |
messageDiv.textContent = message;
|