<div class="d-block g-5 ms-md-5 me-md-5 mt-md-1" style="font-size: 1.8vh;">
    <div class="d-flex fs-1 justify-content-center align-items-center col-md-12 col-sm-12 mt-3">
        <h1 style="font-size: 1rem;">Gestor de empregados</h1>
    </div>
    <div class="d-flex justify-content-center align-items-center col-md-12 col-sm-12 mb-md-3 mt-md-3">
        <select id="select-employee" class="d-block form-select w-50 col-md-12 col-sm-12 ms-sm-2 me-sm-2" aria-label="Selecionar empregado">
            <option selected value="null">Selecione</option>
            <?php
                include './connect.php';
                $sql = "SELECT id, nome, apelido FROM utilizadores WHERE id != 3 AND active = '1' ORDER BY nome;";
                $result = $TraceStockDB->query($sql);
                if ($result->rowCount() > 0) {
                    while($row = $result->fetch(PDO::FETCH_ASSOC)) {
                        $id = $row['id'];
                        $nome = htmlspecialchars($row['nome']);
                        $apelido = htmlspecialchars($row['apelido']);
                        echo "<option value='$id'>".$nome . " " . $apelido ."</option>";
                    }
                }
            ?>
        </select>
    </div>
    <div class="table-responsive">
        <table class="table table-striped table-bordered align-middle text-center" id="employeeTable">
            <thead>
                <tr>
                    <th class="w-5">ID</th>
                    <th>Nome</th>
                    <th>Email</th>
                    <th>Telefone</th>
                    <th>Empresa</th>
                    <th>Ações</th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>
    </div>
</div>

<div class="modal fade" id="EmployeeModal" tabindex="-1" aria-labelledby="EmployeeModalLabel">
  <div class="modal-dialog modal-dialog-centered modal-lg">
        <div class="modal-content bg-dark text-white">
            <div class="modal-header">
                <h5 class="modal-title" id="EmployeeModalLabel">Gestão de Empregado</h5>
                <button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal" aria-label="Fechar"></button>
            </div>
            <div id="modal-employee" class="modal-body">
            </div>
        </div>
    </div>
</div>