<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ 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">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> <!-- 引入 Chart.js -->
    <style>
        .pageConfig{
            margin-top: 1%;
            width: 100%;
            display: flex;
            cursor: pointer;
            /*border: 2px solid #126bff;*/
        }

        .pageConfigUp{
            width: 100%;
            cursor: pointer;
            /*border: 2px solid #126bff;*/
            /*margin-bottom: 1%;*/
            /*margin-top: 1%;*/
            /*box-shadow: 0 0 0 2px #f0f0f0;*/
            border-radius: 8px;
            text-align: center; /* 让内容水平居中 */
            font-family: Arial, sans-serif;
        }

        .publishButton {

            font-size: 24px; /* 设置字体大小 */
            display: inline-block; /* 让按钮元素作为块级元素显示 */
            padding: 10px 20px; /* 设定按钮内边距 */
            border: 2px solid #fff; /* 按钮边框 */
            border-radius: 5px; /* 圆角 */
            text-decoration: none; /* 去除链接下划线 */
            /*color: #333; !* 文字颜色 *!*/
            margin-top: 1%; /* 上边距约为页面高度的 30% */
            margin-bottom: 1%; /* 下边距约为页面高度的 30% */
            background-color: #3fb643;
            color: #fff; /* 设置文字颜色为白色 */.
        }

        .publishButton:hover {
            background-color: #333; /* 鼠标悬停时背景颜色 */
            color: #fff; /* 鼠标悬停时文字颜色 */
        }



    </style>
</head>
<%
    request.setCharacterEncoding("UTF-8");
    List<Vehicle> carlist=null;
    carlist = (List<Vehicle>) request.getAttribute("carlist");
%>
<body>
<div class="top-bar">
    <div class="top-bar-logo">
        <a  href="<%=request.getContextPath()%>/mall/AllTask"><img id="logo" src="<%=request.getContextPath()%>/static/images/logo.jpg" alt="" ></a>
        <a id="logo-text" href="#">山东科技大学 作为小组停车场管理系统 <span></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">
        <%
            if (carlist != null) {
        %>
        <table class="vehicle-table">
            <tr style="color:#087DCE;">
                <th style="font-weight: bold;">车牌号</th>
                <th style="font-weight: bold;">用户ID</th>
                <th style="font-weight: bold;">品牌</th>
                <th style="font-weight: bold;">型号</th>
            </tr>
            <%
                }
            %>
            <%
                if (carlist != null) {
                    for(Vehicle car: carlist) {
            %>
            <tr>
                <th><%=car.getCar_license()%></th>
                <th><%=car.getUser_id()%></th>
                <th><%=car.getBrand()%></th>
                <th><%=car.getModel()%></th>
            </tr>
            <%
                    }
                }
            %>

        </table>
    </div>
</div>
</body>
</html>
