<?php include('conn.php');
if (isset($_GET['id'])) {
    $id=mysqli_real_escape_string($conn, $_GET['id']);
    $id2=base64_decode($id); }
$page='Bar Auditing Report '." ". $id2;

?>
<!DOCTYPE html>
<html lang="en">
<?php include("common/head.php")?>
<body>

    <?php include("common/menu.php")?>
<!---side nav bar end-->
<?php include("common/tittle.php")?>
            <!--Main body Start-->
           
            <!--Nav menu end-->
            <!--Main body Start-->
            <div style="overflow:scroll; height:100vh;" id="accordions" class="col-sm-12 mt-1">
        
                        <?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'];

?>
      <hr class="bg-success">
                <!--search section end-->
                <!--Orders start-->

                <!--order-items-->
                <!--order-items-one-->
               <div  id="collapseOne" class="  col-sm-12  " data-parent="#accordions">         
                    <h5 class="text-center">Bar Auditing Report</h5>
                    <!-- Button trigger modal -->

  <table id="example_table" class="table-customer table-striped table-hover text-center  w-100 table-bordered">
                        <thead>
                            
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th> Expected Quantity</th>
                            <th>Quantity Entered</th>
                            <th>Quantity Lose</th>
                            <th>Amount Lose</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php

      

$sql="select * from bar_auditing where date='$id2' ";
$result = mysqli_query($conn,$sql)or die( mysqli_error($conn));
while ($row=mysqli_fetch_array($result)) {




 $data=$row['item_id'];
   $qty1=$row['qty'];
   $qtyinstock=$row['qtyInStock'];
   $name=$row['name'];
   $totalLose=$row['totalLose'];
   $amountLose=$row['amountLose'];

   




  include('item_data.php');

?>
                        <tr>
                            <td><?php echo $data ?></td>
                            <td><?php echo $name ?></td>
                            <td><?php echo $qtyinstock?></td>
                            <td ><?php  echo $qty1?></td>
                            <td><?php echo $totalLose?></td>
                            <td><?php echo $currency."".  number_format($amountLose,2)?></td>
                            
                        </tr>
                        <?php } ?>
                        <thead>
                        <th>id</th>
                            <th>Name</th>
                            <th> Expected Quantity</th>
                            <th>Quantity Entered</th>
                            <th>Quantity Lose</th>
                            <th>Amount Lose</th>
                    </tbody>
                    </table>
    

                </div>

        


       

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

            <!--Customer massaging section-->
    
              

                

          





      
       

   
    
  
    <!--  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>
    

</body>

</html>