<?php
include 'dbconn.php';

if (isset($_GET['event_id'])) {
    $eventId = (int)$_GET['event_id'];
    $stmt = $mysqli->prepare("SELECT id, thumb_image, picture_image FROM project_pictures WHERE catagory_id = ?");
    $stmt->bind_param("i", $eventId);
    $stmt->execute();
    $result = $stmt->get_result();

    while ($row = $result->fetch_assoc()) {
        $small = htmlspecialchars("Admin/" . $row['thumb_image']);
        $big = htmlspecialchars("Admin/" . $row['picture_image']);
        echo '
        <div class="isotope-item col-lg-6 col-md-12 col-sm-12 category-1">
            <article class="vertical-item content-padding big-padding with_border bottom_color_border loop-color text-center">
                <div class="item-media">
                   <img src="' . $small . '" alt="" class="open-big-image" data-big="' . $big . '" style="width:100%; height:250px; object-fit:cover;">
                </div>
            </article>
        </div>';
    }
}
?>
