Ejemplo n.º 1
0
function attendingEventBox($userID)
{
    $userattendance = getEventsUserAttends($userID);
    if (!empty($userattendance)) {
        foreach ($userattendance as $row) {
            $creator = getUserByID($row['user_id']);
            $link = '"event.php?id=' . $row['id'] . '"';
            $linkToCreator = '"profile.php?id=' . $row['user_id'] . '"';
            $alt = '"image_' . $row['event_id'] . '"';
            $imgPath = '"Images/Event/' . $row['image_path'] . '.jpg"';
            $value = '"' . $row['id'] . '"';
            ?>

			<div class="event_box">
				<a class="event_id" href=<?php 
            echo $link;
            ?>
><?php 
            echo $row['event_id'];
            ?>
</a>
				<span class="event_type"><?php 
            echo getEventsByTypeID($row['type'])['type'];
            ?>
</span>
				<span class="event_user">Created by: <a href=<?php 
            echo $linkToCreator;
            ?>
><?php 
            echo $creator['user_name'];
            ?>
</a></span>
				<span class="event_date"><?php 
            echo $row['date'];
            ?>
</span>
				<img class="event_img" src=<?php 
            echo $imgPath;
            ?>
 alt=<?php 
            echo $alt;
            ?>
>
			</div>

			<?php 
        }
    } else {
        ?>
 <span class="no-results">This user is currently not attending any events.</span> <?php 
    }
}
Ejemplo n.º 2
0
if (empty($_SESSION)) {
    header('Location: index.php');
}
include 'Database/event_type_connection.php';
include 'Database/user_connection.php';
include 'Database/event_connection.php';
include 'Database/comment_connection.php';
include 'PHP/joinleaveEvent.php';
include 'PHP/addremoveComment.php';
include 'PHP/topnav.php';
?>
	<?php 
if (isset($_GET['id'])) {
    if (existsEventByID($_GET['id'])) {
        $this_event = getEventByID($_GET['id']);
        $eventtype = getEventsByTypeID($this_event['type']);
        $isOwner = false;
        if ($this_event['user_id'] == $_SESSION['user_id']) {
            $isOwner = true;
        }
        ?>
				<div class="event-container">
					<span class="event-title"><?php 
        echo $this_event['event_id'];
        ?>
</span>
					<div class="event-info-container">
						<?php 
        if (checkIfUserAttends($this_event['id'], $_SESSION['user_id'])) {
            ?>
						<span class="attendance">You're going!</span>