prepare("SELECT event_id, date, time, name, image, description, feature, location, type, promo FROM events WHERE date > CURDATE() ORDER BY date ASC");
$stmt->execute();
$result = $stmt->get_result();
if ($result->num_rows > 0) {
// Loop through each row
while ($row = $result->fetch_assoc()) {
$event_id = $row['event_id'];
$date = $row['date'];
$time = $row['time'];
$name = $row['name'];
$image = $row['image'];
$description = $row['description'];
$feature = $row['feature'];
$location = $row['location'];
$type = $row['type'];
$promo = $row['promo'];
// Determine the badge text based on the status
$badge_text = 'OPEN DAY';
// Output the HTML structure with dynamic data
echo '
' . $location . '
' . $name . '
' . $feature . '
' . $description . '
' . convertDate($date) . '
' . $time . '
';
}
} else {
echo "No events available.";
}
// Close connection
$conn->close();
?>