<?php
include_once "global.php";

$pageTitle = "Add Staff - ";
include_once 'header.php';
?>

<!--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">Add Staff</li>
            </ol>
        </nav>
    </div>
</div>
<!--end breadcrumb-->
<div class="card">
    <div class="card-body p-4">
        <h5 class="mb-4">Add Staff</h5>
        <form id="staffAddForm" class="row g-3" method="post">
            <div class="col-md-6">
                <label for="userId" class="form-label">Name <span>*</span></label>
                <select id="userId" name="userId" class="form-select" required>
                    <option value="" disabled selected>Select...</option>
                    <?php
                    $users = $productClass->AllEmployeesAndManagersArray();
                    foreach ($users as $user) {
                        $userId = $user["acc_id"];
                        $name = $user["acc_name"];
                        echo "<option value='$userId'>$name</option>";
                    }
                    ?>
                </select>
            </div>
            <div class="col-md-6">
                <label for="designation" class="form-label">Designation <span>*</span></label>
                <select id="designation" name="designation[]" class="multiple-select-field"
                    data-placeholder="Select Designation" multiple>
                    <?php
                    $designations = $productClass->AllDesignationArray();
                    foreach ($designations as $designation) {
                        $Id = $designation["id"];
                        $designationTitle = $designation["designation"];
                        echo "<option value='$Id'>$designationTitle</option>";
                    }
                    ?>
                </select>
            </div>
            <div class="col-md-6">
                <label for="checkintime" class="form-label">Check-In Time <span>*</span></label>
                <input type="time" name="checkintime" id="checkintime" class="form-control" value="10:00" required>
            </div>
            <div class="col-md-6">
                <label for="checkouttime" class="form-label">Check-Out Time <span>*</span></label>
                <input type="time" name="checkouttime" id="checkouttime" class="form-control" value="19:00" required>
            </div>
            <div class="col-md-6">
                <label for="salary" class="form-label">Salary</label>
                <input type="number" name="salary" id="salary" class="form-control">
            </div>
            <div class="col-md-12">
                <button type="submit" class="btn btn-grd-primary px-4">Submit</button>
            </div>
        </form>
    </div>
</div>

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