<!DOCTYPE html>
<html>
<head>
     <?= $this->include('admin/inc/title') ?>
    <link rel="stylesheet"
          href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
</head>
<body>
 <?= $this->include('admin/inc/header') ?>
<div class="container mt-4">
    <h4 class="mb-3">My Attendance History</h4>

    <table class="table table-bordered table-striped">
        <thead class="thead-dark">
        <tr>
            <th>Date</th>
            <th>Punch In</th>
            <th>Punch Out</th>
            <th>Work Mode</th>
        </tr>
        </thead>
        <tbody>
        <?php if (!empty($records)) { ?>
            <?php foreach ($records as $row) { ?>
                <tr>
                    <td><?= $row['attendance_date'] ?></td>
                    <td><?= $row['punch_in_time'] ?></td>
                    <td><?= $row['punch_out_time'] ?? '-' ?></td>
                    <td><?= $row['work_mode'] ?></td>
                </tr>
            <?php } ?>
        <?php } else { ?>
            <tr>
                <td colspan="4" class="text-center text-danger">No attendance found</td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
	
	<div class="row mt-5">
		<div class="col-md-4"></div>
		<div class="col-md-4"><a href="<?= base_url('home')?>"><button class="btn btn-danger btn-md">Return to Home</button></a></div>
		<div class="col-md-4"></div>
        </div>
</div>
 <?= $this->include('admin/inc/footer') ?>
</body>
</html>
