This repository has been archived by the owner on Oct 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
info_sessions.php
66 lines (62 loc) · 2.63 KB
/
info_sessions.php
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
<?php
/**
* Created by IntelliJ IDEA.
* User: Erik (God Tier) [Updated by Swagat]
* Date: 8/16/2018
* Time: 2:44 PM
*/
$year = 2021;
$tz = new DateTimeZone("America/Indiana/Indianapolis");
$etime = function ($month, $day, $hour, $minute = 0) use ($year, $tz) {
return new DateTime("$year-$month-$day $hour:$minute:00", $tz);
};
$info_sessions = array(
array($etime(9, 1, 18, 30), $etime(9, 1, 20, 0), 'PHYS 112', GENERAL),
array($etime(9, 2, 18, 30), $etime(9, 2, 20, 0), 'PHYS 112', GENERAL),
array($etime(9, 5, 16, 0), $etime(9, 5, 17, 0), '<a href="https://discord.gg/kZNkKXM">IEEE Q&A Discord [Learning]</a>', LEARNING),
array($etime(9, 8, 18, 0), $etime(9, 8, 20, 0), 'POTR 234', ROV),
array($etime(9, 8, 18, 30), $etime(9, 8, 19, 30), 'ARMS 1010', PARTIEEE),
array($etime(9, 8, 18, 30), $etime(9, 8, 19, 30), 'LWSN B151', RACING),
array($etime(9, 9, 18, 0), $etime(9, 9, 18, 30), 'TBA', SOCIAL),
array($etime(9, 9, 18, 0), $etime(9, 9, 18, 30), 'TBA', INDUSTRIAL_RELATIONS),
array($etime(9, 9, 18, 0), $etime(9, 9, 18, 30), 'TBA', GROWTH),
array($etime(9, 9, 18, 0), $etime(9, 9, 19, 0), 'EE 117', COMPUTER_SOCIETY),
array($etime(9, 9, 18, 0), $etime(9, 9, 19, 30), 'EE 222', EMBS),
array($etime(9, 9, 19, 0), $etime(9, 9, 20, 0), '<a href="https://discord.gg/kZNkKXM">IEEE Q&A Discord [MTT-S]</a>', MTTS),
array($etime(9, 11, 15, 30), $etime(9, 11, 16, 30), '<a href="https://purdue-edu.zoom.us/j/99675779158?pwd=Vklib29nS1BCYVpXaG5wMkRlUnpTQT09">WALC 1087 and Zoom</a>', SOFTWARE_SATURDAYS),
);
$info_session_text = '<h2><b>' . $year . ' Info Sessions</b></h2>';
$previous_day = null;
foreach ($info_sessions as $session) {
$start = $session[0];
$end = $session[1];
$place = $session[2];
$committee = $session[3];
if (isset($start)) {
$day = '<b>' . $start->format('l') . '</b> - ' . $start->format('n/j');
$time = $start->format('g:i a') . ' - ' . $end->format('g:i a');
$today = new DateTime('now midnight', $tz);
if ($today > $end) {
$day = '<s>' . $day . '</s>';
}
} else {
$day = '<b>Undetermined</b>';
$time = '';
}
if ($day == $previous_day) {
$day = '';
} else {
$previous_day = $day;
}
$info_session_text .= '<div class="row">
<div class="col-sm-4">
<h4>' . $day . '</h4>
</div>
<div class="col-sm-9">
<div class="col-xs-4"><h4>' . $committee . '</h4></div>
<div class="col-xs-4"><h4>' . $time . '</h4></div>
<div class="col-xs-4"><h4>' . $place . '</h4></div>
</div>
</div>';
}
echo $info_session_text;