
						<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">
									<thead>
										<tr>
											<td colspan="9"><b>Deposit Payment (Payment on 2024 and below)</b></td>
										</tr>
										<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>Receipt No</b></td>
											<td rowspan="2" align="center"><b>Date Paid</b></td>
											<td align = "center" colspan="3"><b>Deposit Payment Details</b></td>
											<td rowspan="2" valign="middle" align="center"><b>Total (RM)</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>
									</thead>
									
									<?PHP
									$no = 1;
									$total2monthRental = 0;
									$totalUtilities = 0;
									$totalMgtFree = 0;
									$totalAllDeposit = 0;
									while($resultDeposit_oldRecord = mysqli_fetch_array($runDeposit_oldRecord)){
										
										$tenant_name = $resultDeposit_oldRecord["tenant_name"];
										$unit_no = $resultDeposit_oldRecord["unit_no"];
										$receipt_no = $resultDeposit_oldRecord["receipt_no"];
										$one_month_rental = $resultDeposit_oldRecord["one_month_rental"];
										$one_month_date = $resultDeposit_oldRecord["one_month_date"];
										$two_month_rental = $resultDeposit_oldRecord["two_month_rental"];
										$utilities = $resultDeposit_oldRecord["utilities"];
										$management_fee = $resultDeposit_oldRecord["management_fee"];
										$total_deposit = $resultDeposit_oldRecord["total_deposit"];
										$created_at = $resultDeposit_oldRecord["created_at"];
										$deposit_id = $resultDeposit_oldRecord["id"];
										$tenant_id = $resultDeposit_oldRecord["tenant_id"];
										$total_deposit = $two_month_rental + $utilities + $management_fee;
									?>
									<tbody>
										<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>
									</tbody>
								</table>
								<br/>
								<table class="table table-bordered table-hover table-sm" id="dataTable" width="70%" cellspacing="0" style="font-size: 12px">
									<thead>
										<tr>
											<td colspan="9"><b>Deposit Payment (Payment on 2024 onwards)</b></td>
										</tr>
										<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>Receipt No</b></td>
											<td rowspan="2" align = "center" ><b>Date Paid</b></td>
											<td colspan="2" align="center"><b>Deposit Payment Info</b></td>
											<td rowspan="2" align="center"><b>Total (RM)</b></td>
											<td rowspan="2" align="center"><b>Invoice No.</b></td>
											
										</tr>
										<tr>
											<td align="center"><b>Two Month Rental (RM)</b></td>
											<td align="center"><b>Utilities (RM)</b></td>
										</tr>
									</thead>
									<?PHP
									$no = 1;
									$total2monthRental_paid = 0;
									$totalUtilities_paid = 0;
									$totalAllDeposit = 0;
									while($resultDeposit_newRecord = mysqli_fetch_array($runDeposit_newRecord)){
										$deposit_id = $resultDeposit_newRecord["deposit_id"];
										$receipt_no = $resultDeposit_newRecord["receipt_no"];
										$two_months_amount_paid = $resultDeposit_newRecord["two_months_amount_paid"];
										$utility_amount_paid = $resultDeposit_newRecord["utility_amount_paid"];
										$created_at = $resultDeposit_newRecord["created_at"];
										$tenant_name = $resultDeposit_newRecord["tenant_name"];
										$unit_no = $resultDeposit_newRecord["unit_no"];
										$tenant_id = $resultDeposit_newRecord["tenant_id"];
										$deposit_bill_no = $resultDeposit_newRecord["deposit_bill_no"];
										$total_deposit = $two_months_amount_paid + $utility_amount_paid ;
									?>
									<tbody>
										<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_months_amount_paid; ?></td>
											<td align="right"><?php echo $utility_amount_paid; ?></td>
											<td align="right"><?php echo number_format($total_deposit,2,".",","); ?></td>
											<td align="right"><?php echo $deposit_bill_no; ?></td>
										
									<?php 
										$total2monthRental_paid += $two_months_amount_paid;
										$totalUtilities_paid += $utility_amount_paid;
										$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_paid,2,".",",")?></b></th>
											<td  align="right"><b><?php echo number_format($totalUtilities_paid,2,".",",")?></b></th>
											<td  align="right"><b><?php echo number_format($totalAllDeposit,2,".",",")?></b></th>
											<td  align="right">&nbsp;</th>
										</tr>
									</tbody>
								</table>
								<br/>
								<table class="table table-bordered table-hover table-sm" id="dataTable" width="70%" cellspacing="0" style="font-size: 12px">
									<thead>
										<tr>
											<td colspan="10"><b>Others Payment (Pelbagai)</b></td>
										</tr>
										<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>Receipt No</b></td>
											<td rowspan="2" align = "center" ><b>Date Paid</b></td>
											<td colspan="3" align="center"><b>Others Payment Info</b></td>
											<td rowspan="2" align="center"><b>Total (RM)</b></td>
											<td rowspan="2" align="center"><b>Invoice No.</b></td>
											
										</tr>
										<tr>
											<td align="center"><b>Yuran Pelbagai (RM)</b></td>
											<td align="center"><b>SST (RM)</b></td>
											<td align="center"><b>Stamping (RM)</b></td>
										</tr>
									</thead>
									<?PHP
									$no = 1;
									$total2monthRental_paid = 0;
									$totalUtilities_paid = 0;
									$totalAllDeposit = 0;
									while($resultDepositPaymentOthers = mysqli_fetch_array($runDepositPaymentOthers)){
										$deposit_id = $resultDepositPaymentOthers["deposit_id"];
										$receipt_no = $resultDepositPaymentOthers["receipt_no"];
										$yp_paid = $resultDepositPaymentOthers["yp_paid"];
										$sst_paid  = $resultDepositPaymentOthers["sst_paid"];
										$stamping_paid  = $resultDepositPaymentOthers["stamping_paid"];
										$tenant_name = $resultDepositPaymentOthers["tenant_name"];
										$unit_no = $resultDepositPaymentOthers["unit_no"];
										$tenant_id = $resultDepositPaymentOthers["tenant_id"];
										$deposit_other_bill_no = $resultDepositPaymentOthers["deposit_other_bill_no"];
										$deposit_bill_id = $resultDepositPaymentOthers["deposit_bill_id"];
										$created_at = $resultDepositPaymentOthers["created_at"];
										$total_deposit = $yp_paid + $sst_paid + $stamping_paid;
									?>
									<tbody>
										<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 $yp_paid; ?></td>
											<td align="right"><?php echo $sst_paid; ?></td>
											<td align="right"><?php echo $stamping_paid; ?></td>
											<td align="right"><?php echo number_format($total_deposit,2,".",","); ?></td>
											<td align="right"><?php echo $deposit_other_bill_no; ?></td>
										
									<?php 
										$yp_paid_total += $yp_paid;
										$sst_paid_total += $sst_paid;
										$stamping_paid_total += $stamping_paid;
										$totalAllDepositOthers += $total_deposit;
										$no++;
									
									} ?>
										</tr>
										<tr>
											<td colspan="5"><b><?php echo "TOTAL (RM)"?></b></th>
											<td align="right" ><b><?php echo number_format($yp_paid_total,2,".",",")?></b></th>
											<td  align="right"><b><?php echo number_format($sst_paid_total,2,".",",")?></b></th>
											<td  align="right"><b><?php echo number_format($stamping_paid_total,2,".",",")?></b></th>
											<td  align="right"><b><?php echo number_format($totalAllDepositOthers,2,".",",")?></b></th>
											<td  align="right">&nbsp;</th>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					