<%@ page import="java.util.List" %>
<%@ page import="pojo.Vehicle" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>管理员</title>
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/mainTemplate.css">
    <link rel="stylesheet" href="<%=request.getContextPath()%>/static/css/vehicleStyle.css">
</head>
<%
    request.setCharacterEncoding("UTF-8");
    List<Vehicle> vehicles = (List<Vehicle>) request.getAttribute("vehicles");
%>
<body>
<div class="top-bar">
    <div class="top-bar-logo">
        <a  href="#"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
        <a id="logo-text" href="<%=request.getContextPath()%>">山东科技大学 作为小组停车场管理系统 <span style="font-size: 20px;">管理员端</span></a>
    </div>
    <div class="top-bar-btn">
    </div>
    <div class="top-bar-right">
        <div class="drop-menu">
            <div class="top-bar-account">
<%--                <span><%=request.getSession().getAttribute("username")%></span>--%>
<%--                <div class="drop"><a href="<%=request.getContextPath()%>/account/exit">退出账户</a></div>--%>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div class="side-bar">
        <a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/User">用户信息</a>
        <a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Spots">车位情况</a>
        <a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Records">停车记录</a>
        <a class="side-bar-button" href="<%=request.getContextPath()%>/main/admin/Vehicles">车辆信息</a>
    </div>
    <div class="tasks-content">
        <form id="vehicle-form" action="<%=request.getContextPath()%>/main/admin/Vehicles" method="post">
            <input type="text" name="car_license" placeholder="请输入车牌号">
            <input type="text" name="brand" placeholder="请输入品牌">
            <input type="text" name="model" placeholder="请输入型号">
            <input type="text" name="buildnum" placeholder="楼号">
            <input type="submit" value="搜索">
        </form>
        <table class="vehicle-table">
            <tr style="color:#087DCE;">
                <th style="font-weight: bold;">车牌号</th>
                <th style="font-weight: bold;">品牌</th>
                <th style="font-weight: bold;">型号</th>
                <th style="font-weight: bold;">业主</th>
                <th style="font-weight: bold;">联系方式</th>
                <th style="font-weight: bold;">地址</th>
            </tr>
            <%
                for(Vehicle vehicle: vehicles) {
            %>
            <tr>
                <th><%=vehicle.getCar_license()%></th>
                <th><%=vehicle.getBrand()%></th>
                <th><%=vehicle.getModel()%></th>
                <th><%=vehicle.getUsername()%></th>
                <th><%=vehicle.getTelephone()%></th>
                <th><%=vehicle.getAddress()%></th>
            </tr>
            <%
                }
            %>
        </table>
    </div>
</div>
</body>
</html>
