-
Notifications
You must be signed in to change notification settings - Fork 0
/
coworkers-now.php
119 lines (98 loc) · 3.43 KB
/
coworkers-now.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
/**
* coworkers_now_tv();
* Get the number of people connected
*/
function coworkers_now_tv() {
$hour_now = date('H');
$hour_now += 2;
$start_hour = 12;
$end_hour = 14;
if ($hour_now >= $start_hour && $hour_now < $end_hour) {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=120';
} else {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=15';
}
$ch = curl_init($curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$number_coworkers = curl_exec($ch);
$number_worplaces = 28;
$remaining_workplaces = $number_worplaces - $number_coworkers;
if ($number_coworkers == 0) {
echo 'Pas de coworker !';
}
elseif ($number_coworkers == 1) {
echo '<span class="highlight-text">' . $number_coworkers . ' </span>coworker actuellement !';
}
else {
echo 'Nous sommes <span class="highlight-text">' . $number_coworkers . '</span> actuellement !';
}
}
/**
* coworkers_now();
* Get the number of people connected
*/
function coworkers_now() {
$hour_now = date('H');
$hour_now += 2;
$start_hour = 12;
$end_hour = 14;
if ($hour_now >= $start_hour && $hour_now < $end_hour) {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=120';
} else {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=15';
}
$ch = curl_init($curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$number_coworkers = curl_exec($ch);
$number_worplaces = 28;
$remaining_workplaces = $number_worplaces - $number_coworkers;
if ($number_coworkers == 0) {
echo 'Pas de coworker actuellement. <span class="highlight-text">';
}
elseif ($number_coworkers == 1) {
echo 'Actuellement <span class="highlight-text">' . $number_coworkers . ' </span>coworker présent.<br/><span class="highlight-text">' . $remaining_workplaces . '</span> postes de travail encore disponibles.';
}
else {
echo 'Actuellement <span class="highlight-text">' . $number_coworkers . ' </span>coworkers présents.<br/><span class="highlight-text">' . $remaining_workplaces . '</span> postes de travail encore disponibles.';
}
}
/**
* coworkers_now_app();
* Get the number of people connected
*/
function coworkers_now_app() {
$hour_now = date('H');
$hour_now += 2;
$start_hour = 12;
$end_hour = 14;
if ($hour_now >= $start_hour && $hour_now < $end_hour) {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=120';
} else {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=15';
}
$ch = curl_init($curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
echo curl_exec($ch);
}
/**
* coworkers_now_app();
* Get the number of people connected
*/
function remaining_workplaces_app() {
$hour_now = date('H');
$hour_now += 2;
$start_hour = 12;
$end_hour = 14;
if ($hour_now >= $start_hour && $hour_now < $end_hour) {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=120';
} else {
$curl_url = 'https://tickets.coworking-metz.fr/coworkersNow?delay=15';
}
$ch = curl_init($curl_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$number_coworkers = curl_exec($ch);
$number_worplaces = 28;
$remaining_workplaces = $number_worplaces - $number_coworkers;
echo $remaining_workplaces;
}