function getSearchedEvents($search) { $found = false; $allevents = getAllEvents(); if (!empty($allevents)) { foreach ($allevents as $row) { if (strpos(strtolower($row['event_id']), strtolower($search)) !== false) { $found = true; $link = '"event.php?id=' . $row['id'] . '"'; ?> <a class="event-link" href=<?php echo $link; ?> ><?php echo $row['event_id']; ?> </a> <?php } } } else { ?> <span class="no-results">There are no events avaiable at the moment.</span> <?php } if (!empty($allevents) && $found == false) { ?> <span class="no-results">There were no events found with the word "<?php echo $search; ?> ".</span> <?php } }
function createTablePreregs() { #---------------------------------------------------------------------- #--- Create the table. reportAction("Preregs", "Create"); foreach (getAllEvents() as $event) { extract($event); $eventFields .= "E{$id} BOOLEAN NOT NULL DEFAULT 0,"; } dbCommand("\n CREATE TABLE Preregs (\n id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\n competitionId VARCHAR(32) NOT NULL,\n name VARCHAR(80) NOT NULL,\n personId VARCHAR(10) NOT NULL,\n countryId VARCHAR(50) NOT NULL,\n gender CHAR(1) NOT NULL,\n birthYear SMALLINT(6) UNSIGNED NOT NULL,\n birthMonth TINYINT(4) UNSIGNED NOT NULL,\n birthDay TINYINT(4) UNSIGNED NOT NULL,\n email VARCHAR(80) NOT NULL,\n guests TEXT NOT NULL,\n comments TEXT NOT NULL,\n ip VARCHAR(16) NOT NULL,\n status CHAR(1) NOT NULL,\n {$eventFields}\n PRIMARY KEY ( id )\n )"); }
function getEvent($eventId) { foreach (getAllEvents() as $event) { if ($event['id'] == $eventId) { return $event; } } // Failed to get from cache file $event = dbQuery("SELECT * FROM Events WHERE id='{$eventId}'"); if (count($event) == 1) { return $event[0]; } }
function eventChoice($required) { #---------------------------------------------------------------------- global $chosenEventId; if (!$required) { $options[] = array('', 'All'); $options[] = array('', ''); } foreach (getAllEvents() as $event) { $options[] = array($event['id'], $event['cellName']); } return choice('eventId', 'Event', $options, $chosenEventId); }
<!-- Container --> <div id="main" style="width:940px; margin:20px auto;"> <div class="cl"> </div> <?php echo "<span style='margin-left:20px;margin-top:5px;'>{$registerscs} </span>"; ?> <div id="content" > <?php echo $stuff; ?> <?php $categories = getEventCategories(); $events = getAllEvents(); for ($i = 0; $i < count($categories); $i++) { $eventcat = $categories[$i]['id']; $count[$i] = 0; for ($j = 1; $j <= count($events); $j++) { if ($events[$j - 1]['event_category_id'] == $eventcat) { $count[$i]++; } } } for ($i = 0; $i < count($categories); $i++) { $eventcat = $categories[$i]['id']; if ($count[$i]) { echo "<div class='box'>\n\t\t\t\t\t\t\t\t <div class='box-head'>\n\t\t\t\t\t\t\t\t\t<h2 class='left'>" . ucFirst($categories[$i]['name']) . "</h2>\n\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t <div class='table'>\n\t\t\t\t\t\t\t\t\t<table width='100%' border='0' cellspacing='0' cellpadding='0'>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t\t<th width='' height='34'>Sl No.</th>\n\t\t\t\t\t\t\t\t\t\t<th width='' align='center'>Event</th>\n\t\t\t\t\t\t\t\t\t\t<th width='' align='center'>Start on</th>\n\t\t\t\t\t\t\t\t\t\t<th width='' align='center'>Ends on</th>\n\t\t\t\t\t\t\t\t\t\t<th width='' align='center'>Register</th>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t"; $k = 1; for ($j = 1; $j <= count($events); $j++) {
function getAllEventIds () { return getAllIDs( getAllEvents() ); }
function getEventFences($calendarToken, $geoRefToken, $profileID) { $validEvents = json_decode(getAllEvents($calendarToken, $profileID), TRUE); $fences = (array) getFences($geoRefToken, $profileID); /* file_put_contents("simpleFences", "calendarToken :" . $calendarToken . "\n" . "geoRefToken :" . $geoRefToken . "\n" . "validEvents :" . print_r($validEvents["eventList"][$profileID], TRUE) . "\n" . "fences :" . print_r(getFences($geoRefToken, $profileID), TRUE) ); */ if (count($fences) == 0) { return array(); } $fences = (array) $fences["return"]; /* file_put_contents("getAllFences1", "calendarToken :" . $calendarToken . "\n" . "geoRefToken :" . $geoRefToken . "\n" . "validEvents :" . print_r($validEvents["eventList"][$profileID], TRUE) . "\n" . "fences :" . print_r($fences, TRUE) ); */ for ($j = 0; $j < count($fences); $j++) { $fences[$j] = (array) $fences[$j]; } for ($j = 0; $j < count($fences); $j++) { if ($fences[$j]["id"] == -1) { unset($fences[$j]); $fences = array_values($fences); $j = count($fences); } } $result = array(); for ($i = 0; $i < count($validEvents["eventList"][$profileID]); $i++) { $result[$i] = array(); $result[$i]["event"] = $validEvents["eventList"][$profileID][$i]; $fenceId = $validEvents["eventList"][$profileID][$i]["location"]; for ($j = 0; $j < count($fences); $j++) { if ($fences[$j]["id"] == $fenceId) { $result[$i]["fence"] = $fences[$j]; $j = count($fences); } } } return $result; }
$app->get('/user/:email/:password', function ($email, $password) { $user = getLoginInfo($email, $password); if ($user != null) { echo json_encode($user); } }); /* GET USER INFO FOR ONE EVENT */ $app->get('/user/:email/events/:eventId', function ($email, $eventId) { $user = getUserEventInfo($email, $eventId); if ($user != null) { echo json_encode($user); } }); /* GET ALL EVENTS */ $app->get('/events/all', function () { echo json_encode(getAllEvents()); }); /* USERS */ $app->post('/user', function () { $body = http_get_request_body(); if ($body != null) { $typeCheck = json_decode($body); switch ($typeCheck->type) { /* CREATE A USER */ case USER: $inUser = $typeCheck->obj; if ($inUser != null) { $userId = createUser($inUser->email, $inUser->password, $inUser->firstname, $inUser->lastname, $inUser->usefid); if ($userId > 0) { $user = R::load(USER, $userId); echo json_encode($user->export());
?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Piute Ponds Event Log</title> <link href="AdminCSS.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="../">Piute Ponds Event Log</a> <br> <a href="admin_home.php">Admin Home Page</a> <h1>Event Log</h1> This is the hunter link home page. <?php $eventList = getAllEvents(50); ?> <form method="POST" name="update_event_log_link" action='../php/update_event_log_action.php'> <table border="1"> <tr> <th> </th> <th>id</th> <th>Date</th> <th>Type</th> <th>Message</th> </tr> <?php $eventCount = 0; foreach ($eventList as $oneEvent) { $eventCount++;
function handleGetRequest($type, $id) { validateCache($id); $output = array(); //rg2log("Type ".$type."|ID ".$id); switch ($type) { case 'events': if (file_exists(CACHE_DIRECTORY . "events.json")) { $output = file_get_contents(CACHE_DIRECTORY . "events.json"); } else { // FALSE = don't include stats in output $output = getAllEvents(FALSE); @file_put_contents(CACHE_DIRECTORY . "events.json", $output); } break; case 'stats': if (file_exists(CACHE_DIRECTORY . "stats.json")) { $output = file_get_contents(CACHE_DIRECTORY . "stats.json"); } else { // TRUE = do include stats in output $output = getAllEvents(TRUE); @file_put_contents(CACHE_DIRECTORY . "stats.json", $output); } break; case 'courses': if (file_exists(CACHE_DIRECTORY . "courses_" . $id . ".json")) { $output = file_get_contents(CACHE_DIRECTORY . "courses_" . $id . ".json"); } else { $output = getCoursesForEvent($id); @file_put_contents(CACHE_DIRECTORY . "courses_" . $id . ".json", $output); } break; case 'results': if (file_exists(CACHE_DIRECTORY . "results_" . $id . ".json")) { $output = file_get_contents(CACHE_DIRECTORY . "results_" . $id . ".json"); } else { $output = getResultsForEvent($id); @file_put_contents(CACHE_DIRECTORY . "results_" . $id . ".json", $output); } break; case 'maps': $output = getMaps(); break; case 'tracks': if (file_exists(CACHE_DIRECTORY . "tracks_" . $id . ".json")) { $output = file_get_contents(CACHE_DIRECTORY . "tracks_" . $id . ".json"); } else { $output = getTracksForEvent($id); @file_put_contents(CACHE_DIRECTORY . "tracks_" . $id . ".json", $output); } break; case 'lang': $output = getLanguage($id); break; case 'splitsbrowser': $output = getSplitsbrowser($id); break; default: rg2log("Get request not recognised: " . $type . ", " . $id); $output = json_encode("Request not recognised."); break; } if ($type == 'splitsbrowser') { echo $output; } else { // output JSON data header("Content-type: application/json"); echo "{\"data\":" . $output . "}"; } }
function selectEventsHeadSubaction($pmcid) { //form to select the subaction $subactionForm = <<<SFORM <form method="GET" action="./+eventshead&subaction=addEvent"> <input type="submit" name="" value="ADD EVENT"/> </form> <a href="./+eventshead&subaction=notif">Notification</a> SFORM; $subactionForm .= getAllEvents($pmcid); return $subactionForm; }
<?php require_once 'admin/includes/init.php'; $tbl = 'tbl_events'; $getEvents = getAllEvents($tbl); $getPastEvents = getAllPastEvents($tbl); ?> <!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Eating Disorders Foundation of Canada | Events</title> <link rel="stylesheet" href="css/normalize.css"/> <link rel="stylesheet" href="css/foundation.css" /> <link rel="stylesheet" href="css/app.css" /> <link href='https://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="css/main.css"/> <script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.2/TweenMax.min.js"></script> <link rel="icon" href="images/icon.png" type="image/x-icon"/> </head> <body> <div id="cover"></div> <div class="container-navigation small-12 medium-12 large-3 columns"> <div class="logo"> <a href="index.php" class="navigation_link desktop-logo"><img src="images/logo_full.svg" id="index" alt="logo"></a> <a href="index.php" class="navigation_link mobile-logo"><img src="images/logo.svg" id="index" alt="logo"></a>
<? if (!isset($_POST['id'])) die('No id'); include_once('../database/eventFunc.php'); session_start(); //recebe todas as informções do evento presentes na table Event $table = getAllEvents(); $line = getEventfromID($_POST['id']); //verifica quem é o admin do evento. $line['host'] = getEventAdmin($line['name'])['username']; if ($line['host'] == $_SESSION['username']){ $line['host'] = "Delete Event"; } else{ $line['host'] = "host: ".$line['host']; } //inclui todos os comentários em $line['ArrayCom'] $tableCom = getCommentsFromEvent($line['name']); $maxCom = sizeof($tableCom); $line['tableCom'] = $tableCom; $line['maxCom'] = $maxCom; $line['ArrayCom'] = array(); for($j = 0; $j < $maxCom; $j++){ $lineCom = getLine($tableCom, $j); $comUser = getUsername($lineCom['idUser']); array_push($line['ArrayCom'], $comUser['username'], $lineCom['commentary'], $lineCom['idComment']); }