<commit_before><html>
<head>
<title>openQDA</title>

<link rel="stylesheet" type="text/css" href="css/main.css">

<style>
img {
    float: left;
    margin: 0 20px 10px 0;
    width: 150px;
    }
.item {
    }
</style>

</head>

<body>

<div id="#tudo">

<object data="css/logo.svg" type="image/svg+xml" height=200 width=900></object>

<div id="menu">
<?php include("menu.html"); ?>
</div>

<div id="centro">

<h2>Registered images</h2>

<?php
include("connection.php");

// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
//getting the lastest date
$sql = "SELECT date FROM sources ORDER BY date DESC LIMIT 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$d = $row["date"];
echo "<br>" . $d . "<br>";

//getting the registers inserted at the same date as the latest
$sql = "SELECT id, name, memo, date FROM sources WHERE date='" . $d . "'";
$result = mysqli_query($conn, $sql);

if (mysqli_num_rows($result) > 0) {
    // output data of each row
    while($row = mysqli_fetch_assoc($result)) {
        //basic info from the sources table
        echo "<div class='item'>";
        echo "<img src='sources/" . $row["name"]. "'>\n";
        echo "<span class='fieldname'>ID: </span>" . $row["id"]. "<br/><span class='fieldname'>Description: </span>" . $row["memo"]. "<br/>";
        //getting and showing the attributes
        $result2 = mysqli_query($conn, "SELECT * FROM (SELECT sourceAttributes.value, attributes.name, sourceAttributes.source_id FROM sourceAttributes INNER JOIN attributes ON sourceAttributes.attributes_id=attributes.id)fusao WHERE source_id=" . $row["id"]);
        echo "<span class='fieldname'>Atributes:</span>";
        while($row2 = mysqli_fetch_assoc($result2)) {
            echo $row2["name"] . "=" . $row2["value"] . ", ";
        }
        echo "\n<br>\n<br>\n<span class='fieldname'>actions:</span><a href='viewImagewithBites.php?idImage=" . $row["id"] . "'>View</a> | <a href='editAttributes.php?idImage=" . $row["id"] . "'>Edit attributes</a> | <a href='applyCodes.php?idImage=" . $row["id"] . "'>Apply code</a>";
        echo "\n<div style='clear: both;'><!-- --></div></div>\n";
    }
} else {
    echo "0 results";
}


mysqli_close($conn);
?> 

</div>
</div>

</body>
</html><commit_msg>To include videos<commit_after><html>
<head>
<title>openQDA</title>

<link rel="stylesheet" type="text/css" href="css/main.css">

<style>
img {
    float: left;
    margin: 0 20px 10px 0;
    width: 150px;
    }
.item {
    }
</style>

</head>

<body>

<div id="#tudo">

<object data="css/logo.svg" type="image/svg+xml" height=200 width=900></object>

<div id="menu">
<?php include("menu.html"); ?>
</div>

<div id="centro">

<h2>Registered images</h2>

<?php
include("connection.php");
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if (!$conn) {
    die("Connection failed: " . mysqli_connect_error());
}
//getting the lastest date
$sql = "SELECT date FROM sources ORDER BY date DESC LIMIT 1";
$result = mysqli_query($conn, $sql);
$row = mysqli_fetch_assoc($result);
$d = $row["date"];
echo "</br>Date: " . $d . "</br></br>";
//getting the registers inserted at the same date as the latest
$sql = "SELECT id, name, memo, date, type FROM sources WHERE date='" . $d . "'";
$result = mysqli_query($conn, $sql);
if (mysqli_num_rows($result) > 0) {
    // output data of each row
    while($row = mysqli_fetch_assoc($result)) {
        //basic info from the sources table
        echo "<div class='item'>";
        if ($row["type"]=="i") {
                echo "<img src='sources/" . $row["name"]. "'>\n";
                }
        if ($row["type"]=="v") {
                echo "<img src='css/video-icon.png'>\n";
                }        
        echo "<span class='fieldname'>ID: </span>" . $row["id"]. "<br/><span class='fieldname'>Description: </span>" . $row["memo"]. "<br/>";
        //getting and showing the attributes
        $result2 = mysqli_query($conn, "SELECT * FROM (SELECT sourceAttributes.value, attributes.name, sourceAttributes.source_id FROM sourceAttributes INNER JOIN attributes ON sourceAttributes.attributes_id=attributes.id)fusao WHERE source_id=" . $row["id"]);
        echo "<span class='fieldname'>Atributes:</span>";
        while($row2 = mysqli_fetch_assoc($result2)) {
            echo $row2["name"] . "=" . $row2["value"] . ", ";
        }
        echo "\n<br>\n<br>\n<span class='fieldname'>actions:</span><a href='viewImagewithBites.php?idImage=" . $row["id"] . "'>View</a> | <a href='editAttributes.php?idImage=" . $row["id"] . "'>Edit attributes</a> | <a href='applyCodes.php?idImage=" . $row["id"] . "'>Apply code</a>";
        echo "\n<div style='clear: both;'><!-- --></div></div>\n";
    }
} else {
    echo "0 results";
}
mysqli_close($conn);
?> 

</div>
</div>

</body>
</html>
{'fraction_non_alphanumeric': 0.20894620189401572, 'fraction_numerical': 0.01007455168245013, 'mean_word_length': 3.5457875457875456, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 105, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5646831', 'n_tokens_mistral': 1747, 'n_tokens_neox': 1689, 'n_words': 409}