Mini Kabibi Habibi

Current Path : C:/xampp/htdocs/ict_schedule/
Upload File :
Current File : C:/xampp/htdocs/ict_schedule/leave_schedule.php

<div id="leave-schedule">
    <h2>Leave Schedule</h2>

    <!-- Leave Insertion Form -->
    <form method="POST">
        <label for="complete_name">Complete Name:</label>
        <input type="text" id="complete_name" name="complete_name" required><br><br>

        <label for="date_of_leave">Date of Leave:</label>
        <input type="date" id="date_of_leave" name="date_of_leave" required><br><br>

        <label for="type_of_leave">Type of Leave:</label>
        <select id="type_of_leave" name="type_of_leave" required>
            <option value="Sick Leave">Sick Leave</option>
            <option value="Special Privileged Leave">Special Privileged Leave</option>
            <option value="Force Leave">Force Leave</option>
        </select><br><br>

        <button type="submit" name="insert_leave">Insert Leave</button>
    </form>

    <!-- Leave Records Table -->
    <table>
        <thead>
            <tr>
                <th>Name</th>
                <th>Date of Leave</th>
                <th>Type of Leave</th>
            </tr>
        </thead>
        <tbody>
            <?php if (isset($leaveRecords)): ?>
                <?php foreach ($leaveRecords as $record): ?>
                    <tr>
                        <td><?= htmlspecialchars($record['complete_name']) ?></td>
                        <td><?= htmlspecialchars($record['date_of_leave']) ?></td>
                        <td><?= htmlspecialchars($record['type_of_leave']) ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </tbody>
    </table>
</div>