-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfee_payments.php
More file actions
163 lines (144 loc) · 4.41 KB
/
fee_payments.php
File metadata and controls
163 lines (144 loc) · 4.41 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
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['fname']) || !isset($_SESSION['lname'])) {
// Redirect to login if session variables are not set
header("Location: login.php");
exit();
}
// Database connection (adjust your username and password accordingly)
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "erp";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
// Retrieve fee submission data
$sql = "SELECT * FROM fee_submission";
$result = $conn->query($sql);
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fee Submission Records</title>
<style>
/* General Styling */
body {
font-family: 'Segoe UI', Tahoma, sans-serif;
background: url("fee_info.png");
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
color: #333;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
/* Card Container */
.container {
background: rgba(255, 255, 255, 0.95);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
border-radius: 12px;
padding: 30px;
max-width: 800px;
width: 90%;
text-align: left;
}
/* Title Styling */
h1 {
font-size: 30px;
color: #1e73be;
text-align: center;
margin-bottom: 20px;
text-shadow: 1px 1px 3px rgba(255, 255, 255, 0.8);
}
h2 {
font-size: 22px;
color: #444;
margin-bottom: 20px;
text-align: center;
}
/* Table Styling */
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid #ccc;
border-radius: 8px;
}
th, td {
padding: 12px;
text-align: left;
}
th {
background-color: #f0f8ff;
color: #1e73be;
font-weight: bold;
}
td {
background-color: #fafafa;
color: #333;
}
tr:nth-child(even) td {
background-color: #f9f9f9;
}
tr:hover td {
background-color: #e3f2fd;
cursor: pointer;
}
/* Empty Data Styling */
.no-data {
text-align: center;
color: #777;
}
</style>
</head>
<body>
<div class="container">
<h1>Fee Submission Records</h1>
<h2>Welcome, <?php echo $_SESSION['fname'] . " " . $_SESSION['lname']; ?>!</h2>
<table>
<thead>
<tr>
<th>Parent Name</th>
<th>Fee Type</th>
<th>Installment</th>
<th>Amount (Rs.)</th>
<th>Payment Date</th>
</tr>
</thead>
<tbody>
<?php
// Check if there are any records
if ($result->num_rows > 0) {
// Output data for each row
while($row = $result->fetch_assoc()) {
echo "<tr>
<td>" . $row['fname'] . " " . $row['lname'] . "</td>
<td>" . ucfirst($row['fee_type']) . "</td>
<td>" . ucfirst($row['installment']) . "</td>
<td>" . $row['amount'] . "</td>
<td>" . $row['payment_date'] . "</td>
</tr>";
}
} else {
echo "<tr class='no-data'><td colspan='5'>No fee submissions found.</td></tr>";
}
?>
</tbody>
</table>
</div>
</body>
</html>