-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
83 lines (75 loc) · 2.32 KB
/
Copy pathindex.php
File metadata and controls
83 lines (75 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
require_once('pop/pop.php');
require_once('google-api-php-client/src/Google_Client.php');
require_once('google-api-php-client/src/contrib/Google_CalendarService.php');
?>
<section id="linkList" class="buble">
<ul>
<li>
<a href="http://sermons.lincolnroadchapel.ca/">Sermon</a>
</li>
<li>
<a href="/welcome.php">First time here?</a>
</li>
</ul>
</section>
<div id="campfireImg" alt=""/>
<div>
A place where <b>you</b> matter<br>
and <b>Jesus</b> is the main attraction
</div>
</div>
<div id="eventList">
<div class="title">
<h2> Calendar of Events </h2>
</div>
<?php
session_start(); // inline php: you might get "session already started" warning on dev/prod
$client = new Google_Client();
$client->setApplicationName('LRC Test Website');
$client->setDeveloperKey('AIzaSyC2t1b_JMWoVT2WtNoLvofRLsKaB1COSnA');
$cal = new Google_CalendarService($client);
$events = $cal->events->listEvents('m6gor60jv1r7hm75mr7avpsjag@group.calendar.google.com');
$monthNames = array (
0 => '',
1 => 'JAN',
2 => 'FEB',
3 => 'MAR',
4 => 'APR',
5 => 'MAY',
6 => 'JUN',
7 => 'JUL',
8 => 'AUG',
9 => 'SEP',
10 => 'OCT',
11 => 'NOV',
12 => 'DEC'
);
foreach ($events['items'] as $event) {
if ($event['transparency']) {
continue;
}
list($year, $monthNum, $day) = explode('-', $event['start']['date']);
$month = $monthNames[intval($monthNum)];
$title = $event['summary'];
$description = $event['description'];
?>
<div class="event">
<div class="date">
<span class="big"><?php echo $day; ?></span>
<span class="small"><?php echo $month; ?></span>
</div>
<div class="content">
<div class="title">
<?php echo $title; ?>
</div>
<div class="description">
<?php echo $description; ?>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>