
<?php include("conn.php");
$page='Bar Auditing Management';?>
<!DOCTYPE html>
<html lang="en">
<?php include("common/head.php")?>
  <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<body>
<?php include("common/menu.php")?>
<!---side nav bar end-->
<?php include("common/tittle.php")?>

            <!--Main body Start-->
            <div class="col-sm-12 mt-2">
            
               <!--search section start-->


                   
      <hr class="bg-success">

                <!--search section end-->
                <!--Orders start-->
       
            <?php 
            $today= date("F j, Y ");
            $sql2="SELECT * FROM currency ";
            $result2 = mysqli_query($conn,$sql2)or die( mysqli_error($conn));
            $row2=mysqli_fetch_array($result2) ;
            $currency=$row2['curency'];

?>

                    <div  id="collapseOne" class="  col-sm-12  " data-parent="#accordions">
                    <h3 class="text-center">Sales by Item Date</h3>

                    <table id="example_table" class="table-customer table-striped   w-100 table-bordered">
                        <thead>
                        <tr>
                            <th>Date</th>
                            <th>Total lose</th>
                            <th>Action</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php

$sql8="select date,SUM(amountLose)  FROM bar_auditing GROUP BY date ORDER BY date ";
$result8 = mysqli_query($conn,$sql8)or die( mysqli_error($conn));
while ($row8=mysqli_fetch_array($result8)) {
 $date=$row8['date'];
$totalLose=$row8['SUM(amountLose)'];

$link="audit_details.php?id=".urlencode(base64_encode($date));
?>
                        <tr>
                            <td><?php echo $date ?></td>
                            <td><?php echo  $currency."".  number_format($totalLose,2) ?></td>
                            <td>  <a href="<?=$link; ?>" type="button" class="btn btn-success view-details btn-sm">Details</a></td></td>                           
                        </tr>
                        <?php } ?>
                        </tbody>
                        <thead>
                        <th>Date</th>
                        <th>Total lose</th>
                            <th>Action</th>
                        </thead>
                    </table>
    

                </div>

                    <!-- <div id="chart_div" style="width: 100%; height: 500px;"></div>--->
        
                </div>

         
              
            </div>
            <!--Main body end-->

            <!--Invoice Section start-->
          
       

           
            <!--Invoice Section end-->

           
        </div>

    </div>
    
    <!--  isotope plugin cdn  -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha256-CBrpuqrMhXwcLLUd5tvQ4euBHCdh7wGlDfNz8vbu/iI=" crossorigin="anonymous"></script>
    <script src="js/script.js"></script>
    <!--  isotope plugin cdn  -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha256-CBrpuqrMhXwcLLUd5tvQ4euBHCdh7wGlDfNz8vbu/iI=" crossorigin="anonymous"></script>
    <script src="js/script.js"></script>
     <!-- jQuery js-->
 
         <!-- jQuery Datatable js -->
         <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" ></script>
     <script src="https://cdn.datatables.net/2.0.5/js/dataTables.js"></script>
     <script src="https://cdn.datatables.net/buttons/3.0.2/js/dataTables.buttons.js"></script>
     <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.dataTables.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
     <script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
     <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.html5.min.js"></script>
     <script src="https://cdn.datatables.net/buttons/3.0.2/js/buttons.print.min.js"></script>
     <script>
         $(document).ready( function () {
        new DataTable('#example_table', {
            order:[[2,"asc"]],
            autoFill: true,
            pageLength : 20,
    lengthMenu: [[5, 10, 20, -1], [5, 10, 20, 'Todos']],
    layout: {
        topStart: {
            buttons: ['copy', 'csv', 'excel', 'pdf', 'print']
        }
    }
});
       } );
       </script>
    <!--google graph-->
   



 

</body>

</html>