, Joe Johnson LICENSE: AGPLv2 # # Mobile version of summary report for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # # STOP=4000, SLOW=40, GO=4 seconds refresh interval # # changes: # # 190129-1258 - First release # 200414-2000 - Minor display modifications, auto-selecting refresh rate onload # 220301-2036 - Added allow_web_debug system setting # 240801-1130 - Code updates for PHP8 compatibility # 251205-1932 - Added ADAPT_PERCENTMAX # require("dbconnect_mysqli.php"); require("functions.php"); $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); if (isset($_GET["RR"])) {$RR=$_GET["RR"];} elseif (isset($_POST["RR"])) {$RR=$_POST["RR"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];} elseif (isset($_POST["adastats"])) {$adastats=$_POST["adastats"];} if (isset($_GET["types"])) {$types=$_GET["types"];} elseif (isset($_POST["types"])) {$types=$_POST["types"];} if (isset($_GET["current_displayed_report"])) {$current_displayed_report=$_GET["current_displayed_report"];} elseif (isset($_POST["current_displayed_report"])) {$current_displayed_report=$_POST["current_displayed_report"];} if (isset($_GET["submit"])) {$submit=$_GET["submit"];} elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];} if (isset($_GET["browser_dimension"])) {$browser_dimension=$_GET["browser_dimension"];} elseif (isset($_POST["browser_dimension"])) {$browser_dimension=$_POST["browser_dimension"];} $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $NOW_TIME = date("Y-m-d H:i:s"); $STARTtime = date("U"); if (!isset($browser_dimension)) {$browser_dimension=800;} if (!is_array($types)) {$types=array('LIST ALL CAMPAIGNS');} $cell_dimension=floor($browser_dimension/10); $report_name = 'Real-Time Campaign Summary'; $db_source = 'M'; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### $stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method,allow_web_debug FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); #if ($DB) {$MAIN.="$stmt\n";} $qm_conf_ct = mysqli_num_rows($rslt); if ($qm_conf_ct > 0) { $row=mysqli_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; $slave_db_server = $row[2]; $reports_use_slave_db = $row[3]; $SSenable_languages = $row[4]; $SSlanguage_method = $row[5]; $SSallow_web_debug = $row[6]; } if ($SSallow_web_debug < 1) {$DB=0;} ##### END SETTINGS LOOKUP ##### ########################################### $submit = preg_replace('/[^-_0-9a-zA-Z]/', '', $submit); $SUBMIT = preg_replace('/[^-_0-9a-zA-Z]/', '', $SUBMIT); $RR = preg_replace('/[^-_0-9a-zA-Z]/', '', $RR); $file_download = preg_replace('/[^-_0-9a-zA-Z]/', '', $file_download); $adastats = preg_replace('/[^-_0-9a-zA-Z]/', '', $adastats); $current_displayed_report = preg_replace('/[^-_0-9a-zA-Z]/', '', $current_displayed_report); $browser_dimension = preg_replace('/[^-_0-9a-zA-Z]/', '', $browser_dimension); # Variables filtered further down in the code # $types if ($non_latin < 1) { $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW); } else { $PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER); $PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW); } if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) ) { mysqli_close($link); $use_slave_server=1; $db_source = 'S'; require("dbconnect_mysqli.php"); $MAIN.="\n"; } $stmt="SELECT selected_language from vicidial_users where user='$PHP_AUTH_USER';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $sl_ct = mysqli_num_rows($rslt); if ($sl_ct > 0) { $row=mysqli_fetch_row($rslt); $VUselected_language = $row[0]; } $auth=0; $reports_auth=0; $admin_auth=0; $auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1,0); if ($auth_message == 'GOOD') {$auth=1;} if ($auth > 0) { $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $admin_auth=$row[0]; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports='1';"; if ($DB) {echo "|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $reports_auth=$row[0]; if ($reports_auth < 1) { $VDdisplayMESSAGE = _QXZ("You are not allowed to view reports"); Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } if ( ($reports_auth > 0) and ($admin_auth < 1) ) { $ADD=999999; $reports_only_user=1; } } else { $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again"); if ($auth_message == 'LOCK') { $VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes"); Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } if ($auth_message == 'IPBLOCK') { $VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": $ip"; Header ("Content-type: text/html; charset=utf-8"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n"; exit; } Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n"; exit; } $stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER';"; if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGuser_group = $row[0]; $stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';"; if ($DB) {$MAIN.="|$stmt|\n";} $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $LOGallowed_campaigns = $row[0]; $LOGallowed_reports = $row[1]; if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\""); Header("HTTP/1.0 401 Unauthorized"); echo _QXZ("You are not allowed to view this report").": |$PHP_AUTH_USER|$report_name|"._QXZ("$report_name")."|\n"; exit; } $LOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL=''; if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) ) { $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; } for ($q=0; $q"; $HEADER.="\n"; $HEADER.="\n"; $HEADER.="\n"; $HEADER.="\n"; $HEADER.="\n"; $HEADER.="$report_name\n"; # BGCOLOR='#".$SSmenu_background."' $MAIN.="
$report_name
"; $k=0; $JS_text.="var CAMPAIGNS=["; $JS_text2="var ALL_CAMPAIGNS=["; $JS_knob=""; $sub_pct_display=""; while($k<$groups_to_print) { $NFB = ''; $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; $group = $groups[$k]; $JS_text.="'$group',"; $JS_text2.="'$group',"; $sub_pct_display.="
"; $sub_pct_display.="
$group
"; $CSV_text.="\"$group\"\n"; $stmt = "select count(*) from vicidial_campaigns where campaign_id='$group' and campaign_allow_inbound='Y';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $campaign_allow_inbound = $row[0]; $stmt="select auto_dial_level,dial_status_a,dial_status_b,dial_status_c,dial_status_d,dial_status_e,lead_order,lead_filter_id,hopper_level,dial_method,adaptive_maximum_level,adaptive_dropped_percentage,adaptive_dl_diff_target,adaptive_intensity,available_only_ratio_tally,adaptive_latest_server_time,local_call_time,dial_timeout,dial_statuses from vicidial_campaigns where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $DIALlev["$group"] = $row[0]; $DIALstatusA["$group"] = $row[1]; $DIALstatusB["$group"] = $row[2]; $DIALstatusC["$group"] = $row[3]; $DIALstatusD["$group"] = $row[4]; $DIALstatusE["$group"] = $row[5]; $DIALorder["$group"] = $row[6]; $DIALfilter["$group"] = $row[7]; $HOPlev["$group"] = $row[8]; $DIALmethod["$group"] = $row[9]; $maxDIALlev["$group"] = $row[10]; $DROPmax["$group"] = $row[11]; $targetDIFF["$group"] = $row[12]; $ADAintense["$group"] = $row[13]; $ADAavailonly["$group"] = $row[14]; $TAPERtime["$group"] = $row[15]; $CALLtime["$group"] = $row[16]; $DIALtimeout["$group"] = $row[17]; $DIALstatuses["$group"] = $row[18]; $DIALstatuses["$group"] = (preg_replace("/ -$|^ /","",$DIALstatuses["$group"])); $DIALstatuses["$group"] = (preg_replace('/\s/', ', ', $DIALstatuses["$group"])); $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $VDhop["$group"] = $row[0]; $stmt="select dialable_leads,calls_today,drops_today,drops_answers_today_pct,differential_onemin,agents_average_onemin,balance_trunk_fill,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,agent_calls_today,agent_wait_today,agent_custtalk_today,agent_acw_today,agent_pause_today from vicidial_campaign_stats where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $DAleads["$group"] = $row[0]; $callsTODAY["$group"] = $row[1]; $dropsTODAY["$group"] = $row[2]; $drpctTODAY["$group"] = $row[3]; $diffONEMIN["$group"] = $row[4]; $agentsONEMIN["$group"] = $row[5]; $balanceFILL["$group"] = $row[6]; $answersTODAY["$group"] = $row[7]; $VSCcat1["$group"] = $row[8]; $VSCcat1tally["$group"] = $row[9]; $VSCcat2["$group"] = $row[10]; $VSCcat2tally["$group"] = $row[11]; $VSCcat3["$group"] = $row[12]; $VSCcat3tally["$group"] = $row[13]; $VSCcat4["$group"] = $row[14]; $VSCcat4tally["$group"] = $row[15]; $VSCagentcalls["$group"] = $row[16]; $VSCagentwait["$group"] = $row[17]; $VSCagentcust["$group"] = $row[18]; $VSCagentacw["$group"] = $row[19]; $VSCagentpause["$group"] = $row[20]; $diffpctONEMIN = ( MathZDC($diffONEMIN["$group"], $agentsONEMIN["$group"]) * 100); $diffpctONEMIN = sprintf("%01.2f", $diffpctONEMIN); $diffpctONEMIN_ary["$group"] = $diffpctONEMIN; $stmt="select sum(local_trunk_shortage) from vicidial_campaign_server_stats where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $balanceSHORT["$group"] = $row[0]; ################################################################################ ### START calculating calls/agents ################################################################################ ################################################################################ ###### OUTBOUND CALLS ################################################################################ if ($campaign_allow_inbound > 0) { $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $closer_campaigns = preg_replace("/^ | -$/","",$row[0]); $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); $closer_campaigns = "'$closer_campaigns'"; $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') and ( (call_type='IN' and campaign_id IN($closer_campaigns)) or (campaign_id='" . mysqli_real_escape_string($link, $group) . "' and call_type='OUT') );"; } else { if ($group=='XXXX-ALL-ACTIVE-XXXX') {$groupSQL = '';} else {$groupSQL = " and campaign_id='" . mysqli_real_escape_string($link, $group) . "'";} $stmt="select status from vicidial_auto_calls where status NOT IN('XFER') $groupSQL;"; } $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $parked_to_print = mysqli_num_rows($rslt); if ($parked_to_print > 0) { $i=0; $out_total["$group"]=0; $out_ring["$group"]=0; $out_live["$group"]=0; $in_ivr["$group"]=0; while ($i < $parked_to_print) { $row=mysqli_fetch_row($rslt); if (preg_match("/LIVE/i",$row[0])) {$out_live["$group"]++;} else { if (preg_match("/IVR/i",$row[0])) {$in_ivr["$group"]++;} if (preg_match("/CLOSER/i",$row[0])) {$nothing=1;} else {$out_ring["$group"]++;} } $out_total["$group"]++; $i++; } if ($out_live > 0) {$F=''; $FG='';} if ($out_live > 4) {$F=''; $FG='';} if ($out_live > 9) {$F=''; $FG='';} if ($out_live > 14) {$F=''; $FG='';} } ################################################################################### ###### TIME ON SYSTEM ################################################################################### $agent_incall["$group"]=0; $agent_ready["$group"]=0; $agent_paused["$group"]=0; $agent_total["$group"]=0; $stmt="select extension,user,conf_exten,status,server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,campaign_id from vicidial_live_agents where campaign_id='" . mysqli_real_escape_string($link, $group) . "';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$MAIN.="$stmt\n";} $talking_to_print = mysqli_num_rows($rslt); if ($talking_to_print > 0) { $i=0; $agentcount=0; while ($i < $talking_to_print) { $row=mysqli_fetch_row($rslt); if (preg_match("/READY|PAUSED/i",$row[3])) { $row[5]=$row[6]; } $Lstatus = $row[3]; $status = sprintf("%-6s", $row[3]); if (!preg_match("/INCALL|QUEUE/i",$row[3])) {$call_time_S = ($STARTtime - $row[6]);} else {$call_time_S = ($STARTtime - $row[5]);} $call_time_M = MathZDC($call_time_S, 60); $call_time_M = round($call_time_M, 2); $call_time_M_int = intval("$call_time_M"); $call_time_SEC = ($call_time_M - $call_time_M_int); $call_time_SEC = ($call_time_SEC * 60); $call_time_SEC = round($call_time_SEC, 0); if ($call_time_SEC < 10) {$call_time_SEC = "0$call_time_SEC";} $call_time_MS = "$call_time_M_int:$call_time_SEC"; $call_time_MS = sprintf("%7s", $call_time_MS); $G = ''; $EG = ''; if (preg_match("/PAUSED/i",$row[3])) { if ($call_time_M_int >= 30) {$i++; continue;} else { $agent_paused["$group"]++; $agent_total["$group"]++; } } if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) ) {$agent_incall["$group"]++; $agent_total["$group"]++;} if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) ) {$agent_ready["$group"]++; $agent_total["$group"]++;} $agentcount++; $i++; } } ################################################################################ ### END calculating calls/agents ################################################################################ if ($VSCagentcalls > 0) { $avgpauseTODAY = MathZDC($VSCagentpause["$group"], $VSCagentcalls["$group"]); $avgpauseTODAY = round($avgpauseTODAY, 0); $avgpauseTODAY = sprintf("%01.0f", $avgpauseTODAY); $avgpauseTODAY_ary["$group"]=$avgpauseTODAY; $avgwaitTODAY = MathZDC($VSCagentwait["$group"], $VSCagentcalls["$group"]); $avgwaitTODAY = round($avgwaitTODAY, 0); $avgwaitTODAY = sprintf("%01.0f", $avgwaitTODAY); $avgwaitTODAY_ary["$group"]=$avgwaitTODAY; $avgcustTODAY = MathZDC($VSCagentcust["$group"], $VSCagentcalls["$group"]); $avgcustTODAY = round($avgcustTODAY, 0); $avgcustTODAY = sprintf("%01.0f", $avgcustTODAY); $avgcustTODAY_ary["$group"]=$avgcustTODAY; $avgacwTODAY = MathZDC($VSCagentacw["$group"], $VSCagentcalls["$group"]); $avgacwTODAY = round($avgacwTODAY, 0); $avgacwTODAY = sprintf("%01.0f", $avgacwTODAY); $avgacwTODAY_ary["$group"]=$avgacwTODAY; } # $MAIN.="\n\n

"; $k++; } $JS_text=preg_replace('/,$/', '', $JS_text); $JS_text.="];\n"; $JS_text2=preg_replace('/,$/', '', $JS_text2); $JS_text2.="];\n"; $JS_text.=$JS_text2; # Output all arrays $n=0; $DIALlev_JS='var DIAL_lev=['; $DIALstatusA_JS='var DIALstatusA=['; $DIALstatusB_JS='var DIALstatusB=['; $DIALstatusC_JS='var DIALstatusC=['; $DIALstatusD_JS='var DIALstatusD=['; $DIALstatusE_JS='var DIALstatusE=['; $DIALorder_JS='var DIALorder=['; $DIALfilter_JS='var DIALfilter=['; $HOPlev_JS='var HOPlev=['; $DIALmethod_JS='var DIALmethod=['; $maxDIALlev_JS='var maxDIALlev=['; $DROPmax_JS='var DROPmax=['; $targetDIFF_JS='var targetDIFF=['; $ADAintense_JS='var ADAintense=['; $ADAavailonly_JS='var ADAavailonly=['; $TAPERtime_JS='var TAPERtime=['; $CALLtime_JS='var CALLtime=['; $DIALtimeout_JS='var DIALtimeout=['; $DIALstatuses_JS='var DIALstatuses=['; $VDhop_JS='var VDhop=['; $DAleads_JS='var DAleads=['; $callsTODAY_JS='var callsTODAY=['; $dropsTODAY_JS='var dropsTODAY=['; $drpctTODAY_JS='var drpctTODAY=['; $diffONEMIN_JS='var diffONEMIN=['; $agentsONEMIN_JS='var agentsONEMIN=['; $balanceFILL_JS='var balanceFILL=['; $answersTODAY_JS='var answersTODAY=['; $VSCcat1_JS='var VSCcat1=['; $VSCcat1tally_JS='var VSCcat1tally=['; $VSCcat2_JS='var VSCcat2=['; $VSCcat2tally_JS='var VSCcat2tally=['; $VSCcat3_JS='var VSCcat3=['; $VSCcat3tally_JS='var VSCcat3tally=['; $VSCcat4_JS='var VSCcat4=['; $VSCcat4tally_JS='var VSCcat4tally=['; $VSCagentcalls_JS='var VSCagentcalls=['; $VSCagentwait_JS='var VSCagentwait=['; $VSCagentcust_JS='var VSCagentcust=['; $VSCagentacw_JS='var VSCagentacw=['; $VSCagentpause_JS='var VSCagentpause=['; $diffpctONEMIN_ary_JS='var diffpctONEMIN_ary=['; $balanceSHORT_JS='var balanceSHORT=['; $out_total_JS='var out_total=['; $out_ring_JS='var out_ring=['; $out_live_JS='var out_live=['; $in_ivr_JS='var in_ivr=['; $agent_incall_JS='var agent_incall=['; $agent_ready_JS='var agent_ready=['; $agent_paused_JS='var agent_paused=['; $agent_total_JS='var agent_total=['; $avgpauseTODAY_ary_JS='var avgpauseTODAY_ary=['; $avgwaitTODAY_ary_JS='var avgwaitTODAY_ary=['; $avgcustTODAY_ary_JS='var avgcustTODAY_ary=['; $avgacwTODAY_ary_JS='var avgacwTODAY_ary=['; while ($n<$groups_to_print) { # $DIALlev["$group"] = $row[0]; $DIALlev_JS .= "'".$DIALlev[$groups[$n]]."',"; $DIALstatusA_JS .= "'".$DIALstatusA[$groups[$n]]."',"; $DIALstatusB_JS .= "'".$DIALstatusB[$groups[$n]]."',"; $DIALstatusC_JS .= "'".$DIALstatusC[$groups[$n]]."',"; $DIALstatusD_JS .= "'".$DIALstatusD[$groups[$n]]."',"; $DIALstatusE_JS .= "'".$DIALstatusE[$groups[$n]]."',"; $DIALorder_JS .= "'".$DIALorder[$groups[$n]]."',"; $DIALfilter_JS .= "'".$DIALfilter[$groups[$n]]."',"; $HOPlev_JS .= "'".$HOPlev[$groups[$n]]."',"; $DIALmethod_JS .= "'".$DIALmethod[$groups[$n]]."',"; $maxDIALlev_JS .= "'".$maxDIALlev[$groups[$n]]."',"; $DROPmax_JS .= "'".$DROPmax[$groups[$n]]."',"; $targetDIFF_JS .= "'".$targetDIFF[$groups[$n]]."',"; $ADAintense_JS .= "'".$ADAintense[$groups[$n]]."',"; $ADAavailonly_JS .= "'".$ADAavailonly[$groups[$n]]."',"; $TAPERtime_JS .= "'".$TAPERtime[$groups[$n]]."',"; $CALLtime_JS .= "'".$CALLtime[$groups[$n]]."',"; $DIALtimeout_JS .= "'".$DIALtimeout[$groups[$n]]."',"; $DIALstatuses_JS .= "'".$DIALstatuses[$groups[$n]]."',"; $VDhop_JS .= "'".$VDhop[$groups[$n]]."',"; $DAleads_JS .= "'".$DAleads[$groups[$n]]."',"; $callsTODAY_JS .= "'".$callsTODAY[$groups[$n]]."',"; $dropsTODAY_JS .= "'".$dropsTODAY[$groups[$n]]."',"; $drpctTODAY_JS .= "'".$drpctTODAY[$groups[$n]]."',"; $diffONEMIN_JS .= "'".$diffONEMIN[$groups[$n]]."',"; $agentsONEMIN_JS .= "'".$agentsONEMIN[$groups[$n]]."',"; $balanceFILL_JS .= "'".$balanceFILL[$groups[$n]]."',"; $answersTODAY_JS .= "'".$answersTODAY[$groups[$n]]."',"; $VSCcat1_JS .= "'".$VSCcat1[$groups[$n]]."',"; $VSCcat1tally_JS .= "'".$VSCcat1tally[$groups[$n]]."',"; $VSCcat2_JS .= "'".$VSCcat2[$groups[$n]]."',"; $VSCcat2tally_JS .= "'".$VSCcat2tally[$groups[$n]]."',"; $VSCcat3_JS .= "'".$VSCcat3[$groups[$n]]."',"; $VSCcat3tally_JS .= "'".$VSCcat3tally[$groups[$n]]."',"; $VSCcat4_JS .= "'".$VSCcat4[$groups[$n]]."',"; $VSCcat4tally_JS .= "'".$VSCcat4tally[$groups[$n]]."',"; $VSCagentcalls_JS .= "'".$VSCagentcalls[$groups[$n]]."',"; $VSCagentwait_JS .= "'".$VSCagentwait[$groups[$n]]."',"; $VSCagentcust_JS .= "'".$VSCagentcust[$groups[$n]]."',"; $VSCagentacw_JS .= "'".$VSCagentacw[$groups[$n]]."',"; $VSCagentpause_JS .= "'".$VSCagentpause[$groups[$n]]."',"; $diffpctONEMIN_ary_JS .= "'".$diffpctONEMIN_ary[$groups[$n]]."',"; $balanceSHORT_JS .= "'".$balanceSHORT[$groups[$n]]."',"; $out_total_JS .= "'".$out_total[$groups[$n]]."',"; $out_ring_JS .= "'".$out_ring[$groups[$n]]."',"; $out_live_JS .= "'".$out_live[$groups[$n]]."',"; $in_ivr_JS .= "'".$in_ivr[$groups[$n]]."',"; $agent_incall_JS .= "'".$agent_incall[$groups[$n]]."',"; $agent_ready_JS .= "'".$agent_ready[$groups[$n]]."',"; $agent_paused_JS .= "'".$agent_paused[$groups[$n]]."',"; $agent_total_JS .= "'".$agent_total[$groups[$n]]."',"; $avgpauseTODAY_ary_JS .= "'".$avgpauseTODAY_ary[$groups[$n]]."',"; $avgwaitTODAY_ary_JS .= "'".$avgwaitTODAY_ary[$groups[$n]]."',"; $avgcustTODAY_ary_JS .= "'".$avgcustTODAY_ary[$groups[$n]]."',"; $avgacwTODAY_ary_JS .= "'".$avgacwTODAY_ary[$groups[$n]]."',"; $n++; } $DIALlev_JS.="];\n"; $DIALstatusA_JS.="];\n"; $DIALstatusB_JS.="];\n"; $DIALstatusC_JS.="];\n"; $DIALstatusD_JS.="];\n"; $DIALstatusE_JS.="];\n"; $DIALorder_JS.="];\n"; $DIALfilter_JS.="];\n"; $HOPlev_JS.="];\n"; $DIALmethod_JS.="];\n"; $maxDIALlev_JS.="];\n"; $DROPmax_JS.="];\n"; $targetDIFF_JS.="];\n"; $ADAintense_JS.="];\n"; $ADAavailonly_JS.="];\n"; $TAPERtime_JS.="];\n"; $CALLtime_JS.="];\n"; $DIALtimeout_JS.="];\n"; $DIALstatuses_JS.="];\n"; $VDhop_JS.="];\n"; $DAleads_JS.="];\n"; $callsTODAY_JS.="];\n"; $dropsTODAY_JS.="];\n"; $drpctTODAY_JS.="];\n"; $diffONEMIN_JS.="];\n"; $agentsONEMIN_JS.="];\n"; $balanceFILL_JS.="];\n"; $answersTODAY_JS.="];\n"; $VSCcat1_JS.="];\n"; $VSCcat1tally_JS.="];\n"; $VSCcat2_JS.="];\n"; $VSCcat2tally_JS.="];\n"; $VSCcat3_JS.="];\n"; $VSCcat3tally_JS.="];\n"; $VSCcat4_JS.="];\n"; $VSCcat4tally_JS.="];\n"; $VSCagentcalls_JS.="];\n"; $VSCagentwait_JS.="];\n"; $VSCagentcust_JS.="];\n"; $VSCagentacw_JS.="];\n"; $VSCagentpause_JS.="];\n"; $diffpctONEMIN_ary_JS.="];\n"; $balanceSHORT_JS.="];\n"; $out_total_JS.="];\n"; $out_ring_JS.="];\n"; $out_live_JS.="];\n"; $in_ivr_JS.="];\n"; $agent_incall_JS.="];\n"; $agent_ready_JS.="];\n"; $agent_paused_JS.="];\n"; $agent_total_JS.="];\n"; $avgpauseTODAY_ary_JS.="];\n"; $avgwaitTODAY_ary_JS.="];\n"; $avgcustTODAY_ary_JS.="];\n"; $avgacwTODAY_ary_JS.="];\n"; $JS_text.=$DIALlev_JS.$DIALstatusA_JS.$DIALstatusB_JS.$DIALstatusC_JS.$DIALstatusD_JS.$DIALstatusE_JS.$DIALorder_JS.$DIALfilter_JS.$HOPlev_JS.$DIALmethod_JS.$maxDIALlev_JS.$DROPmax_JS.$targetDIFF_JS.$ADAintense_JS.$ADAavailonly_JS.$TAPERtime_JS.$CALLtime_JS.$DIALtimeout_JS.$DIALstatuses_JS.$VDhop_JS.$DAleads_JS.$callsTODAY_JS.$dropsTODAY_JS.$drpctTODAY_JS.$diffONEMIN_JS.$agentsONEMIN_JS.$balanceFILL_JS.$answersTODAY_JS.$VSCcat1_JS.$VSCcat1tally_JS.$VSCcat2_JS.$VSCcat2tally_JS.$VSCcat3_JS.$VSCcat3tally_JS.$VSCcat4_JS.$VSCcat4tally_JS.$VSCagentcalls_JS.$VSCagentwait_JS.$VSCagentcust_JS.$VSCagentacw_JS.$VSCagentpause_JS.$diffpctONEMIN_ary_JS.$balanceSHORT_JS.$out_total_JS.$out_ring_JS.$out_live_JS.$in_ivr_JS.$agent_incall_JS.$agent_ready_JS.$agent_paused_JS.$agent_total_JS.$avgpauseTODAY_ary_JS.$avgwaitTODAY_ary_JS.$avgcustTODAY_ary_JS.$avgacwTODAY_ary_JS; $JS_text=preg_replace('/,];/', '];', $JS_text); $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.=""; # $MAIN.=""; # $MAIN.=""; $MAIN.=""; $MAIN.="
"._QXZ("CAMPAIGNS").":
\n"; # $MAIN.="\n"; $MAIN.="
"; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.="
"; $MAIN.="\n"; $MAIN.="\n"; $MAIN.="\n"; $MAIN.="

