<?php session_start(); require_once "Dao.php"; date_default_timezone_set("UTC"); $dao = new Dao(); $row = $dao->getLogin(); if (!$row) { header("Location: details.php?id={$_GET["id"]}"); } $event = $dao->getEvent($_GET["id"]); if ($row["user_id"] === $event["sherpa"]) { $dao->deleteEvent($_GET["id"]); } header("Location: index.php"); exit;
<script src="js/jquery.js"></script> <script src="js/script.js"></script> <script src="js/details.js"></script> </head> <?php session_start(); include "timezone.php"; date_default_timezone_set("UTC"); require_once "Dao.php"; $here = "details.php?id={$_GET["id"]}"; $dao = new Dao(); $loggedInUser = $dao->getLogin(); $eventID = $_GET["id"]; $event = $dao->getEvent($eventID); $sherpa = $dao->getUser($event["sherpa"]); $activity = $dao->getActivity($event["activity"]); $sherpaName = $sherpa["username"]; $sherpaAbout = $sherpa["about"]; $console = $event["console"]; $activityName = $activity["name"]; $eventStart = date_format(date_create($event['start']), 'M. d - g:i A'); $eventOther = $event["other"]; $open = "- Open -"; $guardians = array(1 => $sherpaName, 2 => $open, 3 => $open, 4 => $open, 5 => $open, 6 => $open); $partOfGroup = false; $i = 2; $eventUsers = $dao->getEventUsers($eventID); foreach ($eventUsers as $user) { if ($user["user"] !== $sherpa["id"]) {