</head> <body> <table cellspacing="1" cellpadding="1" border="0" style="width:720px;height:1280" align="center"> <thead> <th colspan="3" colspan="center" height="80" style="font-size:22px">Next Event</th> </thead> <?php require 'IcalReader.php'; $ical = new ICal(); $i = 0; date_default_timezone_set('Australia/ACT'); //Either pass filename from url eg [...... screen-two.php?file=xyz.ics] or directly put here $filename = isset($_GET['file']) ? trim($_GET['file']) : 'Auditorium.ics'; $events = $ical->getEventsByFileName('ics-files/' . $filename); foreach ($events['VEVENT'] as $data) { $e[$i]['UID'] = $data['UID']; $e[$i]['SUMMARY'] = $data['SUMMARY']; $e[$i]['LOCATION'] = isset($data['LOCATION']) ? $data['LOCATION'] : ''; // $ts = strtotime($data['DTSTART']); $changedDate = date('YmdHis', $ts); $e[$i]['DTSTART'] = $changedDate; $e[$i]['DTEND'] = $data['DTEND']; $i++; } $startDate = date('Y-m-d H:i'); $endDate = date('Y-m-d') . ' 23:59:00'; $upcomingEvents = $ical->eventsFromRange($startDate, $endDate, $e); if (is_array($upcomingEvents) && count($upcomingEvents)) {
<div class="container"> <table cellspacing="0" cellpadding="1" border="0" align="center" class="table_grid row"> <thead> <th class="grey_row">TIME</th> <th class="grey_row2">EVENT</th> </thead> <?php require 'IcalReader.php'; $ical = new ICal(); $files = $ical->findAllFiles('ics-files'); $i = 0; date_default_timezone_set('Australia/ACT'); foreach ($files as $key => $file) { $caldata = array(); $ical->cal = ''; $caldata = $ical->getEventsByFileName($file); foreach ($caldata['VEVENT'] as $data) { $e[$i]['UID'] = $data['UID']; $e[$i]['SUMMARY'] = $data['SUMMARY']; $e[$i]['LOCATION'] = isset($data['LOCATION']) ? $data['LOCATION'] : ''; // $ts = strtotime($data['DTSTART']); $changedDate = date('YmdHis', $ts); $e[$i]['DTSTART'] = $changedDate; $e[$i]['DTEND'] = $data['DTEND']; $i++; } } $startDate = date('Y-m-d'); $endDate = date('Y-m-d') . ' 23:59:00'; $todayEvents = $ical->eventsFromRange($startDate, $endDate, $e);