Пример #1
0
<?php

//Event vars
$Events = [];
foreach (GetAllEventData($conn) as $key => $value) {
    array_push($Events, "<a href='" . ROOT . $redirectOption . "?event=" . $value["EventID"] . "' class='list-group-item'>" . $value["Name"] . "</a>");
}
?>

<?php 
include 'header.php';
?>
<body>
	<div class="container">
			
			<div class="col-sm-8 center-block" style="float:none">
				<div class="row">
					<div class="col-sm-8">
						<?php 
if ($redirectOption == "anmal") {
    ?>
							<h1>Anmäl till event</h1>
						<?php 
} elseif ($redirectOption == "event") {
    ?>
							<h1>Se anmälda</h1>
						<?php 
} elseif ($redirectOption == "stafett") {
    ?>
							<h1>Välj event</h1>
						<?php 
Пример #2
0
    $whatis = "user";
} elseif (isset($_GET["track"]) && isset($_GET["event"])) {
    $e = GetEventData($conn, $_GET["event"]);
    $t = GetTrackData($conn, $_GET["event"]);
    if (empty($e)) {
        die(include 'php/views/notfound.php');
    }
    //Format track
    foreach ($t as $key => $v) {
        if ($v["ID"] == $_GET["track"]) {
            $t = $v;
        }
    }
    $whatis = "track";
} else {
    $e = GetAllEventData($conn);
    $whatis = "listall";
}
include 'php/views/header.php';
?>
	<section class="container-fluid">
		<?php 
if (isset($_GET['success'])) {
    ?>
				<div class="alert alert-success alert-dismissible" role="alert">
				  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				  Eventet har uppdaterats!
				</div>
		<?php 
}
?>
Пример #3
0
<?php

//Conn
include 'php/config.php';
$Events = GetAllEventData($conn);
//User events
$MyEvents = "<ul class='list-group'>";
foreach (array_reverse($Events) as $key => $event) {
    foreach (GetAllRunnerData($conn, $event["EventID"]) as $key => $track) {
        foreach ($track as $key => $runner) {
            if ($userID === $runner["UserID"]) {
                $MyEvents .= "<li class='list-group-item'><h5><a href='anmal?event=" . $event["EventID"] . "'>" . $event["Name"] . "</a> - " . $runner["FirstName"] . " " . $runner["LastName"] . "</h5></li>";
            }
        }
    }
}
$MyEvents .= "</ul>";
//Confirm relays
$relaysToConfirm = false;
$ConfirmRelays = "<div class='list-group'>";
foreach ($Events as $key => $event) {
    foreach (GetAllRelayData($conn, $event["EventID"]) as $key => $relay) {
        if ($relay["Public"]) {
            $ConfirmRelays .= "<a href='bekrafta?event=" . $event["EventID"] . "&relay=" . $relay["RelayID"] . "' class='list-group-item list-group-item-info'>\n\t\t\t\t\tBekräfta laguppställning för " . $event["Name"] . " - " . $relay["RelayName"] . "</a>";
            $relaysToConfirm = true;
        }
    }
}
$ConfirmRelays .= "</div>";
include 'php/views/header.php';
?>