<?php
include('function.php');
 
 include('db_con.php');
 
 $dated = date('d-m-Y h:m A');
 $html = '';
 
 $count = 0;
  $statement = $connect->prepare("select m.id,m.dated,m.description,m.job_type,m.job_status,u.user_name from jobs_detail m, user_detail u where m.user_id=u.user_id order by m.dated desc,m.user_id");
 $statement->execute();
 
 $result = $statement->fetchAll(); 
 ?>
<!DOCTYPE html>
<html>
<head>
  <title>Jobs Detail</title>
  <style>
    * {
      font-family: arial;
      padding: 2px;
    }
@page { size: auto;  margin: 0mm; }
.print_table th{
  border-bottom: 2px solid black;
  border-top: 2px solid black;
}
.print_table td{
  border-bottom: 1px solid black;
  
}
</style>

</head>
<body>
  
  
  <table width="100%" class="table_header">
  <tr>
  <td colspan="10" style="text-align:center;font-size:18px;font-weight:bold;margin:5px">Job Detail Report</td>
  </tr>
  
  
  </table>
  <table width="100%" class="print_table">
  <tr>
  <th width="5%">#</th>
  
  <th width="15%">Date</th> 
  <th width="20%">User</th> 
  <th width="40%">Description</th> 
  <th width="10%">Type</th> 
  <th width="10%">Status</th> 
   
   
  </tr>
 
  
<?php
foreach($result as $row)
 {
  
  
 
   $count = $count+1;
     // if($count == 1){$stock = $opening + $qty_in - $qty_out; }else{$stock = $stock + $qty_in - $qty_out;}
   
 echo '
  
    
  
  
<tr>
<td width="5%">'.$count.'</td>
  
<td width="15%">'.$row["dated"].'</td>
<td width="20%">'.$row["user_name"].'</td>
<td width="40%">'.$row["description"].'</td>
<td width="10%">'.$row["job_type"].'</td>
<td width="10%">'.$row["job_status"].'</td>
    
    

    
  
   
    
   </tr>
   
  
        ';
}
?>
  
 
 </table>
 <table width="100%" class="print_table">
    <tr><td>Printed at : <?php echo $dated;?></td></tr>
  </table>
</body>
 </html>