<?php 
session_start();
ob_start(); 
include "header.php";
//$objIms->Semifinisheditem_alter();
?>
<script type="text/javascript">

window.addEventListener("keyup", function(e){ if(e.keyCode == 27) history.back(); }, false);

</script>
<style type="text/css">
    
        tr:hover {background-color:#bcd1cd;}

</style>
      <div class="page-wrapper">
            <!-- Container fluid  -->
            <div class="container-fluid">
                <!-- Start Page Content -->
                <div class="row">
                    <div class="col-12">
                        <div class="card">
                            <div class="card-body" id="printableArea">
 

<form method="post">
        <div class="panel" >
            <div class="panel-heading" style="font-style: bold"><h3>Group Summary</h3></div>
                <p>&nbsp;</p>
                
                    <table width="100%" class="table table-bordered">
                     <tr height="32" align="left">
                        <th nowrap="nowrap" width="50%" rowspan="2">Particular</th>
                        <th nowrap="nowrap" width="17%" colspan="2" style="text-align: center;">Closing Balance</th>
                    </tr>
                    <tr>
                        
                        <th nowrap="nowrap" width="25%" colspan="1">Debit(Amount)</th>
                        <th nowrap="nowrap" width="50%" colspan="1">Credit(Amount)</th>
                    </tr>
<?php                    
    $sql_pur="SELECT sum(credit) as credit, sum(debit) as debit from tbl_bank where session_login_id = '".$_SESSION['login_id']."'";
    $res_pur=mysql_query($sql_pur);
    $coun=mysql_fetch_assoc($res_pur);
    $credit1=$coun["credit"];  
	$debit_a=$coun["debit"];
// after that we subtract those amount from bank
   /*$sql_bank="SELECT sum(debit) as debit from tbl_bank";
    $res_bank=mysql_query($sql_bank);
    $row=mysql_fetch_assoc($res_bank);
    $debit_a=$row["debit"];*/
$tot=$debit_a-$credit1;

?>    
                    <tr height="32" class='clickable-row' data-href='tri_cur_a_bankdet.php'>
                        <td nowrap="nowrap" width="6%">Bank</td>
                        <td nowrap="nowrap" width="6%"><?php echo $tot; ?></td>
                        <td nowrap="nowrap" width="6%"></td>
                    </tr>
                    



</table>
<br><br><br><br>
            <table class="table">
                    <tr height="32">
                        <td nowrap="nowrap" width="8%" style="font-weight: bold">Grand Total</td>
                        <td nowrap="nowrap" width="1%"><?php echo  $tot; ?></td>
                        <td nowrap="nowrap" width="6%"></td>
                    </tr>
                </table
></div>
</form>
                                         </div>
                        </div>
                    </div>
                </div>
                <!-- End PAge Content -->
            </div>
            <!-- End Container fluid  -->
      </div>
      
      </div>
 <?php include 'footer.php' ?>
 <script src="../js/lib/datatables/datatables.min.js"></script>
    <script src="../js/lib/datatables/cdn.datatables.net/buttons/1.2.2/js/dataTables.buttons.min.js"></script>
    <script src="../js/lib/datatables/cdn.datatables.net/buttons/1.2.2/js/buttons.flash.min.js"></script>
    <script src="../js/lib/datatables/cdnjs.cloudflare.com/ajax/libs/jszip/2.5.0/jszip.min.js"></script>
    <script src="../js/lib/datatables/cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/pdfmake.min.js"></script>
    <script src="../js/lib/datatables/cdn.rawgit.com/bpampuch/pdfmake/0.1.18/build/vfs_fonts.js"></script>
    <script src="../js/lib/datatables/cdn.datatables.net/buttons/1.2.2/js/buttons.html5.min.js"></script>
    <script src="../js/lib/datatables/cdn.datatables.net/buttons/1.2.2/js/buttons.print.min.js"></script>
    <script src="../js/lib/datatables/datatables-init.js"></script>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
    $(".clickable-row").click(function() {
        window.location = $(this).data("href");
    });
});
</script>