-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_records.php
More file actions
247 lines (207 loc) · 7.34 KB
/
view_records.php
File metadata and controls
247 lines (207 loc) · 7.34 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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
<?php
$conn = mysqli_connect("localhost","root","","project");
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Management System</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f5f7fa;
padding: 20px;
background-image: url(library_blur.jpg);
}
.container {
display: flex;
max-width: 1200px;
margin: 0 auto;
gap: 30px;
height: 570px;
}
.form-section {
flex: 1;
background-color: rgb(254, 254, 253);
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 25px;
height: fit-content;
}
.table-section {
flex: 2;
background-color: rgb(254, 253, 253);
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
padding: 25px;
}
h1 {
font-size: 24px;
color: #2c3e50;
margin-bottom: 20px;
border-bottom: 2px solid #eee;
padding-bottom: 10px;
}
h2 {
font-size: 20px;
color: #34495e;
margin: 15px 0 10px;
}
h3 {
font-size: 16px;
color: #7f8c8d;
margin: 12px 0 8px;
}
h4 {
font-size: 14px;
color: #95a5a6;
margin: 10px 0 6px;
}
.input-field {
width: 100%;
padding: 10px 12px;
margin-bottom: 15px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 14px;
}
.button-group {
margin: 20px 0;
display: flex;
gap: 10px;
}
.btn {
padding: 8px 16px;
border: none;
border-radius: 4px;
font-weight: 600;
cursor: pointer;
font-size: 14px;
transition: background-color 0.3s;
}
.btn-add {
background-color: #589f96;
color: white;
}
.btn-add:hover {
background-color: #69938e;
}
.btn-update {
background-color: #2980b9;
color: white;
}
.btn-update:hover {
background-color: #2472a4;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
th, td {
padding: 12px 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background-color: #2c3e50;
color: white;
font-weight: 600;
}
tr:hover {
background-color: #f5f5f5;
}
.divider {
border-top: 1px solid #eee;
margin: 20px 0;
}
.book-info {
margin-top: 20px;
}
.book-info p {
font-weight: bold;
margin: 8px 0;
font-size: 14px;
}
</style>
</head>
<body>
<div class="table-section" >
<h1 style="text-align: center;">View Records</h1>
<!-- <button><div style="height: 30px; width:150px; background-color: #2c3e50; text-align:center;font-size:20px;"><a href="book_insert.php" style="text-decoration: none; color:white;">Insert Book</a></div></button> -->
<div style="width:60px;height:30px;border:2px solid black;background-color: #2c3e50;text-align:center; margin-left:1385px;font-size:20px; position:relative; top:-30px;"><a href="homepage.php" style="text-decoration: none;color:black;"><span style="color: white;">Back</span></a></div>
<table id="bookTable" style="margin-top:-20px">
<thead>
<tr>
<th>Issue ID</th>
<th>Book ID</th>
<th>Student ID</th>
<th>Issue Date</th>
<th>Due Date</th>
<th>Return Date</th>
<th>Status</th>
<th>Approval</th>
<th>Approval</th>
<th>Return book</th>
</tr>
</thead>
<tbody>
<?php
$sql="select * from issue_books";
$result=mysqli_query($conn,$sql);
if($result)
{
while($row=mysqli_fetch_assoc($result))
{
$id=$row['b_id'];
$s_id=$row['s_id'];
$issue_data=$row['issue_date'];
$due_date=$row['due_date'];
$return_date=$row['return_date'];
$status=$row['status'];
$issue_id=$row['issue_id'];
?>
<tr>
<td><?php echo "$issue_id"; ?></td>
<td><?php echo "$id"; ?></td>
<td><?php echo "$s_id"; ?></td>
<td><?php echo "$issue_data"; ?></td>
<td><?php echo "$due_date"; ?></td>
<td><?php echo "$return_date"; ?></td>
<td><?php echo "$status"; ?></td>
<?php if($status == "-----") { ?>
<td><a href="book_approval.php?ap_id=<?php echo $issue_id; ?>" style="color: green; text-decoration: none;"><b>ACCEPT</b></a></td>
<td><a href="book_decline.php?v_id=<?php echo $issue_id; ?>" style="color: red;text-decoration: none;"><b>DECLINE</b></a></td>
<td>-----</td>
<?php }
else if($status=="Approved") {?>
<td>-----</td>
<td>-----</td>
<td><a href="return_book.php?cid=<?php echo $issue_id; ?>" style="color: green;text-decoration: none;"><b>Return</b></a></td>
<?php }
else{?>
<td>-----</td>
<td>-----</td>
<td>-----</td>
<?php }
?>
</tr>
<?php
}
}
?>
</tbody>
</table>
</div>
</div>
</body>
</html>