
						<div class="card-body">
							<div class="table-responsive">
								<table class="table table-bordered table-hover table-sm" id="dataTable" width="70%" cellspacing="0" style="font-size: 12px">
									<tr >
										<td valign="middle" align="center" rowspan="2"><b>#</b></td>
										<td valign="middle" align="center" rowspan="2"><b>Tenant Name</b></td>
										<td valign="middle" align="center" rowspan="2"><b>Unit No</b></td>
										<td rowspan="2" align="center"><b>Invoice No</b></td>
										<td rowspan="2" align="center"><b>Month/Year</b></td>
										<td align = "center" colspan="3"><b>Deposit Details</b></td>
										<td rowspan="2" valign="middle" align="center"><b>Total (RM)</b></td>
										<td align = "center" rowspan="2"><b>Status</b></td>
									</tr>
									<tr>
										<td align="center"><b>Two Month Rental (RM)</b></td>
										<td align="center"><b>Utilities (RM)</b></td>
										<td align="center"><b>Management Fee (RM)</b></td>
									</tr>
									
									<?PHP
									$no = 1;
									$total2monthRental = 0;
									$totalUtilities = 0;
									$totalMgtFree = 0;
									$totalAllDeposit = 0;
									while($resultDeposit = mysqli_fetch_array($runDeposit)){
										
										$tenant_name = $resultDeposit["tenant_name"];
										$unit_no = $resultDeposit["unit_no"];
										$receipt_no = $resultDeposit["receipt_no"];
										$one_month_rental = $resultDeposit["one_month_rental"];
										$one_month_date = $resultDeposit["one_month_date"];
										$two_month_rental = $resultDeposit["two_month_rental"];
										$utilities = $resultDeposit["utilities"];
										$management_fee = $resultDeposit["management_fee"];
										$total_deposit = $resultDeposit["total_deposit"];
										$created_at = $resultDeposit["created_at"];
										$deposit_id = $resultDeposit["id"];
										$tenant_id = $resultDeposit["tenant_id"];
										$total_deposit = $two_month_rental + $utilities + $management_fee;
									?>
									<tr>
										<td><?php echo $no; ?></td>
										<td><a href="viewTenantDashboard.php?tenant_id=<?php echo $tenant_id?>"><?php echo strtoupper($tenant_name); ?></a></td>
										<td><?php echo $unit_no; ?></td>
										<td><a href="receipt/print.php?report_type=<?php echo $report_type?>&tenant_id=<?php echo $tenant_id?>&id=<?php echo $deposit_id?>"><?php echo $receipt_no; ?></a></td>
										<td><?php echo date("d/m/Y",strtotime($created_at)); ?></td>
										<td align="right"><?php echo $two_month_rental; ?></td>
										<td align="right"><?php echo $utilities; ?></td>
										<td align="right"><?php echo $management_fee; ?></td>
										<td align="right"><?php echo number_format($total_deposit,2,".",","); ?></td>
									<?php 
									$total2monthRental += $two_month_rental;
									$totalUtilities += $utilities;
									$totalMgtFree += $management_fee;
									
									$totalAllDeposit += $total_deposit;
									$no++;
									} 
									?>
									</tr>
									<tr>
										<td colspan="5"><b><?php echo "TOTAL (RM)"?></b></th>
										<td align="right" ><b><?php echo number_format($total2monthRental,2,".",",")?></b></th>
										<td  align="right"><b><?php echo number_format($totalUtilities,2,".",",")?></b></th>
										<td  align="right"><b><?php echo number_format($totalMgtFree,2,".",",")?></b></th>
										<td  align="right"><b><?php echo number_format($totalAllDeposit,2,".",",")?></b></th>
									</tr>
								</table>
							</div>
						</div>
					