\n\n"; $MAIN.="
"; $MAIN.=""; # $MAIN.="

"; $MAIN.="
"; $MAIN.="
"; $MAIN.=""; $MAIN.=""; $MAIN.=""; $MAIN.="\n\n
"; $MAIN.="\n"; #$MAIN.="
\n"; $MAIN.="\n"; # $MAIN.="$db_source\n"; if ($file_download>0) { $FILE_TIME = date("Ymd-His"); $CSVfilename = "AST_timeonVDADallSUMMARY_$US$FILE_TIME.csv"; $CSV_text=preg_replace('/\n +,/', ',', $CSV_text); $CSV_text=preg_replace('/ +\"/', '"', $CSV_text); $CSV_text=preg_replace('/\" +/', '"', $CSV_text); // We'll be outputting a TXT file header('Content-type: application/octet-stream'); // It will be called LIST_101_20090209-121212.txt header("Content-Disposition: attachment; filename=\"$CSVfilename\""); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); ob_clean(); flush(); echo "$CSV_text"; exit; } else { header ("Content-type: text/html; charset=utf-8"); echo $HEADER; $android_header=1; require("admin_header.php"); # print_r($VDhop); echo $MAIN; echo ""; } /* if (MainGraph) { if (document.getElementById('graph_type').value!=graph_type) { graph_type=document.getElementById('graph_type').value; MainGraph.destroy(); } else { MainGraph.update(); } } */ ?>