<?php

$query  = "SELECT * FROM image_header WHERE id = '" . $sitepart_id . "' LIMIT 1";
$result = @mysqli_query($GLOBALS['mysql_con'], $query);

if (@mysqli_num_rows($result) == 1) {
    $image = @mysqli_fetch_array($result);

    // Use module path for intranet images
    if (!empty($image["content"]) && strpos($image["content"], 'intranet') !== false) {
        $imagePath = '/module/' . ltrim($image["content"], '/');
    } else {
        $imagePath = '/userdata/' . ltrim($image["content"], '/');
    }

    echo "\n<div class=\"imgcontent\">\n";
    echo "<img loading='lazy' src='" . $imagePath . "'>";
    echo "</div>\n";
}
?>