<%@ 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: #eeeaea; } 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: #f8f6f6; } p { margin: 5px 0; } </style> </head> <body> <h1>質量檢驗資訊</h1> <form method="post" action="processQualityInspection.jsp"> <label for="inspection_id">檢驗 ID</label> <input type="text" id="inspection_id" name="inspection_id" required> <label for="batch_id">產品批次 ID</label> <input type="text" id="batch_id" name="batch_id" required> <label for="inspection_date">檢驗日期</label> <input type="text" id="inspection_date" name="inspection_date" required> <label for="inspector_id">檢驗員 ID</label> <input type="text" id="inspector_id" name="inspector_id" required> <label for="defect_type">缺陷型別</label> <input type="text" id="defect_type" name="defect_type"> <label for="defect_description">缺陷描述</label> <input type="text" id="defect_description" name="defect_description"> <label for="judgment_result">檢驗判定結果</label> <select id="judgment_result" name="judgment_result"> <option value="合格">合格</option> <option value="不合格">不合格</option> </select> <label for="remarks">備註</label> <input type="text" id="remarks" name="remarks"> <button type="submit">提交</button> </form> <%-- 結果展示部分 --%> <% String inspectionId = request.getParameter("inspection_id"); String batchId = request.getParameter("batch_id"); String inspectionDate = request.getParameter("inspection_date"); String inspectorId = request.getParameter("inspector_id"); String defectType = request.getParameter("defect_type"); String defectDescription = request.getParameter("defect_description"); String judgmentResult = request.getParameter("judgment_result"); String remarks = request.getParameter("remarks"); if (inspectionId != null) { %> <div class="result-section"> <h2>輸入結果</h2> <p><strong>檢驗 ID:</strong> <%= inspectionId %></p> <p><strong>產品批次 ID:</strong> <%= batchId %></p> <p><strong>檢驗日期:</strong> <%= inspectionDate %></p> <p><strong>檢驗員 ID:</strong> <%= inspectorId %></p> <p><strong>缺陷型別:</strong> <%= defectType != null ? defectType : "無" %></p> <p><strong>缺陷描述:</strong> <%= defectDescription != null ? defectDescription : "無" %></p> <p><strong>檢驗判定結果:</strong> <%= judgmentResult %></p> <p><strong>備註:</strong> <%= remarks != null ? remarks : "無" %></p> </div> <% } %> </body> </html>