<?php include "layouts/menu.php"; ?>    
  <!--  page-wrapper -->
         <div class="right_col" role="main">
       
            <div class="row">
                <div class="col-lg-12">
                    <!-- Form Elements -->
                    <div class="panel panel-default">
                        <div class="panel-heading">
                             Details
                        </div>
                        <div class="panel-body">
                            <div class="row">

									<div class="table-responsive">
   <table  class="table table-striped table-bordered"><thead>
										

					<font size="1">
						<tr class="danger" style="color:purple;">
						<th colspan="2"><font size="3">Particulars</font></th>
						
				
						<th><font size="3">Debit</font></th> <th><font size="3">Credit</font></th>
						
						</tr></thead> <tbody>
									
									<?php $e=0;  $s=0;  $r=0;  $t=0; $d=0; $d1=0; $i=1;
										$fdate =  date("Y-m-d", strtotime("2018-04-01")); 
										$tdate =  date("Y-m-d", strtotime("2019-03-31"));



//Capital Account Part
$sql11=mysqli_query($conn, "select sum(openbal) from ledger where mfin='$mfin' &&  under='Capital Account' && yn='Cr'");
$rrr11 = mysqli_fetch_array($sql11);
$cpp1 = $rrr11[0];

$sql1=mysqli_query($conn, "select sum(openbal) from ledger where mfin='$mfin' &&  under='Capital Account' && yn='Dr'");
$rrr1 = mysqli_fetch_array($sql1);
$cpp2 = $rrr1[0];


$sqlu = mysqli_query($conn, "select * from ledger where under='Capital Account'");  $capvccdr =0; $capvcccr =0;
while($rowu = mysqli_fetch_array($sqlu)){
	$ledgername = $rowu['ledger'];
$openbal = $rowu['openbal'];	
$yn = $rowu['yn'];
$qrya145=mysqli_query($conn, "select sum(dr) from voucher where mfin='$mfin' && vtype='Payment' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowa145 = mysqli_fetch_array($qrya145);
$qryb145=mysqli_query($conn, "select sum(cr) from voucher where mfin='$mfin' && vtype='Receipt' && par='$ledgername' && date between '$fdate' and '$tdate'");
$rowb145 = mysqli_fetch_array($qryb145);


$capvccdr = $rowa145[0];
$capvcccr = $rowb145[0];
$captot = $openbal - $capvccdr + $capvcccr;
?>
	<tr>
<td colspan="2"><font size="3"><b><?php echo  $ledgername ?></b></font></td>
<?php if($yn == 'Dr') { ?>
					<td><font size="3"><b><?php echo  $captot ?></b></font></td>
						<td><font size="3"></b></font></td>
<?php } else { ?>
<td><font size="3"></b></font></td>
<td><font size="3"><b><?php echo  $captot ?></b></font></td>
						
<?php } ?>
						
						</tr>
<?php
}

$cpp = $cpp1 - $cpp2 - $capvccdr + $capvcccr;
////	//Capital Account Part
						?></p>
						
			
						
						

					
					</tbody></table>	</form>
					
</div>
</div></div>
</div></div></div><footer>
          <div class="pull-right">
             <a href="https://infossel.com">Infossel Soft Solution</a>
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="vendors/jquery/dist/jquery.min.js"></script>
    <!-- Bootstrap -->
    <script src="vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="vendors/nprogress/nprogress.js"></script>
    <!-- iCheck -->
    <script src="vendors/iCheck/icheck.min.js"></script>
    <!-- Datatables -->
    <script src="vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="vendors/datatables.net-scroller/js/dataTables.scroller.min.js"></script>
    <script src="vendors/jszip/dist/jszip.min.js"></script>
    <script src="vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="vendors/pdfmake/build/vfs_fonts.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="build/js/custom.min.js"></script>

  </body>
</html>