<div id="api"> </div> <div id="slide-content" class="scrollpane"> <?php // grab array of library name ids (login names) $name_id = getNameIDs(); // loop through these for the panel display for ($i = 0; $i < count($name_id); $i++) { // smaller functions used for future flexibility $nameid = $name_id[$i]; $id = getID($name_id[$i]); $url = getURL($name_id[$i]); $name = getName($name_id[$i]); $building = getBuilding($name_id[$i], 'at '); $description = getDescription($name_id[$i]); $notes = getHoursNotes($name_id[$i]); $map = getMapCode($name_id[$i]); $address = getAddress($name_id[$i]); $phone = getPhone($name_id[$i]); $accessurl = getAccessURL($name_id[$i]); $currentdate = date('Y-m-d'); $currenttime = date('H:i:s'); ?> <a name="view-<?php echo $nameid; ?> "></a> <div id="<?php
foreach ($events as $event) { $temp = ""; $currEvent = array(); foreach ($event as $info) { echo "{$info}<br>"; if (strpos($info, "SUMMARY:") !== false) { $currEvent["name"] = trim(substr($info, 8, -1)); } elseif (strpos($info, "LOCATION:") !== false) { $value = explode(":", $info); $nvalue = array_slice($value, 1, 1)[0]; $svalue = explode("\\", $nvalue); $fvalue = array_slice($svalue, 0, 1)[0]; $currEvent["location"] = trim($fvalue); $words = explode(" ", $currEvent["location"]); $locationsArray = findRoom($words); $currEvent["building"] = getBuilding($currEvent["location"]); $currEvent["room"] = $locationsArray["room"]; } elseif (strpos($info, "DTSTART") !== false) { $value = explode(":", $info); $currEvent["start"] = intval(trim(strtotime(array_slice($value, -1, 1)[0]))); } elseif (strpos($info, "DTEND") !== false) { $value = explode(":", $info); $currEvent["end"] = intval(trim(strtotime(array_slice($value, -1, 1)[0]))); } elseif (strpos($info, "UID:") !== false) { $value = explode("/", $info); $currEvent["id"] = trim(array_slice($value, -1, 1)[0]); } } array_push($NJIT, $currEvent); } $sendEvents = json_encode(array("events" => $NJIT, "njit" => true));