-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfusionbells.php
178 lines (155 loc) · 4.16 KB
/
fusionbells.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<?php
/*
* Project Name: FusionBells for FusionPBX
*
* Description: Multicast Bell Notification for
* education environments. Uses FFMPEG for transcoding
* and network delivery.
*
* Requirements: FusionPBX, SQLite and Multicast network
* configuration.
*
* Developer: FikesMedia.com
* Contact: [email protected]
* Copyright: Copyright 2017 FikesMedia All Right Reserved
*/
/*
* Integration piece into Fusion PBX
* Contributor(s):
* Mark J Crane <[email protected]>
*/
include "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
if (permission_exists('system_status_sofia_status')
|| permission_exists('system_status_sofia_status_profile')
|| if_group("superadmin")) {
//access granted
}
else {
echo "access denied";
exit;
}
//add multi-lingual support
$language = new text;
$text = $language->get();
//show the content
require_once "resources/header.php";
$document['title'] = $text['title-fusionbells'];
?>
<link rel="stylesheet" type="text/css" href="css/overides.css">
<?php
/*
* Zone Domains
*
* Christopher Fikes
* 03/10/2017
*/
require_once "includes.php";
domainDB();
?>
<?php navMenu(); ?>
<!-- Actions on this page -->
<li class="dropdown">
<a class="dropdown-toggle text-left" data-toggle="dropdown" href="#">
<span class="glyphicon glyphicon-cog" title="Actions"></span>
<span class="hidden-sm" style="margin-left: 5px;">Actions</span>
</a>
<ul class="dropdown-menu">
<li><a href="#" onclick="ringbell('Normal');"> Ring Normal</a></li>
<li><a href="#" onclick="ringbell('FireDrill');"> Fire Drill</a></li>
<li><a href="#" onclick="ringbell('WeatherDrill');"> Weather Drill</a></li>
<!--<li role="separator" class="divider"></li>-->
</ul>
</li>
<?php navMenuClose(); ?>
<br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr><th class="th" colspan="2" align="left">Current Schedule</th></tr>
<tr><td width="20%" class="vncell" style="text-align: left;">Current Time</td><td class="row_style1" id="currentTime">00:00</td></tr>
<tr><td width="20%" class="vncell" style="text-align: left;">Schedule Name</td><td class="row_style1" id="nextSchedule">Normal Bells</td></tr>
<tr><td width="20%" class="vncell" style="text-align: left;">Next Ring</td><td class="row_style1" id="nextRing">3:00 PM</td></tr>
</tbody>
</table>
<script src="js/manualoverride.js"></script>
<div align='center'>
<br>
<p>Fusion Bells is developed and provided by FikesMedia</br><img src='img/fikesmedialogo.png' style='height: 28px;'> <img src="img/fblogo.png" style="height:28px;"></p>
</div>
<?php
//
// Domain Test DEVELOPMENT
//
echo "<hr>Zone Information";
echo "<br>NAME " . $_SESSION["domain_name"];
echo "<br>UUID " . $_SESSION["domain_uuid"];
?>
<script>
/*
* Gets Current Schedule and Next Ring
*
* Christopher Fikes
* 03/05/2017
*/
function getNextRing() {
$('#nextSchedule').html("");
$('#nextRing').html("");
$.ajax({
'method' : "POST",
'url' : "../fusionbells/api.php",
'context' : document.body,
'dataType' : 'json',
'data' : { "call" : "nextring" },
'success' : function (data) {
$.each(data, function() {
$('#nextSchedule').html(this.Schedule);
$('#nextRing').html(this.Time);
});
},
'error' : function (jqXHR, exception) {
console.log(exception);
var responseText = jQuery.parseJSON(jqXHR.responseText);
console.log(responseText);
}
}).done(function(){
//Nothing
console.log("Finished Next Ring");
});
}
/*
* Gets Current Time
*
* Christopher Fikes
* 03/05/2017
*/
function getTime() {
$.ajax({
'method' : "POST",
'url' : "../fusionbells/api.php",
'context' : document.body,
'dataType' : 'json',
'data' : { "call" : "gettime" },
'success' : function (data) {
$.each(data, function() {
console.log(this.Time);
$('#currentTime').html(this.Time);
});
}
}).done(function(){
//Nothing
});
}
//Initial Grab of next getNextRing
getNextRing();
getTime();
//Every 60 Seconds get next ring.
setInterval(function() {
getNextRing();
getTime();
}, 60000);
</script>
<?php
//include the footer
require_once "resources/footer.php";
?>