-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
30 lines (25 loc) · 962 Bytes
/
test.php
File metadata and controls
30 lines (25 loc) · 962 Bytes
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
<?php
require "Timeslots.php";
require "BARKNotifier.php";
/*Read the JSON file
$timeSlotsObj = new Timeslots();
$timeSlots = $timeSlotsObj->getTimeslots();
//Write the method to check if the current time is within the lab hours down
$currentDay = date('l'); // Current day of the week
$currentTime = date('H:i'); // Current time
foreach ($timeSlots as $day => $slots) {
foreach ($slots as $time => $details) {
if ($day === $currentDay) {
list($startTime, $endTime) = explode('-', $time);
$startTime = date('H:i', strtotime($startTime . ' -15 minutes'));
$endTime = date('H:i', strtotime($endTime . ' +15 minutes'));
echo $startTime . " " . $endTime . " " . $currentTime . "\n";
if ($currentTime >= $startTime && $currentTime <= $endTime) {
echo "yes";
}
}
}
}
echo "no";*/
BARKNotifier::notifyTimeSensitive("START THE MEETING NOW");
echo "OK";