<!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>Code</th>
                                                <th>Product Name</th>
                                                <th>Date/Time</th>
                                                <th>Qty Deliver</th>
                                                <th>Deliver by</th>
                                                
                                                 
                                                <!-- <th>Action</th> -->
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php if(!empty($reporting_data)){
     
                                            foreach ($reporting_data as $value) {  ?>
                                            <?php 

                                                    $get_type =  get_child_pro_type($value['product_id']);

                                                    if($get_type == 5){
                                                 ?>
                                            <tr>
                                                
                                                 <td><?php  echo product_code($value['product_id']); ?></td>
                                                <td><?php  echo product_name($value['product_id']); ?></td>
                                                    
                                                    <td><?php  
                                                       $old_date_timestamp = strtotime($value['created_out']);
                                                    echo $new_date = date('d-m-Y H:i:s', $old_date_timestamp); 

                                                    ?></td>          
                                                    <td><?php echo $value['out_qty']; ?></td>
                                                            
                                                   <td><?php echo User_Name($value['user_id']); ?></td>                                       
                                            </tr>
<?php }else{ echo ""; } ?>
                                            <?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 />FG Report</div>'
   
  },
{
    extend: 'pdf',
    title: 'Production Report'
  },
  ]
    } );

} );
</script>