 <button class="btn btn-warning" onclick="printData1();">Print me</button>
 
 <div class="table-responsive" id="container">

                                <h3><?php echo fullname($filter_data[0]['emp_id']); ?></h3>
                                     <table id="" border="1"  style="min-width: 900px">
                                     

                                                <thead>
                                                    <tr style="background: #71A79D;">
                                                        
                                                        
                                                        <th style="text-align: center;">Date</th>
                                                        <th style="text-align: center;">Time IN</th>
                                                        <th style="text-align: center;">Time Out</th>
                                                         <th style="text-align: center;">Status</th>
                                                          <th style="text-align: center;">OT</th>
                                                        <th style="text-align: center;">Advance</th> 
                                                      </tr>
                                                </thead>
                                                <tbody>
                                                    <?php
                                                   $total_absent = 0;
                                                   $total_price = 0;
                                                   $total_adv=0;
                                                   $datecounter=0;
                                                    if(!empty($filter_data)){
                                                     foreach ($filter_data as $value) {  ?>
                                                    
                                                <tr>
                                                    <td style="text-align: center;"><?php
                                                     
                                                     $newDate = date("d-m-Y", strtotime($value['date']));
                                                     echo $newDate;
                                                     ?></td>
                                                    <td style="text-align: center;"><?php
                                                    
                                                        if($value['tap_in'] !=""){
                                                        echo  date("g:i a", strtotime($value['tap_in']));
                                                        }else{
                                                            echo "-";
                                                        }
                                                      ?></td>
                                                    <td style="text-align: center;"><?php 
                                                    if($value['tap_out'] !=""){
                                                        echo  date("g:i a", strtotime($value['tap_out']));
                                                        }else{
                                                            echo "-";
                                                        }
                                                     ?></td>
                                                   

                                                      <?php  
                                                            $new_tapin = date('H:i', strtotime(@$value['tap_in']));
                                                            $new_tapins = strtotime ($new_tapin);
                                                            //$total_tapin = $new_tapin+15;
                                                            ///Emp tap in/////
                                                            $emp_tapin = get_emp_time($value['emp_id']);
                                                            $emp_tap_in = date('H:i', strtotime(@$emp_tapin));
                                                            $emp_time = strtotime ($emp_tap_in);
                                                            //$total_emp =  $emp_time;
                                                            //echo $total_emp; echo "=="; echo $new_tapins;
                                                            if($new_tapins > $emp_time){ ?>

                                                               <td style="text-align: center; background-color:#ff1616;"><b>Late</b></td>
                                                            <?php }else{ ?>

                                                          <td style="text-align: center; background-color:#71a72b;"><b>On Time</b></td>
                                                             <?php } ?>
                                                            
                                                    


                                                     <td style="text-align: center;"><?php
                                                    if($value['over_time']!=""){
                                                     echo $value['over_time'];
                                                        }else{
                                                            echo "-";
                                                        }
                                                      ?></td>
                                                    
                                                    <td style="text-align: center;"><?php 
                                                    if($value['advance']!=""){
                                                        echo $value['advance']; 
                                                    }else{
                                                        echo "-";
                                                    }
                                                    ?></td> 


                                                </tr>
                                             <?php
                                                    //$total_dates = count($value['date_out']);
                                                    $aa = $value['over_time'];
                                                    $bb = $value['advance'];
                                                   
                                                    @$total_price+=$aa;
                                                    @$total_adv+=$bb;
                                                    @$total_dates;

                                                    $datecounter++;

                                                       
                                                  
                                                } ?>
                                                </tbody></table> 
                                                <br/>
                                                <span><strong>Salary: </strong><?php echo salary_emp($value['emp_id']); ?></span>
                                                 <span><strong>Presents: </strong><?php echo $datecounter; ?></span>

                                                 <br/><br/>
                                                 <span><strong>Advance: </strong><?php echo $total_adv; ?></span>
                                                    <?php  
                                                   // if ($total_absent == 0) {
                                                           
                                                         
                                                       // }

                                                    ?></span>
                                                   <span><strong>Over Time: </strong><?php echo  $total_price; ?></span><br/><br/>
                                                   
                                                   <!--  <span><strong>Absents: </strong>
                                                   <span><strong>Payable:</strong></span>  -->
                                                </div>      
                                            <?php } ?>


                                            <script type="text/javascript">
                                                
                                                function printData1()
                                                {
                                                   var divToPrint=document.getElementById("container");
                                                   newWin= window.open("");
                                                   newWin.document.write(divToPrint.outerHTML);
                                                   newWin.print();
                                                   newWin.close();
                                                }
                                            </script>