Sprinthi
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html> <html> <head> <title>Edit Patient Information</title> <style> body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: #f2f2f2; margin: 0; padding: 0; } .container { width: 60%; margin: 50px auto; padding: 20px; background-color: #fff; box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.1); border-radius: 8px; } h2 { text-align: center; color: #333; } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; font-weight: bold; } .form-group input, .form-group textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; } .form-group input[disabled] { background-color: #e9ecef; } button { width: 100%; padding: 10px; background-color: #007bff; border: none; border-radius: 4px; color: #fff; font-size: 16px; cursor: pointer; } button:hover { background-color: #0056b3; } .message { margin-top: 20px; padding: 10px; border: 1px solid; border-radius: 4px; display: none; } .success { border-color: #28a745; color: #28a745; } .error { border-color: #dc3545; color: #dc3545; } </style> <script> function showMessage(type, message) { var messageDiv = document.getElementById("message"); messageDiv.className = "message " + type; messageDiv.innerHTML = message; messageDiv.style.display = "block"; } window.onload = function() {
var message = "<%= request.getAttribute("message") %>";
if (message) {
var type = message.startsWith("Error") ? "error" : "success";
showMessage(type, message);
}
};
</script>
</head>
<body>
<div class="container">
<h2>Edit Patient Information</h2>
<form action="EditPatientServlet" method="post">
<div class="form-group">
<label for="registrationNumber">Registration Number:</label>
<input type="text" id="registrationNumber" name="registrationNumber" value="${patient.registrationNumber}" disabled>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" id="email" name="email" value="${patient.email}">
</div>
<div class="form-group">
<label for="phone">Phone:</label>
<input type="text" id="phone" name="phone" value="${patient.phone}">
</div>
<div class="form-group">
<label for="notes">Notes:</label>
<textarea id="notes" name="notes" rows="4">${patient.notes}</textarea>
</div>
<button type="submit">Update</button>
</form>
<div id="message"></div>
</div>
</body>
</html>