<!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>Product</th>
                                                <th>Machine</th> -->
                                                <th>Material</th>
                                                <th>Unit</th>
                                                <th>Balance</th>
                                                 
                                                <!-- <th>Action</th> -->
                                            </tr>
                                        </thead>
                                        <tbody>
                                          <?php if(!empty($get_material_production_reports)){
     
                                             foreach ($get_material_production_reports as $value) {  ?>
                                                <tr>
                                                   <!--  <td><?php  echo product_name($value['product_id']); ?></td>
                                                       
                                                        <td><?php  $machine =  machine_from_production($value['production_id']);
                                                                    echo machine_name($machine);
                                                         ?></td> -->
                                                        <td><?php  echo material_name($value['material_id']); ?></td>
                                                       
                                                        <td><?php  echo get_unit_name($value['unit']); ?></td>
                                                        
                                                        <td><?php  echo get_in_balance_return($value['material_id'])-get_out_balance_return($value['material_id']); ?></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 />Return Production Report</div>'
   
  },
{
    extend: 'pdf',
    title: 'Return Production Report'
  },
  ]
    } );

} );
</script>