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

    <style type="text/css">
      @media print { 
    .table { 
        background-color: #fff;   
    } 
 
    /* More print styles */ 
  /* ... */ 
} 
    </style>
</head>
<body>

                                  
                                  <table  id="example" class="table table-striped table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Material</th>
                                                <th>Machine</th>
                                                <th>QCR</th>
                                                <th>QTY/Bag</th>
                                                <th>Color Code</th>
                                                <th>Color Ratio</th>
                                                
                                                <!-- <th>Waste Material</th> -->
                                                <th>W Lot</th> 
                                                <th>Weight Wast KG</th>
                                                 <th>Date/Time</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!empty($get_products_production)){
     
                                foreach ($get_products_production as $value) {  ?>
                                            <tr >
                                                <td><?php  echo material_name($value['material_id']); ?></td>
                                                    <td><?php
                                                         echo machine_name($value['machine_id']);
                                                    
                                                    ?></td>
                                                             
                                                    <td><?php 
                                                             echo $value['qcr'];
                                                     ?></td>

                                                     <td><?php
                                                             echo @$value['compund_qty'];
                                                            
                                                             $unit_production_color =  unit_production_color(@$value['production_id']);

                                                            $typematerial =material_type_po(@$value['material_id']);

                                                            if($typematerial == 3){

                                                                   $color_unit = unit_production_color(@$value['production_id']);

                                                                   echo @$color_unit;

                                                            }else{

                                                                 $unit_production =  production_unit(@$value['production_id']);

                                                                 echo $unit_production;
                                                            }
                                                     ?></td>
                                                    
                                                    <td><?php 
                                                             echo @$value['color_code'];
                                                     ?></td>

                                                     <td><?php 
                                                             echo $value['color_ratio'];
                                                     ?></td>
                                                    
                                                    

                                                  
                                                            
                                                    <td><?php 

                                                             echo $value['wlot'];
                                                   

                                                    ?></td> 

                                                    <td><?php 

                                                             echo $value['weight_wast'];
                                                             echo " Kg";

                                                    ?></td> 

                                                    <td><?php 

                                                             echo $value['created'];
                                                   

                                                    ?></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 />Compound Production Report</div>'
   
  },
{
    extend: 'pdf',
    title: 'Production Report'
  },
  ]
    } );

} );
</script>