<!DOCTYPE html>
<html lang="en">

<head>
    
       <link rel="stylesheet" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css">
     <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.7.1/css/buttons.dataTables.min.css">
     
    <script src="https://code.jquery.com/jquery-3.5.1.js"></script>
    <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/dataTables.buttons.min.js"></script>
    <script src="https://cdn.datatables.net/buttons/1.7.1/js/buttons.print.min.js"></script>

</head>
<body>


                                   <table  id="example" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Material</th>
                                                 <!-- <th>Grade</th> -->
                                                <th>Waste LOt#</th>
                                                 
                                                <th>Total Kg</th> 
                                                <th>Bags</th>
                                                <!-- <th>Action</th> -->
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!empty($get_products_wast)){
     
                                foreach ($get_products_wast as $value) {  ?>
                                            <tr>
                                                <td><?php  echo material_name($value['material_id']); ?></td>

                                                  <!-- <td><?php  echo material_grade($value['material_id']); ?></td> -->
                                                  <td><?php echo $value['wast_lot']; ?></td>
                                                            
                                                    <td><?php 

                                                    echo get_in_balance_wast($value['material_id'])-get_out_balance_wast($value['material_id'])-get_out_balance_compund_Waste($value['material_id']); echo " Kg";
                                                    
                                                   $totqal = get_in_balance_wast($value['material_id'])-get_out_balance_wast($value['material_id'])-get_out_balance_compund_Waste($value['material_id']); 
                                                    ?></td>
                                                    <td><?php echo $totqal/10; ?></td> 
                                                                                             
                                            </tr>

                                            <?php }} ?>
                                           
                                        </tbody>
                                    </table>
                                
<script type="text/javascript">
    
   $(document).ready(function() {
    $('#example').DataTable( {

        dom: 'Bfrtip',
        buttons: [{
    extend: 'print',
     title:'<div style="text-align:center;"><h2>Rizwan Associates</h2></div><div style="text-align:center;font-size:15px;"><br />Raw Material Report</div>'
   
  },
{
    extend: 'pdf',
    title: 'Production Report'
  },
  ]
    } );

} );
</script>