-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfineManagement.jsp
More file actions
138 lines (122 loc) · 3.72 KB
/
fineManagement.jsp
File metadata and controls
138 lines (122 loc) · 3.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<%@ page import="com.library.fine.Fine" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>KL Library Management System - Fine Management</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
}
h1 {
font-size: 2.5em;
font-weight: bold;
color: #333;
text-align: center;
background-color: #007bff;
color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
width: 80%;
margin-bottom: 30px;
}
.form-container {
width: 300px;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: left;
}
.form-container p {
font-size: 1em;
color: #333;
margin: 10px 0;
}
.form-container label {
font-size: 0.9em;
color: #555;
display: inline-block;
margin-top: 10px;
}
.form-container input[type="checkbox"] {
margin-left: 5px;
vertical-align: middle;
}
.form-container button {
width: 100%;
padding: 10px;
margin-top: 15px;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
font-size: 1em;
cursor: pointer;
}
.form-container button:hover {
background-color: #0056b3;
}
.message {
font-size: 1em;
color: green;
margin-top: 15px;
text-align: center;
}
.message.error {
color: red;
}
</style>
</head>
<body>
<h1>Welcome to the KL Library Management System</h1>
<div class="form-container">
<h2>Fine Management</h2>
<%-- Retrieve the Fine object from the request --%>
<%
Fine fine = (Fine) request.getAttribute("fine");
%>
<%-- Check if the fine object is available --%>
<%
if (fine != null) {
%>
<p>User ID: <%= fine.getUserId() %></p>
<p>Total Fine: $<%= fine.getAmount() %></p>
<form method="post" action="manageFine">
<input type="hidden" name="fineId" value="<%= fine.getFineId() %>">
<label for="paid">Paid: </label>
<input type="checkbox" name="paid" value="true" <%= fine.isPaid() ? "checked" : "" %>><br><br>
<button type="submit">Update Fine Status</button>
</form>
<%
} else {
%>
<p>No fines found for this user.</p>
<%
}
%>
<%-- Display success or error messages --%>
<%
if (request.getParameter("success") != null) {
%>
<p class="message">Fine updated successfully!</p>
<%
} else if (request.getParameter("error") != null) {
%>
<p class="message error">Error updating fine!</p>
<%
}
%>
</div>
</body>
</html>