-
Notifications
You must be signed in to change notification settings - Fork 0
/
Customer_Rent_Detail.php
236 lines (188 loc) · 8.46 KB
/
Customer_Rent_Detail.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
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
<?php include 'header.php';
$searchTemp=get('srch-normal');
$getdatenotyetpay=get('datanotyetpay');
$getdatepayTo=get('dateyetpayto');
?>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="./css/jquery.datetimepicker.css"/>
</head>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<?php include 'nav.php';?>
<!-- Left side column. contains the logo and sidebar -->
<?php include 'menu.php';?>
<!-- Right side column. Contains the navbar and content of the page -->
<aside class="right-side">
<!-- Content Header (Page header) -->
<section class="content-header">
<h1>
Customer History
</h1>
</section>
<!-- Main content -->
<!-- title row -->
<div class="row">
<div class="col-xs-12">
</div><!-- /.col -->
</div>
<div class="row">
</div><!-- /.row -->
<!-- Table row -->
<div class="panel-body">
<div class="dataTable_wrapper">
<div class="row">
<div class="col-xs-12 table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th colspan="12">
<div class="col-md-12">
<form class="row-fluid">
<div class=" col-md-8 pull-left" >
<div class="form-group">
<input type="text" id="btnDate" name="datanotyetpay" class="inline form-control col-md-1" <?php
if($getdatenotyetpay!=""){
echo 'value="'.$getdatenotyetpay.'"';
}
else{
$datenow=date("Y-m"); echo 'value="'.$datenow.'"';
$getdatenotyetpay=date("Y-m");
}?>/>
<input type="text" id="btnDateTo" name="dateyetpayto" class="inline form-control col-md-1" <?php
if($getdatepayTo!=""){
echo 'value="'.$getdatepayTo.'"';
}
else{
$datenow=date("Y-m"); echo 'value="'.$datenow.'"';
$getdatepayTo=date("Y-m");
}?>/>
<div class="col-md-4 pull-right input-group">
<div class="input-group-btn">
<input type="text" class="form-control" placeholder="Search" name="srch-normal" id="search.php?dnsname=name&srch-term" <?php echo 'value="'.$searchTemp.'"'?>/>
<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
</div>
</div>
</div>
</form>
</th>
</tr>
</thead>
<thead>
<tr style="background-color:#4682B4; color:white;">
<th>No</th>
<th>RentItem</th>
<th>Customer</th>
<th>PayDay</th>
<th>Real PayDay</th>
<th>Price</th>
<th>Electric</th>
<th>Water</th>
<th>Garbage</th>
<th>Other</th>
<th>Total</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
$db->disconnect();
$db->connect();
$TotalAll="";
// $txtsrch = get('srch-normal');
if($getdatenotyetpay!="" && $getdatepayTo!=""){
$getdatenotyetpays=$getdatenotyetpay."-01";
$getdatepayTos=$getdatepayTo."-01";
$_slide1 = $db->query("CALL sp_Customer_Rent_Payment_Detail('".$searchTemp."','".$getdatenotyetpay."','".$getdatepayTos."','".$getComIDUser."')");
}
else{
$datenows=$datenow."-01";
$_slide1 = $db->query("CALL sp_Customer_Rent_Payment_Detail('".$searchTemp."','".$datenows."','".$datenows."','".$getComIDUser."')");
}
$numrow=$db->dbCountRows($_slide1);
$i = 1;
if($numrow>0)
{ $TotalAll=0;
while($row=$db->fetch($_slide1)){
$id=$row->Customer_RentID;
$UserID=$row->UserID;
$RentItemID=$row->RentItemID;
$ItemName = $row->ItemName;
$CustomerID=$row->CustomerID;
$CusName=$row->fullName;
$OldPayDate = $row->PayDate;
$RealPayDate= $row->RealPayDate;
$Price=$row->Price;
$Electric = $row->Electric;
$Water = $row->Water;
$garbage = $row->garbage;
$Other = $row->Other;
$TotalPay = $row->TotalPay;
$TotalAll=$TotalAll+ $TotalPay;
echo '<tr class="gradeA">
<td>'.$i++.'</td>
<td>'.$ItemName.'</td>
<td>'.$CusName.'</td>
<td>'.$OldPayDate.'</td>
<td>'.$RealPayDate.'</td>
<td>'.$Price.'$</td>
<td>'.$Electric.'$</td>
<td>'.$Water.'$</td>
<td>'.$garbage.'$</td>
<td>'.$Other.'$</td>
<td>'.$TotalPay.'$</td>
<td>
<a class="iframe" onclick=\'return confirm("Do you want to delete?");\' href="Customer_Delect.php?id='.$id.'&Customer_Name='.$CusName.'">
<button class="btn btn-sm btn-danger" name="btnDelete" type="submit">
<i class="glyphicon glyphicon-remove"></i>
Delete
</button>
</a>
</td>
</tr>';
}
}
else
echo'<tr><td colspan="12"><font color =Red>No Record Found.</font></td></tr>';
?>
<tr>
<td class="text-right" colspan="11">Total</td>
<td><?php echo $TotalAll."$" ?></td>
</tr>
</tbody>
</table>
</div><!-- /.col -->
</div><!-- /.row -->
<div class="row">
<!-- accepted payments column -->
<!-- this row will not appear when printing -->
<div class="row no-print">
<div class="col-xs-12">
<button class="btn btn-primary pull-right" onClick="window.print();"><i class="fa fa-print"></i> Print</button>
</div>
</div>
</div>
</div>
</aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<!-- add new calendar event modal -->
</body>
<script src="./js/jquery.js"></script>
<script src="./js/jquery.datetimepicker.js"></script>
<script>
// ** show date and time picker
$('#btnDate').datetimepicker({
timepicker: false, //visible time = false
format: 'Y-m',
step: 10
});
$('#btnDateTo').datetimepicker({
timepicker: false, //visible time = false
format: 'Y-m',
step: 10
});
btnDateTo
$('#btnDate').click({
});
</script>
<?php include 'footer.php';?>