<?php
include '../../lib/conn.php';
include"../../lib/all_function.php";
include"../../lib/fungsi_indotgl.php";
include"../../lib/fungsi_sqltgl.php";
?>                
<?php
    $from = $_POST['from'];
    $to = $_POST['to'];
    $query = "SELECT * FROM `tb_log` WHERE date_format(`timestmp`, '%d-%m-%Y') BETWEEN '$from' AND '$to' ORDER BY `timestmp` DESC";
    $sql_kul = mysqli_query($conn,$query);	
    $i=1;
    while ($m = mysqli_fetch_assoc($sql_kul)) {
    if ($m['aksi']=="Login") {	
        $des = $m['deskripsi'];
    } else {
        $des = $m['deskripsi']." ".$m['kode'];
    }
    $date = date_create($m['timestmp']);



?>
<tr>
    <td align="center"><?php echo $i ?></td>
    <td align=""><?php echo nama_petugas($m['petugas'])?></td>
    <td align=""><?php echo $des ?></td>
    <td align="center"><?php echo tglindo($m['timestmp'])?> <?php echo date_format($date,"H:i:s"); ?></td>
    <td><?php echo $m['info'] ?></td>

</tr>

<?php
         $i++;
     }
    ?>