<?php 
include("../config.php");
$id       = $_POST['id'];
$lhc      = "SELECT * FROM `lhc_balance_history` WHERE `lhc_no` = '".$id."' AND branch_id = '".$_SESSION['branch_id']."' AND company_id = '".$_SESSION['company_id']."'";
$lhc_res  = mysqli_query($conn,$lhc);
?>
<table class="table table-bordered table-striped width100">
  <thead>
    <tr>
      <th width="10" class="text-center">SR.NO</th>
      <th width="50" class="text-center">LHC NO</th>
      <th width="50" class="text-center">PAYMENT DATE</th>
      <th width="50" class="text-center">LORRY HIRE</th>
      <th width="50" class="text-center">ADVANCE</th>
      <th width="50" class="text-center">PAID</th>
      <th width="50" class="text-center">DUE</th>
      <th width="10" class="text-center">ACTION</th>
    </tr>
    <?php 
    $cou = 1;
    while ($lhc_row = mysqli_fetch_assoc($lhc_res)) { ?>
    <tr align="center">
      <td><?php echo $cou++;?></td>
      <td><?php echo $lhc_row['lhc_no'];?></td>
      <td><?php echo risFormatDate($lhc_row['p_date'] ,'d-m-Y');?></td>
      <td><?php echo customFormatMoney($lhc_row['lorry_hire']);?></td>
      <td><?php echo customFormatMoney($lhc_row['adv_amnt']);?></td>
      <td><?php echo customFormatMoney($lhc_row['cash'] + $lhc_row['pay_mode_amnt']);?></td>
      <td><?php echo customFormatMoney($lhc_row['balance']);?></td>
      <td><button type="button" class="btn btn-warning" id="<?php echo $lhc_row["id"];?>" data-toggle="tooltip" data-placement="top" title="BALANCE PAYMENT PRINT..!!" onclick="BalancePrint(this);"><em class="fa fa-print"></em></button></td>
    </tr>
    <?php } ?>
  </thead>
</table>