<?php

if (isset($_POST['Delete_button'])) {
    $event_to_delete = $_POST['Delete_button'];
    if (existsEventByID($event_to_delete) && $_SESSION['csrf'] == $_POST['csrf']) {
        $event_name = deleteEvent($event_to_delete);
    }
}
Exemple #2
0
	<?php 
session_start();
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'])) {