<?php
  include('header.php');
  require('connect.php');

  $qry = "SELECT id, hm_paralav, hm_elegxou, etairia, elegkths FROM control_form";
  $res = mysqli_query($dbC,$qry);
 ?>
 <style>
  .qcontrols tr td:hover{
    cursor:pointer;
  }
  .qcontrols tr th{
    background-color:#414141 !important;
    color:rgb(217, 181, 31) !important;
  }
 </style>
 <table class="table bootstrap-datatable table-bordered table-responsive table-condensed table-hover qcontrols">
   <tr><th>ID</th><th>Εταιρία</th><th>Ελεγκτής</th><th>Ημ. Παραλαβής</th><th>Ημ. Ελέγχου</th></tr>
<?php
  while($row=mysqli_fetch_array($res)){
    echo "<tr onclick=\"document.location = 'control.php?type=view&id=".$row['id']."';\"><td>".$row['id']."</td> <td>".$row['etairia']."</td> <td>".$row['elegkths']."</td> <td>".date('d-m-Y',strtotime($row['hm_paralav']))."</td> <td>".date('d-m-Y',strtotime($row['hm_elegxou']))."</td></tr>";
  }
 ?>

 </table>
