<?php
include_once "global.php";

$pageTitle = "Attendance - ";
include_once 'header.php';

// PHP side
// if (!isset($_COOKIE['screen_checked'])) {
//     echo "<script>
//         document.cookie = 'screen_width=' + screen.width + '; path=/';
//         document.cookie = 'screen_checked=1; path=/';
//         location.reload();
//     </script>";
//     exit;
// }

// if (isset($_COOKIE['screen_width']) && $_COOKIE['screen_width'] < 768) {
//     die("Access denied: This page is not accessible on mobile devices.");
// }
?>

<!--breadcrumb-->
<div class="page-breadcrumb d-none d-sm-flex align-items-center mb-3">
    <div class="breadcrumb-title pe-3">Staff Management</div>
    <div class="ps-3">
        <nav aria-label="breadcrumb">
            <ol class="breadcrumb mb-0 p-0">
                <li class="breadcrumb-item"><a href="javascript:;"></a>
                </li>
                <li class="breadcrumb-item active" aria-current="page">Attendance</li>
            </ol>
        </nav>
    </div>
</div>
<!--end breadcrumb-->
<h6 class="mb-0 text-uppercase text-white">Attendance</h6>
<hr>
<div class="card">
    <div class="card-body">
        <div class="table-responsive">
            <?php $crm->attendanceView(); ?>
        </div>
    </div>
</div>

<div class="modal fade" id="checkOutModal">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header border-bottom-0 py-2 bg-grd-success">
                <h5 class="modal-title">Write your today's report</h5>
                <a href="javascript:;" class="primaery-menu-close" data-bs-dismiss="modal">
                    <i class="material-icons-outlined">close</i>
                </a>
            </div>
            <div class="modal-body">
                <div class="form-body">
                    <form class="row g-3" id="checkOutForm" method="post">
                        <input type="hidden" name="emp_id" id="checkout-emp-id">
                        <input type="hidden" name="date" id="checkout-date">
                        <input type="hidden" name="action" value="checkout">
                        <div class="col-md-12">
                            <label for="tinymice-editor" class="form-label">Message</label>
                            <textarea class="form-control" id="tinymice-editor" name="msg" rows="3"></textarea>
                        </div>
                        <div class="col-md-12">
                            <button type="submit" class="btn btn-grd-danger px-4">Submit</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<?php
include_once 'footer.php';
?>