2024.9.24(周二)

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
  <title>合同信息</title>
  <style>
    /* 整体页面布局和样式 */
    body {
      font-family: Arial, sans-serif;
      background-color: #f4f4f4;
      background-image: url('img.jpg'); /* 添加背景图片 */
      background-size: cover; /* 使背景图片覆盖整个页面 */
      background-position: center; /* 背景图片居中 */
      background-repeat: no-repeat; /* 不重复背景图片 */
    }

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

    form {
      background-color: #fff;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      width: 400px;
      margin: 0 auto;
    }

    label {
      display: block;
      margin-bottom: 5px;
      font-weight: bold;
    }

    input[type="text"],
    input[type="number"],
    select {
      width: 100%;
      padding: 8px;
      margin-bottom: 15px;
      border: 1px solid #ccc;
      border-radius: 3px;
    }

    button {
      background-color: #007BFF;
      color: #fff;
      padding: 10px 15px;
      border: none;
      border-radius: 3px;
      cursor: pointer;
      display: block; /* Ensures button is a block element */
      margin: 0 auto; /* Centers the button */
    }

    button:hover {
      background-color: #0056b3;
    }

    /* 结果展示区域样式 */
    .result-section {
      margin-top: 20px;
      background-color: #fff;
      padding: 20px;
      border-radius: 5px;
      box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
      width: 400px;
      margin: 0 auto;
    }

    h2 {
      color: #f5f1f1;
    }

    p {
      margin: 5px 0;
    }
  </style>
</head>
<body>

<h1>合同信息</h1>
<form method="post" action="processContract.jsp">
  <label for="contract_id">合同编号</label>
  <input type="text" id="contract_id" name="contract_id" required>

  <label for="customer_id">客户编号</label>
  <input type="text" id="customer_id" name="customer_id" required>

  <label for="product_id">产品编号</label>
  <input type="text" id="product_id" name="product_id" required>

  <label for="contract_date">合同签订日期</label>
  <input type="text" id="contract_date" name="contract_date" required>

  <label for="delivery_date">交货日期</label>
  <input type="text" id="delivery_date" name="delivery_date" required>

  <label for="order_quantity">订单数量</label>
  <input type="number" id="order_quantity" name="order_quantity" value="0" required>

  <label for="remarks">备注信息</label>
  <input type="text" id="remarks" name="remarks">

  <button type="submit">提交</button>
</form>

<%-- 结果展示部分 --%>
<%
  String contractId = request.getParameter("contract_id");
  String customerId = request.getParameter("customer_id");
  String productId = request.getParameter("product_id");
  String contractDate = request.getParameter("contract_date");
  String deliveryDate = request.getParameter("delivery_date");
  String orderQuantity = request.getParameter("order_quantity");
  String remarks = request.getParameter("remarks");

  if (contractId != null) {
%>
<div class="result-section">
  <h2>输入结果</h2>
  <p><strong>合同编号:</strong> <%= contractId %></p>
  <p><strong>客户编号:</strong> <%= customerId %></p>
  <p><strong>产品编号:</strong> <%= productId %></p>
  <p><strong>合同签订日期:</strong> <%= contractDate %></p>
  <p><strong>交货日期:</strong> <%= deliveryDate %></p>
  <p><strong>订单数量:</strong> <%= orderQuantity %></p>
  <p><strong>备注信息:</strong> <%= remarks != null ? remarks : "无" %></p>
</div>
<%
  }
%>

</body>
</html>

 

posted @ 2024-09-30 10:46  记得关月亮  阅读(19)  评论(0)    收藏  举报