<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- <link rel="stylesheet" href="datatable/data.css"> -->
<script src="datatable/data.js" type="text/javascript"></script>
<!-- <script src="datatable/table.js" type="text/javascript"></script> -->
<!-- <script src="datatable/datatable.js"></script> -->
<!-- <link rel="stylesheet" href="datatable/data-boot.css"> -->
<style>
    #navbar
    {
        flex:15%;
        height:100%; 
        flex-direction:row;
        overflow:auto;
          
        
    }
    #content
    {
        flex:90%;
        overflow:auto;
    }
    #fullbody
    {
        display:flex;
        
         height:100%;         
    }
    @media (max-width: 800px) {
        #fullbody
    {
        display:flex;
        flex-wrap: wrap;
                 
    }
        #navbar,#content {
    flex: 100%;
  }
}
</style>
</head>
<body>
    <div id="fullbody"> 
<div id="navbar" class="bg-info"><?php include "navbar.php"?></div>
<div id="content">
    <!-- charts -->
    <div class="row">
    
    <p>&nbsp;</p>
    </div>
    <div class="row">
    
    <div class="col-sm-5">
    <h3 align="center">Sales</h3>
    <table class="tbl table table-bordered">
    <tbody>
    <?php
	
	$date=date("Y-m-d");
	Date: echo $date;
//echo date_format($date,"Y/m/d H:i:s");
	
	$sql_sales=mysqli_query($connect,"select modeof,sum(totalamount) as totalamt from second_transaction where status='' and date='$date' group by modeof");
	while($row_sales=mysqli_fetch_array($sql_sales))
	{
	?>
    <tr><th><?php echo $row_sales['modeof'];?></th><td align="right"><?php echo number_format($row_sales['totalamt'],2,'.','');?></td></tr>
    <?php
	}
	?>
    <?php
	$sql_driver=mysqli_query($connect,"select sum(driver_amount) as driver_amount from second_transaction where status='' and date='$date' ");
	while($row_bata=mysqli_fetch_array($sql_driver))
	{
	?>
    <tr><th>Driver Amount</th><td align="right"><?php echo number_format($row_bata['driver_amount'],2,'.','');?></td></tr>
    <?php
	}
	?>
    </tbody></table>
    </div>
    
    <div class="col-sm-5">
    
    <h3 align="center">Collection</h3>
    <br>
    <table class="tbl table table-bordered">
    <tbody>
    
    <?php
	
	$sql_collection=mysqli_query($connect,"select sum(amount) as cash,sum(otheramount) as Bank from creditdetails where status='' and date='$date' ");
	while($row_collection=mysqli_fetch_array($sql_collection))
	{
	?>
    <tr><th>CASH</th><td align="right"><?php echo number_format($row_collection['cash'],2,'.','');?></td></tr>
    <tr><th>To BANK</th><td align="right"><?php echo number_format($row_collection['Bank'],2,'.','');?></td></tr>
    <?php
	}
	?>
    
    </tbody></table>
    </div>
    
    </div>
    
    <!--<div class="row">
<div class="col-sm-5"> <?php include "chartsphp/flowchart.php" ?> </div>
<div class="col-sm-1"></div>
<div class="col-sm-5"> <?php include "chartsphp/monthlyproduct.php" ?> </div>
    </div>-->

</div></div>


</body>
</html>
