<?php 
session_start();
if (!isset($_SESSION['loggedin'])) {
    exit("unauthorized");
}

include "../../php/database.php"; 
?>

<table id="cron_logs_table" class="display" style="width:100%">
    <thead>
        <tr>
            <th>ID</th>
            <th>Data/Ora</th>
            <th>Descrizione</th>
        </tr>
    </thead>
    <?php
        $sql    = "SELECT * FROM stamps_import_logs ORDER BY id DESC";
        $result = mysqli_query($con, $sql);
        while ($row = mysqli_fetch_assoc($result)) {
            echo "<tr>";
                echo "<td>". $row["id"] ."</td>";
                echo "<td>". date("d/m/Y H:i:s", strtotime($row["datetime"])) ."</td>";     
                echo "<td>". $row["description"] ."</td>";   
            echo "</tr>";
        }
        ?>
    </tbody>
</table>

