Update call_center_active.php
This commit is contained in:
@@ -17,22 +17,26 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
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.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
*/
|
*/
|
||||||
include "root.php";
|
|
||||||
require_once "resources/require.php";
|
//includes
|
||||||
require_once "resources/check_auth.php";
|
include "root.php";
|
||||||
if (permission_exists('call_center_active_view')) {
|
require_once "resources/require.php";
|
||||||
//access granted
|
require_once "resources/check_auth.php";
|
||||||
}
|
|
||||||
else {
|
//check permissions
|
||||||
echo "access denied";
|
if (permission_exists('call_center_active_view')) {
|
||||||
exit;
|
//access granted
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
echo "access denied";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
$language = new text;
|
$language = new text;
|
||||||
@@ -40,79 +44,85 @@ else {
|
|||||||
|
|
||||||
//get the queue_name and set it as a variable
|
//get the queue_name and set it as a variable
|
||||||
$queue_name = $_GET[queue_name];
|
$queue_name = $_GET[queue_name];
|
||||||
|
$queue_name = str_replace(" ", "-", $queue_name);
|
||||||
|
|
||||||
//get the header
|
//get the header
|
||||||
require_once "resources/header.php";
|
require_once "resources/header.php";
|
||||||
$document['title'] = $text['title-call_center_queue_activity'];
|
$document['title'] = $text['title-call_center_queue_activity'];
|
||||||
|
|
||||||
?><script type="text/javascript">
|
//add the ajax
|
||||||
function loadXmlHttp(url, id) {
|
?><script type="text/javascript">
|
||||||
var f = this;
|
function loadXmlHttp(url, id) {
|
||||||
f.xmlHttp = null;
|
var f = this;
|
||||||
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
|
|
||||||
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
|
|
||||||
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
|
|
||||||
@end @*/
|
|
||||||
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
|
|
||||||
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
|
|
||||||
else if (/(object)|(function)/.test(typeof createRequest))
|
|
||||||
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
|
|
||||||
else {
|
|
||||||
f.xmlHttp = null;
|
f.xmlHttp = null;
|
||||||
// Internet Explorer 5 to 6, includes IE 7+ when local //
|
/*@cc_on @*/ // used here and below, limits try/catch to those IE browsers that both benefit from and support it
|
||||||
/*@cc_on @*/
|
/*@if(@_jscript_version >= 5) // prevents errors in old browsers that barf on try/catch & problems in IE if Active X disabled
|
||||||
/*@if(@_jscript_version >= 5)
|
try {f.ie = window.ActiveXObject}catch(e){f.ie = false;}
|
||||||
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
|
|
||||||
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
|
|
||||||
@end @*/
|
@end @*/
|
||||||
|
if (window.XMLHttpRequest&&!f.ie||/^http/.test(window.location.href))
|
||||||
|
f.xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari, others, IE 7+ when live - this is the standard method
|
||||||
|
else if (/(object)|(function)/.test(typeof createRequest))
|
||||||
|
f.xmlHttp = createRequest(); // ICEBrowser, perhaps others
|
||||||
|
else {
|
||||||
|
f.xmlHttp = null;
|
||||||
|
// Internet Explorer 5 to 6, includes IE 7+ when local //
|
||||||
|
/*@cc_on @*/
|
||||||
|
/*@if(@_jscript_version >= 5)
|
||||||
|
try{f.xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
|
||||||
|
catch (e){try{f.xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e){f.xmlHttp=null;}}
|
||||||
|
@end @*/
|
||||||
|
}
|
||||||
|
if(f.xmlHttp != null){
|
||||||
|
f.el = document.getElementById(id);
|
||||||
|
f.xmlHttp.open("GET",url,true);
|
||||||
|
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
|
||||||
|
f.xmlHttp.send(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(f.xmlHttp != null){
|
|
||||||
f.el = document.getElementById(id);
|
loadXmlHttp.prototype.stateChanged=function () {
|
||||||
f.xmlHttp.open("GET",url,true);
|
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
||||||
f.xmlHttp.onreadystatechange = function(){f.stateChanged();};
|
//this.el.innerHTML = this.xmlHttp.responseText;
|
||||||
f.xmlHttp.send(null);
|
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
loadXmlHttp.prototype.stateChanged=function () {
|
var requestTime = function() {
|
||||||
if (this.xmlHttp.readyState == 4 && (this.xmlHttp.status == 200 || !/^http/.test(window.location.href)))
|
var url = 'call_center_active_inc.php?queue_name=<?php echo $queue_name; ?>';
|
||||||
//this.el.innerHTML = this.xmlHttp.responseText;
|
new loadXmlHttp(url, 'ajax_response');
|
||||||
document.getElementById('ajax_response').innerHTML = this.xmlHttp.responseText;
|
<?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"].");";
|
||||||
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) {
|
|
||||||
window.addEventListener('load', requestTime, false);
|
|
||||||
}
|
|
||||||
else if (window.attachEvent) {
|
|
||||||
window.attachEvent('onload', requestTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
function send_cmd(url) {
|
|
||||||
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
|
|
||||||
xmlhttp=new XMLHttpRequest();
|
|
||||||
}
|
}
|
||||||
else {// code for IE6, IE5
|
|
||||||
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
|
||||||
}
|
|
||||||
xmlhttp.open("GET",url,false);
|
|
||||||
xmlhttp.send(null);
|
|
||||||
//document.getElementById('cmd_response').innerHTML=xmlhttp.responseText;
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
if (window.addEventListener) {
|
||||||
|
window.addEventListener('load', requestTime, false);
|
||||||
|
}
|
||||||
|
else if (window.attachEvent) {
|
||||||
|
window.attachEvent('onload', requestTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
function send_cmd(url) {
|
||||||
|
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
|
||||||
|
xmlhttp=new XMLHttpRequest();
|
||||||
|
}
|
||||||
|
else {// code for IE6, IE5
|
||||||
|
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
|
||||||
|
}
|
||||||
|
xmlhttp.open("GET",url,false);
|
||||||
|
xmlhttp.send(null);
|
||||||
|
//document.getElementById('cmd_response').innerHTML=xmlhttp.responseText;
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<?php
|
<?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";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user