10
This commit is contained in:
31
s1/src/routes/student/+page.svelte
Normal file
31
s1/src/routes/student/+page.svelte
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
export let studentId: any;
|
||||||
|
export function checkAttendance() {
|
||||||
|
// Simulate attendance check (replace with actual logic)
|
||||||
|
const attendanceMessage = document.getElementById('attendance_message');
|
||||||
|
if (attendanceMessage) { // Check if element exists before access
|
||||||
|
attendanceMessage.textContent = `Attendance data for student ID ${studentId} is not available in this demo.`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let afterUpdate = () => {
|
||||||
|
// This code runs after the component updates (DOM is ready)
|
||||||
|
const attendanceMessage = document.getElementById('attendance_message');
|
||||||
|
if (attendanceMessage) {
|
||||||
|
// You can set a default message here if needed
|
||||||
|
attendanceMessage.textContent = ""; // Clear any previous content
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<header>
|
||||||
|
<h1>Check Attendance</h1>
|
||||||
|
</header>
|
||||||
|
<main>
|
||||||
|
<section>
|
||||||
|
<p>Enter your Student ID:</p>
|
||||||
|
<input type="text" bind:this={studentId} id="student_id">
|
||||||
|
<button on:click="{checkAttendance}">Check</button>
|
||||||
|
<p id="attendance_message"></p>
|
||||||
|
</section>
|
||||||
|
</main>
|
Reference in New Issue
Block a user