<%@ page import="java.util.List" %>
<%@ page import="pojo.User" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Vehicle" %>
<%@ page import="pojo.ParkingSpot" %>

<%@ 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; /* 鼠标悬停时文字颜色 */
    }
    .container1 {
      width: 50%;
      margin: 50px auto;
      background-color: #fff;
      padding: 20px;
      border-radius: 10px;
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
      margin-top: 1%;
    }


    h1 {
      text-align: center;
      color: #333;
    }

    form {
      display: flex;
      flex-direction: column;
    }

    label {
      margin-bottom: 8px;
      color: #555;
      /*text-align: center;*/
    }

    input[type="text"],
    input[type="number"],
    input[type="file"],
    textarea {
      width: calc(100% - 20px);
      padding: 10px;
      border: 1px solid #ccc;
      border-radius: 5px;
      margin-bottom: 15px;
    }

    input[type="submit"],
    .returnButton {
      padding: 10px 20px;
      border: none;
      border-radius: 5px;
      background-color: #4caf50;
      color: #fff;
      text-decoration: none;
      cursor: pointer;
      text-align: center;
    }

    input[type="submit"]:hover,
    .returnButton:hover {
      background-color: #45a049;
    }

    .returnButton {
      margin-top: 10px;
      background-color: #087dce;
    }


  </style>
</head>
<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">
    <div class="container1">
      <%
        int user_id= Integer.parseInt(request.getParameter("user_id"));
        int parking_spot_id= Integer.parseInt(request.getParameter("parking_spot_id"));
      %>
      <h1>修改用户信息</h1>
      <form action="<%=request.getContextPath()%>/main/admin/UpdateServlet?user_id=<%=user_id%>" method="post" accept-charset="UTF-8">
        <label for="user_id">用户ID:</label>
        <input type="text" id="user_id" name="user_id" value="<%=user_id%>" readonly>

        <label for="name">姓名:</label>
        <input type="text" id="name" name="name">

        <label for="telephone">手机号:</label>
        <input type="text" id="telephone" name="telephone">

        <label for="user_type">用户类型:</label>
        <input type="text" id="user_type" name="user_type">

        <label for="parking_spot_id">停车场ID:</label>
        <input type="text" id="parking_spot_id" name="parking_spot_id" value="<%=parking_spot_id%>" readonly>

        <label for="address">地址:</label>
        <input type="text" id="address" name="address">

        <label for="gender">性别:</label>
        <input type="text" id="gender" name="gender">

        <input type="submit" value="提交">
        <a href="<%=request.getContextPath()%>/main/admin/User" class="returnButton">返回</a>
      </form>

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