<div class="title">職員</div>

<table id="myTable" datatables_existing data-add="/employee/add" data-module="employee">
    <thead>
        <tr>
            <th>所屬分校</th>
            <th>用戶帳號名稱</th>
            <th>中文姓名</th>
            <th>英文姓名</th>
            <th>稱呼</th>
            <th>薪酬方式</th>
            <th>創建日期</th>
            <th>更新日期</th>
            <th>啟用</th>
            <th>詳情</th>
        </tr>
    </thead>
    <tbody>
        <?php
        foreach ($items as $_ => $item) {
            $id = $item['id'];
            $updateTime = $item['update_time'] ? date('Y-m-d H:i', $item['update_time']) : '-';
            $createTime = $item['create_time'] ? date('Y-m-d H:i', $item['create_time']) : '-';

            echo "<tr data-id='" . $id . "'>
                    <td>{$item['tenant_name']}</td>
                    <td>{$item['username']}</td>
                    <td>{$item['chi_name']}</td>
                    <td>{$item['eng_name']}</td>
                    <td>{$item['display_name']}</td>
                    <td>{$item['income_type']}</td>
                    <td>{$createTime}</td>
                    <td>{$updateTime}</td>
                        <td>{$item['status']}</td>
                    <td><a href='/employee/" . $id . "/edit?tenant=" . $item['tenant_no'] . "'>詳情</a></td>
                </tr>";
        }
        ?>
    </tbody>
</table>
<style>
    table {
        border-collapse: collapse;
    }

    table,
    th,
    td {
        border: 1px solid black;
    }

    td,
    th {
        padding: .5em;
    }
</style>