-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpayment_report.php
More file actions
151 lines (149 loc) · 5.39 KB
/
payment_report.php
File metadata and controls
151 lines (149 loc) · 5.39 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
<?php include 'db_connect.php' ?>
<?php
$month_of = isset($_GET['month_of']) ? $_GET['month_of'] : date('Y-m');
?>
<style>
.on-print{
display: none;
}
</style>
<!-- Author Name: MH RONY.
GigHub Link: https://github.com/dev-mhrony
Facebook Link:https://www.facebook.com/dev.mhrony
Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
Visit My Website : developerrony.com
-->
<noscript>
<style>
.text-center{
text-align:center;
}
.text-right{
text-align:right;
}
table{
width: 100%;
border-collapse: collapse
}
tr,td,th{
border:1px solid black;
}
</style>
</noscript>
<div class="container-fluid">
<div class="col-lg-12 mt-5">
<marquee onMouseOver="this.stop()" onMouseOut="this.start()">For any software development or website designing work contact me at <a href="mailto:codecampbdofficial@gmail.com" >codecampbdofficial@gmail.com </a> Or Contact <a href="https://www.facebook.com/dev.mhrony/" target="_blank" >Facebook</a> </marquee>
<!-- Author Name: MH RONY.
GigHub Link: https://github.com/dev-mhrony
Facebook Link:https://www.facebook.com/dev.mhrony
Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
Visit My Website : developerrony.com
-->
<div class="card">
<div class="card-body">
<div class="col-md-12">
<form id="filter-report">
<div class="row form-group">
<label class="control-label col-md-2 offset-md-2 text-right">Month of: </label>
<input type="month" name="month_of" class='from-control col-md-4' value="<?php echo ($month_of) ?>">
<button class="btn btn-sm btn-block btn-primary col-md-2 ml-1">Filter</button>
</div>
</form>
<hr>
<div class="row">
<div class="col-md-12 mb-2">
<button class="btn btn-sm btn-block btn-success col-md-2 ml-1 float-right" type="button" id="print"><i class="fa fa-print"></i> Print</button>
</div>
</div>
<div id="report">
<div class="on-print">
<p><center>Rental Payments Report</center></p>
<p><center>for the Month of <b><?php echo date('F ,Y',strtotime($month_of.'-1')) ?></b></center></p>
</div>
<div class="row">
<table class="table table-bordered">
<thead>
<tr>
<th>#</th>
<th>Date</th>
<th>Tenant</th>
<th>House #</th>
<th>Invoice</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$tamount = 0;
$payments = $conn->query("SELECT p.*,concat(t.lastname,', ',t.firstname,' ',t.middlename) as name,h.house_no FROM payments p inner join tenants t on t.id = p.tenant_id inner join houses h on h.id = t.house_id where date_format(p.date_created,'%Y-%m') = '$month_of' order by unix_timestamp(date_created) asc");
if($payments->num_rows > 0 ):
while($row=$payments->fetch_assoc()):
$tamount += $row['amount'];
?>
<tr>
<td><?php echo $i++ ?></td>
<td><?php echo date('M d,Y',strtotime($row['date_created'])) ?></td>
<td><?php echo ucwords($row['name']) ?></td>
<td><?php echo $row['house_no'] ?></td>
<td><?php echo $row['invoice'] ?></td>
<td class="text-right"><?php echo number_format($row['amount'],2) ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<th colspan="6"><center>No Data.</center></th>
</tr>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th colspan="5">Total Amount</th>
<th class='text-right'><?php echo number_format($tamount,2) ?></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Author Name: MH RONY.
GigHub Link: https://github.com/dev-mhrony
Facebook Link:https://www.facebook.com/dev.mhrony
Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
Visit My Website : developerrony.com
-->
<script>
$('#print').click(function(){
var _style = $('noscript').clone()
var _content = $('#report').clone()
var nw = window.open("","_blank","width=800,height=700");
nw.document.write(_style.html())
nw.document.write(_content.html())
nw.document.close()
nw.print()
setTimeout(function(){
nw.close()
},500)
})
$('#filter-report').submit(function(e){
e.preventDefault()
location.href = 'index.php?page=payment_report&'+$(this).serialize()
})
</script>
<!-- Author Name: MH RONY.
GigHub Link: https://github.com/dev-mhrony
Facebook Link:https://www.facebook.com/dev.mhrony
Youtube Link: https://www.youtube.com/channel/UChYhUxkwDNialcxj-OFRcDw
for any PHP, Laravel, Python, Dart, Flutter work contact me at developer.mhrony@gmail.com
Visit My Website : developerrony.com
-->
<footer class="footer d-flex flex-column flex-md-row align-items-center justify-content-between px-4 py-3 border-top small">
<p class="text-muted mb-1 mb-md-0">Copyright © 2024 Tenant Management System Software - Design and Develop By <a href="https://www.facebook.com/dev.mhrony/" target="_blank"> MH RONY </a> </p>
</footer>