-
Notifications
You must be signed in to change notification settings - Fork 0
/
printlevy.php
198 lines (175 loc) · 6.9 KB
/
printlevy.php
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
<?php
require 'includes/conn.php';
if (!isset($_SESSION['member'])) {
header('Location:index.php');
}
$member = mysqli_real_escape_string($con, $_SESSION['member']);
$get = mysqli_query($con, "SELECT * FROM members WHERE id = '".$member."'");
if(mysqli_num_rows($get)){
while ($mem = mysqli_fetch_assoc($get)) {
$pass = $mem['password'];
$title = $mem['title'];
$fname = $mem['fname'];
$sname = $mem['sname'];
$oname = $mem['oname'];
$dob = $mem['dob'];
$ms = $mem['marital_status'];
$village = $mem['village'];
$la = $mem['lagos_address'];
$email = $mem['email'];
$phone = $mem['phone'];
$wn = $mem['wa_number'];
$id = $mem['id'];
if ($mem['challenge'] == "") {
$challenge = "NONE";
}
$username = $mem['username'];
$yoe = $mem['yoe'];
$gn = $mem['group_no'];
$mn = $mem['mem_number'];
$chkgroup = mysqli_query($con, "SELECT * FROM groups WHERE id = '".$gn."'");
while ($g = mysqli_fetch_assoc($chkgroup)) {
$gname = $g['name'];
}
}
}else{
header("Location:index.php");
}
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
$url = "https://";
}else{
$url = "http://";
}
$url.= $_SERVER['HTTP_HOST'];
$url.= $_SERVER['REQUEST_URI'];
$report = mysqli_real_escape_string($con, $_GET['report']);
$in = mysqli_query($con, "INSERT INTO print_log VALUES('', '".$report."')");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Ichida Progress Union | Paid Levies</title>
<meta name="description" content="">
<meta name="author" content="">
<?php
require 'includes/header.php';
?>
<!-- Custom fonts for this template-->
</head>
<body>
<!-- Page Wrapper -->
<div id="wrapper">
<!-- Sidebar -->
<?php
require 'includes/sidebar.php';
?>
<!-- End of Sidebar -->
<!-- Content Wrapper -->
<div id="content-wrapper" class="d-flex flex-column">
<!-- Main Content -->
<div id="content">
<!-- Topbar -->
<?php
require 'includes/topbar.php';
?>
<!-- End of Topbar -->
<!-- Begin Page Content -->
<div class="container-fluid">
<div id="box">
<!-- Page Heading -->
<h1> <img src="images/header.jpg" alt="header" style="width:100%;height:150px;"></h1>
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary"><?php echo $title." ".$fname." ".$oname." ".$sname;?> PAID LEVIES</h6>
</div>
<div class="card-body">
<div class="table-responsive">
<?php
$checklevy = mysqli_query($con, "SELECT * FROM levy WHERE member_id = '".$id."' AND paid = true");
$i = 1;
if (mysqli_num_rows($checklevy)) {
echo "<table class='table is-fullwidth is-striped' id='dataTable' width='100%' cellspacing='0'>";
echo "<thead>";
echo "<tr>";
echo "<th>No</th>";
echo "<th>Levy Name</th>";
echo "<th>Category</th>";
echo "<th>Amount</th>";
echo "<th>Date Paid</th>";
echo "</tr>";
echo "</thead>";
echo "<tfoot>";
echo "<tr>";
echo "<th>No</th>";
echo "<th>Levy Name</th>";
echo "<th>Category</th>";
echo "<th>Amount</th>";
echo "<th>Date Paid</th>";
echo "</tr>";
echo "</tfoot>";
echo "<tbody>";
while ($l = mysqli_fetch_assoc($checklevy)) {
$lid = $l['id'];
$lname = $l['name'];
$lcat = $l['category'];
$lamount = $l['amount'];
$lmid = $l['member_id'];
$lpaid = $l['paid'];
$ldate = $l['date'];
$getcatname = mysqli_query($con, "SELECT * FROM levy_categories WHERE id = '".$lcat."'");
while ($gc = mysqli_fetch_assoc($getcatname)) {
$cname = $gc['name'];
}
echo "<tr>";
echo "<td>".$i."</td>";
echo "<td>".$lname."</td>";
echo "<td>".$cname."</td>";
echo "<td>₦".$lamount."</td>";
echo "<td>".$ldate."</td>";
echo "</tr>";
$i++;
}
echo "</tbody>";
echo "</table>";
} else {
echo "This member has not paid any levy yet";
}
?>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
<p class="text-center"><input type="button" class="btn btn-primary" onclick="printDiv('box')" value="Print" /></p>
</div></div>
<!-- End of Main Content -->
<!-- Footer -->
<footer class="sticky-footer bg-white">
<div class="container my-auto">
<div class="copyright text-center my-auto">
<span>Copyright © IPU 2019</span>
</div>
</div>
</footer>
<!-- End of Footer -->
</div>
<!-- End of Content Wrapper -->
</div>
<!-- End of Page Wrapper -->
<!-- Scroll to Top Button-->
<a class="scroll-to-top rounded" href="#page-top">
<i class="fas fa-angle-up"></i>
</a>
<!-- Logout Modal-->
<?php
require 'includes/logoutmodal.php';
?>
<!-- Bootstrap core JavaScript-->
<?php
require 'includes/scripts.php';
?>
</body>
</html>