<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ page import="java.net.URLEncoder" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>全部员工</title>
    <!-- 新 Bootstrap 核心 CSS 文件 -->
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            position: absolute;
            width: 600px;
            height: 500px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            justify-content: center;
        }
    </style>
</head>
<body>
<div class="container mt-3">
    <table class="table" style="text-overflow:ellipsis;white-space:nowrap;overflow:hidden;">
        <caption>查看所有员工信息</caption>
        <thead>
        <tr>
            <th>员工编号</th>
            <th>员工姓名</th>
            <th>员工部门</th>
            <th>员工生日</th>
            <th>员工电话</th>
            <th>员工照片</th>
        </tr>
        </thead>
        <c:if test="${empty emp}">
            <tbody>
            <tr class="danger">
                <td colspan="6">暂无任何员工信息</td>
            </tr>
            </tbody>
        </c:if>
        <c:if test="${not empty emp}">
        <c:forEach begin="0" end="${emp.size()-1}" var="i">
        <tbody>
        <tr class="active">
            <td>${emp[i].empId}</td>
            <td>${emp[i].empName}</td>
            <td>${emp[i].empDepartment}</td>
            <td><fmt:formatDate value="${emp[i].empBirthday}" pattern="yyyy年MM月dd日" /></td>
            <td>${emp[i].empTel}</td>
            <td colspan="2">
                <img src="upload/${emp[i].empPhoto}" class="img-rounded" height="150px">
            </td>
            <td><a href="delete?id=${emp[i].empId}">删除</a></td>
        </tr>
        </c:forEach>
        </c:if>
        </tbody>
    </table>
</div>
</body>
</html>
