Update call_center_active.php
This commit is contained in:
parent
92ba5e1529
commit
7c62ff196d
|
|
@ -17,22 +17,26 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2017
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('call_center_active_view')) {
|
||||
|
||||
//includes
|
||||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('call_center_active_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//add multi-lingual support
|
||||
$language = new text;
|
||||
|
|
@ -40,13 +44,15 @@ else {
|
|||
|
||||
//get the queue_name and set it as a variable
|
||||
$queue_name = $_GET[queue_name];
|
||||
$queue_name = str_replace(" ", "-", $queue_name);
|
||||
|
||||
//get the header
|
||||
require_once "resources/header.php";
|
||||
$document['title'] = $text['title-call_center_queue_activity'];
|
||||
|
||||
?><script type="text/javascript">
|
||||
function loadXmlHttp(url, id) {
|
||||
//add the ajax
|
||||
?><script type="text/javascript">
|
||||
function loadXmlHttp(url, id) {
|
||||
var f = this;
|
||||
f.xmlHttp = null;
|
||||
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
|
||||
|
|
@ -72,31 +78,31 @@ function loadXmlHttp(url, id) {
|
|||
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
|
||||
f.xmlHttp.send(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loadXmlHttp.prototype.stateChanged=function () {
|
||||
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
||||
loadXmlHttp.prototype.stateChanged=function () {
|
||||
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
||||
//this.el.innerHTML = this.xmlHttp.responseText;
|
||||
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
var requestTime = function() {
|
||||
var requestTime = function() {
|
||||
var url = 'call_center_active_inc.php?queue_name=<?php echo $queue_name; ?>';
|
||||
new loadXmlHttp(url, 'ajax_response');
|
||||
<?php
|
||||
if (strlen($_SESSION["ajax_refresh_rate"]) == 0) { $_SESSION["ajax_refresh_rate"] = "1777"; }
|
||||
echo "setInterval(function(){new loadXmlHttp(url, 'ajax_reponse');}, ".$_SESSION["ajax_refresh_rate"].");";
|
||||
?>
|
||||
}
|
||||
}
|
||||
|
||||
if (window.addEventListener) {
|
||||
if (window.addEventListener) {
|
||||
window.addEventListener('load', requestTime, false);
|
||||
}
|
||||
else if (window.attachEvent) {
|
||||
}
|
||||
else if (window.attachEvent) {
|
||||
window.attachEvent('onload', requestTime);
|
||||
}
|
||||
}
|
||||
|
||||
function send_cmd(url) {
|
||||
function send_cmd(url) {
|
||||
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
|
||||
xmlhttp=new XMLHttpRequest();
|
||||
}
|
||||
|
|
@ -106,13 +112,17 @@ function send_cmd(url) {
|
|||
xmlhttp.open("GET",url,false);
|
||||
xmlhttp.send(null);
|
||||
//document.getElementById('cmd_response').innerHTML=xmlhttp.responseText;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<?php
|
||||
echo " <div id='ajax_response'></div>\n";
|
||||
echo "<br><br>";
|
||||
|
||||
require_once "resources/footer.php";
|
||||
//show the response
|
||||
echo " <div id='ajax_response'></div>\n";
|
||||
echo "<br><br>";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue