Added Dialer Inventory Report options for excluding lists and ranking shifts display order
Added User Group multi-selection option to the real-time report Added HTML bar chart display options to most of the reports Removed password logging from admin scripts failed login attempts Made webroot-writable system setting function the same on all admin scripts Fixed list lastcalldate for manual dial calls git-svn-id: svn://192.168.202.10@1789 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -815,6 +815,13 @@ OTHER CHANGES:
|
||||
index the vendor_lead_code field in the vicidial_list table:
|
||||
CREATE INDEX vendor_lead_code on vicidial_list (vendor_lead_code);
|
||||
|
||||
185. Added Dialer Inventory Report options for excluding lists and ranking
|
||||
shifts display order.
|
||||
|
||||
186. Added User Group multi-selection option to the real-time report.
|
||||
|
||||
187. Added HTML bar chart display options to most of the reports.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#
|
||||
# AST_dialer_inventory_snapshot.pl
|
||||
#
|
||||
# Copyright (C) 2011 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Matt Florell <vicidial@gmail.com>
|
||||
#
|
||||
# NOTES:
|
||||
@@ -17,6 +17,7 @@
|
||||
# 111106-1317 - Added help screen and debug output, reformatting
|
||||
# 111110-0652 - Added single campaign/list options and call time override option
|
||||
# 111230-1140 - Debugging additions and more minor changes
|
||||
# 120221-2238 - Added list option for inventory_report, use list_description
|
||||
#
|
||||
|
||||
use DBI;
|
||||
@@ -200,7 +201,7 @@ while(@shift_row=$shift_rslt->fetchrow_array)
|
||||
|
||||
if ($DB > 0) {print "SHIFT COUNT: $i\n";}
|
||||
|
||||
$campaign_stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists) $campaign_SQL order by campaign_id;";
|
||||
$campaign_stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $campaign_SQL order by campaign_id;";
|
||||
$campaign_rslt=$dbhA->prepare($campaign_stmt);
|
||||
$campaign_rslt->execute();
|
||||
while (@group=$campaign_rslt->fetchrow_array)
|
||||
@@ -248,7 +249,7 @@ while (@group=$campaign_rslt->fetchrow_array)
|
||||
|
||||
if ($DB > 0) {print "CAMPAIGN: $group[0] LIMIT: $call_count_limit TARGET: $call_count_target STATUSES: $i\n";}
|
||||
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where (campaign_id='$group[0]') $list_SQL order by list_id asc";
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where (campaign_id='$group[0]') and inventory_report='Y' $list_SQL order by list_id asc";
|
||||
if ($DBX > 0) {print " |$lists_stmt|\n";}
|
||||
$lists_rslt=$dbhB->prepare($lists_stmt);
|
||||
$lists_rslt->execute();
|
||||
@@ -352,7 +353,7 @@ while (@group=$campaign_rslt->fetchrow_array)
|
||||
$shift_data.="$val,$shift_count|";
|
||||
}
|
||||
$shift_data=substr($shift_data,0,-1);
|
||||
$ins_stmt="insert into dialable_inventory_snapshots(snapshot_time, list_id, list_name, campaign_id, list_lastcalldate, list_start_inv, dialable_count, dialable_count_nofilter, dialable_count_oneoff, dialable_count_inactive, average_call_count, penetration, shift_data, time_setting) values('$snapshot_time', '$list_id', '$list_name', '$group[0]', '$last_calldate', '$list_start_inv', '$Xdialable_count', '$Xdialable_count_nofilter', '$oneoff_count', '$Xdialable_inactive_count', '$average_calls', '$penetration', '$shift_data', '$time_setting')";
|
||||
$ins_stmt="insert into dialable_inventory_snapshots(snapshot_time, list_id, list_name, list_description, campaign_id, list_lastcalldate, list_start_inv, dialable_count, dialable_count_nofilter, dialable_count_oneoff, dialable_count_inactive, average_call_count, penetration, shift_data, time_setting) values('$snapshot_time', '$list_id', '$list_name', '$list_description', '$group[0]', '$last_calldate', '$list_start_inv', '$Xdialable_count', '$Xdialable_count_nofilter', '$oneoff_count', '$Xdialable_inactive_count', '$average_calls', '$penetration', '$shift_data', '$time_setting')";
|
||||
if ($DBX > 0) {print " |$ins_stmt|\n";}
|
||||
$ins_rslt=$dbh->prepare($ins_stmt);
|
||||
$ins_rslt->execute();
|
||||
|
||||
@@ -2458,6 +2458,9 @@ SUBPHASE 6.5: setting up astguiclient scripts for continuous running
|
||||
#32 0 * * * /usr/share/astguiclient/AST_VDsales_export.pl
|
||||
#42 0 * * * /usr/share/astguiclient/AST_sourceID_summary_export.pl
|
||||
|
||||
### inventory report optional
|
||||
#1 7 * * * /usr/share/astguiclient/AST_dialer_inventory_snapshot.pl -q --override-24hours
|
||||
|
||||
### remove old recordings more than 7 days old
|
||||
#24 0 * * * /usr/bin/find /var/spool/asterisk/monitorDONE -maxdepth 2 -type f -mtime +7 -print | xargs rm -f
|
||||
|
||||
|
||||
@@ -872,7 +872,8 @@ xferconf_d_number VARCHAR(50) default '',
|
||||
xferconf_e_number VARCHAR(50) default '',
|
||||
web_form_address TEXT,
|
||||
web_form_address_two TEXT,
|
||||
time_zone_setting ENUM('COUNTRY_AND_AREA_CODE','POSTAL_CODE','NANPA_PREFIX','OWNER_TIME_ZONE_CODE') default 'COUNTRY_AND_AREA_CODE'
|
||||
time_zone_setting ENUM('COUNTRY_AND_AREA_CODE','POSTAL_CODE','NANPA_PREFIX','OWNER_TIME_ZONE_CODE') default 'COUNTRY_AND_AREA_CODE',
|
||||
inventory_report ENUM('Y','N') default 'Y'
|
||||
);
|
||||
|
||||
CREATE TABLE vicidial_statuses (
|
||||
@@ -1641,6 +1642,7 @@ shift_length VARCHAR(5) default '16:00',
|
||||
shift_weekdays VARCHAR(7) default '0123456',
|
||||
report_option ENUM('Y','N') default 'N',
|
||||
user_group VARCHAR(20) default '---ALL---',
|
||||
report_rank SMALLINT(5) default '1',
|
||||
index (shift_id)
|
||||
);
|
||||
|
||||
@@ -2794,7 +2796,7 @@ CREATE TABLE vicidial_log_noanswer_archive LIKE vicidial_log_noanswer;
|
||||
CREATE TABLE vicidial_did_agent_log_archive LIKE vicidial_did_agent_log;
|
||||
CREATE UNIQUE INDEX vdala on vicidial_did_agent_log_archive (uniqueid,call_date,did_route);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1313',db_schema_update_date=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1314',db_schema_update_date=NOW();
|
||||
|
||||
GRANT RELOAD ON *.* TO cron@'%';
|
||||
GRANT RELOAD ON *.* TO cron@localhost;
|
||||
|
||||
@@ -1261,3 +1261,9 @@ index (user)
|
||||
);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1313',db_schema_update_date=NOW() where db_schema_version < 1313;
|
||||
|
||||
ALTER TABLE vicidial_lists ADD inventory_report ENUM('Y','N') default 'Y';
|
||||
|
||||
ALTER TABLE vicidial_shifts ADD report_rank SMALLINT(5) default '1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1314',db_schema_update_date=NOW() where db_schema_version < 1314;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# install.pl version 2.4
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
# CHANGES
|
||||
@@ -25,6 +25,7 @@
|
||||
# 101217-0520 - Added PREPROCESS directory
|
||||
# 110619-2153 - Added languages install and conf file specify options
|
||||
# 110812-1510 - Added tts sound directories creation
|
||||
# 120224-1614 - Added function to clear out web auth log files
|
||||
#
|
||||
|
||||
############################################
|
||||
@@ -2522,6 +2523,12 @@ if ($NOWEB < 1)
|
||||
`chmod 0777 $PATHweb/vicidial/ploticus/`;
|
||||
`chmod 0777 $PATHweb/vicidial/agent_reports/`;
|
||||
`chmod 0777 $PATHweb/vicidial/server_reports/`;
|
||||
`cp -f /dev/null $PATHweb/vicidial/project_auth_entries.txt`;
|
||||
`chmod 0777 $PATHweb/vicidial/project_auth_entries.txt`;
|
||||
`cp -f /dev/null $PATHweb/agc/vicidial_auth_entries.txt`;
|
||||
`chmod 0777 $PATHweb/agc/vicidial_auth_entries.txt`;
|
||||
`cp -f /dev/null $PATHweb/agc/astguiclient_auth_entries.txt`;
|
||||
`chmod 0777 $PATHweb/agc/astguiclient_auth_entries.txt`;
|
||||
}
|
||||
|
||||
if ( ($PROMPTcopy_web_lang =~ /y/i) || ($CLIcopy_web_lang =~ /y/i) )
|
||||
|
||||
@@ -832,6 +832,10 @@ Maximum System Stats Reports||
|
||||
These statistics are cached totals that are stored throughout each day in real-time through back-end processes. For inbound calls, the total calls per in-group are calculated for each call that enters the process that calculates. For the whole system counts, the totals are generated from log entries as well as other in-group and campaign totals. These totals may not add up due to the settings that you have in your system as well as when the call is hung up||
|
||||
Hopper VLC Dup Check||
|
||||
Setting this to Y will result in every lead being inserted into the hopper being checked by vendor_lead_code to make sure there are no duplicate leads inserted with the same vendor_lead_code. This is most useful when Auto-Alt-Dialing with MULTI_LEAD. Default is N||
|
||||
Inventory Report||
|
||||
If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes||
|
||||
Report Rank||
|
||||
This option allows you to rank shifts in selected reports that support this option||
|
||||
|
||||
|
||||
lead_report_export.php
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
<?php
|
||||
### SCRIPT_virido_crm_call.php - button to post to virido to initiate call in CRM
|
||||
#
|
||||
# To be inserted into a SCRIPT in VICIDIAL with the following code:
|
||||
#
|
||||
# <iframe src="/agc/SCRIPT_virido_crm_call.php?lead_id=--A--lead_id--B--&list_id=--A--list_id--B--&user=--A--user--B--&campaign_id=--A--campaign_id--B--&phone_number=--A--phone_number--B--&vendor_id=--A--vendor_lead_code--B--&user_custom_five=--A--user_custom_five--B--" style="width:600;height:400;background-color:transparent;" scrolling="no" frameborder="0" allowtransparency="true" id="popupFrame" name="popupFrame" width="600" height="400" STYLE="z-index:17"> </iframe>
|
||||
#
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
# 120223-1156 - First Build
|
||||
#
|
||||
|
||||
if (isset($_GET["button_id"])) {$button_id=$_GET["button_id"];}
|
||||
elseif (isset($_POST["button_id"])) {$button_id=$_POST["button_id"];}
|
||||
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
|
||||
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
|
||||
if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];}
|
||||
elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];}
|
||||
if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];}
|
||||
if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];}
|
||||
elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];}
|
||||
elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
|
||||
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$button_id=ereg_replace("[^0-9]","",$button_id);
|
||||
$lead_id=ereg_replace("[^0-9]","",$lead_id);
|
||||
$list_id=ereg_replace("[^0-9]","",$list_id);
|
||||
$phone_number=ereg_replace("[^0-9]","",$phone_number);
|
||||
$vendor_id = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vendor_id);
|
||||
$user=ereg_replace("[^0-9a-zA-Z]","",$user);
|
||||
$campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign);
|
||||
$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage);
|
||||
$epoch = ereg_replace("[^0-9]","",$epoch);
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
if (eregi("CLICK",$stage))
|
||||
{
|
||||
$epochNOW = date("U");
|
||||
$click_seconds = ($epochNOW - $epoch);
|
||||
if ( ($click_seconds < 0) or ($click_seconds > 3600) )
|
||||
{$click_seconds=0;}
|
||||
|
||||
$stmt="UPDATE qr_busy_button_log SET stage='$stage',click_seconds='$click_seconds' where button_id='$button_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "Thank you for clicking the button\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$CL=':';
|
||||
$script_name = getenv("SCRIPT_NAME");
|
||||
$server_name = getenv("SERVER_NAME");
|
||||
$server_port = getenv("SERVER_PORT");
|
||||
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
|
||||
else {$HTTPprotocol = 'http://';}
|
||||
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
|
||||
else {$server_port = "$CL$server_port";}
|
||||
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
|
||||
|
||||
$epoch = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
|
||||
# $stmt="INSERT INTO qr_busy_button_log SET lead_id='$lead_id',list_id='$list_id',phone_number='$phone_number',vendor_lead_code='$vendor_id',user='$user',campaign_id='$campaign',stage='DISPLAY',event_time='$SQLdate';";
|
||||
# if ($DB) {echo "|$stmt|\n";}
|
||||
# $rslt=mysql_query($stmt, $link);
|
||||
# $button_id = mysql_insert_id($link);
|
||||
|
||||
|
||||
# Client_Code: XYZ (Default)
|
||||
# Vendor_Code: ABC (Default)
|
||||
# Campaign_Code: XX12 (Default)
|
||||
# BTN: Outbound Dialed Phone number as specified in the lead file (This number will be used to identify the record from the lead file)
|
||||
# User_Name: This is the Agent Id of the CSR which are used in the daily files sent to us for import. These Ids will also be used by the agent to log into the scripting application
|
||||
|
||||
$virido_url = 'http://iconnect1.intellicomsoftware.com/script/dialercall.aspx';
|
||||
|
||||
echo "<B>Client_Code: </B>XYZ<BR>\n";
|
||||
echo "<B>Vendor_Code: </B>ABC<BR>\n";
|
||||
echo "<B>Campaign_Code: </B>XX12<BR>\n";
|
||||
echo "<B>User_Name: </B>$user_custom_five<BR>\n";
|
||||
echo "<B>BTN: </B>$phone_number<BR>\n";
|
||||
echo "<BR>\n";
|
||||
|
||||
echo "<FORM NAME=button_form ID=button_form ACTION=\"$virido_url\" METHOD=POST>\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Client_Code VALUE=\"XYZ\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Vendor_Code VALUE=\"ABC\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=Campaign_Code VALUE=\"XX12\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=User_Name VALUE=\"$user_custom_five\">\n";
|
||||
echo "<INPUT TYPE=HIDDEN NAME=BTN VALUE=\"$phone_number\">\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=\"Initiate Phone Call\">\n";
|
||||
echo "</FORM>\n\n";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# astguiclient.php - the web-based version of the astGUIclient client application
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least
|
||||
# user_level 1 or greater to access this page. Also you need to have the login
|
||||
@@ -58,6 +58,7 @@
|
||||
# 60829-1528 - Made compatible with WeBRooTWritablE setting in dbconnect.php
|
||||
# 90508-0727 - Changed to PHP long tags
|
||||
# 91129-2211 - Replaced SELECT STAR in SQL query
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -89,8 +90,8 @@ $user_abb = "$user$user$user$user";
|
||||
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
|
||||
{$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
|
||||
|
||||
$version = '2.2.0';
|
||||
$build = '91129-2211';
|
||||
$version = '2.2.4-1';
|
||||
$build = '120223-2124';
|
||||
|
||||
### security strip all non-alphanumeric characters out of the variables ###
|
||||
$DB=ereg_replace("[^0-9a-z]","",$DB);
|
||||
@@ -187,7 +188,7 @@ else
|
||||
$LOGfullname=$row[0];
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +196,7 @@ else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# deactivate_lead.php
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used in the "Dispo URL" field of a campaign
|
||||
# or in-group. It should take in the campaign_id to check for the same source_id
|
||||
@@ -23,6 +23,7 @@
|
||||
#
|
||||
# CHANGES
|
||||
# 100304-0354 - First Build
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$api_script = 'deactivate';
|
||||
@@ -196,6 +197,6 @@ else
|
||||
if ($log_to_file > 0)
|
||||
{
|
||||
$fp = fopen ("./deactivate_lead.txt", "a");
|
||||
fwrite ($fp, "$NOW_TIME|$lead_id|$search_field|$search_value|$campaign_check|$sale_status|$dispo|$new_status|$user|$pass|$DB|$log_to_file|$MESSAGE|\n");
|
||||
fwrite ($fp, "$NOW_TIME|$lead_id|$search_field|$search_value|$campaign_check|$sale_status|$dispo|$new_status|$user|XXXX|$DB|$log_to_file|$MESSAGE|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_move_list.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed to be used in the "Dispo URL" field of a campaign
|
||||
# or in-group. It should take in the lead_id to check for the same lead_id
|
||||
@@ -30,6 +30,7 @@
|
||||
# 100915-1600 - First Build
|
||||
# 110702-2020 - Added multiple sets of options
|
||||
# 111005-1102 - Added check and update for scheduled callback entry
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$api_script = 'deactivate';
|
||||
@@ -226,6 +227,6 @@ else
|
||||
if ($log_to_file > 0)
|
||||
{
|
||||
$fp = fopen ("./dispo_move_list.txt", "a");
|
||||
fwrite ($fp, "$NOW_TIME|$k|$lead_id|$new_list_id|$sale_status|$dispo|$user|$pass|$DB|$log_to_file|$MESSAGE|\n");
|
||||
fwrite ($fp, "$NOW_TIME|$k|$lead_id|$new_list_id|$sale_status|$dispo|$user|XXXX|$DB|$log_to_file|$MESSAGE|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
# phone_only.php - the web-based web-phone-only client application
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 110511-1336 - First Build
|
||||
# 110526-1757 - Added webphone_auto_answer option
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$version = '2.4-2p';
|
||||
$build = '110526-1757';
|
||||
$version = '2.4-3p';
|
||||
$build = '120223-2124';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=72;
|
||||
$one_mysql_log=0;
|
||||
@@ -287,7 +288,7 @@ else
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "vdweb|GOOD|$date|$VD_login|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
$user_abb = "$VD_login$VD_login$VD_login$VD_login";
|
||||
@@ -299,7 +300,7 @@ else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n");
|
||||
fwrite ($fp, "vdweb|FAIL|$date|$VD_login|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
$VDloginDISPLAY=1;
|
||||
|
||||
@@ -303,10 +303,11 @@
|
||||
# 111201-1443 - Added group_grade option
|
||||
# 120104-2031 - Fixed missing fullname variable before dispo and start URLs
|
||||
# 120213-1700 - Added vendor_lead_code to all vicidial_hopper inserts
|
||||
# 120221-2125 - Manual dials update lastcalldate, and other small changes
|
||||
#
|
||||
|
||||
$version = '2.4-203';
|
||||
$build = '120213-1700';
|
||||
$version = '2.4-204';
|
||||
$build = '120221-2125';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=438;
|
||||
$one_mysql_log=0;
|
||||
@@ -2336,7 +2337,12 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00032',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
|
||||
$stmt="UPDATE vicidial_lists set list_lastcalldate=NOW() where list_id='$list_id';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00XXX',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
$campaign_cid_override='';
|
||||
$LISTweb_form_address='';
|
||||
$LISTweb_form_address_two='';
|
||||
@@ -2627,7 +2633,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
$VDCL_xferconf_c_number='';
|
||||
$VDCL_xferconf_d_number='';
|
||||
$VDCL_xferconf_e_number='';
|
||||
$stmt = "select xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00277',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -2644,7 +2650,7 @@ if ($ACTION == 'manDiaLnextCaLL')
|
||||
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "select xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00278',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -3322,7 +3328,7 @@ if ($ACTION == 'manDiaLlookCaLL')
|
||||
{
|
||||
$wait_sec=0;
|
||||
$dead_epochSQL = '';
|
||||
$stmt = "select wait_epoch,wait_sec,dead_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "SELECT wait_epoch,wait_sec,dead_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00053',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -4508,7 +4514,7 @@ if ($stage == "end")
|
||||
$dead_secSQL='';
|
||||
$lead_id_commentsSQL='';
|
||||
$StarTtime = date("U");
|
||||
$stmt = "select talk_epoch,talk_sec,wait_sec,wait_epoch,lead_id,comments,dead_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "SELECT talk_epoch,talk_sec,wait_sec,wait_epoch,lead_id,comments,dead_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00101',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -4951,7 +4957,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "select xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00281',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5024,7 +5030,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = "select count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';";
|
||||
$stmt = "SELECT count(*) from vicidial_log where lead_id='$lead_id' and uniqueid='$uniqueid';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00118',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5048,7 +5054,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$script_recording_delay = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "select group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
$stmt = "SELECT group_name,group_color,web_form_address,fronter_display,ingroup_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_xfer_group,ingroup_recording_override,ingroup_rec_filename,default_group_alias,web_form_address_two,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,uniqueid_status_display,uniqueid_status_prefix,timer_action_destination from vicidial_inbound_groups where group_id='$VDADchannel_group';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00119',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5083,7 +5089,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$VDCL_uniqueid_status_prefix = $row[24];
|
||||
$VDCL_timer_action_destination = $row[25];
|
||||
|
||||
$stmt = "select campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt = "SELECT campaign_script,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00181',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5138,7 +5144,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
}
|
||||
}
|
||||
|
||||
$stmt = "select group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';";
|
||||
$stmt = "SELECT group_web_vars from vicidial_inbound_group_agents where group_id='$VDADchannel_group' and user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00188',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5151,7 +5157,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
|
||||
if (strlen($VDCL_group_web_vars) < 1)
|
||||
{
|
||||
$stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';";
|
||||
$stmt = "SELECT group_web_vars from vicidial_campaign_agents where campaign_id='$campaign' and user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00189',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5173,7 +5179,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "select campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$VDADchannel_group';";
|
||||
$stmt = "SELECT campaign_script,get_call_launch,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,default_group_alias,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,timer_action_destination from vicidial_campaigns where campaign_id='$VDADchannel_group';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00121',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5212,7 +5218,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$script_recording_delay = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';";
|
||||
$stmt = "SELECT group_web_vars from vicidial_campaign_agents where campaign_id='$VDADchannel_group' and user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00190',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5227,7 +5233,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
$VDCL_caller_id_number='';
|
||||
if (strlen($VDCL_default_group_alias)>1)
|
||||
{
|
||||
$stmt = "select caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';";
|
||||
$stmt = "SELECT caller_id_number from groups_alias where group_alias_id='$VDCL_default_group_alias';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00187',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5242,7 +5248,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
### Check for List ID override settings
|
||||
if (strlen($list_id)>0)
|
||||
{
|
||||
$stmt = "select xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two from vicidial_lists where list_id='$list_id';";
|
||||
$stmt = "SELECT xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two from vicidial_lists where list_id='$list_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00282',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5442,7 +5448,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
|
||||
$wait_sec=0;
|
||||
$StarTtime = date("U");
|
||||
$stmt = "select wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "SELECT wait_epoch,wait_sec from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00123',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5517,7 +5523,7 @@ if ($ACTION == 'VDADcheckINCOMING')
|
||||
{
|
||||
if (eregi('--A--user_custom_',$VDCL_start_call_url))
|
||||
{
|
||||
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
|
||||
$stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00283',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -5867,7 +5873,7 @@ if ($ACTION == 'userLOGout')
|
||||
$vlia_delete = mysql_affected_rows($link);
|
||||
|
||||
$pause_sec=0;
|
||||
$stmt = "select pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;";
|
||||
$stmt = "SELECT pause_epoch,pause_sec,wait_epoch,talk_epoch,dispo_epoch,agent_log_id from vicidial_agent_log where agent_log_id >= '$agent_log_id' and user='$user' order by agent_log_id desc limit 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6301,7 +6307,7 @@ if ($ACTION == 'updateDISPO')
|
||||
$insert_into_dnc=0;
|
||||
if ( ($use_internal_dnc=='Y') and (eregi("\|$log_dispo_choice\|", $DNC_string_check) ) )
|
||||
{
|
||||
$stmt = "select phone_number from vicidial_list where lead_id='$lead_id';";
|
||||
$stmt = "SELECT phone_number from vicidial_list where lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00146',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6314,7 +6320,7 @@ if ($ACTION == 'updateDISPO')
|
||||
}
|
||||
if ( ($use_campaign_dnc=='Y') and (eregi("\|$log_dispo_choice\|", $DNC_string_check) ) )
|
||||
{
|
||||
$stmt = "select phone_number from vicidial_list where lead_id='$lead_id';";
|
||||
$stmt = "SELECT phone_number from vicidial_list where lead_id='$lead_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00148',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6331,7 +6337,7 @@ if ($ACTION == 'updateDISPO')
|
||||
$dispo_epochSQL='';
|
||||
$lead_id_commentsSQL='';
|
||||
$StarTtime = date("U");
|
||||
$stmt = "select dispo_epoch,dispo_sec,talk_epoch,wait_epoch,lead_id,comments,agent_log_id from vicidial_agent_log where agent_log_id <='$agent_log_id' and lead_id='$lead_id' order by agent_log_id desc limit 1;";
|
||||
$stmt = "SELECT dispo_epoch,dispo_sec,talk_epoch,wait_epoch,lead_id,comments,agent_log_id from vicidial_agent_log where agent_log_id <='$agent_log_id' and lead_id='$lead_id' order by agent_log_id desc limit 1;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00150',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6458,7 +6464,7 @@ if ($ACTION == 'updateDISPO')
|
||||
|
||||
if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$VC_auto_alt_dial_statuses)) )
|
||||
{
|
||||
$stmt = "select count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';";
|
||||
$stmt = "SELECT count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00156',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6591,7 +6597,7 @@ if ($ACTION == 'updateDISPO')
|
||||
if ( (ereg('ACCTID',$vtiger_search_category)) or (ereg('ACCOUNT',$vtiger_search_category)) )
|
||||
{
|
||||
### find the full status name for this status
|
||||
$stmt = "select status_name from vicidial_statuses where status='$dispo_choice';";
|
||||
$stmt = "SELECT status_name from vicidial_statuses where status='$dispo_choice';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00211',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -6603,7 +6609,7 @@ if ($ACTION == 'updateDISPO')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "select status_name from vicidial_campaign_statuses where status='$dispo_choice' and campaign_id='$campaign';";
|
||||
$stmt = "SELECT status_name from vicidial_campaign_statuses where status='$dispo_choice' and campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00212',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7070,7 +7076,7 @@ if ($ACTION == 'updateDISPO')
|
||||
$talk_time_min=0;
|
||||
if ( (eregi('--A--user_custom_',$dispo_call_url)) or (eregi('--A--fullname',$dispo_call_url)) )
|
||||
{
|
||||
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
|
||||
$stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00288',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7089,7 +7095,7 @@ if ($ACTION == 'updateDISPO')
|
||||
|
||||
if (eregi('--A--talk_time',$dispo_call_url))
|
||||
{
|
||||
$stmt = "select talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';";
|
||||
$stmt = "SELECT talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00289',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7116,7 +7122,7 @@ if ($ACTION == 'updateDISPO')
|
||||
if (eregi('--A--dispo_name--B--',$dispo_call_url))
|
||||
{
|
||||
### find the full status name for this status
|
||||
$stmt = "select status_name from vicidial_statuses where status='$dispo_choice';";
|
||||
$stmt = "SELECT status_name from vicidial_statuses where status='$dispo_choice';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00297',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7128,7 +7134,7 @@ if ($ACTION == 'updateDISPO')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "select status_name from vicidial_campaign_statuses where status='$dispo_choice' and campaign_id='$campaign';";
|
||||
$stmt = "SELECT status_name from vicidial_campaign_statuses where status='$dispo_choice' and campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00298',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7478,7 +7484,7 @@ if ($ACTION == 'updateDISPO')
|
||||
if ( ($WeBRooTWritablE > 0) and ($enable_agc_dispo_log > 0) )
|
||||
{
|
||||
$talk_time = 0;
|
||||
$stmt = "select talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';";
|
||||
$stmt = "SELECT talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00312',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7735,7 +7741,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
|
||||
}
|
||||
|
||||
$pause_sec=0;
|
||||
$stmt = "select pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "SELECT pause_epoch,pause_sec,wait_epoch,wait_sec,dispo_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00169',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7851,7 +7857,7 @@ if ($ACTION == 'UpdatEFavoritEs')
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "select count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';";
|
||||
$stmt = "SELECT count(*) from phone_favorites where extension='$exten' and server_ip='$server_ip';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00172',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -7902,7 +7908,7 @@ if ($ACTION == 'PauseCodeSubmit')
|
||||
else
|
||||
{
|
||||
$pause_sec=0;
|
||||
$stmt = "select pause_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
$stmt = "SELECT pause_epoch from vicidial_agent_log where agent_log_id='$agent_log_id';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00306',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -8435,7 +8441,7 @@ if ($ACTION == 'CALLLOGview')
|
||||
echo "</TR>";
|
||||
|
||||
|
||||
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments from vicidial_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;";
|
||||
$stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments from vicidial_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$out_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($format=='debug') {echo "|$out_logs_to_print|$stmt|";}
|
||||
@@ -8469,7 +8475,7 @@ if ($ACTION == 'CALLLOGview')
|
||||
$u++;
|
||||
}
|
||||
|
||||
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds from vicidial_closer_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;";
|
||||
$stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds from vicidial_closer_log where user='$user' and call_date >= '$date 0:00:00' and call_date <= '$date 23:59:59' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$in_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($format=='debug') {echo "|$in_logs_to_print|$stmt|";}
|
||||
@@ -8553,7 +8559,7 @@ if ($ACTION == 'SEARCHRESULTSview')
|
||||
if (strlen($stage) < 3)
|
||||
{$stage = '670';}
|
||||
|
||||
$stmt="select agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt="SELECT agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00374',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
@@ -8753,7 +8759,7 @@ if ($ACTION == 'SEARCHRESULTSview')
|
||||
|
||||
|
||||
##### BEGIN search queries and output #####
|
||||
$stmt="select count(*) from vicidial_list where $searchSQL $searchownerSQL $searchmethodSQL;";
|
||||
$stmt="SELECT count(*) from vicidial_list where $searchSQL $searchownerSQL $searchmethodSQL;";
|
||||
|
||||
### LOG INSERTION Search Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
@@ -8803,7 +8809,7 @@ if ($ACTION == 'SEARCHRESULTSview')
|
||||
|
||||
if ($search_result_count)
|
||||
{
|
||||
$stmt="select first_name,last_name,phone_code,phone_number,status,last_local_call_time,lead_id,city,state,postal_code from vicidial_list where $searchSQL $searchownerSQL $searchmethodSQL order by last_local_call_time desc limit 1000;";
|
||||
$stmt="SELECT first_name,last_name,phone_code,phone_number,status,last_local_call_time,lead_id,city,state,postal_code from vicidial_list where $searchSQL $searchownerSQL $searchmethodSQL order by last_local_call_time desc limit 1000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00380',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$out_logs_to_print = mysql_num_rows($rslt);
|
||||
@@ -8904,7 +8910,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
|
||||
if (strlen($stage) < 3)
|
||||
{$stage = '670';}
|
||||
|
||||
$stmt="select agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt="SELECT agent_lead_search_method,manual_dial_list_id from vicidial_campaigns where campaign_id='$campaign';";
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00431',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$camps_to_print = mysql_num_rows($rslt);
|
||||
@@ -9073,7 +9079,7 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview')
|
||||
}
|
||||
|
||||
##### BEGIN search queries and output #####
|
||||
$stmt="select count(*) from contact_information where $searchSQL;";
|
||||
$stmt="SELECT count(*) from contact_information where $searchSQL;";
|
||||
|
||||
### LOG INSERTION Search Log Table ###
|
||||
$SQL_log = "$stmt|";
|
||||
@@ -9243,7 +9249,7 @@ if ($ACTION == 'LEADINFOview')
|
||||
$callback_id = preg_replace('/\D/','',$callback_id);
|
||||
if (strlen($callback_id) > 0)
|
||||
{
|
||||
$stmt="select status,entry_time,callback_time,modify_date,user,recipient,comments,lead_status from vicidial_callbacks where lead_id='$lead_id' and callback_id='$callback_id' limit 1;";
|
||||
$stmt="SELECT status,entry_time,callback_time,modify_date,user,recipient,comments,lead_status from vicidial_callbacks where lead_id='$lead_id' and callback_id='$callback_id' limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00397',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$cb_to_print = mysql_num_rows($rslt);
|
||||
@@ -9265,7 +9271,7 @@ if ($ACTION == 'LEADINFOview')
|
||||
### END Display callback information ###
|
||||
|
||||
### find the screen_label for this campaign
|
||||
$stmt="select screen_labels from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt="SELECT screen_labels from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00416',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$csl_to_print = mysql_num_rows($rslt);
|
||||
@@ -9363,7 +9369,7 @@ if ($ACTION == 'LEADINFOview')
|
||||
|
||||
$INFOout .= "<TABLE CELLPADDING=0 CELLSPACING=1 BORDER=0 WIDTH=500>";
|
||||
|
||||
$stmt="select status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='$lead_id' limit 1;";
|
||||
$stmt="SELECT status,vendor_lead_code,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id from vicidial_list where lead_id='$lead_id' limit 1;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00398',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$info_to_print = mysql_num_rows($rslt);
|
||||
@@ -9585,7 +9591,7 @@ if ($ACTION == 'LEADINFOview')
|
||||
$NOTESout .= "</TR>";
|
||||
|
||||
|
||||
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;";
|
||||
$stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,alt_dial,comments,uniqueid,user from vicidial_log where lead_id='$lead_id' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$out_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($format=='debug') {$NOTESout .= "|$out_logs_to_print|$stmt|";}
|
||||
@@ -9636,7 +9642,7 @@ if ($ACTION == 'LEADINFOview')
|
||||
$u++;
|
||||
}
|
||||
|
||||
$stmt="select start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;";
|
||||
$stmt="SELECT start_epoch,call_date,campaign_id,length_in_sec,status,phone_code,phone_number,lead_id,term_reason,queue_seconds,uniqueid,closecallid,user from vicidial_closer_log where lead_id='$lead_id' order by call_date desc limit 10000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$in_logs_to_print = mysql_num_rows($rslt);
|
||||
if ($format=='debug') {$NOTESout .= "|$in_logs_to_print|$stmt|";}
|
||||
@@ -9822,7 +9828,7 @@ if ($ACTION == 'CALLSINQUEUEgrab')
|
||||
if ($ACTION == 'CalLBacKLisT')
|
||||
{
|
||||
$campaignCBhoursSQL = '';
|
||||
$stmt = "select callback_hours_block,callback_list_calltime,local_call_time from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt = "SELECT callback_hours_block,callback_list_calltime,local_call_time from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00437',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($rslt) {$camp_count = mysql_num_rows($rslt);}
|
||||
@@ -9842,7 +9848,7 @@ if ($ACTION == 'CalLBacKLisT')
|
||||
if ($agentonly_callback_campaign_lock > 0)
|
||||
{$campaignCBsql = "and campaign_id='$campaign'";}
|
||||
|
||||
$stmt = "select callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status NOT IN('INACTIVE','DEAD') order by callback_time;";
|
||||
$stmt = "SELECT callback_id,lead_id,campaign_id,status,entry_time,callback_time,comments from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status NOT IN('INACTIVE','DEAD') order by callback_time;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00178',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -9864,7 +9870,7 @@ if ($ACTION == 'CalLBacKLisT')
|
||||
$loop_count=0;
|
||||
while ($callbacks_count>$loop_count)
|
||||
{
|
||||
$stmt = "select first_name,last_name,phone_number,gmt_offset_now,state from vicidial_list where lead_id='$lead_id[$loop_count]';";
|
||||
$stmt = "SELECT first_name,last_name,phone_number,gmt_offset_now,state from vicidial_list where lead_id='$lead_id[$loop_count]';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00179',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -9888,7 +9894,7 @@ if ($ACTION == 'CalLBacKLisT')
|
||||
if ($ACTION == 'CalLBacKCounT')
|
||||
{
|
||||
$campaignCBhoursSQL = '';
|
||||
$stmt = "select callback_hours_block from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$stmt = "SELECT callback_hours_block from vicidial_campaigns where campaign_id='$campaign';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00438',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($rslt) {$camp_count = mysql_num_rows($rslt);}
|
||||
@@ -9906,14 +9912,14 @@ if ($ACTION == 'CalLBacKCounT')
|
||||
if ($agentonly_callback_campaign_lock > 0)
|
||||
{$campaignCBsql = "and campaign_id='$campaign'";}
|
||||
|
||||
$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status NOT IN('INACTIVE','DEAD');";
|
||||
$stmt = "SELECT count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status NOT IN('INACTIVE','DEAD');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00180',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$cbcount=$row[0];
|
||||
|
||||
$stmt = "select count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status IN('LIVE');";
|
||||
$stmt = "SELECT count(*) from vicidial_callbacks where recipient='USERONLY' and user='$user' $campaignCBsql $campaignCBhoursSQL and status IN('LIVE');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00332',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
@@ -9947,7 +9953,7 @@ if ($ACTION == 'customer_3way_hangup_process')
|
||||
################################################################################
|
||||
if ($ACTION == 'DiaLableLeaDsCounT')
|
||||
{
|
||||
$stmt = "select dialable_leads from vicidial_campaign_stats where campaign_id='$campaign';";
|
||||
$stmt = "SELECT dialable_leads from vicidial_campaign_stats where campaign_id='$campaign';";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00252',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
@@ -374,10 +374,11 @@
|
||||
# 111202-1444 - Added grade-random next-agent-call options
|
||||
# 111227-1940 - Added Timer Action for Dx_DIAL_QUIET options
|
||||
# 120213-2029 - Changed consultative transfer with custom fields behavior for better data updating
|
||||
# 120223-2119 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$version = '2.4-341c';
|
||||
$build = '120213-2029';
|
||||
$version = '2.4-342c';
|
||||
$build = '120223-2119';
|
||||
$mel=1; # Mysql Error Log enabled = 1
|
||||
$mysql_log_count=75;
|
||||
$one_mysql_log=0;
|
||||
@@ -1224,7 +1225,7 @@ else
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "vdweb|GOOD|$date|$VD_login|$VD_pass|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "vdweb|GOOD|$date|$VD_login|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
$user_abb = "$VD_login$VD_login$VD_login$VD_login";
|
||||
@@ -1857,7 +1858,7 @@ else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{
|
||||
fwrite ($fp, "vdweb|FAIL|$date|$VD_login|$VD_pass|$ip|$browser|\n");
|
||||
fwrite ($fp, "vdweb|FAIL|$date|$VD_login|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
$VDloginDISPLAY=1;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_CLOSER_service_level.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -19,6 +19,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1756 - Added download option
|
||||
# 111103-2300 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -40,6 +41,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -179,6 +182,7 @@ if (!preg_match("/\|$group\|/i",$groups_string))
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -225,6 +229,11 @@ while ($groups_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.=" ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n";
|
||||
$MAIN.=" ";
|
||||
$MAIN.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$MAIN.="<option selected value=\"$shift\">$shift</option>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
@@ -238,7 +247,8 @@ $MAIN.="<option value=\"845-1745\">845-1745</option>\n";
|
||||
$MAIN.="<option value=\"1745-100\">1745-100</option>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a>";
|
||||
$MAIN.="</FONT>\n";
|
||||
$MAIN.="</FORM>\n\n";
|
||||
|
||||
$MAIN.="<PRE><FONT SIZE=2>\n\n";
|
||||
@@ -566,13 +576,40 @@ while ($j < $TOTintervals)
|
||||
|
||||
###################################################
|
||||
### TOTALS SUMMARY SECTION ###
|
||||
$MAIN.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$MAIN.="| | | | | | | AVG | AVG | | TOTAL | AVG |\n";
|
||||
$MAIN.="| SHIFT | | | AVG | | | HOLD(s)| HOLD(s)| | CALLTIME |CALLTIME|\n";
|
||||
$MAIN.="| DATE-TIME RANGE | DROPS | DROP % | DROP(s)| HOLD | HOLD % | HOLD | TOTAL | CALLS | MIN:SEC |SECONDS |\n";
|
||||
$MAIN.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$ASCII_text.="| | | | | | | AVG | AVG | | TOTAL | AVG |\n";
|
||||
$ASCII_text.="| SHIFT | | | AVG | | | HOLD(s)| HOLD(s)| | CALLTIME |CALLTIME|\n";
|
||||
$ASCII_text.="| DATE-TIME RANGE | DROPS | DROP % | DROP(s)| HOLD | HOLD % | HOLD | TOTAL | CALLS | MIN:SEC |SECONDS |\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"DROPS\",\" DROP %\",\" AVG DROP(s)\",\" HOLD\",\" HOLD %\",\" AVG HOLD(S) HOLD\",\" AVG HOLD(S) TOTAL\",\" CALLS\",\" TOTAL CALLTIME MIN:SEC\",\" AVG CALLTIME SECONDS\"\n";
|
||||
|
||||
|
||||
$graph_stats=array();
|
||||
$max_drops=1;
|
||||
$max_droppct=1;
|
||||
$max_avgdrops=1;
|
||||
$max_hold=1;
|
||||
$max_holdpct=1;
|
||||
$max_avgholds=1;
|
||||
$max_avgholdstotal=1;
|
||||
$max_calls=1;
|
||||
$max_totalcalltime=1;
|
||||
$max_avgcalltime=1;
|
||||
|
||||
$GRAPH="<BR><BR><a name='inbound_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='10%' class='grey_graph_cell' id='inbound_graph1'><a href='#' onClick=\"DrawGraph('DROPS', '1'); return false;\">DROPS</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph2'><a href='#' onClick=\"DrawGraph('DROPPCT', '2'); return false;\">DROP %</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph3'><a href='#' onClick=\"DrawGraph('AVGDROPS', '3'); return false;\">AVG DROP(s)</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph4'><a href='#' onClick=\"DrawGraph('HOLD', '4'); return false;\">HOLD</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph5'><a href='#' onClick=\"DrawGraph('HOLDPCT', '5'); return false;\">HOLD %</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph6'><a href='#' onClick=\"DrawGraph('AVGHOLDS', '6'); return false;\">AVG HOLD(s) HOLD</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph7'><a href='#' onClick=\"DrawGraph('AVGHOLDSTOTAL', '7'); return false;\">AVG HOLD(s) TOTAL</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph8'><a href='#' onClick=\"DrawGraph('CALLS', '8'); return false;\">CALLS</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph9'><a href='#' onClick=\"DrawGraph('TOTALCALLTIME', '9'); return false;\">TOTAL CALLTIME MIN:SEC</a></th><th width='10%' class='grey_graph_cell' id='inbound_graph10'><a href='#' onClick=\"DrawGraph('AVGCALLTIME', '10'); return false;\">AVG CALLTIME SECONDS</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='10' class='graph_span_cell'><span id='inbound_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>INBOUND SERVICE LEVEL REPORT</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$DROPS_graph=$graph_header."<th class='thgraph' scope='col'>DROPS </th></tr>";
|
||||
$DROPPCT_graph=$graph_header."<th class='thgraph' scope='col'>DROP % </th></tr>";
|
||||
$AVGDROPS_graph=$graph_header."<th class='thgraph' scope='col'>AVG DROP(s) </th></tr>";
|
||||
$HOLD_graph=$graph_header."<th class='thgraph' scope='col'>HOLD </th></tr>";
|
||||
$HOLDPCT_graph=$graph_header."<th class='thgraph' scope='col'>HOLD % </th></tr>";
|
||||
$AVGHOLDS_graph=$graph_header."<th class='thgraph' scope='col'>AVG HOLD(s) HOLD </th></tr>";
|
||||
$AVGHOLDSTOTAL_graph=$graph_header."<th class='thgraph' scope='col'>AVG HOLD(s) TOTAL </th></tr>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$TOTALCALLTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLTIME MIN:SEC </th></tr>";
|
||||
$AVGCALLTIME_graph=$graph_header."<th class='thgraph' scope='col'>AVG CALLTIME SECONDS </th></tr>";
|
||||
$d=0;
|
||||
while ($d < $DURATIONday)
|
||||
{
|
||||
@@ -616,9 +653,32 @@ while ($d < $DURATIONday)
|
||||
else
|
||||
{
|
||||
$totCALLSavgDATE[$d] = 0;
|
||||
$totTIME_MS=' ';
|
||||
$totTIME_MS=' 0:00';
|
||||
}
|
||||
|
||||
if (trim($totDROPSdate[$d])>$max_drops) {$max_drops=trim($totDROPSdate[$d]);}
|
||||
if (trim($totDROPSpctDATE[$d])>$max_droppct) {$max_droppct=trim($totDROPSpctDATE[$d]);}
|
||||
if (trim($totDROPSavgDATE[$d])>$max_avgdrops) {$max_avgdrops=trim($totDROPSavgDATE[$d]);}
|
||||
if (trim($totQUEUEdate[$d])>$max_hold) {$max_hold=trim($totQUEUEdate[$d]);}
|
||||
if (trim($totQUEUEpctDATE[$d])>$max_holdpct) {$max_holdpct=trim($totQUEUEpctDATE[$d]);}
|
||||
if (trim($totQUEUEavgDATE[$d])>$max_avgholds) {$max_avgholds=trim($totQUEUEavgDATE[$d]);}
|
||||
if (trim($totQUEUEtotDATE[$d])>$max_avgholdstotal) {$max_avgholdstotal=trim($totQUEUEtotDATE[$d]);}
|
||||
if (trim($totCALLSdate[$d])>$max_calls) {$max_calls=trim($totCALLSdate[$d]);}
|
||||
if (trim($totCALLSsecDATE[$d])>$max_totalcalltime) {$max_totalcalltime=trim($totCALLSsecDATE[$d]);}
|
||||
if (trim($totCALLSavgDATE[$d])>$max_avgcalltime) {$max_avgcalltime=trim($totCALLSavgDATE[$d]);}
|
||||
$graph_stats[$d][0]=trim("$daySTART[$d] - $dayEND[$d]");
|
||||
$graph_stats[$d][1]=trim($totDROPSdate[$d]);
|
||||
$graph_stats[$d][2]=trim(sprintf("%6.2f", $totDROPSpctDATE[$d]));
|
||||
$graph_stats[$d][3]=trim(sprintf("%7.2f", $totDROPSavgDATE[$d]));
|
||||
$graph_stats[$d][4]=trim($totQUEUEdate[$d]);
|
||||
$graph_stats[$d][5]=trim(sprintf("%6.2f", $totQUEUEpctDATE[$d]));
|
||||
$graph_stats[$d][6]=trim(sprintf("%7.2f", $totQUEUEavgDATE[$d]));
|
||||
$graph_stats[$d][7]=trim(sprintf("%7.2f", $totQUEUEtotDATE[$d]));
|
||||
$graph_stats[$d][8]=trim($totCALLSdate[$d]);
|
||||
$graph_stats[$d][9]=trim($totCALLSsecDATE[$d]);
|
||||
$graph_stats[$d][10]=trim($totTIME_MS);
|
||||
$graph_stats[$d][11]=trim(sprintf("%6.0f", $totCALLSavgDATE[$d]));
|
||||
|
||||
$totCALLSavgDATE[$d] = sprintf("%6.0f", $totCALLSavgDATE[$d]);
|
||||
$totDROPSavgDATE[$d] = sprintf("%7.2f", $totDROPSavgDATE[$d]);
|
||||
$totQUEUEavgDATE[$d] = sprintf("%7.2f", $totQUEUEavgDATE[$d]);
|
||||
@@ -629,7 +689,7 @@ while ($d < $DURATIONday)
|
||||
$totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]);
|
||||
$totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]);
|
||||
|
||||
$MAIN.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n";
|
||||
$ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totDROPSdate[$d] | $totDROPSpctDATE[$d]%|$totDROPSavgDATE[$d] | $totQUEUEdate[$d] | $totQUEUEpctDATE[$d]%|$totQUEUEavgDATE[$d] |$totQUEUEtotDATE[$d] | $totCALLSdate[$d] | $totTIME_MS | $totCALLSavgDATE[$d] |\n";
|
||||
$CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totDROPSdate[$d]\",\"$totDROPSpctDATE[$d]%\",\"$totDROPSavgDATE[$d]\",\"$totQUEUEdate[$d]\",\"$totQUEUEpctDATE[$d]%\",\"$totQUEUEavgDATE[$d]\",\"$totQUEUEtotDATE[$d]\",\"$totCALLSdate[$d]\",\"$totTIME_MS\",\"$totCALLSavgDATE[$d]\"\n";
|
||||
$d++;
|
||||
}
|
||||
@@ -684,11 +744,62 @@ else
|
||||
$FtotQUEUE = sprintf("%6s", $totQUEUE);
|
||||
$FtotCALLS = sprintf("%6s", $totCALLS);
|
||||
|
||||
$MAIN.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$MAIN.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n";
|
||||
$MAIN.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$ASCII_text.="| TOTALS | $FtotDROPS | $FtotDROPSpct%|$FtotDROPSavg | $FtotQUEUE | $FtotQUEUEpct%|$FtotQUEUEavg |$FtotQUEUEtot | $FtotCALLS |$totTIME_MS | $FtotCALLSavg |\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+--------+--------+--------+--------+--------+--------+--------+----------+--------+\n";
|
||||
$CSV_text.="\"TOTALS\",\"$FtotDROPS\",\"$FtotDROPSpct%\",\"$FtotDROPSavg\",\"$FtotQUEUE\",\"$FtotQUEUEpct%\",\"$FtotQUEUEavg\",\"$FtotQUEUEtot\",\"$FtotCALLS\",\"$totTIME_MS\",\"$FtotCALLSavg\"\n";
|
||||
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_drops)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$DROPPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_droppct)."' height='16' />".$graph_stats[$d][2]."%</td></tr>";
|
||||
$AVGDROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avgdrops)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
|
||||
$HOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_hold)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
|
||||
$HOLDPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_holdpct)."' height='16' />".$graph_stats[$d][5]."%</td></tr>";
|
||||
$AVGHOLDS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_avgholds)."' height='16' />".$graph_stats[$d][6]."</td></tr>";
|
||||
$AVGHOLDSTOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_avgholdstotal)."' height='16' />".$graph_stats[$d][7]."</td></tr>";
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_calls)."' height='16' />".$graph_stats[$d][8]."</td></tr>";
|
||||
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_totalcalltime)."' height='16' />".$graph_stats[$d][10]."</td></tr>";
|
||||
$AVGCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][11]/$max_avgcalltime)."' height='16' />".$graph_stats[$d][11]."</td></tr>";
|
||||
}
|
||||
$DROPS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotDROPS)."</th></tr></table>";
|
||||
$DROPPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotDROPSpct)."%</th></tr></table>";
|
||||
$AVGDROPS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotDROPSavg)."</th></tr></table>";
|
||||
$HOLD_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotQUEUE)."</th></tr></table>";
|
||||
$HOLDPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotQUEUEpct)."%</th></tr></table>";
|
||||
$AVGHOLDS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotQUEUEavg)."</th></tr></table>";
|
||||
$AVGHOLDSTOTAL_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotQUEUEtot)."</th></tr></table>";
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
|
||||
$TOTALCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totTIME_MS)."</th></tr></table>";
|
||||
$AVGCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLSavg)."</th></tr></table>";
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
$JS_onload.="\tDrawGraph('DROPS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n";
|
||||
$JS_text.=" var DROPPCT_graph=\"$DROPPCT_graph\";\n";
|
||||
$JS_text.=" var AVGDROPS_graph=\"$AVGDROPS_graph\";\n";
|
||||
$JS_text.=" var HOLD_graph=\"$HOLD_graph\";\n";
|
||||
$JS_text.=" var HOLDPCT_graph=\"$HOLDPCT_graph\";\n";
|
||||
$JS_text.=" var AVGHOLDS_graph=\"$AVGHOLDS_graph\";\n";
|
||||
$JS_text.=" var AVGHOLDSTOTAL_graph=\"$AVGHOLDSTOTAL_graph\";\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var TOTALCALLTIME_graph=\"$TOTALCALLTIME_graph\";\n";
|
||||
$JS_text.=" var AVGCALLTIME_graph=\"$AVGCALLTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=10; i++) {\n";
|
||||
$JS_text.=" var cellID=\"inbound_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"inbound_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('inbound_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
# $MAIN.=$GRAPH;
|
||||
|
||||
|
||||
## FORMAT OUTPUT ##
|
||||
$i=0;
|
||||
$hi_hour_count=0;
|
||||
@@ -727,7 +838,14 @@ if ($hi_hold_count < 1)
|
||||
else
|
||||
{$hold_multiplier = (20 / $hi_hold_count);}
|
||||
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
|
||||
###################################################################
|
||||
@@ -805,10 +923,20 @@ while ($k <= 22)
|
||||
}
|
||||
|
||||
|
||||
$MAIN.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$MAIN.="| TIME | AVG HOLD TIME (sec) | (in seconds) | | CALLS HANDLED | | |\n";
|
||||
$MAIN.="| 15 MIN INT |$hold_scale| AVG | MAX | |$call_scale| DROPS | TOTAL |\n";
|
||||
$MAIN.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$ASCII_text.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$ASCII_text.="| TIME | AVG HOLD TIME (sec) | (in seconds) | | CALLS HANDLED | | |\n";
|
||||
$ASCII_text.="| 15 MIN INT |$hold_scale| AVG | MAX | |$call_scale| DROPS | TOTAL |\n";
|
||||
$ASCII_text.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
|
||||
$max_avg_hold_time=1;
|
||||
$max_calls=1;
|
||||
$graph_stats=array();
|
||||
$GRAPH="<BR><BR><a name='holdcalldropgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='50%' class='grey_graph_cell' id='holdcalldropgraph1'><a href='#' onClick=\"DrawHCDGraph('AVGHOLD', '1'); return false;\">AVERAGE HOLD TIME</a></th><th width=50% class='grey_graph_cell' id='holdcalldropgraph2'><a href='#' onClick=\"DrawHCDGraph('CALLSHANDLED', '2'); return false;\">CALLS HANDLED</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='5' class='graph_span_cell'><span id='holdcalldrop_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$AVGHOLD_graph="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>AVERAGE HOLD TIME</caption><tr><th class='thgraph' scope='col'>TIME 15-MIN INT</th><th class='thgraph' scope='col'>AVG HOLD TIME</th><th class='thgraph' scope='col'>AVG</th><th class='thgraph' scope='col'>MAX</th></tr>";
|
||||
$CALLSHANDLED_graph="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>CALLS HANDLED</caption><tr><th class='thgraph' scope='col'>TIME 15-MIN INT</th><th class='thgraph' scope='col'>DROPS <img src='./images/bar_blue.png' width='10' height='10'> / CALLS <img src='./images/bar.png' width='10' height='10'></th></tr>";
|
||||
|
||||
|
||||
$CSV_text.="\"TIME - 15 MIN INT\",\"AVG SECS\",\"MAX SECS\",\"\",\"DROPS\",\"TOTAL\"\n";
|
||||
|
||||
@@ -832,9 +960,14 @@ while ($i < $TOTintervals)
|
||||
$TOT_lines++;
|
||||
$qrtQUEUEavg[$i] = sprintf("%5s", $qrtQUEUEavg[$i]);
|
||||
$qrtQUEUEmax[$i] = sprintf("%5s", $qrtQUEUEmax[$i]);
|
||||
$MAIN.="|$HMdisplay[$i]|";
|
||||
$k=0; while ($k <= 22) {$MAIN.=" "; $k++;}
|
||||
$MAIN.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
$ASCII_text.="|$HMdisplay[$i]|";
|
||||
$k=0; while ($k <= 22) {$ASCII_text.=" "; $k++;}
|
||||
$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
|
||||
$graph_stats[$i][0]="$HMdisplay[$i]";
|
||||
$graph_stats[$i][1]=trim($qrtQUEUEavg[$i]);
|
||||
$graph_stats[$i][2]=trim($qrtQUEUEmax[$i]);
|
||||
if (trim($qrtQUEUEavg[$i])>$max_avg_hold_time) {$max_avg_hold_time=trim($qrtQUEUEavg[$i]);}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -847,13 +980,14 @@ while ($i < $TOTintervals)
|
||||
$qrtQUEUEavg[$i] = sprintf("%5s", $qrtQUEUEavg[$i]);
|
||||
$qrtQUEUEmax[$i] = sprintf("%5s", $qrtQUEUEmax[$i]);
|
||||
|
||||
$MAIN.="|$HMdisplay[$i]|<SPAN class=\"orange\">";
|
||||
$k=0; while ($k <= $Xavg_hold) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter >= 22) {$MAIN.="H</SPAN>"; $char_counter++;}
|
||||
else {$MAIN.="*H</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yavg_hold) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$MAIN.=" "; $char_counter++;}
|
||||
$MAIN.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
$ASCII_text.="|$HMdisplay[$i]|<SPAN class=\"orange\">";
|
||||
$k=0; while ($k <= $Xavg_hold) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter >= 22) {$ASCII_text.="H</SPAN>"; $char_counter++;}
|
||||
else {$ASCII_text.="*H</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yavg_hold) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
|
||||
}
|
||||
### END HOLD TIME TOTALS GRAPH ###
|
||||
|
||||
@@ -869,9 +1003,9 @@ while ($i < $TOTintervals)
|
||||
else
|
||||
{
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
$MAIN.=" |";
|
||||
$k=0; while ($k <= 22) {$MAIN.=" "; $k++;}
|
||||
$MAIN.="| $qrtCALLS[$i] | 0 |\n";
|
||||
$ASCII_text.=" |";
|
||||
$k=0; while ($k <= 22) {$ASCII_text.=" "; $k++;}
|
||||
$ASCII_text.="| $qrtCALLS[$i] | 0 |\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -885,13 +1019,13 @@ while ($i < $TOTintervals)
|
||||
{
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
|
||||
$MAIN.=" |<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter > 21) {$MAIN.="C</SPAN>"; $char_counter++;}
|
||||
else {$MAIN.="*C</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$MAIN.=" "; $char_counter++;}
|
||||
$MAIN.="| 0 | $qrtCALLS[$i] |\n";
|
||||
$ASCII_text.=" |<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter > 21) {$ASCII_text.="C</SPAN>"; $char_counter++;}
|
||||
else {$ASCII_text.="*C</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| 0 | $qrtCALLS[$i] |\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -904,19 +1038,27 @@ while ($i < $TOTintervals)
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
$qrtDROPS[$i] = sprintf("%5s", $qrtDROPS[$i]);
|
||||
|
||||
$MAIN.=" |<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {$MAIN.=">"; $k++; $char_counter++;}
|
||||
$MAIN.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
$MAIN.="C</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$MAIN.=" "; $char_counter++;}
|
||||
$MAIN.="| $qrtDROPS[$i] | $qrtCALLS[$i] |\n";
|
||||
$ASCII_text.=" |<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;}
|
||||
$ASCII_text.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="C</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 22) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| $qrtDROPS[$i] | $qrtCALLS[$i] |\n";
|
||||
}
|
||||
}
|
||||
### END CALLS TOTALS GRAPH ###
|
||||
$CSV_text.="\"$HMdisplay[$i]\",\"$qrtQUEUEavg[$i]\",\"$qrtQUEUEmax[$i]\",\"\",\"$qrtDROPS[$i]\",\"$qrtCALLS[$i]\"\n";
|
||||
|
||||
$graph_stats[$i][0]="$HMdisplay[$i]";
|
||||
$graph_stats[$i][1]=trim($qrtQUEUEavg[$i]);
|
||||
$graph_stats[$i][2]=trim($qrtQUEUEmax[$i]);
|
||||
$graph_stats[$i][3]=trim($qrtCALLS[$i]);
|
||||
$graph_stats[$i][4]=trim($qrtDROPS[$i]);
|
||||
if (trim($qrtQUEUEavg[$i])>$max_avg_hold_time) {$max_avg_hold_time=trim($qrtQUEUEavg[$i]);}
|
||||
if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=trim($qrtCALLS[$i]);}
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -933,11 +1075,58 @@ $totDROPS = sprintf("%5s", $totDROPS);
|
||||
$totCALLS = sprintf("%5s", $totCALLS);
|
||||
|
||||
|
||||
$MAIN.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$MAIN.="| TOTAL | $totQUEUEavg | $totQUEUEmax | | | $totDROPS | $totCALLS |\n";
|
||||
$MAIN.="+-------------------------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$ASCII_text.="+-------------+-----------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$ASCII_text.="| TOTAL | $totQUEUEavg | $totQUEUEmax | | | $totDROPS | $totCALLS |\n";
|
||||
$ASCII_text.="+-------------------------------------+-------+-------+ +-----------------------+-------+-------+\n";
|
||||
$CSV_text.="\"TOTAL\",\"$totQUEUEavg\",\"$totQUEUEmax\",\"\",\"$totDROPS\",\"$totCALLS\"\n\n";
|
||||
|
||||
$AVGHOLD_graph="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>AVERAGE HOLD TIME</caption><tr><th class='thgraph' scope='col'>TIME 15-MIN INT</th><th class='thgraph' scope='col'>AVG HOLD TIME</th><th class='thgraph' scope='col'>AVG</th><th class='thgraph' scope='col'>MAX</th></tr>";
|
||||
$CALLSHANDLED_graph="<table cellspacing='0' cellpadding='0'><caption align='top'>CALLS HANDLED</caption><tr><th class='thgraph' scope='col'>TIME 15-MIN INT</th><th class='thgraph' scope='col'>DROPS <img src='./images/bar_blue.png' width='10' height='10'> / CALLS <img src='./images/bar.png' width='10' height='10'></th></tr>";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$AVGHOLD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_avg_hold_time)."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][2]."</td></tr>";
|
||||
|
||||
$CALLSHANDLED_graph.=" <tr><td class='chart_td' width='50'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value' width='600' valign='bottom'>";
|
||||
if ($graph_stats[$d][3]>0) {
|
||||
$CALLSHANDLED_graph.="<ul class='overlap_barGraph'><li class='p1' style='height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][3]/$max_calls)."px'><font style='background-color: #900'>".$graph_stats[$d][3]."</font></li>";
|
||||
if ($graph_stats[$d][4]>0) {
|
||||
$CALLSHANDLED_graph.="<li class='p2' style='height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][4]/$max_calls)."px'><font style='background-color: #009'>".$graph_stats[$d][4]."</font></li>";
|
||||
}
|
||||
$CALLSHANDLED_graph.="</ul>";
|
||||
} else {
|
||||
$CALLSHANDLED_graph.="0";
|
||||
}
|
||||
$CALLSHANDLED_graph.="</td></tr>";
|
||||
}
|
||||
$AVGHOLD_graph.="<tr><th class='thgraph' colspan='2' scope='col'>TOTALS:</th><th class='thgraph' scope='col'>".trim($totQUEUEavg)." </th><th class='thgraph' scope='col'> ".trim($totQUEUEmax)."</th></tr></table>";
|
||||
$CALLSHANDLED_graph.="<tr><th class='thgraph' scope='col'>TOTALS:</th><th class='thgraph' scope='col'>DROPS: ".trim($totDROPS)." CALLS: ".trim($totCALLS)."</th></tr></table>";
|
||||
$JS_text.="function DrawHCDGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var AVGHOLD_graph=\"$AVGHOLD_graph\";\n";
|
||||
$JS_text.=" var CALLSHANDLED_graph=\"$CALLSHANDLED_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=2; i++) {\n";
|
||||
$JS_text.=" var cellID=\"holdcalldropgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"holdcalldropgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('holdcalldrop_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$JS_onload.="\tDrawHCDGraph('AVGHOLD','1');\n";
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1098,6 +1287,7 @@ if ($file_download > 0)
|
||||
{
|
||||
|
||||
echo "$HEADER";
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo "$MAIN";
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_CLOSERsummary_hourly.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -14,6 +14,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1806 - Added download option
|
||||
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -51,6 +52,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -260,6 +263,7 @@ $HEADER.="</STYLE>\n";
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -334,7 +338,11 @@ if ($bareformat < 1)
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&inbound_rate=$inbound_rate&outbound_rate=$outbound_rate$groupQS&costformat=$costformat&print_calls=$print_calls&query_date=$query_date&end_date=$end_date&exclude_rollover=$exclude_rollover&SUBMIT=$SUBMIT&shift=$shift&file_download=1\">DOWNLOAD</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFY</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">REPORTS</a>";
|
||||
$MAIN.="</FONT><BR><BR>\n";
|
||||
$MAIN.="</FONT>\n";
|
||||
$MAIN.="<BR> Display as: ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>";
|
||||
$MAIN.=" Exclude Outbound Drop Groups: <BR>";
|
||||
$MAIN.=" <SELECT SIZE=1 NAME=exclude_rollover>\n";
|
||||
$MAIN.="<option selected value=\"$exclude_rollover\">$exclude_rollover</option>\n";
|
||||
@@ -428,20 +436,45 @@ else
|
||||
$CSV_main.="Inbound Summary Hourly Report:,$NOW_TIME\n";
|
||||
|
||||
|
||||
$JS_text.="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
if ($group_ct > 0)
|
||||
{
|
||||
$MAIN .= "\n";
|
||||
$MAIN .= "---------- MULTI-GROUP BREAKDOWN:\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$MAIN .= "| | | | | | TOTAL | AVERAGE | MAXIMUM | TOTAL |\n";
|
||||
$MAIN .= "| | TOTAL | TOTAL | TOTAL | AVERAGE | QUEUE | QUEUE | QUEUE | ABANDON|\n";
|
||||
$MAIN .= "| IN-GROUP | CALLS | ANSWER | TALK | TALK | TIME | TIME | TIME | CALLS |\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- MULTI-GROUP BREAKDOWN:\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$ASCII_text .= "| | | | | | TOTAL | AVERAGE | MAXIMUM | TOTAL |\n";
|
||||
$ASCII_text .= "| | TOTAL | TOTAL | TOTAL | AVERAGE | QUEUE | QUEUE | QUEUE | ABANDON|\n";
|
||||
$ASCII_text .= "| IN-GROUP | CALLS | ANSWER | TALK | TALK | TIME | TIME | TIME | CALLS |\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
|
||||
$CSV_main.="\"MULTI-GROUP BREAKDOWN:\"\n";
|
||||
$CSV_main.="\"IN-GROUP\",\"TOTAL CALLS\",\"TOTAL ANSWER\",\" TOTAL TALK\",\" AVERAGE TALK\",\" TOTAL QUEUE TIME\",\" AVERAGE QUEUE TIME\",\" MAXIMUM QUEUE TIME\",\" TOTAL ABANDON CALLS\"\n";
|
||||
$CSV_subreports="";
|
||||
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_answer=1;
|
||||
$max_talk=1;
|
||||
$max_avgtalk=1;
|
||||
$max_queue=1;
|
||||
$max_avgqueue=1;
|
||||
$max_maxqueue=1;
|
||||
$max_totalabandons=1;
|
||||
$GRAPH="<BR><BR><a name='multigroup_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='12%' class='grey_graph_cell' id='multigroup_graph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">TOTAL CALLS</a></th><th width='12%' class='grey_graph_cell' id='multigroup_graph2'><a href='#' onClick=\"DrawGraph('ANSWER', '2'); return false;\">TOTAL ANSWER</a></th><th width='12%' class='grey_graph_cell' id='multigroup_graph3'><a href='#' onClick=\"DrawGraph('TALK', '3'); return false;\">TOTAL TALK</a></th><th width='12%' class='grey_graph_cell' id='multigroup_graph4'><a href='#' onClick=\"DrawGraph('AVGTALK', '4'); return false;\">AVERAGE TALK</a></th><th width='13%' class='grey_graph_cell' id='multigroup_graph5'><a href='#' onClick=\"DrawGraph('QUEUE', '5'); return false;\">TOTAL QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='multigroup_graph6'><a href='#' onClick=\"DrawGraph('AVGQUEUE', '6'); return false;\">AVERAGE QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='multigroup_graph7'><a href='#' onClick=\"DrawGraph('MAXQUEUE', '7'); return false;\">MAXIMUM QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='multigroup_graph8'><a href='#' onClick=\"DrawGraph('TOTALABANDONS', '8'); return false;\">TOTAL ABANDON CALLS</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='8' class='graph_span_cell'><span id='multigroup_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>INBOUND SERVICE LEVEL REPORT</caption><tr><th class='thgraph' scope='col'>IN-GROUP</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLS </th></tr>";
|
||||
$ANSWER_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL ANSWER </th></tr>";
|
||||
$TALK_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL TALK </th></tr>";
|
||||
$AVGTALK_graph=$graph_header."<th class='thgraph' scope='col'>AVERAGE TALK </th></tr>";
|
||||
$QUEUE_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL QUEUE TIME </th></tr>";
|
||||
$AVGQUEUE_graph=$graph_header."<th class='thgraph' scope='col'>AVERAGE QUEUE TIME </th></tr>";
|
||||
$MAXQUEUE_graph=$graph_header."<th class='thgraph' scope='col'>MAXIMUM QUEUE TIME </th></tr>";
|
||||
$TOTALABANDONS_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL ABANDON CALLS </th></tr>";
|
||||
|
||||
$i=0;
|
||||
$TOTcalls_count=0;
|
||||
$TOTanswer_count=0;
|
||||
@@ -457,7 +490,7 @@ else
|
||||
{
|
||||
$stmt="select group_name,agent_alert_delay from vicidial_inbound_groups where group_id='$group[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$group_name[$i] = $row[0];
|
||||
$agent_alert_delay[$i] = round($row[1] / 1000);
|
||||
@@ -497,7 +530,7 @@ else
|
||||
|
||||
$stmt = "SELECT status,length_in_sec,queue_seconds,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$calls_to_parse = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $calls_to_parse)
|
||||
@@ -556,7 +589,7 @@ else
|
||||
|
||||
if ($print_calls > 0)
|
||||
{
|
||||
$MAIN.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$PCtemptalk = ($PCtemptalk + $TEMPtalk);
|
||||
}
|
||||
$q++;
|
||||
@@ -564,7 +597,7 @@ else
|
||||
else
|
||||
{$out_of_call_time++;}
|
||||
if ($DB)
|
||||
{$MAIN.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
|
||||
{$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
|
||||
$p++;
|
||||
}
|
||||
if ( ($answer_count[$i] > 0) and ($talk_sec[$i] > 0) )
|
||||
@@ -579,7 +612,7 @@ else
|
||||
if ($print_calls > 0)
|
||||
{
|
||||
$PCtemptalkmin = ($PCtemptalk / 60);
|
||||
$MAIN.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
|
||||
$ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
|
||||
}
|
||||
|
||||
$TOTcalls_count = ($TOTcalls_count + $calls_count[$i]);
|
||||
@@ -590,6 +623,24 @@ else
|
||||
if ($max_queue_seconds[$i] > $TOTmax_queue_seconds)
|
||||
{$TOTmax_queue_seconds = $max_queue_seconds[$i];}
|
||||
|
||||
$graph_stats[$i][0]="$group[$i] - $group_name[$i]";
|
||||
$graph_stats[$i][1]=$calls_count[$i];
|
||||
$graph_stats[$i][2]=$answer_count[$i];
|
||||
$graph_stats[$i][3]=$talk_sec[$i];
|
||||
$graph_stats[$i][4]=$talk_avg[$i];
|
||||
$graph_stats[$i][5]=$queue_seconds[$i];
|
||||
$graph_stats[$i][6]=$queue_avg[$i];
|
||||
$graph_stats[$i][7]=$max_queue_seconds[$i];
|
||||
$graph_stats[$i][8]=$drop_count[$i];
|
||||
if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];}
|
||||
if ($answer_count[$i]>$max_answer) {$max_answer=$answer_count[$i];}
|
||||
if ($talk_sec[$i]>$max_talk) {$max_talk=$talk_sec[$i];}
|
||||
if ($talk_avg[$i]>$max_avgtalk) {$max_avgtalk=$talk_avg[$i];}
|
||||
if ($queue_seconds[$i]>$max_queue) {$max_queue=$queue_seconds[$i];}
|
||||
if ($queue_avg[$i]>$max_avgqueue) {$max_avgqueue=$queue_avg[$i];}
|
||||
if ($max_queue_seconds[$i]>$max_maxqueue) {$max_maxqueue=$max_queue_seconds[$i];}
|
||||
if ($drop_count[$i]>$max_totalabandons) {$max_totalabandons=$drop_count[$i];}
|
||||
|
||||
$talk_sec[$i] = sec_convert($talk_sec[$i],'H');
|
||||
$talk_avg[$i] = sec_convert($talk_avg[$i],'H');
|
||||
$queue_seconds[$i] = sec_convert($queue_seconds[$i],'H');
|
||||
@@ -608,9 +659,10 @@ else
|
||||
|
||||
while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);}
|
||||
|
||||
$MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gANSWERcalls | $gSUMtalk | $gAVGtalk | $gSUMqueue | $gAVGqueue | $gMAXqueue | $gDROPcalls |";
|
||||
|
||||
$ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gANSWERcalls | $gSUMtalk | $gAVGtalk | $gSUMqueue | $gAVGqueue | $gMAXqueue | $gDROPcalls |";
|
||||
$CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gANSWERcalls\",\"$gSUMtalk\",\"$gAVGtalk\",\"$gSUMqueue\",\"$gAVGqueue\",\"$gMAXqueue\",\"$gDROPcalls\"\n";
|
||||
$MAIN .= "<!-- OUT OF CALLTIME: $out_of_call_time -->\n";
|
||||
$ASCII_text .= "<!-- OUT OF CALLTIME: $out_of_call_time -->\n";
|
||||
|
||||
### hour by hour sumaries
|
||||
$SUBoutput .= "\n---------- $group[$i] - $group_name[$i] HOURLY BREAKDOWN:\n";
|
||||
@@ -623,7 +675,29 @@ else
|
||||
$CSV_subreports.="\n\n\"$group[$i] - $group_name[$i]\"\n\"HOURLY BREAKDOWN:\"\n";
|
||||
$CSV_subreports.="\"HOUR\",\"TOTAL CALLS\",\"TOTAL ANSWER\",\" TOTAL TALK\",\" AVERAGE TALK\",\" TOTAL QUEUE TIME\",\" AVERAGE QUEUE TIME\",\" MAXIMUM QUEUE TIME\",\" TOTAL ABANDON CALLS\"\n";
|
||||
|
||||
$h=0;
|
||||
$sub_graph_stats=array();
|
||||
$sub_max_calls=1;
|
||||
$sub_max_answer=1;
|
||||
$sub_max_talk=1;
|
||||
$sub_max_avgtalk=1;
|
||||
$sub_max_queue=1;
|
||||
$sub_max_avgqueue=1;
|
||||
$sub_max_maxqueue=1;
|
||||
$sub_max_totalabandons=1;
|
||||
$sub_GRAPH.="<BR><BR><a name='".$group[$i]."_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$sub_GRAPH.="<tr><th width='12%' class='grey_graph_cell' id='".$group[$i]."_graph1'><a href='#' onClick=\"Draw".$group[$i]."Graph('CALLS', '1'); return false;\">TOTAL CALLS</a></th><th width='12%' class='grey_graph_cell' id='".$group[$i]."_graph2'><a href='#' onClick=\"Draw".$group[$i]."Graph('ANSWER', '2'); return false;\">TOTAL ANSWER</a></th><th width='12%' class='grey_graph_cell' id='".$group[$i]."_graph3'><a href='#' onClick=\"Draw".$group[$i]."Graph('TALK', '3'); return false;\">TOTAL TALK</a></th><th width='12%' class='grey_graph_cell' id='".$group[$i]."_graph4'><a href='#' onClick=\"Draw".$group[$i]."Graph('AVGTALK', '4'); return false;\">AVERAGE TALK</a></th><th width='13%' class='grey_graph_cell' id='".$group[$i]."_graph5'><a href='#' onClick=\"Draw".$group[$i]."Graph('QUEUE', '5'); return false;\">TOTAL QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='".$group[$i]."_graph6'><a href='#' onClick=\"Draw".$group[$i]."Graph('AVGQUEUE', '6'); return false;\">AVERAGE QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='".$group[$i]."_graph7'><a href='#' onClick=\"Draw".$group[$i]."Graph('MAXQUEUE', '7'); return false;\">MAXIMUM QUEUE TIME</a></th><th width='13%' class='grey_graph_cell' id='".$group[$i]."_graph8'><a href='#' onClick=\"Draw".$group[$i]."Graph('TOTALABANDONS', '8'); return false;\">TOTAL ABANDON CALLS</a></th></tr>";
|
||||
$sub_GRAPH.="<tr><td colspan='8' class='graph_span_cell'><span id='".$group[$i]."_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$sub_graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>$group[$i] - $group_name[$i] HOURLY BREAKDOWN</caption><tr><th class='thgraph' scope='col'>HOUR</th>";
|
||||
$sub_CALLS_graph=$sub_graph_header."<th class='thgraph' scope='col'>TOTAL CALLS </th></tr>";
|
||||
$sub_ANSWER_graph=$sub_graph_header."<th class='thgraph' scope='col'>TOTAL ANSWER </th></tr>";
|
||||
$sub_TALK_graph=$sub_graph_header."<th class='thgraph' scope='col'>TOTAL TALK </th></tr>";
|
||||
$sub_AVGTALK_graph=$sub_graph_header."<th class='thgraph' scope='col'>AVERAGE TALK </th></tr>";
|
||||
$sub_QUEUE_graph=$sub_graph_header."<th class='thgraph' scope='col'>TOTAL QUEUE TIME </th></tr>";
|
||||
$sub_AVGQUEUE_graph=$sub_graph_header."<th class='thgraph' scope='col'>AVERAGE QUEUE TIME </th></tr>";
|
||||
$sub_MAXQUEUE_graph=$sub_graph_header."<th class='thgraph' scope='col'>MAXIMUM QUEUE TIME </th></tr>";
|
||||
$sub_TOTALABANDONS_graph=$sub_graph_header."<th class='thgraph' scope='col'>TOTAL ABANDON CALLS </th></tr>";
|
||||
|
||||
$h=0; $q=0;
|
||||
while ($h < 24)
|
||||
{
|
||||
if ($Hcalltime[$h] > 0)
|
||||
@@ -652,6 +726,25 @@ else
|
||||
else
|
||||
{$Hqueue_avg[$h] = 0;}
|
||||
|
||||
$sub_graph_stats[$q][0]=sprintf("%2s", $h);
|
||||
$sub_graph_stats[$q][1]=$Hcalls_count[$h];
|
||||
$sub_graph_stats[$q][2]=$Hanswer_count[$h];
|
||||
$sub_graph_stats[$q][3]=$Htalk_sec[$h];
|
||||
$sub_graph_stats[$q][4]=$Htalk_avg[$h];
|
||||
$sub_graph_stats[$q][5]=$Hqueue_seconds[$h];
|
||||
$sub_graph_stats[$q][6]=$Hqueue_avg[$h];
|
||||
$sub_graph_stats[$q][7]=$Hmax_queue_seconds[$h];
|
||||
$sub_graph_stats[$q][8]=$Hdrop_count[$h];
|
||||
if ($Hcalls_count[$h]>$sub_max_calls) {$sub_max_calls=$Hcalls_count[$h];}
|
||||
if ($Hanswer_count[$h]>$sub_max_answer) {$sub_max_answer=$Hanswer_count[$h];}
|
||||
if ($Htalk_sec[$h]>$sub_max_talk) {$sub_max_talk=$Htalk_sec[$h];}
|
||||
if ($Htalk_avg[$h]>$sub_max_avgtalk) {$sub_max_avgtalk=$Htalk_avg[$h];}
|
||||
if ($Hqueue_seconds[$h]>$sub_max_maxqueue) {$sub_max_maxqueue=$Hqueue_seconds[$h];}
|
||||
if ($Hqueue_avg[$h]>$sub_max_avgqueue) {$sub_max_avgqueue=$Hqueue_avg[$h];}
|
||||
if ($Hsub_max_queue_seconds[$h]>$sub_max_maxqueue) {$sub_max_maxqueue=$Hmax_queue_seconds[$h];}
|
||||
if ($Hdrop_count[$h]>$sub_max_totalabandons) {$sub_max_totalabandons=$Hdrop_count[$h];}
|
||||
$q++;
|
||||
|
||||
$Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H');
|
||||
$Htalk_avg[$h] = sec_convert($Htalk_avg[$h],'H');
|
||||
$Hqueue_seconds[$h] = sec_convert($Hqueue_seconds[$h],'H');
|
||||
@@ -670,10 +763,11 @@ else
|
||||
|
||||
$SUBoutput .= "| $hPRINT | $hTOTALcalls | $hANSWERcalls | $hSUMtalk | $hAVGtalk | $hSUMqueue | $hAVGqueue | $hMAXqueue | $hDROPcalls |\n";
|
||||
$CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hANSWERcalls\",\"$hSUMtalk\",\"$hAVGtalk\",\"$hSUMqueue\",\"$hAVGqueue\",\"$hMAXqueue\",\"$hDROPcalls\"\n";
|
||||
|
||||
}
|
||||
|
||||
$h++;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ($hTOTanswer_count > 0) and ($hTOTtalk_sec > 0) )
|
||||
{$hTOTtalk_avg = ($hTOTtalk_sec / $hTOTanswer_count);}
|
||||
@@ -699,12 +793,56 @@ else
|
||||
$hTOTmax_queue_seconds = sprintf("%7s", $hTOTmax_queue_seconds);
|
||||
$hTOTdrop_count = sprintf("%6s", $hTOTdrop_count);
|
||||
|
||||
|
||||
for ($q=0; $q<count($sub_graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($sub_graph_stats)) {$class=" last";} else {$class="";}
|
||||
$sub_CALLS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][1]/$sub_max_calls)."' height='16' />".$sub_graph_stats[$q][1]."</td></tr>";
|
||||
$sub_ANSWER_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][2]/$sub_max_answer)."' height='16' />".$sub_graph_stats[$q][2]."</td></tr>";
|
||||
$sub_TALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][3]/$sub_max_talk)."' height='16' />".sec_convert($sub_graph_stats[$q][3],'H')."</td></tr>";
|
||||
$sub_AVGTALK_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][4]/$sub_max_avgtalk)."' height='16' />".sec_convert($sub_graph_stats[$q][4],'H')."</td></tr>";
|
||||
$sub_QUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][5]/$sub_max_queue)."' height='16' />".sec_convert($sub_graph_stats[$q][5],'H')."</td></tr>";
|
||||
$sub_AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][6]/$sub_max_avgqueue)."' height='16' />".sec_convert($sub_graph_stats[$q][6],'H')."</td></tr>";
|
||||
$sub_MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][7]/$sub_max_maxqueue)."' height='16' />".sec_convert($sub_graph_stats[$q][7],'H')."</td></tr>";
|
||||
$sub_TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$sub_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$sub_graph_stats[$q][8]/$sub_max_totalabandons)."' height='16' />".$sub_graph_stats[$q][8]."</td></tr>";
|
||||
}
|
||||
$sub_CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
|
||||
$sub_ANSWER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTanswer_count)."</th></tr></table>";
|
||||
$sub_TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_sec)."</th></tr></table>";
|
||||
$sub_AVGTALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_avg)."</th></tr></table>";
|
||||
$sub_QUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_seconds)."</th></tr></table>";
|
||||
$sub_AVGQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_avg)."</th></tr></table>";
|
||||
$sub_MAXQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTmax_queue_seconds)."</th></tr></table>";
|
||||
$sub_TOTALABANDONS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdrop_count)."</th></tr></table>";
|
||||
$JS_onload.="\tDraw".$group[$i]."Graph('CALLS', '1');\n";
|
||||
$JS_text.="function Draw".$group[$i]."Graph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$sub_CALLS_graph\";\n";
|
||||
$JS_text.=" var ANSWER_graph=\"$sub_ANSWER_graph\";\n";
|
||||
$JS_text.=" var TALK_graph=\"$sub_TALK_graph\";\n";
|
||||
$JS_text.=" var AVGTALK_graph=\"$sub_AVGTALK_graph\";\n";
|
||||
$JS_text.=" var QUEUE_graph=\"$sub_QUEUE_graph\";\n";
|
||||
$JS_text.=" var AVGQUEUE_graph=\"$sub_AVGQUEUE_graph\";\n";
|
||||
$JS_text.=" var MAXQUEUE_graph=\"$sub_MAXQUEUE_graph\";\n";
|
||||
$JS_text.=" var TOTALABANDONS_graph=\"$sub_TOTALABANDONS_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=8; i++) {\n";
|
||||
$JS_text.=" var cellID=\"".$group[$i]."_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"".$group[$i]."_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('".$group[$i]."_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
|
||||
$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$SUBoutput .= "|TOTALS| $hTOTcalls_count | $hTOTanswer_count | $hTOTtalk_sec | $hTOTtalk_avg | $hTOTqueue_seconds | $hTOTqueue_avg | $hTOTmax_queue_seconds | $hTOTdrop_count |\n";
|
||||
$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
|
||||
$CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTanswer_count\",\"$hTOTtalk_sec\",\"$hTOTtalk_avg\",\"$hTOTqueue_seconds\",\"$hTOTqueue_avg\",\"$hTOTmax_queue_seconds\",\"$hTOTdrop_count\"\n";
|
||||
|
||||
# $SUBoutput.=$sub_GRAPH;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -720,6 +858,49 @@ else
|
||||
else
|
||||
{$TOTqueue_avg = 0;}
|
||||
|
||||
|
||||
for ($q=0; $q<count($graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_calls)."' height='16' />".$graph_stats[$q][1]."</td></tr>";
|
||||
$ANSWER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][2]/$max_answer)."' height='16' />".$graph_stats[$q][2]."</td></tr>";
|
||||
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][3]/$max_talk)."' height='16' />".sec_convert($graph_stats[$q][3],'H')."</td></tr>";
|
||||
$AVGTALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][4]/$max_avgtalk)."' height='16' />".sec_convert($graph_stats[$q][4],'H')."</td></tr>";
|
||||
$QUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][5]/$max_queue)."' height='16' />".sec_convert($graph_stats[$q][5],'H')."</td></tr>";
|
||||
$AVGQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][6]/$max_avgqueue)."' height='16' />".sec_convert($graph_stats[$q][6],'H')."</td></tr>";
|
||||
$MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][7]/$max_maxqueue)."' height='16' />".sec_convert($graph_stats[$q][7],'H')."</td></tr>";
|
||||
$TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][8]/$max_totalabandons)."' height='16' />".$graph_stats[$q][8]."</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
|
||||
$ANSWER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTanswer_count)."</th></tr></table>";
|
||||
$TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_sec)."</th></tr></table>";
|
||||
$AVGTALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_avg)."</th></tr></table>";
|
||||
$QUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_seconds)."</th></tr></table>";
|
||||
$AVGQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_avg)."</th></tr></table>";
|
||||
$MAXQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTmax_queue_seconds)."</th></tr></table>";
|
||||
$TOTALABANDONS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdrop_count)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var ANSWER_graph=\"$ANSWER_graph\";\n";
|
||||
$JS_text.=" var TALK_graph=\"$TALK_graph\";\n";
|
||||
$JS_text.=" var AVGTALK_graph=\"$AVGTALK_graph\";\n";
|
||||
$JS_text.=" var QUEUE_graph=\"$QUEUE_graph\";\n";
|
||||
$JS_text.=" var AVGQUEUE_graph=\"$AVGQUEUE_graph\";\n";
|
||||
$JS_text.=" var MAXQUEUE_graph=\"$MAXQUEUE_graph\";\n";
|
||||
$JS_text.=" var TOTALABANDONS_graph=\"$TOTALABANDONS_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=8; i++) {\n";
|
||||
$JS_text.=" var cellID=\"multigroup_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"multigroup_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('multigroup_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
|
||||
|
||||
$TOTtalk_sec = sec_convert($TOTtalk_sec,'H');
|
||||
$TOTtalk_avg = sec_convert($TOTtalk_avg,'H');
|
||||
$TOTqueue_seconds = sec_convert($TOTqueue_seconds,'H');
|
||||
@@ -736,19 +917,26 @@ else
|
||||
$TOTmax_queue_seconds = sprintf("%7s", $TOTmax_queue_seconds);
|
||||
$TOTdrop_count = sprintf("%6s", $TOTdrop_count);
|
||||
|
||||
$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$MAIN .= "| TOTALS In-Groups: $i | $TOTcalls_count | $TOTanswer_count | $TOTtalk_sec | $TOTtalk_avg | $TOTqueue_seconds | $TOTqueue_avg | $TOTmax_queue_seconds | $TOTdrop_count |\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
$ASCII_text .= "| TOTALS In-Groups: $i | $TOTcalls_count | $TOTanswer_count | $TOTtalk_sec | $TOTtalk_avg | $TOTqueue_seconds | $TOTqueue_avg | $TOTmax_queue_seconds | $TOTdrop_count |\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
|
||||
|
||||
# $MAIN.=$GRAPH;
|
||||
|
||||
$CSV_main.="\"TOTALS In-Groups: $i\",\"$TOTcalls_count\",\"$TOTanswer_count\",\"$TOTtalk_sec\",\"$TOTtalk_avg\",\"$TOTqueue_seconds\",\"$TOTqueue_avg\",\"$TOTmax_queue_seconds\",\"$TOTdrop_count\"\n";
|
||||
}
|
||||
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($costformat > 0)
|
||||
{
|
||||
$MAIN.="</PRE>\n<B>";
|
||||
$ASCII_text.="</PRE>\n<B>";
|
||||
$inbound_cost = ($rawTOTtalk_min * $inbound_rate);
|
||||
$inbound_cost = sprintf("%8.2f", $inbound_cost);
|
||||
|
||||
$MAIN.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
@@ -779,10 +967,22 @@ if ($file_download > 0)
|
||||
else
|
||||
{
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH;
|
||||
$MAIN.=$sub_GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
$MAIN.=$SUBoutput;
|
||||
}
|
||||
|
||||
echo "$HEADER";
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo "$MAIN";
|
||||
echo "$SUBoutput";
|
||||
# echo "$SUBoutput";
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_DIDstats.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -14,6 +14,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1809 - Added download option
|
||||
# 111104-1133 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -38,6 +39,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -196,9 +199,23 @@ $HEADER.=" .red {color: black; background-color: #FF9999}\n";
|
||||
$HEADER.=" .orange {color: black; background-color: #FFCC99}\n";
|
||||
$HEADER.="-->\n";
|
||||
$HEADER.=" </STYLE>\n";
|
||||
$HEADER.="<style type=\"text/css\">\n";
|
||||
$HEADER.="<!--\n";
|
||||
$HEADER.=".auraltext\n";
|
||||
$HEADER.=" {\n";
|
||||
$HEADER.=" position: absolute;\n";
|
||||
$HEADER.=" font-size: 0;\n";
|
||||
$HEADER.=" left: -1000px;\n";
|
||||
$HEADER.=" }\n";
|
||||
$HEADER.=".chart_td\n";
|
||||
$HEADER.=" {background-image: url(images/gridline58.gif); background-repeat: repeat-x; background-position: left top; border-left: 1px solid #e5e5e5; border-right: 1px solid #e5e5e5; padding:0; border-bottom: 1px solid #e5e5e5; background-color:transparent;}\n";
|
||||
$HEADER.="\n";
|
||||
$HEADER.="-->\n";
|
||||
$HEADER.="</style>\n";
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -270,8 +287,12 @@ $MAIN.="<option value=\"9AM-1AM\">9AM-1AM</option>\n";
|
||||
$MAIN.="<option value=\"845-1745\">845-1745</option>\n";
|
||||
$MAIN.="<option value=\"1745-100\">1745-100</option>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD align=center valign=top>\n";
|
||||
$MAIN.="</TD><TD align=left valign=top>\n";
|
||||
$MAIN.="<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
$MAIN.=" ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&DB=$DB&SUBMIT=$SUBMIT&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3311&did_id=$group[0]\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
$MAIN.="</TD></TR></TABLE>\n";
|
||||
@@ -519,18 +540,27 @@ else
|
||||
### TOTALS DID SUMMARY SECTION ###
|
||||
if (strlen($extension[0]) > 0)
|
||||
{
|
||||
$MAIN.="DID Summary:\n";
|
||||
$MAIN.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
$MAIN.="| DID | DESCRIPTION | ROUTE | CALLS |\n";
|
||||
$MAIN.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
$ASCII_text.="DID Summary:\n";
|
||||
$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
$ASCII_text.="| DID | DESCRIPTION | ROUTE | CALLS |\n";
|
||||
$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
|
||||
$CSV_text1.="\"DID Summary:\"\n";
|
||||
$CSV_text1.="\"DID\",\"DESCRIPTION\",\"ROUTE\",\"CALLS\"\n";
|
||||
|
||||
$GRAPH_text.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH_text.=" <caption align=\"top\">DID Summary:</caption>\n";
|
||||
$GRAPH_text.="<tr>\n";
|
||||
$GRAPH_text.="<th class=\"thgraph\" scope=\"col\">DID</th>\n";
|
||||
$GRAPH_text.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH_text.="</tr>\n";
|
||||
|
||||
|
||||
$stats_array = array_group_count($extension, 'desc');
|
||||
$stats_array_ct = count($stats_array);
|
||||
|
||||
$d=0;
|
||||
$max_calls=1;
|
||||
while ($d < $stats_array_ct)
|
||||
{
|
||||
$stat_description = ' *** default *** ';
|
||||
@@ -539,6 +569,9 @@ else
|
||||
$stat_record_array = explode(' ',$stats_array[$d]);
|
||||
$stat_count = ($stat_record_array[0] + 0);
|
||||
$stat_pattern = $stat_record_array[1];
|
||||
if ($stat_count>$max_calls) {$max_calls=$stat_count;}
|
||||
$graph_stats[$d][0]=$stat_count;
|
||||
$graph_stats[$d][1]=$stat_pattern;
|
||||
|
||||
$stmt="select did_description,did_route from vicidial_inbound_dids where did_pattern='$stat_pattern';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
@@ -561,16 +594,31 @@ else
|
||||
|
||||
$stat_pattern = "<a href=\"admin.php?ADD=3311&did_pattern=$stat_pattern\">$stat_pattern</a>";
|
||||
|
||||
$MAIN.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n";
|
||||
$ASCII_text.="| $stat_pattern | $stat_description | $stat_route | $stat_count |\n";
|
||||
$d++;
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH_text.=" <tr>\n";
|
||||
$GRAPH_text.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH_text.=" </tr>\n";
|
||||
}
|
||||
$GRAPH_text.=" <tr>\n";
|
||||
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">TOTAL CALLS:</th>\n";
|
||||
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">".trim($totCALLS)."</th>\n";
|
||||
$GRAPH_text.=" </tr>\n";
|
||||
$GRAPH_text.="</table><PRE>\n";
|
||||
|
||||
$FtotCALLS = sprintf("%10s", $totCALLS);
|
||||
|
||||
$MAIN.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
$MAIN.="| TOTALS | $FtotCALLS |\n";
|
||||
$MAIN.="+------------------------------------------------------------------+------------+\n";
|
||||
$ASCII_text.="+--------------------+--------------------------------+------------+------------+\n";
|
||||
$ASCII_text.="| TOTALS | $FtotCALLS |\n";
|
||||
$ASCII_text.="+------------------------------------------------------------------+------------+\n";
|
||||
$CSV_text1.="\"\",\"\",\"TOTALS\",\"$FtotCALLS\"\n";
|
||||
#$MAIN.=$GRAPH;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -622,20 +670,29 @@ else
|
||||
|
||||
###################################################
|
||||
### TOTALS DATE SUMMARY SECTION ###
|
||||
$MAIN.="\nDate Summary:\n";
|
||||
$MAIN.="+-------------------------------------------+--------+\n";
|
||||
$MAIN.="| SHIFT | |\n";
|
||||
$MAIN.="| DATE-TIME RANGE | CALLS |\n";
|
||||
$MAIN.="+-------------------------------------------+--------+\n";
|
||||
$ASCII_text.="\nDate Summary:\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+\n";
|
||||
$ASCII_text.="| SHIFT | |\n";
|
||||
$ASCII_text.="| DATE-TIME RANGE | CALLS |\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+\n";
|
||||
|
||||
$CSV_text1.="\n\"Date Summary:\"\n";
|
||||
$CSV_text1.="\"SHIFT DATE-TIME RANGE\",\"CALLS\"\n";
|
||||
|
||||
$GRAPH_text.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH_text.=" <caption align=\"top\">Date Summary:</caption>\n";
|
||||
$GRAPH_text.="<tr>\n";
|
||||
$GRAPH_text.="<th class=\"thgraph\" scope=\"col\">SHIFT DATE-TIME RANGE</th>\n";
|
||||
$GRAPH_text.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH_text.="</tr>\n";
|
||||
|
||||
$d=0;
|
||||
$max_calls=1;
|
||||
$graph_stats=array();
|
||||
while ($d < $DURATIONday)
|
||||
{
|
||||
if ($totCALLSdate[$d] < 1) {$totCALLSdate[$d]=0;}
|
||||
|
||||
|
||||
if ($totCALLSsecDATE[$d] > 0)
|
||||
{
|
||||
$totCALLSavgDATE[$d] = ($totCALLSsecDATE[$d] / $totCALLSdate[$d]);
|
||||
@@ -660,17 +717,45 @@ else
|
||||
{$totCALLSdate[$d]='';}
|
||||
$totCALLSdate[$d] = sprintf("%6s", $totCALLSdate[$d]);
|
||||
|
||||
$MAIN.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n";
|
||||
if ($totCALLSdate[$d]>$max_calls) {$max_calls=$totCALLSdate[$d];}
|
||||
$graph_stats[$d][0]=$totCALLSdate[$d]+0;
|
||||
$graph_stats[$d][1]=substr($daySTART[$d],0,10);
|
||||
|
||||
$ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] |\n";
|
||||
$CSV_text1.="\"$daySTART[$d]\",\"$dayEND[$d]\",\"$totCALLSdate[$d]\"\n";
|
||||
$d++;
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH_text.=" <tr>\n";
|
||||
$GRAPH_text.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH_text.=" <td nowrap class=\"chart_td value$class\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH_text.=" </tr>\n";
|
||||
}
|
||||
$GRAPH_text.=" <tr>\n";
|
||||
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">TOTAL CALLS:</th>\n";
|
||||
$GRAPH_text.=" <th class=\"thgraph\" scope=\"col\">".trim($totCALLS)."</th>\n";
|
||||
$GRAPH_text.=" </tr>\n";
|
||||
$GRAPH_text.="</table><PRE>\n";
|
||||
|
||||
|
||||
$FtotCALLS = sprintf("%6s", $totCALLS);
|
||||
|
||||
$MAIN.="+-------------------------------------------+--------+\n";
|
||||
$MAIN.="| TOTALS | $FtotCALLS |\n";
|
||||
$MAIN.="+-------------------------------------------+--------+\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+\n";
|
||||
$ASCII_text.="| TOTALS | $FtotCALLS |\n";
|
||||
$ASCII_text.="+-------------------------------------------+--------+\n";
|
||||
$CSV_text1.="\"TOTALS\",\"$FtotCALLS\"\n";
|
||||
#$MAIN.=$GRAPH;
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
|
||||
## FORMAT OUTPUT ##
|
||||
@@ -705,16 +790,15 @@ else
|
||||
######### HOLD TIME, CALL AND DROP STATS 15-MINUTE INCREMENTS ####
|
||||
|
||||
$MAIN.="\n";
|
||||
$MAIN.="---------- HOLD TIME, CALL AND DROP STATS\n";
|
||||
$ASCII_text.="---------- HOLD TIME, CALL AND DROP STATS\n";
|
||||
|
||||
$CSV_text1.="\n\"HOLD TIME, CALL AND DROP STATS\"\n";
|
||||
|
||||
$MAIN.="<FONT SIZE=0>";
|
||||
|
||||
$MAIN.="<!-- HICOUNT CALLS: $hi_hour_count|$hour_multiplier -->";
|
||||
$MAIN.="<!-- HICOUNT HOLD: $hi_hold_count|$hold_multiplier -->\n";
|
||||
$MAIN.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
|
||||
$ASCII_text.="<FONT SIZE=0>";
|
||||
|
||||
$ASCII_text.="<!-- HICOUNT CALLS: $hi_hour_count|$hour_multiplier -->";
|
||||
$ASCII_text.="<!-- HICOUNT HOLD: $hi_hold_count|$hold_multiplier -->\n";
|
||||
$ASCII_text.="GRAPH IN 15 MINUTE INCREMENTS OF AVERAGE HOLD TIME FOR CALLS TAKEN INTO THIS IN-GROUP\n";
|
||||
|
||||
$k=1;
|
||||
$Mk=0;
|
||||
@@ -776,13 +860,20 @@ else
|
||||
}
|
||||
|
||||
|
||||
$MAIN.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$MAIN.="| TIME | CALLS HANDLED | |\n";
|
||||
$MAIN.="| 15 MIN INT |$call_scale| TOTAL |\n";
|
||||
$MAIN.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$ASCII_text.="| TIME | CALLS HANDLED | |\n";
|
||||
$ASCII_text.="| 15 MIN INT |$call_scale| TOTAL |\n";
|
||||
$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
|
||||
$CSV_text1.="\"TIME 15-MIN INT\",\"TOTAL\"\n";
|
||||
|
||||
|
||||
|
||||
$max_calls=1;
|
||||
$graph_stats=array();
|
||||
$GRAPH_text="<table cellspacing='0' cellpadding='0'><caption align='top'>HOLD TIME, CALL AND DROP STATS</caption><tr><th class='thgraph' scope='col'>TIME 15-MIN INT</th><th class='thgraph' scope='col'>DROPS <img src='./images/bar_blue.png' width='10' height='10'> / CALLS <img src='./images/bar.png' width='10' height='10'></th></tr>";
|
||||
|
||||
|
||||
$i=0;
|
||||
while ($i < $TOTintervals)
|
||||
{
|
||||
@@ -803,10 +894,10 @@ else
|
||||
$TOT_lines++;
|
||||
$qrtQUEUEavg[$i] = sprintf("%5s", $qrtQUEUEavg[$i]);
|
||||
$qrtQUEUEmax[$i] = sprintf("%5s", $qrtQUEUEmax[$i]);
|
||||
$MAIN.="|$HMdisplay[$i]|";
|
||||
$ASCII_text.="|$HMdisplay[$i]|";
|
||||
$CSV_text1.="\"$HMdisplay[$i]\",";
|
||||
# $k=0; while ($k <= 22) {$MAIN.=" "; $k++;}
|
||||
# $MAIN.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
# $k=0; while ($k <= 22) {$ASCII_text.=" "; $k++;}
|
||||
# $ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -819,15 +910,15 @@ else
|
||||
$qrtQUEUEavg[$i] = sprintf("%5s", $qrtQUEUEavg[$i]);
|
||||
$qrtQUEUEmax[$i] = sprintf("%5s", $qrtQUEUEmax[$i]);
|
||||
|
||||
# $MAIN.="|$HMdisplay[$i]|<SPAN class=\"orange\">";
|
||||
$MAIN.="|$HMdisplay[$i]|";
|
||||
# $ASCII_text.="|$HMdisplay[$i]|<SPAN class=\"orange\">";
|
||||
$ASCII_text.="|$HMdisplay[$i]|";
|
||||
$CSV_text1.="\"$HMdisplay[$i]\",\"\"";
|
||||
# $k=0; while ($k <= $Xavg_hold) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
# if ($char_counter >= 22) {$MAIN.="H</SPAN>"; $char_counter++;}
|
||||
# else {$MAIN.="*H</SPAN>"; $char_counter++; $char_counter++;}
|
||||
# $k=0; while ($k <= $Yavg_hold) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
# while ($char_counter <= 22) {$MAIN.=" "; $char_counter++;}
|
||||
# $MAIN.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
# $k=0; while ($k <= $Xavg_hold) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
# if ($char_counter >= 22) {$ASCII_text.="H</SPAN>"; $char_counter++;}
|
||||
# else {$ASCII_text.="*H</SPAN>"; $char_counter++; $char_counter++;}
|
||||
# $k=0; while ($k <= $Yavg_hold) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
# while ($char_counter <= 22) {$ASCII_text.=" "; $char_counter++;}
|
||||
# $ASCII_text.="| $qrtQUEUEavg[$i] | $qrtQUEUEmax[$i] |";
|
||||
}
|
||||
### END HOLD TIME TOTALS GRAPH ###
|
||||
|
||||
@@ -844,9 +935,9 @@ else
|
||||
{
|
||||
if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
# $MAIN.=" |";
|
||||
$k=0; while ($k <= 72) {$MAIN.=" "; $k++;}
|
||||
$MAIN.="| $qrtCALLS[$i] |\n";
|
||||
# $ASCII_text.=" |";
|
||||
$k=0; while ($k <= 72) {$ASCII_text.=" "; $k++;}
|
||||
$ASCII_text.="| $qrtCALLS[$i] |\n";
|
||||
$CSV_text1.="\"0\"\n";
|
||||
}
|
||||
}
|
||||
@@ -862,13 +953,13 @@ else
|
||||
if ($qrtCALLS[$i] < 1) {$qrtCALLS[$i]='';}
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
|
||||
$MAIN.="<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter > 71) {$MAIN.="C</SPAN>"; $char_counter++;}
|
||||
else {$MAIN.="*C</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 72) {$MAIN.=" "; $char_counter++;}
|
||||
$MAIN.="| $qrtCALLS[$i] |\n";
|
||||
$ASCII_text.="<SPAN class=\"green\">";
|
||||
$k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
if ($char_counter > 71) {$ASCII_text.="C</SPAN>"; $char_counter++;}
|
||||
else {$ASCII_text.="*C</SPAN>"; $char_counter++; $char_counter++;}
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 72) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| $qrtCALLS[$i] |\n";
|
||||
$CSV_text1.="\"$qrtCALLS[$i]\"\n";
|
||||
}
|
||||
else
|
||||
@@ -883,20 +974,23 @@ else
|
||||
$qrtCALLS[$i] = sprintf("%5s", $qrtCALLS[$i]);
|
||||
$qrtDROPS[$i] = sprintf("%5s", $qrtDROPS[$i]);
|
||||
|
||||
$MAIN.="<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {$MAIN.=">"; $k++; $char_counter++;}
|
||||
$MAIN.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$MAIN.="*"; $k++; $char_counter++;}
|
||||
$MAIN.="C</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$MAIN.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 72) {$MAIN.=" "; $char_counter++;}
|
||||
$ASCII_text.="<SPAN class=\"red\">";
|
||||
$k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;}
|
||||
$ASCII_text.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="C</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 72) {$ASCII_text.=" "; $char_counter++;}
|
||||
|
||||
$MAIN.="| $qrtCALLS[$i] |\n";
|
||||
$ASCII_text.="| $qrtCALLS[$i] |\n";
|
||||
$CSV_text1.="\"$qrtCALLS[$i]\"\n";
|
||||
}
|
||||
}
|
||||
### END CALLS TOTALS GRAPH ###
|
||||
|
||||
$graph_stats[$i][0]=$HMdisplay[$i];
|
||||
$graph_stats[$i][1]=trim($qrtCALLS[$i]);
|
||||
$graph_stats[$i][2]=trim($qrtDROPS[$i]);
|
||||
if (trim($qrtCALLS[$i])>$max_calls) {$max_calls=$qrtCALLS[$i];}
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -913,9 +1007,36 @@ else
|
||||
$totCALLS = sprintf("%5s", $totCALLS);
|
||||
|
||||
|
||||
$MAIN.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$MAIN.="| TOTAL | | $totCALLS |\n";
|
||||
$MAIN.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
$ASCII_text.="| TOTAL | | $totCALLS |\n";
|
||||
$ASCII_text.="+-------------+-------------------------------------------------------------------------+-------+\n";
|
||||
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
$graph_stats[$d][0]=preg_replace('/\s/', "", $graph_stats[$d][0]);
|
||||
$GRAPH_text.=" <tr><td class='chart_td' width='50'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value' width='600' valign='bottom'>\n";
|
||||
if ($graph_stats[$d][1]>0) {
|
||||
$GRAPH_text.="<ul class='overlap_barGraph'><li class=\"p1\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][1]/$max_calls)."px\">".$graph_stats[$d][1]."</li>";
|
||||
if ($graph_stats[$d][2]>0) {
|
||||
$GRAPH_text.="<li class=\"p2\" style=\"height: 12px; left: 0px; width: ".round(600*$graph_stats[$d][2]/$max_calls)."px\">".$graph_stats[$d][2]."</li>";
|
||||
}
|
||||
$GRAPH_text.="</ul>\n";
|
||||
} else {
|
||||
$GRAPH_text.="0";
|
||||
}
|
||||
$GRAPH_text.="</td></tr>\n";
|
||||
}
|
||||
$GRAPH_text.="<tr><th class='thgraph' scope='col'>TOTALS:</th><th class='thgraph' scope='col'>".trim($totCALLS)."</th></tr></table>";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
|
||||
$CSV_text1.="\"TOTAL\",\"$totCALLS\"\n";
|
||||
|
||||
@@ -953,6 +1074,8 @@ else
|
||||
} else {
|
||||
echo $HEADER;
|
||||
require("admin_header.php");
|
||||
|
||||
|
||||
echo $MAIN;
|
||||
}
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ $row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_IVRstats.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 81026-2026 - First build
|
||||
@@ -19,6 +19,7 @@
|
||||
# 110525-1907 - Added support for outbound log analysis
|
||||
# 110703-1850 - Added download option
|
||||
# 111103-2315 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -44,6 +45,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -56,6 +59,8 @@ if ($type == 'inbound')
|
||||
else
|
||||
{$report_name = 'Outbound IVR Report';}
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -285,6 +290,7 @@ $end_date_T = $end_dateARRAY[1];
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
@@ -425,7 +431,11 @@ $MAIN.=" }\n";
|
||||
|
||||
$MAIN.="</SCRIPT>\n";
|
||||
|
||||
$MAIN.=" <input type=button value=\"SUBMIT\" name=smt id=smt onClick=\"submit_form()\">\n";
|
||||
$MAIN.="<BR>Display as: ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>";
|
||||
$MAIN.=" <input type=button value=\"SUBMIT\" name=smt id=smt onClick=\"submit_form()\">\n";
|
||||
|
||||
$MAIN.="</TD></TR></TABLE>\n";
|
||||
$MAIN.="</FORM>\n\n";
|
||||
@@ -601,11 +611,30 @@ else
|
||||
### put call flows and counts together for sorting again
|
||||
$s=0;
|
||||
|
||||
$MAIN.="+--------+--------+--------+--------+------+------+\n";
|
||||
$MAIN.="| | | QUEUE | QUEUE | IVR | TOTAL|\n";
|
||||
$MAIN.="| IVR | QUEUE | DROP | DROP | AVG | AVG |\n";
|
||||
$MAIN.="| CALLS | CALLS | CALLS | PERCENT| TIME | TIME | CALL PATH\n";
|
||||
$MAIN.="+--------+--------+--------+--------+------+------+------------\n";
|
||||
$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
|
||||
$ASCII_text.="| | | QUEUE | QUEUE | IVR | TOTAL|\n";
|
||||
$ASCII_text.="| IVR | QUEUE | DROP | DROP | AVG | AVG |\n";
|
||||
$ASCII_text.="| CALLS | CALLS | CALLS | PERCENT| TIME | TIME | CALL PATH\n";
|
||||
$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
|
||||
|
||||
######## GRAPHING #########
|
||||
$graph_stats=array();
|
||||
$max_ivr_calls=1;
|
||||
$max_queue_calls=1;
|
||||
$max_queue_drops=1;
|
||||
$max_queue_drops_percent=1;
|
||||
$max_ivr_avg=1;
|
||||
$max_total_avg=1;
|
||||
$GRAPH="<a name='ivrgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='16%' id='ivrgraph1' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('IVRCALLS', '1'); return false;\">IVR CALLS</a></th><th width='17%' id='ivrgraph2' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('QUEUECALLS', '2'); return false;\">QUEUE CALLS</a></th><th width='17%' id='ivrgraph3' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('QUEUEDROPCALLS', '3'); return false;\">QUEUE DROP CALLS</a></th><th width='16%' id='ivrgraph4' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('QUEUEDROPPERCENT', '4'); return false;\">QUEUE DROP PERCENT</a></th><th width='17%' id='ivrgraph5' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('IVRAVGTIME', '5'); return false;\">IVR AVG TIME</a></th><th width='17%' id='ivrgraph6' class='grey_graph_cell'><a href='#' onClick=\"DrawGraph('TOTALAVGTIME', '6'); return false;\">TOTAL AVG TIME</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='6' class='graph_span_cell'><span id='ivr_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$IVRCALLS_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>IVR CALLS</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
$QUEUECALLS_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>QUEUE CALLS</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
$QUEUEDROPCALLS_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>QUEUE DROP CALLS</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
$QUEUEDROPPERCENT_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>QUEUE DROP PERCENT</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
$IVRAVGTIME_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>IVR AVG TIME</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
$TOTALAVGTIME_graph="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>IVR STATS</caption><tr><th class='thgraph' scope='col'>TOTAL AVG TIME</th><th class='thgraph' scope='col'>CALL PATH</th></tr>";
|
||||
###########################
|
||||
|
||||
$CSV_text.="\"\",\"IVR CALLS\",\"QUEUE CALLS\",\"QUEUE DROP CALLS\",\"QUEUE DROP PERCENT\",\"IVR AVG TIME\",\"TOTAL AVG TIME\",\"CALL PATH\"\n";
|
||||
|
||||
@@ -626,7 +655,7 @@ else
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$vcl_statuses_to_print = mysql_num_rows($rslt);
|
||||
$w=0;
|
||||
while ($w < $vcl_statuses_to_print)
|
||||
@@ -645,6 +674,16 @@ else
|
||||
$FLOWdropPCT[$s] = ( ($FLOWdrop[$s] / $FLOWtotal[$s]) * 100);
|
||||
$FLOWdropPCT[$s] = round($FLOWdropPCT[$s], 2);
|
||||
}
|
||||
|
||||
if ($FLOWsummary[0]>$max_ivr_calls) {$max_ivr_calls=$FLOWsummary[0];}
|
||||
if ($FLOWtotal[$s]>$max_queue_calls) {$max_queue_calls=$FLOWtotal[$s];}
|
||||
if ($FLOWdrop[$s]>$max_queue_drops) {$max_queue_drops=$FLOWdrop[$s];}
|
||||
if ($FLOWdropPCT[$s]>$max_queue_drops_percent) {$max_queue_drops_percent=$FLOWdropPCT[$s];}
|
||||
$graph_stats[$s][1]=$FLOWsummary[0];
|
||||
$graph_stats[$s][2]=$FLOWtotal[$s];
|
||||
$graph_stats[$s][3]=$FLOWdrop[$s];
|
||||
$graph_stats[$s][4]=$FLOWdropPCT[$s];
|
||||
|
||||
$FLOWsummary[0] = sprintf("%6s", $FLOWsummary[0]);
|
||||
$FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]);
|
||||
$FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]);
|
||||
@@ -659,12 +698,19 @@ else
|
||||
$avgFLOWtotal_time[$s] = round($avgFLOWtotal_time[$s], 0);
|
||||
$avgFLOWtotal_time[$s] = sprintf("%4s", $avgFLOWtotal_time[$s]);
|
||||
|
||||
if (trim($avgFLOWivr_time[$s])>$max_ivr_avg) {$max_ivr_avg=trim($avgFLOWivr_time[$s]);}
|
||||
if (trim($avgFLOWtotal_time[$s])>$max_total_avg) {$max_total_avg=trim($avgFLOWtotal_time[$s]);}
|
||||
$graph_stats[$s][0]=$FLOWsummary[1];
|
||||
$graph_stats[$s][5]=trim($avgFLOWivr_time[$s]);
|
||||
$graph_stats[$s][6]=trim($avgFLOWtotal_time[$s]);
|
||||
|
||||
|
||||
$totFLOWtotal_time = ($totFLOWtotal_time + $FLOWtotal_time[$s]);
|
||||
$totFLOWivr_time = ($totFLOWivr_time + $FLOWivr_time[$s]);
|
||||
$totFLOWtotal = ($totFLOWtotal + $FLOWtotal[$s]);
|
||||
$totFLOWdrop = ($totFLOWdrop + $FLOWdrop[$s]);
|
||||
|
||||
$MAIN.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n";
|
||||
$ASCII_text.="| $FLOWsummary[0] | $FLOWtotal[$s] | $FLOWdrop[$s] | $FLOWdropPCT[$s]%| $avgFLOWivr_time[$s] | $avgFLOWtotal_time[$s] | $FLOWsummary[1]\n";
|
||||
$CSV_text.="\"\",\"$FLOWsummary[0]\",\"$FLOWtotal[$s]\",\"$FLOWdrop[$s]\",\"$FLOWdropPCT[$s]%\",\"$avgFLOWivr_time[$s]\",\"$avgFLOWtotal_time[$s]\",\"$FLOWsummary[1]\"\n";
|
||||
|
||||
$s++;
|
||||
@@ -689,12 +735,56 @@ else
|
||||
}
|
||||
$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
|
||||
|
||||
$MAIN.="+--------+--------+--------+--------+------+------+------------\n";
|
||||
$MAIN.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
|
||||
$MAIN.="+--------+--------+--------+--------+------+------+\n";
|
||||
$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
|
||||
$ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
|
||||
$ASCII_text.="+--------+--------+--------+--------+------+------+\n";
|
||||
|
||||
$CSV_text.="\"\",\"$TOTALcalls\",\"$totFLOWtotal\",\"$totFLOWdrop\",\"$totFLOWdropPCT%\",\"$TavgFLOWivr_time\",\"$TavgFLOWtotal_time\"\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$IVRCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_ivr_calls)."' height='16' />".$graph_stats[$d][1]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
$QUEUECALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_queue_calls)."' height='16' />".$graph_stats[$d][2]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
$QUEUEDROPCALLS_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_queue_drops)."' height='16' />".$graph_stats[$d][3]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
$QUEUEDROPPERCENT_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_queue_drops_percent)."' height='16' />".$graph_stats[$d][4]."%</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
$IVRAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_ivr_avg)."' height='16' />".$graph_stats[$d][5]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
$TOTALAVGTIME_graph.=" <tr><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_total_avg)."' height='16' />".$graph_stats[$d][6]."</td><td class='chart_td$class'>".$graph_stats[$d][0]."</td></tr>";
|
||||
}
|
||||
$IVRCALLS_graph.="<tr><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$QUEUECALLS_graph.="<tr><th class='thgraph' scope='col'>".trim($totFLOWtotal)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$QUEUEDROPCALLS_graph.="<tr><th class='thgraph' scope='col'>".trim($totFLOWdrop)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$QUEUEDROPPERCENT_graph.="<tr><th class='thgraph' scope='col'>".trim($totFLOWdropPCT)."%</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$IVRAVGTIME_graph.="<tr><th class='thgraph' scope='col'>".trim($TavgFLOWivr_time)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$TOTALAVGTIME_graph.="<tr><th class='thgraph' scope='col'>".trim($TavgFLOWtotal_time)."</th><th class='thgraph' scope='col'>TOTAL</th></tr></table>";
|
||||
$JS_onload.="\tDrawGraph('IVRCALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var IVRCALLS_graph=\"$IVRCALLS_graph\";\n";
|
||||
$JS_text.=" var QUEUECALLS_graph=\"$QUEUECALLS_graph\";\n";
|
||||
$JS_text.=" var QUEUEDROPCALLS_graph=\"$QUEUEDROPCALLS_graph\";\n";
|
||||
$JS_text.=" var QUEUEDROPPERCENT_graph=\"$QUEUEDROPPERCENT_graph\";\n";
|
||||
$JS_text.=" var IVRAVGTIME_graph=\"$IVRAVGTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALAVGTIME_graph=\"$TOTALAVGTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=6; i++) {\n";
|
||||
$JS_text.=" var cellID=\"ivrgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"ivrgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('ivr_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
##############################
|
||||
######### TIME STATS
|
||||
|
||||
@@ -913,7 +1003,12 @@ else
|
||||
|
||||
exit;
|
||||
} else {
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
echo $HEADER;
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo $MAIN;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_LISTS_campaign_stats.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This is a list inventory report, not a calling report. This report will show
|
||||
# statistics for all of the lists in the selected campaigns
|
||||
@@ -9,6 +9,7 @@
|
||||
# CHANGES
|
||||
# 100916-0928 - First build
|
||||
# 110703-1815 - Added download option
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -29,12 +30,16 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$report_name = 'Lists Campaign Statuses Report';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -256,6 +261,7 @@ $HEADER.=" .blue {color: white; background-color: blue}\n";
|
||||
$HEADER.=" .purple {color: white; background-color: purple}\n";
|
||||
$HEADER.="-->\n";
|
||||
$HEADER.=" </STYLE>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -282,7 +288,11 @@ while ($campaigns_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD VALIGN=TOP><BR>";
|
||||
$MAIN.="</TD><TD VALIGN=TOP>";
|
||||
$MAIN.="Display as:<BR/>";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select> ";
|
||||
$MAIN.="<BR><BR>\n";
|
||||
$MAIN.="<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$MAIN.="</TD><TD VALIGN=TOP> ";
|
||||
@@ -330,6 +340,14 @@ else
|
||||
$CSV_text1.="\"LIST ID SUMMARY\"\n";
|
||||
$CSV_text1.="\"LIST\",\"LEADS\",\"ACTIVE\"\n";
|
||||
|
||||
$max_calls=1; $graph_stats=array();
|
||||
$GRAPH="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>LIST ID SUMMARY</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LIST</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LEADS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*),list_id from vicidial_list where list_id IN( SELECT list_id from vicidial_lists where active IN('Y','N') $group_SQLand) group by list_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -341,6 +359,9 @@ else
|
||||
$LISTIDcalls[$i] = $row[0];
|
||||
$LISTIDlists[$i] = $row[1];
|
||||
$list_id_SQL .= "'$row[1]',";
|
||||
if ($row[0]>$max_calls) {$max_calls=$row[0];}
|
||||
$graph_stats[$i][0]=$row[0];
|
||||
$graph_stats[$i][1]=$row[1];
|
||||
$i++;
|
||||
}
|
||||
if (strlen($list_id_SQL)>2) {$list_id_SQL = substr("$list_id_SQL", 0, -1);}
|
||||
@@ -357,10 +378,11 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LISTIDlist_names[$i] = $row[0];
|
||||
$graph_stats[$i][1].=" - $row[0]";
|
||||
if ($row[1]=='Y')
|
||||
{$LISTIDlist_active[$i] = 'ACTIVE ';}
|
||||
{$LISTIDlist_active[$i] = 'ACTIVE '; $graph_stats[$i][1].=" (ACTIVE)";}
|
||||
else
|
||||
{$LISTIDlist_active[$i] = 'INACTIVE';}
|
||||
{$LISTIDlist_active[$i] = 'INACTIVE'; $graph_stats[$i][1].=" (INACTIVE)";}
|
||||
}
|
||||
|
||||
$TOTALleads = ($TOTALleads + $LISTIDcalls[$i]);
|
||||
@@ -381,6 +403,20 @@ else
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$CSV_text1.="\"TOTAL\",\"$TOTALleads\"\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTALleads)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
# $OUToutput.=$GRAPH;
|
||||
|
||||
|
||||
##############################
|
||||
######### STATUS FLAGS STATS
|
||||
@@ -398,6 +434,14 @@ else
|
||||
$UW_count=0;
|
||||
$UW_percent=0;
|
||||
|
||||
$max_calls=1; $graph_stats=array();
|
||||
$GRAPH.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>STATUS FLAG SUMMARY</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">STATUS FLAG</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*) from vicidial_list where status IN($human_answered_statuses) and list_id IN($list_id_SQL);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -406,8 +450,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$HA_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($HA_count > 0)
|
||||
{
|
||||
if ($HA_count>$max_calls) {$max_calls=$HA_count;}
|
||||
$HA_percent = ( ($HA_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -419,8 +465,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$SALE_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($SALE_count > 0)
|
||||
{
|
||||
if ($SALE_count>$max_calls) {$max_calls=$SALE_count;}
|
||||
$SALE_percent = ( ($SALE_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -432,8 +480,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DNC_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($DNC_count > 0)
|
||||
{
|
||||
if ($DNC_count>$max_calls) {$max_calls=$DNC_count;}
|
||||
$DNC_percent = ( ($DNC_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -445,8 +495,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$CC_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($CC_count > 0)
|
||||
{
|
||||
if ($C_count>$max_calls) {$max_calls=$CC_count;}
|
||||
$CC_percent = ( ($CC_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -458,8 +510,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$NI_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($NI_count > 0)
|
||||
{
|
||||
if ($NI_count>$max_calls) {$max_calls=$NI_count;}
|
||||
$NI_percent = ( ($NI_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -471,8 +525,10 @@ else
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$UW_count = $row[0];
|
||||
$flag_count+=$row[0];
|
||||
if ($UW_count > 0)
|
||||
{
|
||||
if ($UW_count>$max_calls) {$max_calls=$UW_count;}
|
||||
$UW_percent = ( ($UW_count / $TOTALleads) * 100);
|
||||
}
|
||||
}
|
||||
@@ -512,6 +568,36 @@ else
|
||||
$CSV_text2 .= "\"Not Interested\",\"$NI_count\",\"$NI_percent%\"\n";
|
||||
$CSV_text2 .= "\"Unworkable\",\"$UW_count\",\"$UW_percent%\"\n";
|
||||
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td first\">Human Answer</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value first\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$HA_count/$max_calls)."\" height=\"16\"/>".$HA_count." ($HA_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td\">Sale</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$SALE_count/$max_calls)."\" height=\"16\" />".$SALE_count." ($SALE_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td\">DNC</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$DNC_count/$max_calls)."\" height=\"16\" />".$DNC_count." ($DNC_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td\">Customer Contact</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$CC_count/$max_calls)."\" height=\"16\" />".$CC_count." ($CC_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td\">Not Interested</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$NI_count/$max_calls)."\" height=\"16\" />".$NI_count." ($NI_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td last\">Unworkable</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value last\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$UW_count/$max_calls)."\" height=\"16\" />".$UW_count." ($UW_percent%)</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($flag_count)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
# $OUToutput.=$GRAPH;
|
||||
|
||||
##############################
|
||||
######### STATUS CATEGORY STATS
|
||||
@@ -525,8 +611,16 @@ else
|
||||
$CSV_text3.="\"CUSTOM STATUS CATEGORY STATS\"\n";
|
||||
$CSV_text3.="\"CATEGORY\",\"CALLS\",\"DESCRIPTION\"\n";
|
||||
|
||||
$max_calls=1; $graph_stats=array();
|
||||
$GRAPH.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>CUSTOM STATUS CATEGORY STATS</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CATEGORY</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$TOTCATcalls=0;
|
||||
$r=0;
|
||||
$r=0; $i=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ($vsc_id[$r] != 'UNDEFINED')
|
||||
@@ -536,6 +630,11 @@ else
|
||||
$CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
|
||||
$CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
|
||||
|
||||
if ($vsc_count[$r]>$max_calls) {$max_calls=$vsc_count[$r];}
|
||||
$graph_stats[$i][0]=$vsc_count[$r];
|
||||
$graph_stats[$i][1]=$vsc_id[$r];
|
||||
$i++;
|
||||
|
||||
$OUToutput .= "| $category | $CATcount | $CATname |\n";
|
||||
$CSV_text3.="\"$category\",\"$CATcount\",\"$CATname\"\n";
|
||||
}
|
||||
@@ -549,6 +648,19 @@ else
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$CSV_text3.="\"TOTAL\",\"$TOTCATcalls\"\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTCATcalls)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
#$OUToutput.=$GRAPH;
|
||||
|
||||
|
||||
##############################
|
||||
@@ -576,6 +688,17 @@ else
|
||||
$OUToutput .= "| TOTAL LEADS: $header_list_count |\n";
|
||||
$OUToutput .= "+--------------------------------------------------------------+\n";
|
||||
|
||||
$max_flags=1;
|
||||
$max_status=1;
|
||||
$graph_stats=array();
|
||||
$GRAPH.="<BR><BR><a name='graph".$LISTIDlists[$i]."'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='50%' class='grey_graph_cell' id='graph".$LISTIDlists[$i]."1'><a href='#' onClick=\"Draw".$LISTIDlists[$i]."Graph('FLAGS', '1'); return false;\">STATUS FLAG BREAKDOWN</a></th><th width='50%' class='grey_graph_cell' id='graph".$LISTIDlists[$i]."2'><a href='#' onClick=\"Draw".$LISTIDlists[$i]."Graph('STATUS', '2'); return false;\">STATUS BREAKDOWN</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='4' class='graph_span_cell'><span id='status_".$LISTIDlists[$i]."_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='1' cellpadding='0' bgcolor='white' class='horizontalgraph'>";
|
||||
$graph_header.="<caption align='top'>$LISTIDlists[$i] - $LISTIDlist_names[$i] ($LISTIDlist_active[$i])<br>TOTAL LEADS: $LISTIDcalls[$i]</caption>";
|
||||
$FLAGS_graph=$graph_header."<tr><th class='thgraph' scope='col'>FLAG</th><th class='thgraph' scope='col'>COUNT / %</th></tr>";
|
||||
$STATUS_graph=$graph_header."<tr><th class='thgraph' scope='col'>STATUS</th><th class='thgraph' scope='col'>COUNT</th></tr>";
|
||||
|
||||
$CSV_text4.="\"LIST ID: $LISTIDlists[$i]\",\"$LISTIDlist_names[$i]\",\"$LISTIDlist_active[$i]\"\n";
|
||||
$CSV_text4.="\"TOTAL LEADS:\",\"$header_list_count\"\n\n";
|
||||
|
||||
@@ -605,6 +728,7 @@ else
|
||||
$HA_percent = ( ($HA_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($HA_count>$max_flags) {$max_flags=$HA_count;}
|
||||
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($sale_statuses);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -618,6 +742,7 @@ else
|
||||
$SALE_percent = ( ($SALE_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($SALE_count>$max_flags) {$max_flags=$SALE_count;}
|
||||
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($dnc_statuses);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -631,6 +756,7 @@ else
|
||||
$DNC_percent = ( ($DNC_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($DNC_count>$max_flags) {$max_flags=$DNC_count;}
|
||||
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($customer_contact_statuses);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -644,6 +770,7 @@ else
|
||||
$CC_percent = ( ($CC_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($CC_count>$max_flags) {$max_flags=$CC_count;}
|
||||
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($not_interested_statuses);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -657,6 +784,7 @@ else
|
||||
$NI_percent = ( ($NI_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($NI_count>$max_flags) {$max_flags=$NI_count;}
|
||||
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($unworkable_statuses);";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -670,6 +798,7 @@ else
|
||||
$UW_percent = ( ($UW_count / $LISTIDcalls[$i]) * 100);
|
||||
}
|
||||
}
|
||||
if ($UW_count>$max_flags) {$max_flags=$UW_count;}
|
||||
|
||||
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
|
||||
$SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
|
||||
@@ -696,6 +825,12 @@ else
|
||||
$OUToutput .= " | STATUS BREAKDOWN: | COUNT |\n";
|
||||
$OUToutput .= " +--------+-----------------------------------+------------+\n";
|
||||
|
||||
$FLAGS_graph.=" <tr><td class='chart_td first'>HUMAN ANSWER</td><td nowrap class='chart_td value first'><img src='images/bar.png' alt='' width='".round(400*$HA_count/$max_flags)."' height='16' />$HA_count ($HA_percent%)</td></tr>";
|
||||
$FLAGS_graph.=" <tr><td class='chart_td'>SALE</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$SALE_count/$max_flags)."' height='16' />$SALE_count ($SALE_percent%)</td></tr>";
|
||||
$FLAGS_graph.=" <tr><td class='chart_td'>DNC</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$DNC_count/$max_flags)."' height='16' />$DNC_count ($DNC_percent%)</td></tr>";
|
||||
$FLAGS_graph.=" <tr><td class='chart_td'>CUSTOMER CONTACT</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$CC_count/$max_flags)."' height='16' />$CC_count ($CC_percent%)</td></tr>";
|
||||
$FLAGS_graph.=" <tr><td class='chart_td'>NOT INTERESTED</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$NI_count/$max_flags)."' height='16' />$NI_count ($NI_percent%)</td></tr>";
|
||||
$FLAGS_graph.=" <tr><td class='chart_td last'>UNWORKABLE</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$UW_count/$max_flags)."' height='16' />$UW_count ($UW_percent%)</td></tr>";
|
||||
|
||||
$CSV_text4.="\"STATUS FLAGS BREAKDOWN:\",\"(and % of total leads in the list)\"\n";
|
||||
$CSV_text4.="\"Human Answer:\",\"$HA_count\",\"$HA_percent%\"\n";
|
||||
@@ -716,6 +851,9 @@ else
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LISTIDstatus[$r] = $row[0];
|
||||
$LISTIDcounts[$r] = $row[1];
|
||||
$graph_stats[$r][0]=$row[0];
|
||||
$graph_stats[$r][1]=$row[1];
|
||||
if ($row[1]>$max_status) {$max_status=$row[1];}
|
||||
if ($DB) {$MAIN.="$r|$LISTIDstatus[$r]|$LISTIDcounts[$r]| |$row[0]|$row[1]|<BR>\n";}
|
||||
$r++;
|
||||
}
|
||||
@@ -729,6 +867,7 @@ else
|
||||
|
||||
$LISTID_status_count = sprintf("%10s", $LISTIDcounts[$r]); while(strlen($LISTID_status_count)>10) {$LISTID_status_count = substr("$LISTID_status_count", 0, -1);}
|
||||
$LISTIDname = sprintf("%-42s", "$LIDstatus_format | $statname_list[$LIDstatus]"); while(strlen($LISTIDname)>42) {$LISTIDname = substr("$LISTIDname", 0, -1);}
|
||||
$graph_stats[$r][0].=" - $statname_list[$LIDstatus]";
|
||||
|
||||
$OUToutput .= " | $LISTIDname | $LISTID_status_count |\n";
|
||||
$CSV_text4.="\"".trim($LIDstatus_format)."\",\"$statname_list[$LIDstatus]\",\"$LISTID_status_count\"\n";
|
||||
@@ -742,17 +881,44 @@ else
|
||||
|
||||
$CSV_text4.="\"TOTAL:\",\"\",\"$TOTALleads\"\n\n\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$STATUS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_status)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
}
|
||||
$STATUS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALleads)."</th></tr></table>";
|
||||
$JS_onload.="\tDraw".$LISTIDlists[$i]."Graph('FLAGS', '1');\n";
|
||||
$JS_text.="function Draw".$LISTIDlists[$i]."Graph(graph, th_id) {\n";
|
||||
$JS_text.=" var FLAGS_graph=\"$FLAGS_graph\";\n";
|
||||
$JS_text.=" var STATUS_graph=\"$STATUS_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=2; i++) {\n";
|
||||
$JS_text.=" var cellID=\"graph".$LISTIDlists[$i]."\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"graph".$LISTIDlists[$i]."\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('status_".$LISTIDlists[$i]."_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
# $OUToutput.=$GRAPH;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.="$OUToutput";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$MAIN.="$OUToutput";
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
$MAIN.="\nRun Time: $RUNtime seconds|$db_source\n";
|
||||
@@ -785,7 +951,12 @@ else
|
||||
|
||||
exit;
|
||||
} else {
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
echo $HEADER;
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo $MAIN;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_OUTBOUNDsummary_interval.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -14,6 +14,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1825 - Added download option
|
||||
# 111104-1205 - Added user_group and calltime restrictions
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -49,6 +50,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -59,6 +62,8 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';}
|
||||
|
||||
$report_name = 'Outbound Summary Interval Report';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -371,6 +376,7 @@ $HEADER.=" </STYLE>\n";
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -391,6 +397,14 @@ if ($bareformat < 1)
|
||||
$MAIN.="<BR>\n";
|
||||
}
|
||||
|
||||
|
||||
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||
$MAIN.="<TABLE BORDER=0><TR><TD VALIGN=TOP>\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=costformat VALUE=\"$costformat\">\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=print_calls VALUE=\"$print_calls\">\n";
|
||||
$MAIN.="Date Range:<BR>\n";
|
||||
$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
|
||||
$MAIN.=" <script language=\"JavaScript\">\n";
|
||||
$MAIN.=" var o_cal = new tcal ({\n";
|
||||
$MAIN.=" // form name\n";
|
||||
@@ -401,6 +415,7 @@ if ($bareformat < 1)
|
||||
$MAIN.=" o_cal.a_tpl.yearscroll = false;\n";
|
||||
$MAIN.=" // o_cal.a_tpl.weekstart = 1; // Monday week start\n";
|
||||
$MAIN.=" </script>\n";
|
||||
$MAIN.=" to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
|
||||
$MAIN.=" <script language=\"JavaScript\">\n";
|
||||
$MAIN.=" var o_cal = new tcal ({\n";
|
||||
$MAIN.=" // form name\n";
|
||||
@@ -412,16 +427,6 @@ if ($bareformat < 1)
|
||||
$MAIN.=" // o_cal.a_tpl.weekstart = 1; // Monday week start\n";
|
||||
$MAIN.=" </script>\n";
|
||||
|
||||
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||
$MAIN.="<TABLE BORDER=0><TR><TD VALIGN=TOP>\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=costformat VALUE=\"$costformat\">\n";
|
||||
$MAIN.="<INPUT TYPE=HIDDEN NAME=print_calls VALUE=\"$print_calls\">\n";
|
||||
$MAIN.="Date Range:<BR>\n";
|
||||
$MAIN.="<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
|
||||
|
||||
$MAIN.=" to <INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
|
||||
|
||||
$MAIN.="</TD><TD VALIGN=TOP ROWSPAN=2> Campaigns:<BR>";
|
||||
$MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
|
||||
if (eregi("--ALL--",$group_string))
|
||||
@@ -477,6 +482,10 @@ if ($bareformat < 1)
|
||||
$MAIN.="<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">MODIFY</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">REPORTS</a>";
|
||||
$MAIN.="</FONT><BR><BR>\n";
|
||||
$MAIN.="Display as:<BR>";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>";
|
||||
$MAIN.="<BR> ";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
|
||||
@@ -603,18 +612,43 @@ else
|
||||
##### Loop through each campaign and gether stats
|
||||
if ($group_ct > 0)
|
||||
{
|
||||
$MAIN .= "\n";
|
||||
$MAIN .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$MAIN .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n";
|
||||
$MAIN .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n";
|
||||
$MAIN .= "| CAMPAIGN | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- MULTI-CAMPAIGN BREAKDOWN:\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$ASCII_text .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n";
|
||||
$ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n";
|
||||
$ASCII_text .= "| CAMPAIGN | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
|
||||
$CSV_main.="\"MULTI-CAMPAIGN BREAKDOWN:\"\n";
|
||||
$CSV_main.="\"CAMPAIGN\",\"TOTAL CALLS\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ANSWER PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME(H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n";
|
||||
$CSV_subreports="";
|
||||
|
||||
######## GRAPHING #########
|
||||
$max_calls=1;
|
||||
$max_system_release=1;
|
||||
$max_agent_release=1;
|
||||
$max_sales=1;
|
||||
$max_dncs=1;
|
||||
$max_nas=1;
|
||||
$max_drops=1;
|
||||
$max_login_time=1;
|
||||
$max_pause_time=1;
|
||||
|
||||
$GRAPH="<BR><BR><a name='campbreakdown'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='11%' class='grey_graph_cell' id='campbreakdown1'><a href='#' onClick=\"DrawMultiCampaignGraph('CALLS', '1'); return false;\">CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown2'><a href='#' onClick=\"DrawMultiCampaignGraph('SYSTEMRELEASE', '2'); return false;\">SYSTEM RELEASE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown3'><a href='#' onClick=\"DrawMultiCampaignGraph('AGENTRELEASE', '3'); return false;\">AGENT RELEASE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown4'><a href='#' onClick=\"DrawMultiCampaignGraph('SALES', '4'); return false;\">SALE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown5'><a href='#' onClick=\"DrawMultiCampaignGraph('DNCS', '5'); return false;\">DNC CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown6'><a href='#' onClick=\"DrawMultiCampaignGraph('NAS', '6'); return false;\">NO ANSWER PERCENT</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown7'><a href='#' onClick=\"DrawMultiCampaignGraph('DROPS', '7'); return false;\">DROP PERCENT</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown8'><a href='#' onClick=\"DrawMultiCampaignGraph('LOGINTIME', '8'); return false;\">AGENT LOGIN TIME</a></th><th width='12%' class='grey_graph_cell' id='campbreakdown9'><a href='#' onClick=\"DrawMultiCampaignGraph('PAUSETIME', '9'); return false;\">AGENT PAUSE TIME</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='9' class='graph_span_cell'><span id='multi_campaign_breakdown'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>MULTI-CAMPAIGN BREAKDOWN</caption><tr><th class='thgraph' scope='col'>CAMPAIGNS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLS</th></tr>";
|
||||
$SYSTEMRELEASE_graph=$graph_header."<th class='thgraph' scope='col'>SYSTEM RELEASE CALLS</th></tr>";
|
||||
$AGENTRELEASE_graph=$graph_header."<th class='thgraph' scope='col'>AGENT RELEASE CALLS</th></tr>";
|
||||
$SALES_graph=$graph_header."<th class='thgraph' scope='col'>SALE CALLS</th></tr>";
|
||||
$DNCS_graph=$graph_header."<th class='thgraph' scope='col'>DNC CALLS</th></tr>";
|
||||
$NAS_graph=$graph_header."<th class='thgraph' scope='col'>NO ANSWER PERCENT</th></tr>";
|
||||
$DROPS_graph=$graph_header."<th class='thgraph' scope='col'>DROP PERCENT</th></tr>";
|
||||
$LOGINTIME_graph=$graph_header."<th class='thgraph' scope='col'>AGENT LOGIN TIME (H:M:S)</th></tr>";
|
||||
$PAUSETIME_graph=$graph_header."<th class='thgraph' scope='col'>AGENT PAUSE TIME (H:M:S)</th></tr>";
|
||||
###########################
|
||||
|
||||
$i=0;
|
||||
$TOTcalls_count=0;
|
||||
@@ -635,7 +669,7 @@ else
|
||||
##### Gather Agent time records
|
||||
$stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$AGENTtime_to_print = mysql_num_rows($rslt);
|
||||
$s=0;
|
||||
while ($s < $AGENTtime_to_print)
|
||||
@@ -653,7 +687,7 @@ else
|
||||
##### Gather outbound calls
|
||||
$stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$calls_to_parse = mysql_num_rows($rslt);
|
||||
$p=0;
|
||||
while ($p < $calls_to_parse)
|
||||
@@ -680,7 +714,7 @@ else
|
||||
##### Gather inbound calls from drop inbound group if selected
|
||||
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$in_groups_to_print = mysql_num_rows($rslt);
|
||||
if ($in_groups_to_print > 0)
|
||||
{
|
||||
@@ -694,7 +728,7 @@ else
|
||||
$agent_alert_delayZ=0;
|
||||
$stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$INallcalls_to_printZ = mysql_num_rows($rslt);
|
||||
$y=0;
|
||||
while ($y < $INallcalls_to_printZ)
|
||||
@@ -854,7 +888,7 @@ else
|
||||
|
||||
if ($print_calls > 0)
|
||||
{
|
||||
$MAIN.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$PCtemptalk = ($PCtemptalk + $TEMPtalk);
|
||||
}
|
||||
$q++;
|
||||
@@ -862,7 +896,7 @@ else
|
||||
else
|
||||
{$out_of_call_time++;}
|
||||
if ($DB)
|
||||
{$MAIN.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";}
|
||||
{$ASCII_text.="$Hcalltime[$Chour] | AGENT: $agent_sec[$i] PAUSE: $pause_sec[$i]\n";}
|
||||
$p++;
|
||||
}
|
||||
|
||||
@@ -992,7 +1026,7 @@ else
|
||||
|
||||
if ($print_calls > 0)
|
||||
{
|
||||
$MAIN.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$ASCII_text.="$row[5]\t$row[6]\t$TEMPtalk\n";
|
||||
$PCtemptalk = ($PCtemptalk + $TEMPtalk);
|
||||
}
|
||||
$q++;
|
||||
@@ -1000,7 +1034,7 @@ else
|
||||
else
|
||||
{$out_of_call_time++;}
|
||||
if ($DB)
|
||||
{$MAIN.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
|
||||
{$ASCII_text.="$call_time > $CTstart | $call_time < $CTstop | $Cwday | $Chour | $Hcalltime[$Chour] | $talk_sec[$i]\n";}
|
||||
$p++;
|
||||
}
|
||||
|
||||
@@ -1017,7 +1051,7 @@ else
|
||||
if ($print_calls > 0)
|
||||
{
|
||||
$PCtemptalkmin = ($PCtemptalk / 60);
|
||||
$MAIN.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
|
||||
$ASCII_text.="$q\t$PCtemptalk\t$PCtemptalkmin\n";
|
||||
}
|
||||
|
||||
if ( ($calls_count_IN[$i] > 0) and ($drop_count_OUT[$i] > 0) )
|
||||
@@ -1043,6 +1077,22 @@ else
|
||||
if ($max_queue_seconds[$i] > $TOTmax_queue_seconds)
|
||||
{$TOTmax_queue_seconds = $max_queue_seconds[$i];}
|
||||
|
||||
if ($calls_count[$i]>$max_calls) {$max_calls=$calls_count[$i];}
|
||||
if ($system_count[$i]>$max_system_release) {$max_system_release=$system_count[$i];}
|
||||
if ($agent_count[$i]>$max_agent_release) {$max_agent_release=$agent_count[$i];}
|
||||
if ($ptp_count[$i]>$max_sales) {$max_sales=$ptp_count[$i];}
|
||||
if ($rtp_count[$i]>$max_dncs) {$max_dncs=$rtp_count[$i];}
|
||||
if ($agent_sec[$i]>$max_login_time) {$max_login_time=$agent_sec[$i];}
|
||||
if ($pause_sec[$i]>$max_pause_time) {$max_pause_time=$pause_sec[$i];}
|
||||
$graph_stats[$i][0]="$group[$i] - $group_cname[$i]";
|
||||
$graph_stats[$i][1]=$calls_count[$i];
|
||||
$graph_stats[$i][2]=$system_count[$i];
|
||||
$graph_stats[$i][3]=$agent_count[$i];
|
||||
$graph_stats[$i][4]=$ptp_count[$i];
|
||||
$graph_stats[$i][5]=$rtp_count[$i];
|
||||
$graph_stats[$i][8]=$agent_sec[$i];
|
||||
$graph_stats[$i][9]=$pause_sec[$i];
|
||||
|
||||
$agent_sec[$i] = sec_convert($agent_sec[$i],'H');
|
||||
$pause_sec[$i] = sec_convert($pause_sec[$i],'H');
|
||||
$talk_sec[$i] = sec_convert($talk_sec[$i],'H');
|
||||
@@ -1079,25 +1129,59 @@ else
|
||||
$gDROPpercent = sprintf("%6.2f",$gDROPpercent);
|
||||
$gDROPcalls = sprintf("%6s", $drop_count[$i]);
|
||||
|
||||
if (trim($gNApercent)>$max_nas) {$max_nas=trim($gNApercent);}
|
||||
if (trim($gDROPpercent)>$max_drops) {$max_drops=trim($gDROPpercent);}
|
||||
$graph_stats[$i][6]=trim($gNApercent);
|
||||
$graph_stats[$i][7]=trim($gDROPpercent);
|
||||
|
||||
|
||||
while(strlen($groupDISPLAY)>40) {$groupDISPLAY = substr("$groupDISPLAY", 0, -1);}
|
||||
|
||||
$MAIN .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |";
|
||||
$ASCII_text .= "| $groupDISPLAY | $gTOTALcalls | $gSYSTEMcalls | $gAGENTcalls | $gPTPcalls | $gRTPcalls | $gNApercent%| $gDROPpercent%| $gSUMagent | $gSUMpause |";
|
||||
$CSV_main.="\"$groupDISPLAY\",\"$gTOTALcalls\",\"$gSYSTEMcalls\",\"$gAGENTcalls\",\"$gPTPcalls\",\"$gRTPcalls\",\"$gNApercent%\",\"$gDROPpercent%\",\"$gSUMagent\",\"$gSUMpause\"\n";
|
||||
if ($DB) {$MAIN .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";}
|
||||
$MAIN .= "<!-- OUT OF CALLTIME: $out_of_call_time -->\n";
|
||||
if ($DB) {$ASCII_text .= " $gDROPcalls($calls_count_IN[$i]/$drop_count_OUT[$i]) |";}
|
||||
$ASCII_text .= "<!-- OUT OF CALLTIME: $out_of_call_time -->\n";
|
||||
|
||||
### hour by hour sumaries
|
||||
$SUBoutput .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n";
|
||||
$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUBoutput .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n";
|
||||
$SUBoutput .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n";
|
||||
$SUBoutput .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
|
||||
$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUB_ASCII_text .= "\n---------- $group[$i] - $group_cname[$i]\nINTERVAL BREAKDOWN:\n";
|
||||
$SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUB_ASCII_text .= "| | | SYSTEM | AGENT | | | NO | | AGENT | AGENT |\n";
|
||||
$SUB_ASCII_text .= "| | TOTAL | RELEASE| RELEASE| SALE | DNC | ANSWER | DROP | LOGIN | PAUSE |\n";
|
||||
$SUB_ASCII_text .= "| INTERVAL | CALLS | CALLS | CALLS | CALLS | CALLS | PERCENT| PERCENT| TIME(H:M:S)| TIME(H:M:S)|\n";
|
||||
$SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
|
||||
$CSV_subreports.="\n\n\"$group[$i] - $group_cname[$i]\"\n\"INTERVAL BREAKDOWN:\"\n";
|
||||
$CSV_subreports.="\"INTERVAL\",\"TOTAL CALLS\",\"SYSTEM RELEASE CALLS\",\"AGENT RELEASE CALLS\",\"SALE CALLS\",\"DNC CALLS\",\"NO ANSWER PERCENT\",\"DROP PERCENT\",\"AGENT LOGIN TIME (H:M:S)\",\"AGENT PAUSE TIME(H:M:S)\"\n";
|
||||
|
||||
$h=0;
|
||||
######## GRAPHING #########
|
||||
$SUBmax_calls=1;
|
||||
$SUBmax_system_release=1;
|
||||
$SUBmax_agent_release=1;
|
||||
$SUBmax_sales=1;
|
||||
$SUBmax_dncs=1;
|
||||
$SUBmax_nas=1;
|
||||
$SUBmax_drops=1;
|
||||
$SUBmax_login_time=1;
|
||||
$SUBmax_pause_time=1;
|
||||
$SUBgraph_stats="";
|
||||
$SUBrpt_campaign=$group[$i];
|
||||
|
||||
$SUBGRAPH="<BR><BR><a name='campbreakdown".$SUBrpt_campaign."'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$SUBGRAPH.="<tr><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."1'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('CALLS', '1'); return false;\">CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."2'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('SYSTEMRELEASE', '2'); return false;\">SYSTEM RELEASE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."3'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('AGENTRELEASE', '3'); return false;\">AGENT RELEASE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."4'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('SALES', '4'); return false;\">SALE CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."5'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('DNCS', '5'); return false;\">DNC CALLS</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."6'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('NAS', '6'); return false;\">NO ANSWER PERCENT</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."7'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('DROPS', '7'); return false;\">DROP PERCENT</a></th><th width='11%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."8'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('LOGINTIME', '8'); return false;\">AGENT LOGIN TIME</a></th><th width='12%' class='grey_graph_cell' id='campbreakdown".$SUBrpt_campaign."9'><a href='#' onClick=\"Draw".$SUBrpt_campaign."CampaignGraph('PAUSETIME', '9'); return false;\">AGENT PAUSE TIME</a></th></tr>";
|
||||
$SUBGRAPH.="<tr><td colspan='9' class='graph_span_cell'><span id='campaign_breakdown_".$SUBrpt_campaign."'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$SUBgraph_header="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>$SUBrpt_campaign - $group_cname[$i] INTERVAL BREAKDOWN:</caption><tr><th class='thgraph' scope='col'>INTERVAL</th>";
|
||||
$SUBCALLS_graph=$SUBgraph_header."<th class='thgraph' scope='col'>TOTAL CALLS</th></tr>";
|
||||
$SUBSYSTEMRELEASE_graph=$SUBgraph_header."<th class='thgraph' scope='col'>SYSTEM RELEASE CALLS</th></tr>";
|
||||
$SUBAGENTRELEASE_graph=$SUBgraph_header."<th class='thgraph' scope='col'>AGENT RELEASE CALLS</th></tr>";
|
||||
$SUBSALES_graph=$SUBgraph_header."<th class='thgraph' scope='col'>SALE CALLS</th></tr>";
|
||||
$SUBDNCS_graph=$SUBgraph_header."<th class='thgraph' scope='col'>DNC CALLS</th></tr>";
|
||||
$SUBNAS_graph=$SUBgraph_header."<th class='thgraph' scope='col'>NO ANSWER PERCENT</th></tr>";
|
||||
$SUBDROPS_graph=$SUBgraph_header."<th class='thgraph' scope='col'>DROP PERCENT</th></tr>";
|
||||
$SUBLOGINTIME_graph=$SUBgraph_header."<th class='thgraph' scope='col'>AGENT LOGIN TIME (H:M:S)</th></tr>";
|
||||
$SUBPAUSETIME_graph=$SUBgraph_header."<th class='thgraph' scope='col'>AGENT PAUSE TIME (H:M:S)</th></tr>";
|
||||
###########################
|
||||
|
||||
$h=0; $z=0;
|
||||
while ($h < $interval_count)
|
||||
{
|
||||
if ($Hcalltime[$h] > 0)
|
||||
@@ -1148,6 +1232,24 @@ else
|
||||
else
|
||||
{$Hqueue_avg[$h] = 0;}
|
||||
|
||||
if ($Hcalls_count[$h]>$SUBmax_calls) {$SUBmax_calls=$Hcalls_count[$h];}
|
||||
if ($Hsystem_count[$h]>$SUBmax_system_release) {$SUBmax_system_release=$Hsystem_count[$h];}
|
||||
if ($Hagent_count[$h]>$SUBmax_agent_release) {$SUBmax_agent_release=$Hagent_count[$h];}
|
||||
if ($Hptp_count[$h]>$SUBmax_sales) {$SUBmax_sales=$Hptp_count[$h];}
|
||||
if ($Hrtp_count[$h]>$SUBmax_dncs) {$SUBmax_dncs=$Hrtp_count[$h];}
|
||||
if (trim($hNApercent)>$SUBmax_nas) {$SUBmax_nas=trim($hNApercent);}
|
||||
if (trim($hDROPpercent)>$SUBmax_drops) {$SUBmax_drops=trim($hDROPpercent);}
|
||||
if ($Hagent_sec[$h]>$SUBmax_login_time) {$SUBmax_login_time=$Hagent_sec[$h];}
|
||||
if ($Hpause_sec[$h]>$SUBmax_pause_time) {$SUBmax_pause_time=$Hpause_sec[$h];}
|
||||
$SUBgraph_stats[$z][0]="$Hcalltime_HHMM[$h]";
|
||||
$SUBgraph_stats[$z][1]=$Hcalls_count[$h];
|
||||
$SUBgraph_stats[$z][2]=$Hsystem_count[$h];
|
||||
$SUBgraph_stats[$z][3]=$Hagent_count[$h];
|
||||
$SUBgraph_stats[$z][4]=$Hptp_count[$h];
|
||||
$SUBgraph_stats[$z][5]=$Hrtp_count[$h];
|
||||
$SUBgraph_stats[$z][8]=$Hagent_sec[$h];
|
||||
$SUBgraph_stats[$z][9]=$Hpause_sec[$h];
|
||||
|
||||
$Hagent_sec[$h] = sec_convert($Hagent_sec[$h],'H');
|
||||
$Hpause_sec[$h] = sec_convert($Hpause_sec[$h],'H');
|
||||
$Htalk_sec[$h] = sec_convert($Htalk_sec[$h],'H');
|
||||
@@ -1183,9 +1285,13 @@ else
|
||||
$hDROPcalls = sprintf("%6s", $Hdrop_count[$h]);
|
||||
$hPRINT = sprintf("%19s", $Hcalltime_HHMM[$h]);
|
||||
|
||||
$SUBoutput .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n";
|
||||
$SUB_ASCII_text .= "| $hPRINT | $hTOTALcalls | $hSYSTEMcalls | $hAGENTcalls | $hPTPcalls | $hRTPcalls | $hNApercent%| $hDROPpercent%| $hSUMagent | $hSUMpause |\n";
|
||||
$CSV_subreports.="\"$hPRINT\",\"$hTOTALcalls\",\"$hSYSTEMcalls\",\"$hAGENTcalls\",\"$hPTPcalls\",\"$hRTPcalls\",\"$hNApercent%\",\"$hDROPpercent%\",\"$hSUMagent\",\"$hSUMpause\"\n";
|
||||
if ($DB) {$SUBoutput .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";}
|
||||
if ($DB) {$SUB_ASCII_text .= " $hDROPcalls($Hcalls_count_IN[$h]/$Hdrop_count_OUT[$h]) |\n";}
|
||||
|
||||
$SUBgraph_stats[$z][6]=trim($hNApercent);
|
||||
$SUBgraph_stats[$z][7]=trim($hDROPpercent);
|
||||
$z++;
|
||||
}
|
||||
|
||||
$h++;
|
||||
@@ -1234,11 +1340,55 @@ else
|
||||
$hTOTdrop_percent = sprintf("%6.2f",$hTOTdrop_percent);
|
||||
$hTOTdrop_count = sprintf("%6s", $hTOTdrop_count);
|
||||
|
||||
$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUBoutput .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n";
|
||||
$SUBoutput .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$SUB_ASCII_text .= "| TOTALS | $hTOTcalls_count | $hTOTsystem_count | $hTOTagent_count | $hTOTptp_count | $hTOTrtp_count | $hTOTna_percent%| $hTOTdrop_percent%| $hTOTagent_sec | $hTOTpause_sec |\n";
|
||||
$SUB_ASCII_text .= "+---------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTsystem_count\",\"$hTOTagent_count\",\"$hTOTptp_count\",\"$hTOTrtp_count\",\"$hTOTna_percent%\",\"$hTOTdrop_percent%\",\"$hTOTagent_sec\",\"$hTOTpause_sec\"\n";
|
||||
$i++;
|
||||
|
||||
for ($d=0; $d<count($SUBgraph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($SUBgraph_stats)) {$class=" last";} else {$class="";}
|
||||
$SUBCALLS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][1]/$SUBmax_calls)."' height='16' />".$SUBgraph_stats[$d][1]."</td></tr>";
|
||||
$SUBSYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][2]/$SUBmax_system_release)."' height='16' />".$SUBgraph_stats[$d][2]."</td></tr>";
|
||||
$SUBAGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][3]/$SUBmax_agent_release)."' height='16' />".$SUBgraph_stats[$d][3]."</td></tr>";
|
||||
$SUBSALES_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][4]/$SUBmax_sales)."' height='16' />".$SUBgraph_stats[$d][4]."</td></tr>";
|
||||
$SUBDNCS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][5]/$SUBmax_dncs)."' height='16' />".$SUBgraph_stats[$d][5]."</td></tr>";
|
||||
$SUBNAS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][6]/$SUBmax_nas)."' height='16' />".$SUBgraph_stats[$d][6]."%</td></tr>";
|
||||
$SUBDROPS_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][7]/$SUBmax_drops)."' height='16' />".$SUBgraph_stats[$d][7]."%</td></tr>";
|
||||
$SUBLOGINTIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][8]/$SUBmax_login_time)."' height='16' />".sec_convert($SUBgraph_stats[$d][8], 'H')."</td></tr>";
|
||||
$SUBPAUSETIME_graph.=" <tr><td class='chart_td$class'>".$SUBgraph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$SUBgraph_stats[$d][9]/$SUBmax_pause_time)."' height='16' />".sec_convert($SUBgraph_stats[$d][9], 'H')."</td></tr>";
|
||||
}
|
||||
$SUBCALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
|
||||
$SUBSYSTEMRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTsystem_count)."</th></tr></table>";
|
||||
$SUBAGENTRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTagent_count)."</th></tr></table>";
|
||||
$SUBSALES_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTptp_count)."</th></tr></table>";
|
||||
$SUBDNCS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTrtp_count)."</th></tr></table>";
|
||||
$SUBNAS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTna_percent)."%</th></tr></table>";
|
||||
$SUBDROPS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdrop_percent)."%</th></tr></table>";
|
||||
$SUBLOGINTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTagent_sec)."</th></tr></table>";
|
||||
$SUBPAUSETIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTpause_sec)."</th></tr></table>";
|
||||
$JS_onload.="\tDraw".$SUBrpt_campaign."CampaignGraph('CALLS', '1');\n";
|
||||
$JS_text.="function Draw".$SUBrpt_campaign."CampaignGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$SUBCALLS_graph\";\n";
|
||||
$JS_text.=" var SYSTEMRELEASE_graph=\"$SUBSYSTEMRELEASE_graph\";\n";
|
||||
$JS_text.=" var AGENTRELEASE_graph=\"$SUBAGENTRELEASE_graph\";\n";
|
||||
$JS_text.=" var SALES_graph=\"$SUBSALES_graph\";\n";
|
||||
$JS_text.=" var DNCS_graph=\"$SUBDNCS_graph\";\n";
|
||||
$JS_text.=" var NAS_graph=\"$SUBNAS_graph\";\n";
|
||||
$JS_text.=" var DROPS_graph=\"$SUBDROPS_graph\";\n";
|
||||
$JS_text.=" var LOGINTIME_graph=\"$SUBLOGINTIME_graph\";\n";
|
||||
$JS_text.=" var PAUSETIME_graph=\"$SUBPAUSETIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=9; i++) {\n";
|
||||
$JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"campbreakdown".$SUBrpt_campaign."\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('campaign_breakdown_".$SUBrpt_campaign."').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$SUB_HTML_text.=$SUBGRAPH;
|
||||
}
|
||||
|
||||
$rawTOTtalk_sec = $TOTtalk_sec;
|
||||
@@ -1288,23 +1438,66 @@ else
|
||||
$TOTdrop_percent = sprintf("%6.2f",$TOTdrop_percent);
|
||||
$TOTdrop_count = sprintf("%6s", $TOTdrop_count);
|
||||
|
||||
$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$MAIN .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n";
|
||||
$MAIN .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$ASCII_text .= "| TOTALS Campaigns: $i | $TOTcalls_count | $TOTsystem_count | $TOTagent_count | $TOTptp_count | $TOTrtp_count | $TOTna_percent%| $TOTdrop_percent%| $TOTagent_sec | $TOTpause_sec |\n";
|
||||
$ASCII_text .= "+------------------------------------------+--------+--------+--------+--------+--------+--------+--------+------------+------------+\n";
|
||||
$CSV_main.="\"TOTALS Campaigns: $i\",\"$TOTcalls_count\",\"$TOTsystem_count\",\"$TOTagent_count\",\"$TOTptp_count\",\"$TOTrtp_count\",\"$TOTna_percent%\",\"$TOTdrop_percent%\",\"$TOTagent_sec\",\"$TOTpause_sec\"\n";
|
||||
}
|
||||
|
||||
if ($costformat > 0)
|
||||
{
|
||||
$MAIN.="</PRE>\n<B>";
|
||||
$ASCII_text.="</PRE>\n<B>";
|
||||
$inbound_cost = ($rawTOTtalk_min * $inbound_rate);
|
||||
$inbound_cost = sprintf("%8.2f", $inbound_cost);
|
||||
|
||||
$MAIN.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||
$ASCII_text.="INBOUND $query_date to $end_date, $rawTOTtalk_min minutes at \$$inbound_rate = \$$inbound_cost\n";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$SYSTEMRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_system_release)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
|
||||
$AGENTRELEASE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_agent_release)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
|
||||
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_sales)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
|
||||
$DNCS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_dncs)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
|
||||
$NAS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_nas)."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
|
||||
$DROPS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_drops)."' height='16' />".$graph_stats[$d][7]."%</td></tr>";
|
||||
$LOGINTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_login_time)."' height='16' />".sec_convert($graph_stats[$d][8], 'H')."</td></tr>";
|
||||
$PAUSETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_pause_time)."' height='16' />".sec_convert($graph_stats[$d][9], 'H')."</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls_count)."</th></tr></table>";
|
||||
$SYSTEMRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTsystem_count)."</th></tr></table>";
|
||||
$AGENTRELEASE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTagent_count)."</th></tr></table>";
|
||||
$SALES_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTptp_count)."</th></tr></table>";
|
||||
$DNCS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTrtp_count)."</th></tr></table>";
|
||||
$NAS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTna_percent)."%</th></tr></table>";
|
||||
$DROPS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTdrop_percent)."%</th></tr></table>";
|
||||
$LOGINTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTagent_sec)."</th></tr></table>";
|
||||
$PAUSETIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTpause_sec)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawMultiCampaignGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawMultiCampaignGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var SYSTEMRELEASE_graph=\"$SYSTEMRELEASE_graph\";\n";
|
||||
$JS_text.=" var AGENTRELEASE_graph=\"$AGENTRELEASE_graph\";\n";
|
||||
$JS_text.=" var SALES_graph=\"$SALES_graph\";\n";
|
||||
$JS_text.=" var DNCS_graph=\"$DNCS_graph\";\n";
|
||||
$JS_text.=" var NAS_graph=\"$NAS_graph\";\n";
|
||||
$JS_text.=" var DROPS_graph=\"$DROPS_graph\";\n";
|
||||
$JS_text.=" var LOGINTIME_graph=\"$LOGINTIME_graph\";\n";
|
||||
$JS_text.=" var PAUSETIME_graph=\"$PAUSETIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=9; i++) {\n";
|
||||
$JS_text.=" var cellID=\"campbreakdown\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"campbreakdown\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('multi_campaign_breakdown').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
if ($file_download>0) {
|
||||
# $CSV_report=fopen("AST_OUTBOUNDsummary_interval.csv", "w");
|
||||
@@ -1330,7 +1523,22 @@ else
|
||||
|
||||
exit;
|
||||
} else {
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$GRAPH_text;
|
||||
$SUBoutput.=$SUB_HTML_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
$SUBoutput.=$SUB_ASCII_text;
|
||||
}
|
||||
|
||||
echo "$HEADER";
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo "$MAIN";
|
||||
echo "$SUBoutput";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_VDADstats.php
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat
|
||||
@@ -31,6 +31,7 @@
|
||||
# 100814-2307 - Added display of preset dials if presets are enabled in the campaign
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -69,6 +70,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -80,6 +83,8 @@ if (strlen($include_rollover)<2) {$include_rollover='NO';}
|
||||
|
||||
$report_name = 'Outbound Calling Report';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -310,11 +315,13 @@ else
|
||||
|
||||
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
|
||||
$short_header=1;
|
||||
$draw_graph=1;
|
||||
|
||||
require("admin_header.php");
|
||||
|
||||
@@ -393,6 +400,10 @@ if ($carrier_logging_active > 0)
|
||||
echo "<option value=\"NO\">NO</option>\n";
|
||||
echo "</SELECT>\n";
|
||||
}
|
||||
echo "<BR><BR>Display as:<BR>";
|
||||
echo "<select name='report_display_type'>";
|
||||
if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>";
|
||||
echo "</TD><TD VALIGN=TOP>Shift: <BR>";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
@@ -765,16 +776,23 @@ else
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- CALL HANGUP REASON STATS\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$OUToutput .= "| HANGUP REASON | CALLS |\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- CALL HANGUP REASON STATS\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "| HANGUP REASON | CALLS |\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
|
||||
$GRAPH.="<BR/><BR/><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>CALL HANGUP REASON STATS</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">DID</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand group by term_reason;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$reasons_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $reasons_to_print)
|
||||
@@ -788,17 +806,33 @@ else
|
||||
if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';}
|
||||
if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER ';}
|
||||
|
||||
$OUToutput .= "| $reason | $REASONcount |\n";
|
||||
$ASCII_text .= "| $reason | $REASONcount |\n";
|
||||
|
||||
if ($row[0]>$max_calls) {$max_calls=$row[0];}
|
||||
$graph_stats[$i][0]=$row[0];
|
||||
$graph_stats[$i][1]=$row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$OUToutput .= "| TOTAL: | $TOTALcalls |\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "| TOTAL: | $TOTALcalls |\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTALcalls)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
|
||||
@@ -808,12 +842,31 @@ else
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- CALL STATUS STATS\n";
|
||||
$OUToutput .= "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
|
||||
$OUToutput .= "| | | | | CALL TIME |AGENT TIME|\n";
|
||||
$OUToutput .= "| STATUS | DESCRIPTION | CATEGORY | CALLS | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
|
||||
$OUToutput .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- CALL STATUS STATS\n";
|
||||
$ASCII_text .= "+--------+----------------------+----------------------+------------+----------------------------------+----------+\n";
|
||||
$ASCII_text .= "| | | | | CALL TIME |AGENT TIME|\n";
|
||||
$ASCII_text .= "| STATUS | DESCRIPTION | CATEGORY | CALLS | TOTAL TIME | AVG TIME |CALLS/HOUR|CALLS/HOUR|\n";
|
||||
$ASCII_text .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
|
||||
######## GRAPHING #########
|
||||
$GRAPH="<BR><BR><a name='cssgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='20%' class='grey_graph_cell' id='cssgraph1'><a href='#' onClick=\"DrawCSSGraph('CALLS', '1'); return false;\">CALLS</a></th><th width=20% class='grey_graph_cell' id='cssgraph2'><a href='#' onClick=\"DrawCSSGraph('TOTALTIME', '2'); return false;\">TOTAL TIME</a></th><th width=20% class='grey_graph_cell' id='cssgraph3'><a href='#' onClick=\"DrawCSSGraph('AVGTIME', '3'); return false;\">AVG TIME</a></th><th width=20% class='grey_graph_cell' id='cssgraph4'><a href='#' onClick=\"DrawCSSGraph('CALLSHOUR', '4'); return false;\">CALLS/HR</a></th><th width=20% class='grey_graph_cell' id='cssgraph5'><a href='#' onClick=\"DrawCSSGraph('CALLSHOUR_agent', '5'); return false;\">AGENT CALLS/HR</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='5' class='graph_span_cell'><span id='call_status_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_total_time=1;
|
||||
$max_avg_time=1;
|
||||
$max_callshr=1;
|
||||
$max_agentcallshr=1;
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>CALL STATUS STATS</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$TOTALTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL TIME</th></tr>";
|
||||
$AVGTIME_graph=$graph_header."<th class='thgraph' scope='col'>AVG TIME</th></tr>";
|
||||
$CALLSHOUR_graph=$graph_header."<th class='thgraph' scope='col'>CALLS/HR</th></tr>";
|
||||
$CALLSHOUR_agent_graph=$graph_header."<th class='thgraph' scope='col'>AGENT CALLS/HR</th></tr>";
|
||||
###########################
|
||||
|
||||
|
||||
$campaignSQL = "$group_SQLand";
|
||||
if (eregi("YES",$include_rollover))
|
||||
@@ -827,7 +880,7 @@ else
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$AGENTsec = "$rowx[0]";
|
||||
}
|
||||
if ($DB) {$OUToutput .= "$AGENTsec|$Ctally_to_print|$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$AGENTsec|$Ctally_to_print|$stmt\n";}
|
||||
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
@@ -838,7 +891,7 @@ else
|
||||
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$statuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $statuses_to_print)
|
||||
@@ -915,6 +968,17 @@ else
|
||||
$AGENTrate = ($STATUScount / ($AGENTsec / 3600) );
|
||||
$AGENTrate = sprintf("%.2f", $AGENTrate);
|
||||
|
||||
if ($STATUScount>$max_calls) {$max_calls=$STATUScount;}
|
||||
if ($RAWhours>$max_total_time) {$max_total_time=$RAWhours;}
|
||||
if ($STATUSavg_sec>$max_avg_time) {$max_avg_time=$STATUSavg_sec;}
|
||||
if ($STATUSrate>$max_callshr) {$max_callshr=$STATUSrate;}
|
||||
if ($AGENTrate>$max_agentcallshr) {$max_agentcallshr=$AGENTrate;}
|
||||
$graph_stats[$i][1]=$STATUScount;
|
||||
$graph_stats[$i][2]=$RAWhours;
|
||||
$graph_stats[$i][3]=($RAWhours / $STATUScount);
|
||||
$graph_stats[$i][4]=$STATUSrate;
|
||||
$graph_stats[$i][5]=$AGENTrate;
|
||||
|
||||
$STATUShours = sec_convert($RAWhours,'H');
|
||||
$STATUSavg_sec = ($RAWhours / $STATUScount);
|
||||
$STATUSavg = sec_convert($STATUSavg_sec,'H');
|
||||
@@ -940,8 +1004,9 @@ else
|
||||
$statcat = sprintf("%-60s", $statcat_list[$RAWstatus]);
|
||||
while(mb_strlen($statcat,'utf-8')>20) {$statcat = mb_substr("$statcat", 0, -1,'utf-8');}
|
||||
}
|
||||
$graph_stats[$i][0]="$status - $status_name - $statcat";
|
||||
|
||||
$OUToutput .= "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
|
||||
$ASCII_text .= "| $status | $status_name | $statcat | $STATUScount | $STATUShours | $STATUSavg | $STATUSrate | $AGENTrate |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
@@ -971,12 +1036,43 @@ else
|
||||
$TOTALrate = sprintf("%8s", $TOTALrate);while(strlen($TOTALrate)>8) {$TOTALrate = substr("$TOTALrate", 0, -1);}
|
||||
$aTOTALrate = sprintf("%8s", $aTOTALrate);while(strlen($aTOTALrate)>8) {$aTOTALrate = substr("$aTOTALrate", 0, -1);}
|
||||
|
||||
$OUToutput .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
$OUToutput .= "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate | |\n";
|
||||
# $OUToutput .= "| AGENT TIME | $aTOTALhours | | $aTOTALrate |\n";
|
||||
$OUToutput .= "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
|
||||
$ASCII_text .= "+--------+----------------------+----------------------+------------+------------+----------+----------+----------+\n";
|
||||
$ASCII_text .= "| TOTAL: | $TOTALcalls | $TOTALhours | $TOTALavg | $TOTALrate | |\n";
|
||||
# $ASCII_text .= "| AGENT TIME | $aTOTALhours | | $aTOTALrate |\n";
|
||||
$ASCII_text .= "+------------------------------------------------------+------------+------------+---------------------+----------+\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_total_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
|
||||
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avg_time)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
|
||||
$CALLSHOUR_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_callshr)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
|
||||
$CALLSHOUR_agent_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*($graph_stats[$d][5]/$max_agentcallshr))."' height='16' />".$graph_stats[$d][5]."</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALcalls)."</th></tr></table>";
|
||||
$TOTALTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALhours)."</th></tr></table>";
|
||||
$AVGTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALavg)."</th></tr></table>";
|
||||
$CALLSHOUR_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTALrate)."</th></tr></table>";
|
||||
$CALLSHOUR_agent_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($aTOTALrate)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawCSSGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawCSSGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var TOTALTIME_graph=\"$TOTALTIME_graph\";\n";
|
||||
$JS_text.=" var AVGTIME_graph=\"$AVGTIME_graph\";\n";
|
||||
$JS_text.=" var CALLSHOUR_graph=\"$CALLSHOUR_graph\";\n";
|
||||
$JS_text.=" var CALLSHOUR_agent_graph=\"$CALLSHOUR_agent_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=5; i++) {\n";
|
||||
$JS_text.=" var cellID=\"cssgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"cssgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('call_status_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
|
||||
@@ -985,23 +1081,34 @@ else
|
||||
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- LIST ID STATS\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$OUToutput .= "| LIST | CALLS |\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- LIST ID STATS\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "| LIST | CALLS |\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
|
||||
$GRAPH="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>LIST ID STATS</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">LIST</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*),list_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand group by list_id;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$listids_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$max_calls=1; $graph_stats=array();
|
||||
while ($i < $listids_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LISTIDcalls[$i] = $row[0];
|
||||
$LISTIDlists[$i] = $row[1];
|
||||
if ($row[0]>$max_calls) {$max_calls=$row[0];}
|
||||
$graph_stats[$i][0]=$row[0];
|
||||
$graph_stats[$i][1]=$row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -1010,7 +1117,7 @@ else
|
||||
{
|
||||
$stmt="select list_name from vicidial_lists where list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$list_name_to_print = mysql_num_rows($rslt);
|
||||
if ($list_name_to_print > 0)
|
||||
{
|
||||
@@ -1023,19 +1130,31 @@ else
|
||||
$LISTIDcount = sprintf("%10s", $LISTIDcalls[$i]);while(strlen($LISTIDcount)>10) {$LISTIDcount = substr("$LISTIDcount", 0, -1);}
|
||||
$LISTIDname = sprintf("%-40s", "$LISTIDlists[$i] - $LISTIDlist_names[$i]");while(strlen($LISTIDname)>40) {$LISTIDname = substr("$LISTIDname", 0, -1);}
|
||||
|
||||
$OUToutput .= "| $LISTIDname | $LISTIDcount |\n";
|
||||
$ASCII_text .= "| $LISTIDname | $LISTIDcount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTALcalls = sprintf("%10s", $TOTALcalls);
|
||||
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$OUToutput .= "| TOTAL: | $TOTALcalls |\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "| TOTAL: | $TOTALcalls |\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTALcalls)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
if ( ($carrier_logging_active > 0) and ($carrier_stats == 'YES') )
|
||||
@@ -1043,17 +1162,17 @@ else
|
||||
##############################
|
||||
######### CARRIER STATS
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- CARRIER CALL STATUSES\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$OUToutput .= "| STATUS | CALLS |\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- CARRIER CALL STATUSES\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "| STATUS | CALLS |\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select dialstatus,count(*) from vicidial_carrier_log vcl,vicidial_log vl where vcl.uniqueid=vl.uniqueid and vcl.call_date > \"$query_date_BEGIN\" and vcl.call_date < \"$query_date_END\" and vl.call_date > \"$query_date_BEGIN\" and vl.call_date < \"$query_date_END\" $group_SQLand group by dialstatus order by dialstatus;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$carrierstatuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $carrierstatuses_to_print)
|
||||
@@ -1063,16 +1182,16 @@ else
|
||||
$CARstatus = sprintf("%-20s", $row[0]); while(strlen($CARstatus)>20) {$CARstatus = substr("$CARstatus", 0, -1);}
|
||||
$CARcount = sprintf("%10s", $row[1]); while(strlen($CARcount)>10) {$CARcount = substr("$CARcount", 0, -1);}
|
||||
|
||||
$OUToutput .= "| $CARstatus | $CARcount |\n";
|
||||
$ASCII_text .= "| $CARstatus | $CARcount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$TOTCARcalls = sprintf("%10s", $TOTCARcalls); while(strlen($TOTCARcalls)>10) {$TOTCARcalls = substr("$TOTCARcalls", 0, -1);}
|
||||
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$OUToutput .= "| TOTAL | $TOTCARcalls |\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "| TOTAL | $TOTCARcalls |\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
}
|
||||
|
||||
|
||||
@@ -1080,7 +1199,7 @@ else
|
||||
$presets_enabled=0;
|
||||
$stmt="select count(*) from vicidial_campaigns where enable_xfer_presets='ENABLED' $group_SQLand;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$presets_enabled_count = mysql_num_rows($rslt);
|
||||
if ($presets_enabled_count > 0)
|
||||
{
|
||||
@@ -1093,16 +1212,24 @@ else
|
||||
##############################
|
||||
######### PRESET DIAL STATS
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- AGENT PRESET DIALS\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$OUToutput .= "| PRESET NAME | CALLS |\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- AGENT PRESET DIALS\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "| PRESET NAME | CALLS |\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
|
||||
$GRAPH="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>AGENT PRESET DIALS</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">PRESET NAME</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
$max_calls=1; $graph_stats=array();
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select preset_name,count(*) from user_call_log where call_date > \"$query_date_BEGIN\" and call_date < \"$query_date_END\" and preset_name!='' and preset_name is not NULL $group_SQLand group by preset_name order by preset_name;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$carrierstatuses_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $carrierstatuses_to_print)
|
||||
@@ -1112,31 +1239,57 @@ else
|
||||
$PREstatus = sprintf("%-40s", $row[0]); while(strlen($PREstatus)>40) {$PREstatus = substr("$PREstatus", 0, -1);}
|
||||
$PREcount = sprintf("%10s", $row[1]); while(strlen($PREcount)>10) {$PREcount = substr("$PREcount", 0, -1);}
|
||||
|
||||
$OUToutput .= "| $PREstatus | $PREcount |\n";
|
||||
if ($row[1]>$max_calls) {$max_calls=$row[1];}
|
||||
$graph_stats[$i][0]=$row[1];
|
||||
$graph_stats[$i][1]=$row[0];
|
||||
|
||||
$ASCII_text .= "| $PREstatus | $PREcount |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL CALLS:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTPREcalls)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
|
||||
$TOTPREcalls = sprintf("%10s", $TOTPREcalls); while(strlen($TOTPREcalls)>10) {$TOTPREcalls = substr("$TOTPREcalls", 0, -1);}
|
||||
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$OUToutput .= "| TOTAL | $TOTPREcalls |\n";
|
||||
$OUToutput .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
$ASCII_text .= "| TOTAL | $TOTPREcalls |\n";
|
||||
$ASCII_text .= "+------------------------------------------+------------+\n";
|
||||
|
||||
$GRAPH_text.=$GRAPH;
|
||||
}
|
||||
|
||||
|
||||
##############################
|
||||
######### STATUS CATEGORY STATS
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- CUSTOM STATUS CATEGORY STATS\n";
|
||||
$OUToutput .= "+----------------------+------------+--------------------------------+\n";
|
||||
$OUToutput .= "| CATEGORY | CALLS | DESCRIPTION |\n";
|
||||
$OUToutput .= "+----------------------+------------+--------------------------------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- CUSTOM STATUS CATEGORY STATS\n";
|
||||
$ASCII_text .= "+----------------------+------------+--------------------------------+\n";
|
||||
$ASCII_text .= "| CATEGORY | CALLS | DESCRIPTION |\n";
|
||||
$ASCII_text .= "+----------------------+------------+--------------------------------+\n";
|
||||
|
||||
$GRAPH="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.="<caption align='top'>CUSTOM STATUS CATEGORY STATS</caption>";
|
||||
$GRAPH.="<tr>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CATEGORY</th>\n";
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">CALLS</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
$max_calls=1; $graph_stats=array();
|
||||
|
||||
$TOTCATcalls=0;
|
||||
$r=0;
|
||||
$r=0; $i=0;
|
||||
while ($r < $statcats_to_print)
|
||||
{
|
||||
if ($vsc_id[$r] != 'UNDEFINED')
|
||||
@@ -1146,17 +1299,35 @@ else
|
||||
$CATcount = sprintf("%10s", $vsc_count[$r]); while(strlen($CATcount)>10) {$CATcount = substr("$CATcount", 0, -1);}
|
||||
$CATname = sprintf("%-30s", $vsc_name[$r]); while(strlen($CATname)>30) {$CATname = substr("$CATname", 0, -1);}
|
||||
|
||||
$OUToutput .= "| $category | $CATcount | $CATname |\n";
|
||||
if ($vsc_count[$r]>$max_calls) {$max_calls=$vsc_count[$r];}
|
||||
$graph_stats[$i][0]=$vsc_count[$r];
|
||||
$graph_stats[$i][1]=$vsc_id[$r];
|
||||
$i++;
|
||||
|
||||
$ASCII_text .= "| $category | $CATcount | $CATname |\n";
|
||||
}
|
||||
$r++;
|
||||
}
|
||||
|
||||
$TOTCATcalls = sprintf("%10s", $TOTCATcalls); while(strlen($TOTCATcalls)>10) {$TOTCATcalls = substr("$TOTCATcalls", 0, -1);}
|
||||
|
||||
$OUToutput .= "+----------------------+------------+--------------------------------+\n";
|
||||
$OUToutput .= "| TOTAL | $TOTCATcalls |\n";
|
||||
$OUToutput .= "+----------------------+------------+\n";
|
||||
$ASCII_text .= "+----------------------+------------+--------------------------------+\n";
|
||||
$ASCII_text .= "| TOTAL | $TOTCATcalls |\n";
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <td class=\"chart_td$class\">".$graph_stats[$d][1]."</td>\n";
|
||||
$GRAPH.=" <td nowrap class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$graph_stats[$d][0]/$max_calls)."\" height=\"16\" />".$graph_stats[$d][0]."</td>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">".trim($TOTCATcalls)."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.="</table><PRE>\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
##############################
|
||||
@@ -1167,16 +1338,30 @@ else
|
||||
$TOTtime=0;
|
||||
$TOTavg=0;
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- AGENT STATS\n";
|
||||
$OUToutput .= "+--------------------------+------------+------------+--------+\n";
|
||||
$OUToutput .= "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n";
|
||||
$OUToutput .= "+--------------------------+------------+------------+--------+\n";
|
||||
$ASCII_text .= "\n";
|
||||
$ASCII_text .= "---------- AGENT STATS\n";
|
||||
$ASCII_text .= "+--------------------------+------------+------------+--------+\n";
|
||||
$ASCII_text .= "| AGENT | CALLS | TIME H:M:S |AVERAGE |\n";
|
||||
$ASCII_text .= "+--------------------------+------------+------------+--------+\n";
|
||||
|
||||
######## GRAPHING #########
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_total_time=1;
|
||||
$max_avg_time=1;
|
||||
$GRAPH="<BR><BR><a name='AGENTgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='33%' class='grey_graph_cell' id='AGENTgraph1'><a href='#' onClick=\"DrawAGENTGraph('CALLS', '1'); return false;\">CALLS</a></th><th width='33%' class='grey_graph_cell' id='AGENTgraph2'><a href='#' onClick=\"DrawAGENTGraph('TOTALTIME', '2'); return false;\">TOTAL TIME</a></th><th width='34%' class='grey_graph_cell' id='AGENTgraph3'><a href='#' onClick=\"DrawAGENTGraph('AVGTIME', '3'); return false;\">AVG TIME</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='4' class='graph_span_cell'><span id='agent_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>AGENT STATS</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$TOTALTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL TIME</th></tr>";
|
||||
$AVGTIME_graph=$graph_header."<th class='thgraph' scope='col'>AVG TIME</th></tr>";
|
||||
###########################
|
||||
|
||||
$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and vicidial_log.user is not null and length_in_sec is not null and length_in_sec > 0 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
@@ -1246,13 +1431,24 @@ else
|
||||
$USERtotTALK = $RAWuser_talk[$i];
|
||||
$USERavgTALK = round($RAWuser_talk[$i] / $RAWuser_calls[$i]);
|
||||
|
||||
#######
|
||||
if ($RAWuser_calls[$i]>$max_calls) {$max_calls=$RAWuser_calls[$i];}
|
||||
if ($RAWuser_talk[$i]>$max_total_time) {$max_total_time=$RAWuser_talk[$i];}
|
||||
if ($USERavgTALK>$max_avg_time) {$max_avg_time=$USERavgTALK;}
|
||||
$graph_stats[$i][0]="$user - $full_name";
|
||||
$graph_stats[$i][1]=$RAWuser_calls[$i];
|
||||
$graph_stats[$i][2]=$RAWuser_talk[$i];
|
||||
$graph_stats[$i][3]=$USERavgTALK;
|
||||
#######
|
||||
|
||||
|
||||
$USERtotTALK_MS = sec_convert($USERtotTALK,'H');
|
||||
$USERavgTALK_MS = sec_convert($USERavgTALK,'H');
|
||||
|
||||
$USERtotTALK_MS = sprintf("%9s", $USERtotTALK_MS);
|
||||
$USERavgTALK_MS = sprintf("%6s", $USERavgTALK_MS);
|
||||
|
||||
$OUToutput .= "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
|
||||
$ASCII_text .= "| $user - $full_name | $USERcalls | $USERtotTALK_MS | $USERavgTALK_MS |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
@@ -1275,19 +1471,44 @@ else
|
||||
|
||||
$stmt="select avg(wait_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQLand;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$AVGwait = $row[0];
|
||||
$AVGwait_MS = sec_convert($AVGwait,'H');
|
||||
$AVGwait = sprintf("%6s", $AVGwait_MS);
|
||||
|
||||
$OUToutput .= "+--------------------------+------------+------------+--------+\n";
|
||||
$OUToutput .= "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
|
||||
$OUToutput .= "+--------------------------+------------+------------+--------+\n";
|
||||
$OUToutput .= "| Average Wait time between calls $AVGwait |\n";
|
||||
$OUToutput .= "+-------------------------------------------------------------+\n";
|
||||
$ASCII_text .= "+--------------------------+------------+------------+--------+\n";
|
||||
$ASCII_text .= "| TOTAL Agents: $TOTagents | $TOTcalls | $TOTtime | $TOTavg |\n";
|
||||
$ASCII_text .= "+--------------------------+------------+------------+--------+\n";
|
||||
$ASCII_text .= "| Average Wait time between calls $AVGwait |\n";
|
||||
$ASCII_text .= "+-------------------------------------------------------------+\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$TOTALTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_total_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
|
||||
$AVGTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_avg_time)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$TOTALTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtime)."</th></tr></table>";
|
||||
$AVGTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavg)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawAGENTGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawAGENTGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var TOTALTIME_graph=\"$TOTALTIME_graph\";\n";
|
||||
$JS_text.=" var AVGTIME_graph=\"$AVGTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=3; i++) {\n";
|
||||
$JS_text.=" var cellID=\"AGENTgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"AGENTgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('agent_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
if ($costformat > 0)
|
||||
@@ -1339,6 +1560,14 @@ else
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$OUToutput.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$OUToutput.=$ASCII_text;
|
||||
}
|
||||
|
||||
echo "$OUToutput";
|
||||
|
||||
@@ -1558,7 +1787,10 @@ else
|
||||
echo "\nRun Time: $RUNtime seconds|$db_source\n";
|
||||
}
|
||||
|
||||
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
echo $JS_text;
|
||||
|
||||
?>
|
||||
</PRE>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_agent_days_detail.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -15,6 +15,7 @@
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 111104-1302 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
|
||||
@@ -43,11 +44,15 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$report_name = 'Single Agent Daily';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -257,6 +262,7 @@ if ($file_download < 1)
|
||||
|
||||
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>Single Agent Daily</TITLE></HEAD><BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -267,8 +273,9 @@ if ($file_download < 1)
|
||||
require("admin_header.php");
|
||||
|
||||
echo "</span>\n";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:19;\" id=agent_status_stats>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
$ASCII_text.="<span style=\"position:absolute;left:3px;top:3px;z-index:19;\" id=agent_status_stats>\n";
|
||||
$ASCII_text.="<PRE><FONT SIZE=2>\n";
|
||||
$GRAPH_text.="<PRE><FONT SIZE=2>\n";
|
||||
}
|
||||
|
||||
if (strlen($group[0]) < 1)
|
||||
@@ -307,10 +314,12 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "Agent Days Status Report: $user $NOW_TIME\n";
|
||||
|
||||
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENT Details -------------\n\n";
|
||||
$ASCII_text.="Agent Days Status Report: $user $NOW_TIME\n";
|
||||
$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
$ASCII_text.="---------- AGENT Details -------------\n\n";
|
||||
$GRAPH_text.="Agent Days Status Report: $user $NOW_TIME\n";
|
||||
$GRAPH_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
$GRAPH_text.="---------- AGENT Details -------------\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -366,10 +375,17 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "LEAD STATS BREAKDOWN:\n";
|
||||
echo "+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| <a href=\"$LINKbase\">DATE</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
|
||||
echo "+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="LEAD STATS BREAKDOWN:\n";
|
||||
$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| <a href=\"$LINKbase\">DATE</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
|
||||
$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
for ($i=0; $i<count($statusesARY); $i++) {
|
||||
$Sstatus=$statusesARY[$i];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='callgraph".($i+4)."'><a href='#' onClick=\"DrawGraph('$Sstatus', '".($i+4)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -380,6 +396,18 @@ else
|
||||
$m=0;
|
||||
$CIScountTOT=0;
|
||||
$DNCcountTOT=0;
|
||||
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_cicalls=1;
|
||||
$max_dncci=1;
|
||||
$GRAPH="<BR><BR><a name='callgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH2="<tr><th class='column_header grey_graph_cell' id='callgraph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">CALLS</a></th><th class='column_header grey_graph_cell' id='callgraph2'><a href='#' onClick=\"DrawGraph('CICALLS', '2'); return false;\">CI/CALLS</a></th><th class='column_header grey_graph_cell' id='callgraph3'><a href='#' onClick=\"DrawGraph('DNCCI', '3'); return false;\">DNC/CI</a></th>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>LEAD STATS BREAKDOWN</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$CICALLS_graph=$graph_header."<th class='thgraph' scope='col'>CI CALLS</th></tr>";
|
||||
$DNCCI_graph=$graph_header."<th class='thgraph' scope='col'>DNC/CI%</th></tr>";
|
||||
|
||||
while ($m < $k)
|
||||
{
|
||||
$Sdate=$datesARY[$m];
|
||||
@@ -395,6 +423,10 @@ else
|
||||
{
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
$varname=$Sstatus."_graph";
|
||||
$$varname=$graph_header."<th class='thgraph' scope='col'>$Sstatus</th></tr>";
|
||||
$max_varname="max_".$Sstatus;
|
||||
$graph_stats[$m][(4+$n)]=0;
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -413,6 +445,10 @@ else
|
||||
$DNCcount = ($DNCcount + $calls[$i]);
|
||||
$DNCcountTOT = ($DNCcountTOT + $calls[$i]);
|
||||
}
|
||||
|
||||
if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];}
|
||||
$graph_stats[$m][(4+$n)]=$calls[$i];
|
||||
|
||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
$SstatusesFILE .= "$SstatusTXT,";
|
||||
@@ -452,9 +488,17 @@ else
|
||||
# $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs);
|
||||
$DNCcountPCTs = sprintf("%6s", $DNCcountPCTs);
|
||||
|
||||
if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);}
|
||||
if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);}
|
||||
if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);}
|
||||
$graph_stats[$m][1]=trim("$Scalls");
|
||||
$graph_stats[$m][2]=trim("$CIScount");
|
||||
$graph_stats[$m][3]=trim("$DNCcountPCTs");
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
$Toutput = "| <a href=\"./user_stats.php?user=$user&start_date=$RAWdate\">$Sdate</a> | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n";
|
||||
$graph_stats[$m][0]=trim("$Sdate");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -492,7 +536,7 @@ else
|
||||
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
|
||||
{
|
||||
if ($file_download < 1)
|
||||
{echo "$Toutput";}
|
||||
{$ASCII_text.="$Toutput";}
|
||||
else
|
||||
{$file_output .= "$fileToutput";}
|
||||
}
|
||||
@@ -521,7 +565,7 @@ else
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
if ($file_download < 1)
|
||||
{echo "$TOPsorted_output[$i]";}
|
||||
{$ASCII_text.="$TOPsorted_output[$i]";}
|
||||
else
|
||||
{$file_output .= "$TOPsorted_outputFILE[$i]";}
|
||||
$m++;
|
||||
@@ -540,6 +584,7 @@ else
|
||||
$Scalls=0;
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
$total_var=$Sstatus."_total";
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -555,12 +600,14 @@ else
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
$$total_var=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SUMstatusTXT = sprintf("%8s", $Scalls);
|
||||
$SUMstatusesHTML .= " $SUMstatusTXT |";
|
||||
$SUMstatusesFILE .= "$SUMstatusTXT,";
|
||||
$$total_var=$Scalls;
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
@@ -582,11 +629,71 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
|
||||
echo "+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| TOTALS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
|
||||
$ASCII_text.="+------------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
$ASCII_text.="\n\n</PRE>";
|
||||
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='callgraph".($e+4)."'><a href='#' onClick=\"DrawGraph('$Sstatus', '".($e+4)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_cicalls)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
|
||||
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_dncci)."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$varname=$Sstatus."_graph";
|
||||
$max_varname="max_".$Sstatus;
|
||||
|
||||
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+4)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$CICALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($CIScountTOT)."</th></tr></table>";
|
||||
$DNCCI_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($DNCcountPCT)."%</th></tr></table>";
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$total_var=$Sstatus."_total";
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$$graph_var.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($$total_var)."</th></tr></table>";
|
||||
}
|
||||
$JS_onload.="\tDrawGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n";
|
||||
$JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n";
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$JS_text.=" var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=".(3+count($statusesARY))."; i++) {\n";
|
||||
$JS_text.=" var cellID=\"callgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"callgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('agent_time_detail_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
$GRAPH3="<tr><td colspan='".(3+count($statusesARY))."' class='graph_span_cell'><span id='agent_time_detail_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
$GRAPH_text.=$GRAPH.$GRAPH2.$GRAPH3;
|
||||
|
||||
echo "\n\n</PRE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -617,8 +724,19 @@ if ($file_download > 0)
|
||||
exit;
|
||||
}
|
||||
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
echo $JS_text;
|
||||
echo $GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ASCII_text;
|
||||
}
|
||||
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||
echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>";
|
||||
@@ -667,6 +785,11 @@ while ($campaigns_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "</TD><TD VALIGN=TOP>";
|
||||
echo "Display as: <BR>";
|
||||
echo "<select name='report_display_type'>";
|
||||
if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
echo "</TD><TD VALIGN=TOP>User:<BR>";
|
||||
echo "<INPUT TYPE=TEXT SIZE=10 NAME=user value=\"$user\">\n";
|
||||
echo "</TD><TD VALIGN=TOP>Shift:<BR>";
|
||||
@@ -694,35 +817,38 @@ echo "</TD></TR></TABLE>";
|
||||
echo "</FORM>\n\n<BR>$db_source";
|
||||
|
||||
echo "</span>\n";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:18;\" id=agent_status_bars>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n\n\n\n\n\n\n\n\n\n";
|
||||
|
||||
$m=0;
|
||||
while ($m < $k)
|
||||
if ($report_display_type=="TEXT" || !$report_display_type)
|
||||
{
|
||||
$sort_split = explode("-----",$TOPsort[$m]);
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:18;\" id=agent_status_bars>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n\n\n\n\n\n\n\n\n\n";
|
||||
|
||||
if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
|
||||
{echo " \n";}
|
||||
else
|
||||
$m=0;
|
||||
while ($m < $k)
|
||||
{
|
||||
echo " <SPAN class=\"yellow\">";
|
||||
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
|
||||
$h=0;
|
||||
while ($h <= $TOPsortPLOT)
|
||||
$sort_split = explode("-----",$TOPsort[$m]);
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
|
||||
if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
|
||||
{echo " \n";}
|
||||
else
|
||||
{
|
||||
echo " ";
|
||||
$h++;
|
||||
echo " <SPAN class=\"yellow\">";
|
||||
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 120 );
|
||||
$h=0;
|
||||
while ($h <= $TOPsortPLOT)
|
||||
{
|
||||
echo " ";
|
||||
$h++;
|
||||
}
|
||||
echo "</SPAN>\n";
|
||||
}
|
||||
echo "</SPAN>\n";
|
||||
$m++;
|
||||
}
|
||||
$m++;
|
||||
|
||||
echo "</span>\n";
|
||||
}
|
||||
|
||||
echo "</span>\n";
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_agent_performance_detail.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -28,7 +28,8 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1739 - Added file download option
|
||||
# 111007-0709 - Changed user and fullname to use non-truncated for output file
|
||||
# 111104-1256 - Added user_group restrictions for selecting in-groups
|
||||
# 111104-1249 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -57,12 +58,16 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$report_name = 'Agent Performance Detail';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -269,6 +274,7 @@ $HTML_head.=" </STYLE>\n";
|
||||
|
||||
$HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HTML_head.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HTML_head.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -345,6 +351,10 @@ $HTML_text.="<option value=\"AM\">AM</option>\n";
|
||||
$HTML_text.="<option value=\"PM\">PM</option>\n";
|
||||
$HTML_text.="<option value=\"ALL\">ALL</option>\n";
|
||||
$HTML_text.="</SELECT><BR><BR>\n";
|
||||
$HTML_text.="Display as:<BR>";
|
||||
$HTML_text.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$HTML_text.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$HTML_text.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
$HTML_text.="<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$HTML_text.="</TD><TD VALIGN=TOP> ";
|
||||
|
||||
@@ -423,6 +433,40 @@ $stmt="select count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.u
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_time=1;
|
||||
$max_pause=1;
|
||||
$max_pauseavg=1;
|
||||
$max_wait=1;
|
||||
$max_waitavg=1;
|
||||
$max_talk=1;
|
||||
$max_talkavg=1;
|
||||
$max_dispo=1;
|
||||
$max_dispoavg=1;
|
||||
$max_dead=1;
|
||||
$max_deadavg=1;
|
||||
$max_customer=1;
|
||||
$max_customeravg=1;
|
||||
$GRAPH="<BR><BR><a name='callstatsgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH2="<tr><th class='column_header grey_graph_cell' id='callstatsgraph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">CALLS</a></th><th class='column_header grey_graph_cell' id='callstatsgraph2'><a href='#' onClick=\"DrawGraph('TIME', '2'); return false;\">TIME</a></th><th class='column_header grey_graph_cell' id='callstatsgraph3'><a href='#' onClick=\"DrawGraph('PAUSE', '3'); return false;\">PAUSE</a></th><th class='column_header grey_graph_cell' id='callstatsgraph4'><a href='#' onClick=\"DrawGraph('PAUSEAVG', '4'); return false;\">PAUSE AVG</a></th><th class='column_header grey_graph_cell' id='callstatsgraph5'><a href='#' onClick=\"DrawGraph('WAIT', '5'); return false;\">WAIT</a></th><th class='column_header grey_graph_cell' id='callstatsgraph6'><a href='#' onClick=\"DrawGraph('WAITAVG', '6'); return false;\">WAIT AVG</a></th><th class='column_header grey_graph_cell' id='callstatsgraph7'><a href='#' onClick=\"DrawGraph('TALK', '7'); return false;\">TALK</a></th><th class='column_header grey_graph_cell' id='callstatsgraph8'><a href='#' onClick=\"DrawGraph('TALKAVG', '8'); return false;\">TALK AVG</a></th><th class='column_header grey_graph_cell' id='callstatsgraph9'><a href='#' onClick=\"DrawGraph('DISPO', '9'); return false;\">DISPO</a></th><th class='column_header grey_graph_cell' id='callstatsgraph10'><a href='#' onClick=\"DrawGraph('DISPOAVG', '10'); return false;\">DISPO AVG</a></th><th class='column_header grey_graph_cell' id='callstatsgraph11'><a href='#' onClick=\"DrawGraph('DEAD', '11'); return false;\">DEAD</a></th><th class='column_header grey_graph_cell' id='callstatsgraph12'><a href='#' onClick=\"DrawGraph('DEADAVG', '12'); return false;\">DEAD AVG</a></th><th class='column_header grey_graph_cell' id='callstatsgraph13'><a href='#' onClick=\"DrawGraph('CUST', '13'); return false;\">CUST</a></th><th class='column_header grey_graph_cell' id='callstatsgraph14'><a href='#' onClick=\"DrawGraph('CUSTAVG', '14'); return false;\">CUST AVG</a></th>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>CALL STATS BREAKDOWN: (Statistics related to handling of calls only)</caption><tr><th class='thgraph' scope='col'>USER</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS</th></tr>";
|
||||
$TIME_graph=$graph_header."<th class='thgraph' scope='col'>TIME</th></tr>";
|
||||
$PAUSE_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE</th></tr>";
|
||||
$PAUSEAVG_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE AVG</th></tr>";
|
||||
$WAIT_graph=$graph_header."<th class='thgraph' scope='col'>WAIT</th></tr>";
|
||||
$WAITAVG_graph=$graph_header."<th class='thgraph' scope='col'>WAIT AVG</th></tr>";
|
||||
$TALK_graph=$graph_header."<th class='thgraph' scope='col'>TALK</th></tr>";
|
||||
$TALKAVG_graph=$graph_header."<th class='thgraph' scope='col'>TALK AVG</th></tr>";
|
||||
$DISPO_graph=$graph_header."<th class='thgraph' scope='col'>DISPO</th></tr>";
|
||||
$DISPOAVG_graph=$graph_header."<th class='thgraph' scope='col'>DISPO AVG</th></tr>";
|
||||
$DEAD_graph=$graph_header."<th class='thgraph' scope='col'>DEAD</th></tr>";
|
||||
$DEADAVG_graph=$graph_header."<th class='thgraph' scope='col'>DEAD AVG</th></tr>";
|
||||
$CUST_graph=$graph_header."<th class='thgraph' scope='col'>CUST</th></tr>";
|
||||
$CUSTAVG_graph=$graph_header."<th class='thgraph' scope='col'>CUST AVG</th></tr>";
|
||||
|
||||
$i=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
@@ -439,6 +483,10 @@ while ($i < $rows_to_print)
|
||||
$status[$i] = $row[7];
|
||||
$dead_sec[$i] = $row[8];
|
||||
$customer_sec[$i] = ($talk_sec[$i] - $dead_sec[$i]);
|
||||
|
||||
$max_varname="max_".$status[$i];
|
||||
$$max_varname=1;
|
||||
|
||||
if ($customer_sec[$i] < 1)
|
||||
{$customer_sec[$i]=0;}
|
||||
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) )
|
||||
@@ -467,10 +515,10 @@ while ($i < $rows_to_print)
|
||||
$CSV_header.="\n";
|
||||
$CSV_lines='';
|
||||
|
||||
$HTML_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) <a href=\"$LINKbase&stage=$stage&file_download=1\">[DOWNLOAD]</a>\n";
|
||||
$HTML_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$HTML_text.="| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n";
|
||||
$HTML_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="CALL STATS BREAKDOWN: (Statistics related to handling of calls only) <a href=\"$LINKbase&stage=$stage&file_download=1\">[DOWNLOAD]</a>\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=TIME\">TIME</a> | PAUSE |PAUSAVG | WAIT |WAITAVG | TALK |TALKAVG | DISPO |DISPAVG | DEAD |DEADAVG | CUSTOMER |CUSTAVG |$statusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
|
||||
|
||||
### BEGIN loop through each user ###
|
||||
@@ -496,6 +544,10 @@ while ($m < $k)
|
||||
{
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
|
||||
$varname=$Sstatus."_graph";
|
||||
$$varname=$graph_header."<th class='thgraph' scope='col'>$Sstatus</th></tr>";
|
||||
$max_varname="max_".$Sstatus;
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -512,6 +564,9 @@ while ($m < $k)
|
||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
|
||||
if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];}
|
||||
$graph_stats[$m][(15+$n)]=($calls[$i]+0);
|
||||
|
||||
$CSVstatuses.=",\"$calls[$i]\"";
|
||||
|
||||
$status_found++;
|
||||
@@ -522,6 +577,7 @@ while ($m < $k)
|
||||
{
|
||||
$SstatusesHTML .= " 0 |";
|
||||
$CSVstatuses.=",\"0\"";
|
||||
$graph_stats[$m][(15+$n)]=0;
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
$n++;
|
||||
@@ -571,6 +627,36 @@ while ($m < $k)
|
||||
while(mb_strlen($Suser,'utf-8')>8) {$Suser = mb_substr("$Suser", 0, -1,'utf-8');}
|
||||
}
|
||||
|
||||
if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);}
|
||||
if (trim($Stime)>$max_time) {$max_time=trim($Stime);}
|
||||
if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);}
|
||||
if (trim($Spause_avg)>$max_pauseavg) {$max_pauseavg=trim($Spause_avg);}
|
||||
if (trim($Swait_sec)>$max_wait) {$max_wait=trim($Swait_sec);}
|
||||
if (trim($Swait_avg)>$max_waitavg) {$max_waitavg=trim($Swait_avg);}
|
||||
if (trim($Stalk_sec)>$max_talk) {$max_talk=trim($Stalk_sec);}
|
||||
if (trim($Stalk_avg)>$max_talkavg) {$max_talkavg=trim($Stalk_avg);}
|
||||
if (trim($Sdispo_sec)>$max_dispo) {$max_dispo=trim($Sdispo_sec);}
|
||||
if (trim($Sdispo_avg)>$max_dispoavg) {$max_dispoavg=trim($Sdispo_avg);}
|
||||
if (trim($Sdead_sec)>$max_dead) {$max_dead=trim($Sdead_sec);}
|
||||
if (trim($Sdead_avg)>$max_deadavg) {$max_deadavg=trim($Sdead_avg);}
|
||||
if (trim($Scustomer_sec)>$max_customer) {$max_customer=trim($Scustomer_sec);}
|
||||
if (trim($Scustomer_avg)>$max_customeravg) {$max_customeravg=trim($Scustomer_avg);}
|
||||
$graph_stats[$m][0]=trim($Sfull_name)." - ".trim($Suser);
|
||||
$graph_stats[$m][1]=trim($Scalls);
|
||||
$graph_stats[$m][2]=trim($Stime);
|
||||
$graph_stats[$m][3]=trim($Spause_sec);
|
||||
$graph_stats[$m][4]=trim($Spause_avg);
|
||||
$graph_stats[$m][5]=trim($Swait_sec);
|
||||
$graph_stats[$m][6]=trim($Swait_avg);
|
||||
$graph_stats[$m][7]=trim($Stalk_sec);
|
||||
$graph_stats[$m][8]=trim($Stalk_avg);
|
||||
$graph_stats[$m][9]=trim($Sdispo_sec);
|
||||
$graph_stats[$m][10]=trim($Sdispo_avg);
|
||||
$graph_stats[$m][11]=trim($Sdead_sec);
|
||||
$graph_stats[$m][12]=trim($Sdead_avg);
|
||||
$graph_stats[$m][13]=trim($Scustomer_sec);
|
||||
$graph_stats[$m][14]=trim($Scustomer_avg);
|
||||
|
||||
$pfUSERtime_MS = sec_convert($Stime,'H');
|
||||
$pfUSERtotTALK_MS = sec_convert($Stalk_sec,'H');
|
||||
$pfUSERavgTALK_MS = sec_convert($Stalk_avg,'M');
|
||||
@@ -615,7 +701,7 @@ while ($m < $k)
|
||||
if ($stage == 'TIME')
|
||||
{$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
|
||||
if (!ereg("ID|TIME|LEADS",$stage))
|
||||
{$HTML_text.="$Toutput";}
|
||||
{$ASCII_text.="$Toutput";}
|
||||
|
||||
$m++;
|
||||
}
|
||||
@@ -637,7 +723,7 @@ if (ereg("ID|TIME|LEADS",$stage))
|
||||
$sort_split = explode("-----",$TOPsort[$m]);
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
$HTML_text.="$TOPsorted_output[$i]";
|
||||
$ASCII_text.="$TOPsorted_output[$i]";
|
||||
$m++;
|
||||
}
|
||||
}
|
||||
@@ -655,6 +741,7 @@ while ($n < $j)
|
||||
$Scalls=0;
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
$total_var=$Sstatus."_total";
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -670,12 +757,14 @@ while ($n < $j)
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
$$total_var=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SUMstatusTXT = sprintf("%8s", $Scalls);
|
||||
$SUMstatusesHTML .= " $SUMstatusTXT |";
|
||||
$CSVSUMstatuses.=",\"$Scalls\"";
|
||||
$$total_var=$Scalls;
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
@@ -740,9 +829,106 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1
|
||||
while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);}
|
||||
|
||||
|
||||
$HTML_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$HTML_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
|
||||
$HTML_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
|
||||
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='callstatsgraph".($e+15)."'><a href='#' onClick=\"DrawGraph('$Sstatus', '".($e+15)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$TIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_time)."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
|
||||
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_pause)."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
|
||||
$PAUSEAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_pauseavg)."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
|
||||
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_wait)."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
|
||||
$WAITAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_waitavg)."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
|
||||
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_talk)."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
|
||||
$TALKAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_talkavg)."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
|
||||
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_dispo)."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
|
||||
$DISPOAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][10]/$max_dispoavg)."' height='16' />".sec_convert($graph_stats[$d][10], 'HF')."</td></tr>";
|
||||
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][11]/$max_dead)."' height='16' />".sec_convert($graph_stats[$d][11], 'HF')."</td></tr>";
|
||||
$DEADAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][12]/$max_deadavg)."' height='16' />".sec_convert($graph_stats[$d][12], 'HF')."</td></tr>";
|
||||
$CUST_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][13]/$max_customer)."' height='16' />".sec_convert($graph_stats[$d][13], 'HF')."</td></tr>";
|
||||
$CUSTAVG_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][14]/$max_customeravg)."' height='16' />".sec_convert($graph_stats[$d][14], 'HF')."</td></tr>";
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$varname=$Sstatus."_graph";
|
||||
$max_varname="max_".$Sstatus;
|
||||
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
|
||||
|
||||
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+15)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+15)]."</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$TIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtime_MS)."</th></tr></table>";
|
||||
$PAUSE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotPAUSE_MS)."</th></tr></table>";
|
||||
$PAUSEAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgPAUSE_MS)."</th></tr></table>";
|
||||
$WAIT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotWAIT_MS)."</th></tr></table>";
|
||||
$WAITAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgWAIT_MS)."</th></tr></table>";
|
||||
$TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotTALK_MS)."</th></tr></table>";
|
||||
$TALKAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgTALK_MS)."</th></tr></table>";
|
||||
$DISPO_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotDISPO_MS)."</th></tr></table>";
|
||||
$DISPOAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgDISPO_MS)."</th></tr></table>";
|
||||
$DEAD_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotDEAD_MS)."</th></tr></table>";
|
||||
$DEADAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgDEAD_MS)."</th></tr></table>";
|
||||
$CUST_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotCUSTOMER_MS)."</th></tr></table>";
|
||||
$CUSTAVG_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTavgCUSTOMER_MS)."</th></tr></table>";
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$total_var=$Sstatus."_total";
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$$graph_var.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($$total_var)."</th></tr></table>";
|
||||
}
|
||||
|
||||
$JS_onload.="\tDrawGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var TIME_graph=\"$TIME_graph\";\n";
|
||||
$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n";
|
||||
$JS_text.=" var PAUSEAVG_graph=\"$PAUSEAVG_graph\";\n";
|
||||
$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n";
|
||||
$JS_text.=" var WAITAVG_graph=\"$WAITAVG_graph\";\n";
|
||||
$JS_text.=" var TALK_graph=\"$TALK_graph\";\n";
|
||||
$JS_text.=" var TALKAVG_graph=\"$TALKAVG_graph\";\n";
|
||||
$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n";
|
||||
$JS_text.=" var DISPOAVG_graph=\"$DISPOAVG_graph\";\n";
|
||||
$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n";
|
||||
$JS_text.=" var DEADAVG_graph=\"$DEADAVG_graph\";\n";
|
||||
$JS_text.=" var CUST_graph=\"$CUST_graph\";\n";
|
||||
$JS_text.=" var CUSTAVG_graph=\"$CUSTAVG_graph\";\n";
|
||||
|
||||
for ($e=0; $e<count($statusesARY); $e++) {
|
||||
$Sstatus=$statusesARY[$e];
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$JS_text.=" var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
|
||||
$JS_text.=" for (var i=1; i<=".(count($statusesARY)+14)."; i++) {\n";
|
||||
$JS_text.=" var cellID=\"callstatsgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"callstatsgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('call_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
$GRAPH3="<tr><td colspan='".(14+count($statusesARY))."' class='graph_span_cell'><span id='call_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3;
|
||||
|
||||
|
||||
$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
|
||||
|
||||
@@ -773,13 +959,7 @@ fwrite($CSV_report, $CSV_lines);
|
||||
fwrite($CSV_report, $CSV_total);
|
||||
|
||||
|
||||
$HTML_text.="\n\n";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$ASCII_text.="\n\n";
|
||||
|
||||
|
||||
|
||||
@@ -800,9 +980,21 @@ $PCusers='-';
|
||||
$PCusersARY=$MT;
|
||||
$PCuser_namesARY=$MT;
|
||||
$k=0;
|
||||
|
||||
$graph_stats=array();
|
||||
$max_total=1;
|
||||
$max_nonpause=1;
|
||||
$max_pause=1;
|
||||
$GRAPH="<BR><BR><a name='pausegraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH2="<tr><th class='column_header grey_graph_cell' id='pausegraph1'><a href='#' onClick=\"DrawPauseGraph('TOTAL', '1'); return false;\">TOTAL</a></th><th class='column_header grey_graph_cell' id='pausegraph2'><a href='#' onClick=\"DrawPauseGraph('NONPAUSE', '2'); return false;\">NONPAUSE</a></th><th class='column_header grey_graph_cell' id='pausegraph3'><a href='#' onClick=\"DrawPauseGraph('PAUSE', '3'); return false;\">PAUSE</a></th>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>PAUSE CODE BREAKDOWN</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$TOTAL_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL </th></tr>";
|
||||
$NONPAUSE_graph=$graph_header."<th class='thgraph' scope='col'>NONPAUSE</th></tr>";
|
||||
$PAUSE_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE</th></tr>";
|
||||
|
||||
$stmt="select full_name,vicidial_users.user,sum(pause_sec),sub_status,sum(wait_sec + talk_sec + dispo_sec) from vicidial_users,vicidial_agent_log where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=vicidial_agent_log.user and pause_sec<65000 $group_SQL $user_group_SQL group by user,full_name,sub_status order by user,full_name,sub_status desc limit 100000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$subs_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $subs_to_print)
|
||||
@@ -813,8 +1005,10 @@ while ($i < $subs_to_print)
|
||||
$PCpause_sec[$i] = $row[2];
|
||||
$sub_status[$i] = $row[3];
|
||||
$PCnon_pause_sec[$i] = $row[4];
|
||||
$max_varname="max_".$sub_status[$i];
|
||||
$$max_varname=1;
|
||||
|
||||
# echo "$sub_status[$i]|$PCpause_sec[$i]\n";
|
||||
# echo "$sub_status[$i]|$PCpause_sec[$i]\n";
|
||||
# if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) )
|
||||
if (!eregi("-$sub_status[$i]-", $sub_statuses))
|
||||
{
|
||||
@@ -837,10 +1031,10 @@ while ($i < $subs_to_print)
|
||||
$i++;
|
||||
}
|
||||
|
||||
$HTML_text.="PAUSE CODE BREAKDOWN: <a href=\"$LINKbase&stage=$stage&file_download=2\">[DOWNLOAD]</a>\n\n";
|
||||
$HTML_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$HTML_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n";
|
||||
$HTML_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="PAUSE CODE BREAKDOWN: <a href=\"$LINKbase&stage=$stage&file_download=2\">[DOWNLOAD]</a>\n\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="| USER NAME | ID | TOTAL | NONPAUSE | PAUSE | |$sub_statusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
|
||||
$CSV_header="\"Agent Performance Detail $NOW_TIME\"\n";
|
||||
$CSV_header.="\"Time range: $query_date_BEGIN to $query_date_END\"\n\n";
|
||||
@@ -877,6 +1071,9 @@ while ($m < $k)
|
||||
{
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
$varname=$Sstatus."_graph";
|
||||
$$varname=$graph_header."<th class='thgraph' scope='col'>$Sstatus</th></tr>";
|
||||
$max_varname="max_".$Sstatus;
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $subs_to_print)
|
||||
@@ -892,6 +1089,10 @@ while ($m < $k)
|
||||
|
||||
$SstatusTXT = sprintf("%8s", $pfUSERcodePAUSE_MS);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
|
||||
if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];}
|
||||
$graph_stats[$m][(4+$n)]=$PCpause_sec[$i];
|
||||
|
||||
$CSV_statuses.=",\"$USERcodePAUSE_MS\"";
|
||||
$status_found++;
|
||||
}
|
||||
@@ -901,6 +1102,7 @@ while ($m < $k)
|
||||
{
|
||||
$SstatusesHTML .= " 0 |";
|
||||
$CSV_statuses.=",\"0\"";
|
||||
$graph_stats[$m][(4+$n)]=0;
|
||||
}
|
||||
### END loop through each stat line ###
|
||||
$n++;
|
||||
@@ -909,6 +1111,7 @@ while ($m < $k)
|
||||
$TOTtotPAUSE=($TOTtotPAUSE + $Spause_sec);
|
||||
$Sfull_nameRAW = $Sfull_name;
|
||||
$SuserRAW = $Suser;
|
||||
$graph_stats[$m][0]="$Sfull_name - $SuserRAW";
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
@@ -928,6 +1131,13 @@ while ($m < $k)
|
||||
$TOTtotNONPAUSE = ($TOTtotNONPAUSE + $Snon_pause_sec);
|
||||
$TOTtotTOTAL = ($TOTtotTOTAL + $Stotal_sec);
|
||||
|
||||
if (trim($Stotal_sec)>$max_total) {$max_total=trim($Stotal_sec);}
|
||||
if (trim($Snon_pause_sec)>$max_nonpause) {$max_nonpause=trim($Snon_pause_sec);}
|
||||
if (trim($Spause_sec)>$max_pause) {$max_pause=trim($Spause_sec);}
|
||||
$graph_stats[$m][1]="$Stotal_sec";
|
||||
$graph_stats[$m][2]="$Snon_pause_sec";
|
||||
$graph_stats[$m][3]="$Spause_sec";
|
||||
|
||||
$USERtotPAUSE_MS = sec_convert($Spause_sec,'H');
|
||||
$USERtotNONPAUSE_MS = sec_convert($Snon_pause_sec,'H');
|
||||
$USERtotTOTAL_MS = sec_convert($Stotal_sec,'H');
|
||||
@@ -940,7 +1150,7 @@ while ($m < $k)
|
||||
|
||||
$BOTTOMsorted_output[$m] = $BOTTOMoutput;
|
||||
|
||||
$HTML_text.="$BOTTOMoutput";
|
||||
$ASCII_text.="$BOTTOMoutput";
|
||||
$CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n");
|
||||
$m++;
|
||||
}
|
||||
@@ -974,6 +1184,7 @@ while ($n < $j)
|
||||
$Scalls=0;
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
$total_var=$Sstatus."_total";
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $subs_to_print)
|
||||
@@ -989,10 +1200,12 @@ while ($n < $j)
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
$$total_var=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$TOTtotPAUSE = ($TOTtotPAUSE + $Scalls);
|
||||
$$total_var=$Scalls;
|
||||
|
||||
$USERsumstatPAUSE_MS = sec_convert($Scalls,'H');
|
||||
$pfUSERsumstatPAUSE_MS = sprintf("%8s", $USERsumstatPAUSE_MS);
|
||||
@@ -1020,9 +1233,72 @@ while ($n < $j)
|
||||
while(strlen($TOTtotTOTAL_MS)>10) {$TOTtotTOTAL_MS = substr("$TOTtotTOTAL_MS", 0, -1);}
|
||||
|
||||
|
||||
$HTML_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$HTML_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
|
||||
$HTML_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS |$TOTtotTOTAL_MS|$TOTtotNONPAUSE_MS|$TOTtotPAUSE_MS| |$SUMstatusesHTML\n";
|
||||
$ASCII_text.="+----------------------------+----------+----------+----------+ +$sub_statusesHEAD\n";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='pausegraph".($e+4)."'><a href='#' onClick=\"DrawPauseGraph('$Sstatus', '".($e+4)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$TOTAL_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_total)."' height='16' />".sec_convert($graph_stats[$d][1], 'H')."</td></tr>";
|
||||
$NONPAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_nonpause)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
|
||||
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_pause)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$varname=$Sstatus."_graph";
|
||||
$max_varname="max_".$Sstatus;
|
||||
|
||||
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+4)]/$$max_varname)."' height='16' />".sec_convert($graph_stats[$d][($e+4)], 'H')."</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$TOTAL_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotTOTAL_MS)."</th></tr></table>";
|
||||
$NONPAUSE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotNONPAUSE_MS)."</th></tr></table>";
|
||||
$PAUSE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTtotPAUSE_MS)."%</th></tr></table>";
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$total_var=$Sstatus."_total";
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$$graph_var.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim(sec_convert($$total_var, 'H'))."</th></tr></table>";
|
||||
}
|
||||
$JS_onload.="\tDrawPauseGraph('TOTAL', '1');\n";
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_text.="function DrawPauseGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var TOTAL_graph=\"$TOTAL_graph\";\n";
|
||||
$JS_text.=" var NONPAUSE_graph=\"$NONPAUSE_graph\";\n";
|
||||
$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$JS_text.=" var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
|
||||
$JS_text.=" for (var i=1; i<=".(3+count($sub_statusesARY))."; i++) {\n";
|
||||
$JS_text.=" var cellID=\"pausegraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"pausegraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('pause_detail_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
$GRAPH3="<tr><td colspan='".(3+count($sub_statusesARY))."' class='graph_span_cell'><span id='pause_detail_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max;
|
||||
|
||||
|
||||
|
||||
$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses");
|
||||
|
||||
@@ -1051,6 +1327,14 @@ fwrite($CSV_report, $CSV_header);
|
||||
fwrite($CSV_report, $CSV_lines);
|
||||
fwrite($CSV_report, $CSV_total);
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$HTML_text.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$HTML_text.=$ASCII_text;
|
||||
}
|
||||
|
||||
$HTML_text.="\n\n<BR>$db_source";
|
||||
$HTML_text.="</TD></TR></TABLE>";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_agent_status_detail.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -15,7 +15,8 @@
|
||||
# 100712-1324 - Added system setting slave server option
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation and allowed campaigns restrictions
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 111104-1249 - Added user_group restrictions for selecting in-groups
|
||||
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
|
||||
@@ -44,11 +45,15 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$report_name = 'Agent Status Detail';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -302,6 +307,7 @@ if ($file_download < 1)
|
||||
|
||||
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -312,13 +318,14 @@ if ($file_download < 1)
|
||||
require("admin_header.php");
|
||||
|
||||
echo "</span>\n";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:19;\" id=agent_status_stats>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n";
|
||||
$ASCII_text.="<span style=\"position:absolute;left:3px;top:3px;z-index:19;\" id=agent_status_stats>\n";
|
||||
$ASCII_text.="\n\n\n<PRE><FONT SIZE=2>\n";
|
||||
$GRAPH.="<PRE><FONT SIZE=2>\n";
|
||||
}
|
||||
|
||||
if ( (strlen($group[0]) < 1) or (strlen($user_group[0]) < 1) )
|
||||
{
|
||||
echo "\n";
|
||||
echo "<PRE><FONT SIZE=2>\n\n\n";
|
||||
echo "PLEASE SELECT A CAMPAIGN OR USER GROUP AND DATE-TIME ABOVE AND CLICK SUBMIT\n";
|
||||
echo " NOTE: stats taken from shift specified\n";
|
||||
}
|
||||
@@ -352,10 +359,12 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "Agent Status Detail Report $NOW_TIME\n";
|
||||
|
||||
echo "Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
echo "---------- AGENT Details -------------\n\n";
|
||||
$ASCII_text.="<BR><BR>Agent Status Detail Report $NOW_TIME\n";
|
||||
$ASCII_text.="Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
$ASCII_text.="---------- AGENT Details -------------\n\n";
|
||||
$GRAPH.="<BR><BR>Agent Status Detail Report $NOW_TIME\n";
|
||||
$GRAPH.="Time range: $query_date_BEGIN to $query_date_END\n\n";
|
||||
$GRAPH.="---------- AGENT Details -------------";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -379,7 +388,7 @@ else
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$i=0; $sub_status_count=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -398,6 +407,12 @@ else
|
||||
$statusesFILE .= "$statusesTXT,";
|
||||
$statuses .= "$status[$i]-";
|
||||
$statusesARY[$j] = $status[$i];
|
||||
|
||||
$sub_statusesARY[$sub_status_count] = $status[$i];
|
||||
$sub_status_count++;
|
||||
$max_varname="max_".$status[$i];
|
||||
$$max_varname=1;
|
||||
|
||||
$j++;
|
||||
}
|
||||
if (!eregi("-$user[$i]-", $users))
|
||||
@@ -413,10 +428,18 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "CALLS STATS BREAKDOWN:\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
|
||||
echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="CALLS STATS BREAKDOWN:\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| <a href=\"$LINKbase\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=CI\">CIcalls</a>| <a href=\"$LINKbase&stage=DNCCI\">DNC/CI%</a>|$statusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
for ($i=0; $i<count($sub_statusesARY); $i++) {
|
||||
$Sstatus=$sub_statusesARY[$i];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell'><a href='#' onClick=\"DrawGraph('$Sstatus'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -428,6 +451,18 @@ else
|
||||
$m=0;
|
||||
$CIScountTOT=0;
|
||||
$DNCcountTOT=0;
|
||||
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_cicalls=1;
|
||||
$max_dncci=1;
|
||||
$GRAPH.="<BR><BR><a name='callgraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH2="<tr><th class='column_header grey_graph_cell' id='callgraph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">CALLS</a></th><th class='column_header grey_graph_cell' id='callgraph2'><a href='#' onClick=\"DrawGraph('CICALLS', '2'); return false;\">CI/CALLS</a></th><th class='column_header grey_graph_cell' id='callgraph3'><a href='#' onClick=\"DrawGraph('DNCCI', '3'); return false;\">DNC/CI</a></th>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>CALL STATS BREAKDOWN</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$CICALLS_graph=$graph_header."<th class='thgraph' scope='col'>CI CALLS</th></tr>";
|
||||
$DNCCI_graph=$graph_header."<th class='thgraph' scope='col'>DNC/CI%</th></tr>";
|
||||
|
||||
while ($m < $k)
|
||||
{
|
||||
$Suser=$usersARY[$m];
|
||||
@@ -444,6 +479,9 @@ else
|
||||
{
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
$varname=$Sstatus."_graph";
|
||||
$$varname=$graph_header."<th class='thgraph' scope='col'>$Sstatus</th></tr>";
|
||||
$max_varname="max_".$Sstatus;
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -461,6 +499,10 @@ else
|
||||
$DNCcount = ($DNCcount + $calls[$i]);
|
||||
$DNCcountTOT = ($DNCcountTOT + $calls[$i]);
|
||||
}
|
||||
|
||||
if ($calls[$i]>$$max_varname) {$$max_varname=$calls[$i];}
|
||||
$graph_stats[$m][(4+$n)]=$calls[$i];
|
||||
|
||||
$SstatusTXT = sprintf("%8s", $calls[$i]);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
$SstatusesFILE .= "$SstatusTXT,";
|
||||
@@ -470,6 +512,7 @@ else
|
||||
}
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$graph_stats[$m][(4+$n)]=0;
|
||||
$SstatusesHTML .= " 0 |";
|
||||
$SstatusesFILE .= "0,";
|
||||
}
|
||||
@@ -514,9 +557,17 @@ else
|
||||
# $DNCcountPCTs = sprintf("%3.2f", $DNCcountPCTs);
|
||||
$DNCcountPCTs = sprintf("%6s", $DNCcountPCTs);
|
||||
|
||||
if (trim($Scalls)>$max_calls) {$max_calls=trim($Scalls);}
|
||||
if (trim($CIScount)>$max_cicalls) {$max_cicalls=trim($CIScount);}
|
||||
if (trim($DNCcountPCTs)>$max_dncci) {$max_dncci=trim($DNCcountPCTs);}
|
||||
$graph_stats[$m][1]=trim("$Scalls");
|
||||
$graph_stats[$m][2]=trim("$CIScount");
|
||||
$graph_stats[$m][3]=trim("$DNCcountPCTs");
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
$Toutput = "| $Sfull_name | <a href=\"./user_stats.php?user=$RAWuser\">$Suser</a> | $Scalls | $CIScount | $DNCcountPCTs%|$SstatusesHTML\n";
|
||||
$graph_stats[$m][0]=trim("$user_namesARY[$m] - $usersARY[$m]");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -553,7 +604,7 @@ else
|
||||
}
|
||||
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage))
|
||||
if ($file_download < 1)
|
||||
{echo "$Toutput";}
|
||||
{$ASCII_text.="$Toutput";}
|
||||
else
|
||||
{$file_output .= "$fileToutput";}
|
||||
|
||||
@@ -581,7 +632,7 @@ else
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
if ($file_download < 1)
|
||||
{echo "$TOPsorted_output[$i]";}
|
||||
{$ASCII_text.="$TOPsorted_output[$i]";}
|
||||
else
|
||||
{$file_output .= "$TOPsorted_outputFILE[$i]";}
|
||||
$m++;
|
||||
@@ -600,6 +651,7 @@ else
|
||||
$Scalls=0;
|
||||
$Sstatus=$statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
$total_var=$Sstatus."_total";
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $rows_to_print)
|
||||
@@ -615,12 +667,14 @@ else
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
$$total_var="0";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SUMstatusTXT = sprintf("%8s", $Scalls);
|
||||
$SUMstatusesHTML .= " $SUMstatusTXT |";
|
||||
$SUMstatusesFILE .= "$SUMstatusTXT,";
|
||||
$$total_var=$Scalls;
|
||||
}
|
||||
$n++;
|
||||
}
|
||||
@@ -628,9 +682,7 @@ else
|
||||
|
||||
$TOTcalls = sprintf("%7s", $TOTcalls);
|
||||
$CIScountTOT = sprintf("%7s", $CIScountTOT);
|
||||
$DNCcountPCT = 0;
|
||||
if ( ($DNCcountTOT > 0) and ($CIScountTOT > 0) )
|
||||
{$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);}
|
||||
$DNCcountPCT = ( ($DNCcountTOT / $CIScountTOT) * 100);
|
||||
$DNCcountPCT = round($DNCcountPCT,2);
|
||||
$DNCcountPCT = sprintf("%3.2f", $DNCcountPCT);
|
||||
if ( ($DNCcountTOT < 1) or ($CIScountTOT < 1) )
|
||||
@@ -646,11 +698,70 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
echo "| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
|
||||
echo "+----------------------------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="+-----------------+----------+--------+--------+--------+$statusesHEAD\n";
|
||||
$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $TOTcalls| $CIScountTOT| $DNCcountPCT%|$SUMstatusesHTML\n";
|
||||
$ASCII_text.="+----------------------------+--------+--------+--------+$statusesHEAD\n";
|
||||
|
||||
echo "\n\n</PRE>";
|
||||
$ASCII_text.="\n\n</PRE>";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='callgraph".($e+4)."'><a href='#' onClick=\"DrawGraph('$Sstatus', '".($e+4)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$CICALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_cicalls)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
|
||||
$DNCCI_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_dncci)."' height='16' />".$graph_stats[$d][3]."%</td></tr>";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$varname=$Sstatus."_graph";
|
||||
$max_varname="max_".$Sstatus;
|
||||
# $max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
|
||||
|
||||
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][($e+4)]/$$max_varname)."' height='16' />".$graph_stats[$d][($e+4)]."</td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$CICALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($CIScountTOT)."</th></tr></table>";
|
||||
$DNCCI_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($DNCcountPCT)."%</th></tr></table>";
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$total_var=$Sstatus."_total";
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$$graph_var.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($$total_var)."</th></tr></table>";
|
||||
}
|
||||
$JS_onload.="\tDrawGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var CICALLS_graph=\"$CICALLS_graph\";\n";
|
||||
$JS_text.=" var DNCCI_graph=\"$DNCCI_graph\";\n";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$JS_text.=" var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
|
||||
$JS_text.=" for (var i=1; i<=".(count($sub_statusesARY)+3)."; i++) {\n";
|
||||
$JS_text.=" var cellID=\"callgraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"callgraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('agent_time_detail_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
$GRAPH3="<tr><td colspan='".(3+$sub_status_count)."' class='graph_span_cell'><span id='agent_time_detail_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
# echo $GRAPH.$GRAPH2.$GRAPH3.$max;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -679,6 +790,20 @@ if ($file_download > 0)
|
||||
exit;
|
||||
}
|
||||
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
echo $GRAPH.$GRAPH2.$GRAPH3;
|
||||
echo $JS_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ASCII_text;
|
||||
}
|
||||
|
||||
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||
echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>";
|
||||
@@ -750,6 +875,10 @@ echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT><BR><BR>\n";
|
||||
echo "Display as:<BR>";
|
||||
echo "<select name='report_display_type'>";
|
||||
if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "</TD><TD VALIGN=TOP> ";
|
||||
|
||||
@@ -762,35 +891,38 @@ echo "</TD></TR></TABLE>";
|
||||
echo "</FORM>\n\n<BR>$db_source";
|
||||
|
||||
echo "</span>\n";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:18;\" id=agent_status_bars>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n\n\n\n\n\n\n\n\n\n";
|
||||
|
||||
$m=0;
|
||||
while ($m < $k)
|
||||
if (!$report_display_type || $report_display_type=="TEXT")
|
||||
{
|
||||
$sort_split = explode("-----",$TOPsort[$m]);
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
echo "<span style=\"position:absolute;left:3px;top:3px;z-index:18;\" id=agent_status_bars>\n";
|
||||
echo "<PRE><FONT SIZE=2>\n\n\n\n\n\n\n\n\n\n";
|
||||
|
||||
if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
|
||||
{echo " \n";}
|
||||
else
|
||||
$m=0;
|
||||
while ($m < $k)
|
||||
{
|
||||
echo " <SPAN class=\"yellow\">";
|
||||
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
|
||||
$h=0;
|
||||
while ($h <= $TOPsortPLOT)
|
||||
$sort_split = explode("-----",$TOPsort[$m]);
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
|
||||
if ( ($TOPsortTALLY[$i] < 1) or ($TOPsortMAX < 1) )
|
||||
{echo " \n";}
|
||||
else
|
||||
{
|
||||
echo " ";
|
||||
$h++;
|
||||
echo " <SPAN class=\"yellow\">";
|
||||
$TOPsortPLOT = ( ($TOPsortTALLY[$i] / $TOPsortMAX) * 110 );
|
||||
$h=0;
|
||||
while ($h <= $TOPsortPLOT)
|
||||
{
|
||||
echo " ";
|
||||
$h++;
|
||||
}
|
||||
echo "</SPAN>\n";
|
||||
}
|
||||
echo "</SPAN>\n";
|
||||
$m++;
|
||||
}
|
||||
$m++;
|
||||
|
||||
echo "</span>\n";
|
||||
}
|
||||
|
||||
echo "</span>\n";
|
||||
|
||||
?>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -4,7 +4,7 @@
|
||||
# Pulls time stats per agent selectable by campaign or user group
|
||||
# should be most accurate agent stats of all of the reports
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 90522-0723 - First build
|
||||
@@ -22,6 +22,7 @@
|
||||
# 110623-0728 - Fixed user group selection bug
|
||||
# 110708-1727 - Added options.php setting for time precision
|
||||
# 111104-1248 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -50,12 +51,16 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
if (strlen($stage)<2) {$stage='NAME';}
|
||||
|
||||
$report_name = 'Agent Time Detail';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
$user_case = '';
|
||||
$TIME_agenttimedetail = '';
|
||||
@@ -298,6 +303,7 @@ if ($file_download < 1)
|
||||
|
||||
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -375,6 +381,29 @@ else
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_timeclock=1;
|
||||
$max_agenttime=1;
|
||||
$max_wait=1;
|
||||
$max_talk=1;
|
||||
$max_dispo=1;
|
||||
$max_pause=1;
|
||||
$max_dead=1;
|
||||
$max_customer=1;
|
||||
$GRAPH="<a name='timegraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH2="<tr><th class='column_header grey_graph_cell' id='timegraph1'><a href='#' onClick=\"DrawGraph('CALLS', '1'); return false;\">CALLS</a></th><th class='column_header grey_graph_cell' id='timegraph2'><a href='#' onClick=\"DrawGraph('TIMECLOCK', '2'); return false;\">TIME CLOCK</a></th><th class='column_header grey_graph_cell' id='timegraph3'><a href='#' onClick=\"DrawGraph('AGENTTIME', '3'); return false;\">AGENT TIME</a></th><th class='column_header grey_graph_cell' id='timegraph4'><a href='#' onClick=\"DrawGraph('WAIT', '4'); return false;\">WAIT</a></th><th class='column_header grey_graph_cell' id='timegraph5'><a href='#' onClick=\"DrawGraph('TALK', '5'); return false;\">TALK</a></th><th class='column_header grey_graph_cell' id='timegraph6'><a href='#' onClick=\"DrawGraph('DISPO', '6'); return false;\">DISPO</a></th><th class='column_header grey_graph_cell' id='timegraph7'><a href='#' onClick=\"DrawGraph('PAUSE', '7'); return false;\">PAUSE</a></th><th class='column_header grey_graph_cell' id='timegraph8'><a href='#' onClick=\"DrawGraph('DEAD', '8'); return false;\">DEAD</a></th><th class='column_header grey_graph_cell' id='timegraph9'><a href='#' onClick=\"DrawGraph('CUSTOMER', '9'); return false;\">CUSTOMER</a></th>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>AGENT TIME BREAKDOWN</caption><tr><th class='thgraph' scope='col'>STATUS</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$TIMECLOCK_graph=$graph_header."<th class='thgraph' scope='col'>TIME CLOCK</th></tr>";
|
||||
$AGENTTIME_graph=$graph_header."<th class='thgraph' scope='col'>AGENT TIME</th></tr>";
|
||||
$WAIT_graph=$graph_header."<th class='thgraph' scope='col'>WAIT</th></tr>";
|
||||
$TALK_graph=$graph_header."<th class='thgraph' scope='col'>TALK</th></tr>";
|
||||
$DISPO_graph=$graph_header."<th class='thgraph' scope='col'>DISPO</th></tr>";
|
||||
$PAUSE_graph=$graph_header."<th class='thgraph' scope='col'>PAUSE</th></tr>";
|
||||
$DEAD_graph=$graph_header."<th class='thgraph' scope='col'>DEAD</th></tr>";
|
||||
$CUSTOMER_graph=$graph_header."<th class='thgraph' scope='col'>CUSTOMER</th></tr>";
|
||||
|
||||
while ($i < $users_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -417,7 +446,7 @@ else
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$subs_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$i=0;
|
||||
while ($i < $subs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -434,6 +463,9 @@ else
|
||||
$sub_statuses .= "$sub_status[$i]-";
|
||||
$sub_statusesARY[$sub_status_count] = $sub_status[$i];
|
||||
$sub_status_count++;
|
||||
|
||||
$max_varname="max_".$sub_status[$i];
|
||||
$$max_varname=1;
|
||||
}
|
||||
if (!eregi("-$PCuser[$i]-", $PCusers))
|
||||
{
|
||||
@@ -536,10 +568,12 @@ else
|
||||
##### BEGIN print the output to screen or put into file output variable
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "AGENT TIME BREAKDOWN:\n";
|
||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n";
|
||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="AGENT TIME BREAKDOWN:\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=LEADS\">CALLS</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | <a href=\"$LINKbase&stage=TIME\">AGENT TIME</a> | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | |$sub_statusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -567,6 +601,23 @@ else
|
||||
$RAWcalls = $Scalls[$m];
|
||||
$RAWtimeSEC = $Stime[$m];
|
||||
|
||||
if (trim($Scalls[$m])>$max_calls) {$max_calls=trim($Scalls[$m]);}
|
||||
if (trim($Stime[$m])>$max_agenttime) {$max_agenttime=trim($Stime[$m]);}
|
||||
if (trim($Swait[$m])>$max_wait) {$max_wait=trim($Swait[$m]);}
|
||||
if (trim($Stalk[$m])>$max_talk) {$max_talk=trim($Stalk[$m]);}
|
||||
if (trim($Sdispo[$m])>$max_dispo) {$max_dispo=trim($Sdispo[$m]);}
|
||||
if (trim($Spause[$m])>$max_pause) {$max_pause=trim($Spause[$m]);}
|
||||
if (trim($Sdead[$m])>$max_dead) {$max_dead=trim($Sdead[$m]);}
|
||||
if (trim($Scustomer[$m])>$max_customer) {$max_customer=trim($Scustomer[$m]);}
|
||||
$graph_stats[$m][1]=trim($Scalls[$m]);
|
||||
$graph_stats[$m][3]=trim($Stime[$m]);
|
||||
$graph_stats[$m][4]=trim($Swait[$m]);
|
||||
$graph_stats[$m][5]=trim($Stalk[$m]);
|
||||
$graph_stats[$m][6]=trim($Sdispo[$m]);
|
||||
$graph_stats[$m][7]=trim($Spause[$m]);
|
||||
$graph_stats[$m][8]=trim($Sdead[$m]);
|
||||
$graph_stats[$m][9]=trim($Scustomer[$m]);
|
||||
|
||||
$Swait[$m]= sec_convert($Swait[$m],$TIME_agenttimedetail);
|
||||
$Stalk[$m]= sec_convert($Stalk[$m],$TIME_agenttimedetail);
|
||||
$Sdispo[$m]= sec_convert($Sdispo[$m],$TIME_agenttimedetail);
|
||||
@@ -610,6 +661,10 @@ else
|
||||
$punches_found++;
|
||||
$RAWtimeTCsec = $TCtime[$n];
|
||||
$TOTtimeTC = ($TOTtimeTC + $TCtime[$n]);
|
||||
|
||||
if (trim($RAWtimeTCsec)>$max_timeclock) {$max_timeclock=trim($RAWtimeTCsec);}
|
||||
$graph_stats[$m][2]=trim($RAWtimeTCsec);
|
||||
|
||||
$StimeTC[$m]= sec_convert($TCtime[$n],$TIME_agenttimedetail);
|
||||
$RAWtimeTC = $StimeTC[$m];
|
||||
$StimeTC[$m] = sprintf("%10s", $StimeTC[$m]);
|
||||
@@ -619,6 +674,9 @@ else
|
||||
if ($punches_found < 1)
|
||||
{
|
||||
$RAWtimeTCsec = "0";
|
||||
|
||||
$graph_stats[$m][2]=0;
|
||||
|
||||
$StimeTC[$m] = "0:00";
|
||||
if ($TIME_agenttimedetail == 'HF')
|
||||
{$StimeTC[$m] = "0:00:00";}
|
||||
@@ -648,6 +706,9 @@ else
|
||||
{
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SstatusTXT='';
|
||||
$varname=$Sstatus."_graph";
|
||||
$$varname=$graph_header."<th class='thgraph' scope='col'>$Sstatus</th></tr>";
|
||||
$max_varname="max_".$Sstatus;
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ( ($i < $subs_to_print) and ($status_found < 1) )
|
||||
@@ -657,6 +718,9 @@ else
|
||||
$USERcodePAUSE_MS = sec_convert($PCpause_sec[$i],$TIME_agenttimedetail);
|
||||
if (strlen($USERcodePAUSE_MS)<1) {$USERcodePAUSE_MS='0';}
|
||||
$pfUSERcodePAUSE_MS = sprintf("%10s", $USERcodePAUSE_MS);
|
||||
|
||||
if ($PCpause_sec[$i]>$$max_varname) {$$max_varname=$PCpause_sec[$i];}
|
||||
$graph_stats_sub[$m][$n]=$PCpause_sec[$i];
|
||||
|
||||
$SstatusTXT = sprintf("%10s", $pfUSERcodePAUSE_MS);
|
||||
$SstatusesHTML .= " $SstatusTXT |";
|
||||
@@ -711,6 +775,8 @@ else
|
||||
if ($file_download < 1)
|
||||
{
|
||||
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser\">$Suser[$m]</a> | $Scalls[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $Stime[$m] | $Swait[$m] | $Stalk[$m] | $Sdispo[$m] | $Spause[$m] | $Sdead[$m] | $Scustomer[$m] | |$SstatusesHTML\n";
|
||||
$graph_stats[$m][0]=trim("$Suser[$m] - $Sname[$m]");
|
||||
#CALLS | TIME CLOCK | AGENT TIME | WAIT | TALK | DISPO | PAUSE | DEAD | CUSTOMER | | LOGIN | TRAIN | TOILET | PRECAL | BREAK | | LUNCH | LAGGED
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -754,7 +820,7 @@ else
|
||||
}
|
||||
if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage))
|
||||
if ($file_download < 1)
|
||||
{echo "$Toutput";}
|
||||
{$ASCII_text.="$Toutput";}
|
||||
else
|
||||
{$file_output .= "$fileToutput";}
|
||||
|
||||
@@ -790,7 +856,7 @@ else
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
if ($file_download < 1)
|
||||
{echo "$TOPsorted_output[$i]";}
|
||||
{$ASCII_text.="$TOPsorted_output[$i]";}
|
||||
else
|
||||
{$file_output .= "$TOPsorted_outputFILE[$i]";}
|
||||
$m++;
|
||||
@@ -817,6 +883,7 @@ else
|
||||
$Scalls=0;
|
||||
$Sstatus=$sub_statusesARY[$n];
|
||||
$SUMstatusTXT='';
|
||||
$total_var=$Sstatus."_total";
|
||||
### BEGIN loop through each stat line ###
|
||||
$i=0; $status_found=0;
|
||||
while ($i < $subs_to_print)
|
||||
@@ -832,6 +899,7 @@ else
|
||||
if ($status_found < 1)
|
||||
{
|
||||
$SUMstatusesHTML .= " 0 |";
|
||||
$$total_var="0";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -839,6 +907,7 @@ else
|
||||
|
||||
$USERsumstatPAUSE_MS = sec_convert($Scalls,$TIME_agenttimedetail);
|
||||
$pfUSERsumstatPAUSE_MS = sprintf("%11s", $USERsumstatPAUSE_MS);
|
||||
$$total_var="$pfUSERsumstatPAUSE_MS";
|
||||
|
||||
$SUMstatusTXT = sprintf("%10s", $pfUSERsumstatPAUSE_MS);
|
||||
$SUMstatusesHTML .= "$SUMstatusTXT |";
|
||||
@@ -873,12 +942,89 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
echo "| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n";
|
||||
echo "+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
$ASCII_text.="| TOTALS AGENTS:$hTOT_AGENTS | $hTOTcalls |$hTOTtimeTC |$hTOTALtime |$hTOTwait |$hTOTtalk |$hTOTdispo |$hTOTpause |$hTOTdead |$hTOTcustomer | |$SUMstatusesHTML\n";
|
||||
$ASCII_text.="+-----------------+----------+----------+------------+------------+------------+------------+------------+------------+------------+------------+ +$sub_statusesHEAD\n";
|
||||
if ($AUTOLOGOUTflag > 0)
|
||||
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
||||
echo "\n\n</PRE>";
|
||||
$ASCII_text.="\n\n</PRE>";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$SstatusTXT=$Sstatus;
|
||||
if ($Sstatus=="") {$SstatusTXT="(blank)";}
|
||||
$GRAPH2.="<th class='column_header grey_graph_cell' id='timegraph".(10+$e)."'><a href='#' onClick=\"DrawGraph('$Sstatus', '".(10+$e)."'); return false;\">$SstatusTXT</a></th>";
|
||||
}
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$TIMECLOCK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_timeclock)."' height='16' />".sec_convert($graph_stats[$d][2], 'HF')."</td></tr>";
|
||||
$AGENTTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_agenttime)."' height='16' />".sec_convert($graph_stats[$d][3], 'HF')."</td></tr>";
|
||||
$WAIT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_wait)."' height='16' />".sec_convert($graph_stats[$d][4], 'HF')."</td></tr>";
|
||||
$TALK_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_talk)."' height='16' />".sec_convert($graph_stats[$d][5], 'HF')."</td></tr>";
|
||||
$DISPO_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_dispo)."' height='16' />".sec_convert($graph_stats[$d][6], 'HF')."</td></tr>";
|
||||
$PAUSE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][7]/$max_pause)."' height='16' />".sec_convert($graph_stats[$d][7], 'HF')."</td></tr>";
|
||||
$DEAD_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][8]/$max_dead)."' height='16' />".sec_convert($graph_stats[$d][8], 'HF')."</td></tr>";
|
||||
$CUSTOMER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][9]/$max_customer)."' height='16' />".sec_convert($graph_stats[$d][9], 'HF')."</td></tr>";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$varname=$Sstatus."_graph";
|
||||
$max_varname="max_".$Sstatus;
|
||||
#$max.= "<!-- $max_varname => ".$$max_varname." //-->\n";
|
||||
|
||||
$$varname.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats_sub[$d][$e]/$$max_varname)."' height='16' />".sec_convert($graph_stats_sub[$d][$e], 'HF')."</td></tr>";
|
||||
}
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls)."</th></tr></table>";
|
||||
$TIMECLOCK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtimeTC)."</th></tr></table>";
|
||||
$AGENTTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTALtime)."</th></tr></table>";
|
||||
$WAIT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTwait)."</th></tr></table>";
|
||||
$TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk)."</th></tr></table>";
|
||||
$DISPO_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdispo)."</th></tr></table>";
|
||||
$PAUSE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTpause)."</th></tr></table>";
|
||||
$DEAD_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdead)."</th></tr></table>";
|
||||
$CUSTOMER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcustomer)."</th></tr></table>";
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$total_var=$Sstatus."_total";
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$$graph_var.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($$total_var)."</th></tr></table>";
|
||||
# $JS_text.="var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
$JS_onload.="\tDrawGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var TIMECLOCK_graph=\"$TIMECLOCK_graph\";\n";
|
||||
$JS_text.=" var AGENTTIME_graph=\"$AGENTTIME_graph\";\n";
|
||||
$JS_text.=" var WAIT_graph=\"$WAIT_graph\";\n";
|
||||
$JS_text.=" var TALK_graph=\"$TALK_graph\";\n";
|
||||
$JS_text.=" var DISPO_graph=\"$DISPO_graph\";\n";
|
||||
$JS_text.=" var PAUSE_graph=\"$PAUSE_graph\";\n";
|
||||
$JS_text.=" var DEAD_graph=\"$DEAD_graph\";\n";
|
||||
$JS_text.=" var CUSTOMER_graph=\"$CUSTOMER_graph\";\n";
|
||||
|
||||
for ($e=0; $e<count($sub_statusesARY); $e++) {
|
||||
$Sstatus=$sub_statusesARY[$e];
|
||||
$graph_var=$Sstatus."_graph";
|
||||
$JS_text.=" var ".$Sstatus."_graph=\"".$$graph_var."\";\n";
|
||||
}
|
||||
|
||||
$JS_text.=" for (var i=1; i<=".(9+count($sub_statusesARY))."; i++) {\n";
|
||||
$JS_text.=" var cellID=\"timegraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"timegraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('agent_time_detail_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
$GRAPH3="<tr><td colspan='".(9+$sub_status_count)."' class='graph_span_cell'><span id='agent_time_detail_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
# echo $GRAPH.$GRAPH2.$GRAPH3.$max;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -919,6 +1065,20 @@ if ($file_download > 0)
|
||||
############################################################################
|
||||
##### BEGIN HTML form section
|
||||
############################################################################
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
echo $JS_text;
|
||||
echo $GRAPH.$GRAPH2.$GRAPH3.$max;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ASCII_text;
|
||||
}
|
||||
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||
echo "<TABLE CELLSPACING=3><TR><TD VALIGN=TOP> Dates:<BR>";
|
||||
echo "<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
@@ -989,6 +1149,10 @@ echo "<option value=\"AM\">AM</option>\n";
|
||||
echo "<option value=\"PM\">PM</option>\n";
|
||||
echo "<option value=\"ALL\">ALL</option>\n";
|
||||
echo "</SELECT><BR><BR>\n";
|
||||
echo "Display as:<BR>";
|
||||
echo "<select name='report_display_type'>";
|
||||
if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
echo "</TD><TD VALIGN=TOP> ";
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#
|
||||
# Pulls all timeclock records for an agent
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 90602-2244 - First build
|
||||
@@ -12,6 +12,7 @@
|
||||
# 100802-2347 - Added User Group Allowed Reports option validation
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 111104-1315 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
|
||||
@@ -41,7 +42,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
if (strlen($stage)<2) {$stage='ID';}
|
||||
|
||||
@@ -265,6 +267,7 @@ if ($file_download < 1)
|
||||
|
||||
<script language="JavaScript" src="calendar_db.js"></script>
|
||||
<link rel="stylesheet" href="calendar.css">
|
||||
<link rel="stylesheet" href="horizontalbargraph.css">
|
||||
|
||||
<?php
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
@@ -380,10 +383,19 @@ else
|
||||
##### BEGIN print the output to screen or put into file output variable
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "AGENT TIME-CLOCK DETAIL:\n";
|
||||
echo "+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
echo "| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">USER GROUP</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n";
|
||||
echo "+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
$ASCII_text.="AGENT TIME-CLOCK DETAIL:\n";
|
||||
$ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
$ASCII_text.="| <a href=\"$LINKbase&stage=NAME\">USER NAME</a> | <a href=\"$LINKbase&stage=ID\">ID</a> | <a href=\"$LINKbase&stage=GROUP\">USER GROUP</a> | <a href=\"$LINKbase&stage=TCLOCK\">TIME CLOCK</a> | TIME CLOCK PUNCHES\n";
|
||||
$ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
|
||||
$GRAPH.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"AGENT TIME-CLOCK DETAIL\" class=\"horizontalgraph\">\n";
|
||||
$GRAPH.=" <caption align=\"top\">AGENT TIME-CLOCK DETAIL</caption>\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">USER/USER GROUP</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\" nowrap>TIME CLOCK </th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TIME CLOCK PUNCHES</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -402,6 +414,9 @@ else
|
||||
##### BEGIN loop through each user formatting data for output
|
||||
$AUTOLOGOUTflag=0;
|
||||
$m=0;
|
||||
$max_time=1;
|
||||
$graph_stats=array();
|
||||
$q=0;
|
||||
while ( ($m < $uc) and ($m < 50000) )
|
||||
{
|
||||
$TCdetail='';
|
||||
@@ -439,6 +454,7 @@ else
|
||||
$TOTtimeTC = ($TOTtimeTC + $TCtime[$n]);
|
||||
$StimeTC[$m]= sec_convert($TCtime[$n],'H');
|
||||
$RAWtimeTC = $StimeTC[$m];
|
||||
if ($RAWtimeTCsec>$max_time) {$max_time=$RAWtimeTCsec;}
|
||||
$StimeTC[$m] = sprintf("%10s", $StimeTC[$m]);
|
||||
}
|
||||
$n++;
|
||||
@@ -455,7 +471,7 @@ else
|
||||
$TCuserAUTOLOGOUT = ' ';
|
||||
$stmt="select event_epoch,event_date,login_sec,event,user_group from vicidial_timeclock_log where event_date <= '$query_date_END' and event_date >= '$query_date_BEGIN' and user='$TCuser[$m]' $TCuser_group_SQL order by event_date limit 10000000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$TC_results = mysql_num_rows($rslt);
|
||||
$k=0;
|
||||
while ($TC_results > $k)
|
||||
@@ -509,6 +525,11 @@ else
|
||||
if ($file_download < 1)
|
||||
{
|
||||
$Toutput = "| $Sname[$m] | <a href=\"./user_stats.php?user=$RAWuser&begin_date=$query_date_D&end_date=$end_date_D\">$Suser[$m]</a> | $Sgroup[$m] | $StimeTC[$m]$TCuserAUTOLOGOUT| $TCdetail\n";
|
||||
$graph_stats[$q][0]="$Sname[$m] - $Suser[$m] / $Sgroup[$m]";
|
||||
$graph_stats[$q][1]="$RAWtimeTCsec";
|
||||
$graph_stats[$q][2]="$TCuserAUTOLOGOUT";
|
||||
$graph_stats[$q][3]="$TCdetail";
|
||||
$q++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -540,7 +561,9 @@ else
|
||||
}
|
||||
if (!ereg("NAME|ID|TCLOCK|GROUP",$stage))
|
||||
if ($file_download < 1)
|
||||
{echo "$Toutput";}
|
||||
{
|
||||
$ASCII_text.="$Toutput";
|
||||
}
|
||||
else
|
||||
{$file_output .= "$fileToutput";}
|
||||
|
||||
@@ -550,12 +573,19 @@ else
|
||||
$m++;
|
||||
}
|
||||
##### END loop through each user formatting data for output
|
||||
|
||||
for ($i=0; $i<count($graph_stats); $i++) {
|
||||
if ($i==0) {$class=" first";} else if (($i+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][0]."</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph value$class\" scope=\"col\" nowrap><img src=\"images/bar.png\" alt=\"\" width=\"".round(200*$graph_stats[$i][1]/$max_time)."\" height=\"16\" />".sec_convert($graph_stats[$i][1], 'H').$graph_stats[$i][2]."</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph$class\" scope=\"col\">".$graph_stats[$i][3]."</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
}
|
||||
|
||||
$TOT_AGENTS = sprintf("%4s", $m);
|
||||
$k=$m;
|
||||
|
||||
if ($DB) {echo "Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
||||
if ($DB) {$ASCII_text.="Done analyzing... $TOTwait|$TOTtalk|$TOTdispo|$TOTpause|$TOTALtime|$TOTcalls|$uc|<BR>\n";}
|
||||
|
||||
|
||||
### BEGIN sort through output to display properly ###
|
||||
@@ -577,7 +607,7 @@ else
|
||||
$i = $sort_split[1];
|
||||
$sort_order[$m] = "$i";
|
||||
if ($file_download < 1)
|
||||
{echo "$TOPsorted_output[$i]";}
|
||||
{$ASCII_text.="$TOPsorted_output[$i]";}
|
||||
else
|
||||
{$file_output .= "$TOPsorted_outputFILE[$i]";}
|
||||
$m++;
|
||||
@@ -606,12 +636,22 @@ else
|
||||
|
||||
if ($file_download < 1)
|
||||
{
|
||||
echo "+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
echo "| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n";
|
||||
echo "+----------------------------+ +------------+\n";
|
||||
$ASCII_text.="+-----------------+----------+----------------------+------------+--------------------\n";
|
||||
$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | |$TOTtimeTC |\n";
|
||||
$ASCII_text.="+----------------------------+ +------------+\n";
|
||||
$GRAPH.=" <tr>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTALS</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">AGENTS: $TOT_AGENTS</th>\n";
|
||||
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">$TOTtimeTC</th>\n";
|
||||
$GRAPH.=" </tr>\n";
|
||||
$GRAPH.=" </table>\n";
|
||||
if ($AUTOLOGOUTflag > 0)
|
||||
{echo " * denotes AUTOLOGOUT from timeclock\n";}
|
||||
echo "\n\n</PRE>";
|
||||
{
|
||||
$ASCII_text.=" * denotes AUTOLOGOUT from timeclock\n";
|
||||
$GRAPH.=" * denotes AUTOLOGOUT from timeclock\n";
|
||||
}
|
||||
$ASCII_text.="</PRE>";
|
||||
$GRAPH.="</PRE>";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -648,6 +688,14 @@ if ($file_download > 0)
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
echo $GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $ASCII_text;
|
||||
}
|
||||
|
||||
############################################################################
|
||||
##### BEGIN HTML form section
|
||||
@@ -721,6 +769,11 @@ while ($user_groups_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "</TD><TD VALIGN=TOP>";
|
||||
echo "Display as: <BR>";
|
||||
echo "<select name='report_display_type'>";
|
||||
if ($report_display_type) {echo "<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
echo "<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
echo "</TD><TD VALIGN=TOP>Shift:<BR>";
|
||||
echo "<SELECT SIZE=1 NAME=shift>\n";
|
||||
echo "<option selected value=\"$shift\">$shift</option>\n";
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
# This report is designed to show the breakdown by list_id of the calls and
|
||||
# their statuses for all lists within a campaign for a set time period
|
||||
#
|
||||
# Copyright (C) 2011 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 110815-2138 - First build
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -35,6 +36,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$report_name="Campaign Status List Report";
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
@@ -188,6 +191,7 @@ $HTML_head.=" </STYLE>\n";
|
||||
|
||||
$HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HTML_head.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HTML_head.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>$group_S\n";
|
||||
@@ -249,6 +253,10 @@ $HTML_text.="</SELECT>\n";
|
||||
|
||||
$HTML_text.="</TD><TD VALIGN=TOP> \n";
|
||||
$HTML_text.="</TD><TD VALIGN=TOP>\n";
|
||||
$HTML_text.="Display as:<BR>";
|
||||
$HTML_text.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$HTML_text.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$HTML_text.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR><BR>";
|
||||
$HTML_text.="<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$HTML_text.="</TD><TD VALIGN=TOP> ";
|
||||
|
||||
@@ -263,6 +271,9 @@ $HTML_text.="<PRE>";
|
||||
$i=0;
|
||||
$group_string='|';
|
||||
$group_ct = count($group);
|
||||
$JS_text.="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
while($i < $group_ct)
|
||||
{
|
||||
$stmt="select distinct status, status_name from vicidial_campaign_statuses where campaign_id='$group[$i]' UNION select distinct status, status_name from vicidial_statuses order by status, status_name";
|
||||
@@ -271,7 +282,8 @@ while($i < $group_ct)
|
||||
{
|
||||
$status_ary[$row[0]]=" - $row[1]";
|
||||
}
|
||||
$HTML_text.="<B>CAMPAIGN: $group[$i]</B>\n";
|
||||
$ASCII_text.="<B>CAMPAIGN: $group[$i]</B>\n";
|
||||
$GRAPH.="<B>CAMPAIGN: $group[$i]</B>\n";
|
||||
$CSV_text.="\"CAMPAIGN: $group[$i]\"\n";
|
||||
|
||||
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='$group[$i]'";
|
||||
@@ -297,19 +309,36 @@ while($i < $group_ct)
|
||||
{
|
||||
$list_id=$row[0]; $list_name=$row[1];
|
||||
$dispo_ary="";
|
||||
$HTML_text.="<FONT SIZE=2><B>List ID #$list_id: $list_name</B>\n";
|
||||
$ASCII_text.="<FONT SIZE=2><B>List ID #$list_id: $list_name</B>\n";
|
||||
$GRAPH.="<FONT SIZE=2><B>List ID #$list_id: $list_name</B>\n";
|
||||
$CSV_text.="\"List ID #$list_id: $list_name\"\n";
|
||||
|
||||
|
||||
# $stat_stmt="select vs.status_name, count(*), sum(pause_sec), sum(wait_sec), sum(talk_sec), sum(dispo_sec), sum(dead_sec) from vicidial_agent_log val, vicidial_list vl, vicidial_statuses vs where val.event_time>='$query_date' and val.event_time<='$end_date' and val.campaign_id='$group[$i]' and val.lead_id=vl.list_id and vl.list_id='$list_id' and val.status=vs.status group by vs.status_name order by vs.status_name";
|
||||
#$stat_stmt="select val.status, count(*), sum(pause_sec), sum(wait_sec), sum(talk_sec), sum(dispo_sec), sum(dead_sec) from vicidial_agent_log val, vicidial_list vl where val.event_time>='$query_date' and val.event_time<='$end_date' and val.campaign_id='$group[$i]' and val.lead_id=vl.lead_id and vl.list_id='$list_id' group by val.status order by val.status";
|
||||
$stat_stmt="select vicidial_log.status, vicidial_log.uniqueid, vicidial_log.length_in_sec as duration, (vicidial_agent_log.talk_sec-vicidial_agent_log.dead_sec) as handle_time from vicidial_log LEFT OUTER JOIN vicidial_agent_log on vicidial_log.lead_id=vicidial_agent_log.lead_id and vicidial_log.uniqueid=vicidial_agent_log.uniqueid where vicidial_log.call_date>='$query_date' and vicidial_log.call_date<='$end_date' and vicidial_log.list_id='$list_id' UNION select vicidial_closer_log.status, vicidial_closer_log.uniqueid, vicidial_closer_log.length_in_sec as duration, (vicidial_agent_log.talk_sec-vicidial_agent_log.dead_sec) as handle_time from vicidial_closer_log LEFT OUTER JOIN vicidial_agent_log on vicidial_closer_log.lead_id=vicidial_agent_log.lead_id and vicidial_closer_log.uniqueid=vicidial_agent_log.uniqueid where call_date>='$query_date' and call_date<='$end_date' and list_id='$list_id' order by status";
|
||||
# $HTML_text.=$stat_stmt."\n";
|
||||
# $ASCII_text.=$stat_stmt."\n";
|
||||
$stat_rslt=mysql_query($stat_stmt, $link);
|
||||
if (mysql_num_rows($stat_rslt)>0)
|
||||
{
|
||||
$GRAPH.="<a name='list_".$list_id."_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='33%' class='grey_graph_cell' id='list_".$list_id."_graph1'><a href='#' onClick=\"Draw".$list_id."Graph('CALLS', '1'); return false;\">CALLS</a></th><th width='33%' class='grey_graph_cell' id='list_".$list_id."_graph2'><a href='#' onClick=\"Draw".$list_id."Graph('DURATION', '2'); return false;\">DURATION</a></th><th width='34%' class='grey_graph_cell' id='list_".$list_id."_graph3'><a href='#' onClick=\"Draw".$list_id."Graph('HANDLETIME', '3'); return false;\">HANDLE TIME</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='3' class='graph_span_cell'><span id='stats_".$list_id."_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>List ID #$list_id: $list_name</caption><tr><th class='thgraph' scope='col'>DISPOSITION</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$DURATION_graph=$graph_header."<th class='thgraph' scope='col'>DURATION</th></tr>";
|
||||
$HANDLETIME_graph=$graph_header."<th class='thgraph' scope='col'>HANDLE TIME</th></tr>";
|
||||
|
||||
$total_calls=0; $total_handle_time=0; $total_duration=0;
|
||||
$HTML_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$HTML_text.="| DISPOSITION | CALLS | DURATION | HANDLE TIME |\n";
|
||||
$HTML_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
|
||||
$graph_stats=array();
|
||||
$max_calls=1;
|
||||
$max_duration=1;
|
||||
$max_handletime=1;
|
||||
|
||||
$ASCII_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$ASCII_text.="| DISPOSITION | CALLS | DURATION | HANDLE TIME |\n";
|
||||
$ASCII_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$CSV_text.="\"DISPOSITION\",\"CALLS\",\"DURATION\",\"HANDLE TIME\"\n";
|
||||
while ($stat_row=mysql_fetch_row($stat_rslt))
|
||||
{
|
||||
@@ -326,33 +355,86 @@ while($i < $group_ct)
|
||||
$total_handle_time+=$stat_row[3];
|
||||
}
|
||||
|
||||
$d=0;
|
||||
while (list($key, $val)=each($dispo_ary))
|
||||
{
|
||||
$HTML_text.="| ".sprintf("%-35s", $key.$status_ary[$key]);
|
||||
$HTML_text.=" | ".sprintf("%5s", $val[0]);
|
||||
$HTML_text.=" | ".sprintf("%9s", sec_convert($val[1], 'H'));
|
||||
$HTML_text.=" | ".sprintf("%11s", sec_convert($val[2], 'H'))." |\n";
|
||||
$ASCII_text.="| ".sprintf("%-35s", $key.$status_ary[$key]);
|
||||
$ASCII_text.=" | ".sprintf("%5s", $val[0]);
|
||||
$ASCII_text.=" | ".sprintf("%9s", sec_convert($val[1], 'H'));
|
||||
$ASCII_text.=" | ".sprintf("%11s", sec_convert($val[2], 'H'))." |\n";
|
||||
$CSV_text.="\"".$key.$status_ary[$key]."\",\"$val[0]\",\"".sec_convert($val[1], 'H')."\",\"".sec_convert($val[2], 'H')."\"\n";
|
||||
|
||||
if ($val[0]>$max_calls) {$max_calls=$val[0];}
|
||||
if ($val[1]>$max_duration) {$max_duration=$val[1];}
|
||||
if ($val[2]>$max_handletime) {$max_handletime=$val[2];}
|
||||
$graph_stats[$d][0]=$key.$status_ary[$key];
|
||||
$graph_stats[$d][1]=$val[0];
|
||||
$graph_stats[$d][2]=$val[1];
|
||||
$graph_stats[$d][3]=$val[2];
|
||||
$d++;
|
||||
}
|
||||
$HTML_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$HTML_text.="| TOTALS:";
|
||||
$HTML_text.=" | ".sprintf("%5s", $total_calls);
|
||||
$HTML_text.=" | ".sprintf("%9s", sec_convert($total_duration, 'H'));
|
||||
$HTML_text.=" | ".sprintf("%11s", sec_convert($total_handle_time, 'H'))." |\n";
|
||||
$HTML_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$ASCII_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$ASCII_text.="| TOTALS:";
|
||||
$ASCII_text.=" | ".sprintf("%5s", $total_calls);
|
||||
$ASCII_text.=" | ".sprintf("%9s", sec_convert($total_duration, 'H'));
|
||||
$ASCII_text.=" | ".sprintf("%11s", sec_convert($total_handle_time, 'H'))." |\n";
|
||||
$ASCII_text.="+-------------------------------------+-------+-----------+-------------+\n";
|
||||
$CSV_text.="\"TOTALS:\",\"$total_calls\",\"".sec_convert($total_duration, 'H')."\",\"".sec_convert($total_handle_time, 'H')."\"\n\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$DURATION_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_duration)."' height='16' />".sec_convert($graph_stats[$d][2], 'H')."</td></tr>";
|
||||
$HANDLETIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_handletime)."' height='16' />".sec_convert($graph_stats[$d][3], 'H')."</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($total_calls)."</th></tr></table>";
|
||||
$DURATION_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".sec_convert($total_duration, 'H')."</th></tr></table>";
|
||||
$HANDLETIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".sec_convert($total_handle_time, 'H')."</th></tr></table>";
|
||||
$JS_onload.="\tDraw".$list_id."Graph('CALLS', '1');\n";
|
||||
$JS_text.="function Draw".$list_id."Graph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var DURATION_graph=\"$DURATION_graph\";\n";
|
||||
$JS_text.=" var HANDLETIME_graph=\"$HANDLETIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=3; i++) {\n";
|
||||
$JS_text.=" var cellID=\"list_".$list_id."_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"list_".$list_id."_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('stats_".$list_id."_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
#$HTML_text.=$GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$HTML_text.="<B>***NO CALLS FOUND FROM $query_date TO $end_date***</B>\n";
|
||||
$ASCII_text.="<B>***NO CALLS FOUND FROM $query_date TO $end_date***</B>\n";
|
||||
$CSV_text.="\"***NO CALLS FOUND FROM $query_date TO $end_date***\"\n\n";
|
||||
$GRAPH.="<B>***NO CALLS FOUND FROM $query_date TO $end_date***</B>\n";
|
||||
}
|
||||
$HTML_text.="</FONT>\n";
|
||||
$ASCII_text.="</FONT>\n";
|
||||
$GRAPH.="</FONT>\n";
|
||||
|
||||
}
|
||||
$i++;
|
||||
$HTML_text.="\n\n";
|
||||
$ASCII_text.="\n\n";
|
||||
$GRAPH.="\n\n";
|
||||
$CSV_text.="\n\n";
|
||||
}
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$HTML_text.=$JS_text.$GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$HTML_text.=$ASCII_text;
|
||||
}
|
||||
|
||||
$HTML_text.="</PRE></BODY></HTML>";
|
||||
|
||||
if ($file_download>0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_dialer_inventory_report.php
|
||||
#
|
||||
# Copyright (C) 2011 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
|
||||
# Matt Florell <vicidial@gmail.com>
|
||||
#
|
||||
# NOTES:
|
||||
@@ -13,6 +13,7 @@
|
||||
# 111013-0054 - First build
|
||||
# 111106-1327 - Reformatting, other minor changes
|
||||
# 111230-1145 - Debugging additions and more minor changes
|
||||
# 120221-2237 - Added totals, list options, other small changes
|
||||
#
|
||||
|
||||
error_reporting(0);
|
||||
@@ -154,7 +155,7 @@ while($i < $group_ct)
|
||||
$i++;
|
||||
}
|
||||
|
||||
$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists) $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
$stmt="SELECT campaign_id from vicidial_campaigns where campaign_id in (SELECT distinct campaign_id from vicidial_lists where inventory_report='Y') $LOGallowed_campaignsSQL order by campaign_id;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) { echo "$stmt\n";}
|
||||
$campaigns_to_print = mysql_num_rows($rslt);
|
||||
@@ -191,7 +192,7 @@ else
|
||||
$group_SQL = "and campaign_id IN($group_SQL)";
|
||||
}
|
||||
|
||||
$stmt="SELECT list_id, list_name from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id, list_name;";
|
||||
$stmt="SELECT list_id, list_name from vicidial_lists where inventory_report='Y' $LOGallowed_campaignsSQL order by list_id, list_name;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_header.="$stmt\n";}
|
||||
$lists_to_print = mysql_num_rows($rslt);
|
||||
@@ -295,6 +296,15 @@ function GetListCount($list_id, $inventory_ptnstr)
|
||||
if ($SUBMIT)
|
||||
{
|
||||
|
||||
$total_list_start_inv=0;
|
||||
$total_dialable_count=0;
|
||||
$total_dialable_count_nofilter=0;
|
||||
$total_dialable_count_oneoff=0;
|
||||
$total_dialable_count_inactive=0;
|
||||
$total_total_calls=0;
|
||||
$total_average_call_count=0;
|
||||
$total_penetration=0;
|
||||
|
||||
if ($snapshot_time && $report_source=="SNAPSHOT")
|
||||
{
|
||||
$rpt_header="SNAPSHOT from $snapshot_time\n";
|
||||
@@ -313,7 +323,7 @@ if ($SUBMIT)
|
||||
}
|
||||
$shift_SQL_str=substr($shift_SQL_str, 0, -1);
|
||||
|
||||
$shift_stmt="SELECT shift_id from vicidial_shifts where report_option='Y' order by shift_start_time asc;";
|
||||
$shift_stmt="SELECT shift_id from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;";
|
||||
if ($DBX > 0) {$HTML_header.= "|$shift_stmt|\n";}
|
||||
$shift_rslt=mysql_query($shift_stmt, $link);
|
||||
$c=0;
|
||||
@@ -324,19 +334,30 @@ if ($SUBMIT)
|
||||
$rpt_header_SHIFTS_lower.=" |";
|
||||
$rpt_header_BORDER.="----------+";
|
||||
$shift_ary[$c]=$shift_row["shift_id"];
|
||||
$total_varname="total_".$shift_row["shift_id"];
|
||||
$$total_varname=0;
|
||||
if ($DB > 0) {echo "<BR>-$c-$shift_ary[$c]-$shift_row[shift_id]-\n";}
|
||||
$c++;
|
||||
}
|
||||
|
||||
if ($report_type=="CAMPAIGNS") {$time_clause=$group_SQL;}
|
||||
if ($report_type=="LIST") {$time_clause="and list_id='$selected_list'";}
|
||||
$stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
|
||||
$stmt="SELECT snapshot_id,snapshot_time,list_id,list_name,list_description,campaign_id,list_lastcalldate,list_start_inv,dialable_count,dialable_count_nofilter,dialable_count_oneoff,dialable_count_inactive,average_call_count,penetration,shift_data,time_setting from dialable_inventory_snapshots where snapshot_time='$snapshot_time' and time_setting='$time_setting' $time_clause order by campaign_id, list_id;";
|
||||
if ($DBX > 0) {$HTML_header.= "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
while ($row=mysql_fetch_array($rslt))
|
||||
{
|
||||
$rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $row["list_name"])." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |";
|
||||
$CSV_body.="\"$row[list_id]\",\"$row[list_name]\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\"";
|
||||
$row["list_description"]=substr($row["list_description"], 0, 30);
|
||||
if (strlen($row["list_description"])>0) {$list_info=$row["list_description"];} else {$list_info=$row["list_name"];}
|
||||
$rpt_body.="| ".sprintf("%9s", $row["list_id"])." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $row["campaign_id"])." | ".$row["list_lastcalldate"]." | ".sprintf("%9s", $row["list_start_inv"])." | ".sprintf("%8s", $row["dialable_count"])." | ".sprintf("%8s", $row["dialable_count_nofilter"])." | ".sprintf("%8s", $row["dialable_count_oneoff"])." | ".sprintf("%8s", $row["dialable_count_inactive"])." | ".sprintf("%8s", $row["average_call_count"])." | ".sprintf("%6s", $row["penetration"])."% |";
|
||||
$CSV_body.="\"$row[list_id]\",\"$list_info\",\"$row[last_calldate]\",\"$row[campaign_id]\",\"$row[list_start_inv]\",\"$row[dialable_count]\",\"$row[dialable_count_nofilter]\",\"$row[dialable_count_oneoff]\",\"$row[dialable_count_inactive]\",\"$row[average_call_count]\",\"$row[penetration] %\"";
|
||||
|
||||
$total_list_start_inv+=$row["list_start_inv"];
|
||||
$total_dialable_count+=$row["dialable_count"];
|
||||
$total_dialable_count_nofilter+=$row["dialable_count_nofilter"];
|
||||
$total_dialable_count_oneoff+=$row["dialable_count_oneoff"];
|
||||
$total_dialable_count_inactive+=$row["dialable_count_inactive"];
|
||||
$total_total_calls+=($row["average_call_count"]*$row["list_start_inv"]);
|
||||
|
||||
$shift_data_a=explode("|", $row["shift_data"]);
|
||||
$b=0;
|
||||
@@ -351,6 +372,8 @@ if ($SUBMIT)
|
||||
{
|
||||
$rpt_body.=" ".sprintf("%8s", $shift_data_b[1])." |";
|
||||
$CSV_body.=",\"$shift_data_b[1]\"";
|
||||
$total_varname="total_".$shift_data_b[0];
|
||||
$$total_varname+=$shift_data_b[1];
|
||||
$line_match++;
|
||||
}
|
||||
if ($DB > 0) {echo "<BR>-$a-$b-$shift_ary[$b]-$shift_data_b[0]($shift_data_b[1])-$line_match-\n";}
|
||||
@@ -374,7 +397,7 @@ if ($SUBMIT)
|
||||
$gmt_row=mysql_fetch_row($gmt_rslt);
|
||||
$local_offset=$gmt_row[0];
|
||||
|
||||
if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where ".substr($group_SQL,4).")";}
|
||||
if ($report_type=="CAMPAIGNS") {$time_clause="where list_id in (SELECT list_id from vicidial_lists where inventory_report='Y' ".substr($group_SQL,4).")";}
|
||||
if ($report_type=="LIST") {$time_clause="where list_id='$selected_list'";}
|
||||
$gmt_stmt="SELECT distinct gmt_offset_now, gmt_offset_now-($local_offset) from vicidial_list $time_clause ;";
|
||||
if ($DB) {$HTML_header.=$gmt_stmt."<BR>\n";}
|
||||
@@ -391,7 +414,7 @@ if ($SUBMIT)
|
||||
}
|
||||
|
||||
# Get shift information
|
||||
$shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by shift_start_time asc;";
|
||||
$shift_stmt="SELECT shift_id, shift_name, str_to_date(shift_start_time, '%H%i') as shift_start_time, addtime(str_to_date(shift_start_time, '%H%i'), shift_length) as shift_end_time, if(addtime(str_to_date(shift_start_time, '%H%i'), shift_length)>'23:59:59', '1', '0') as day_offset, shift_weekdays from vicidial_shifts where report_option='Y' order by report_rank, shift_start_time asc;";
|
||||
if ($DB) {$HTML_header.="$shift_stmt;\n";}
|
||||
$shift_rslt=mysql_query($shift_stmt, $link);
|
||||
while($shift_row=mysql_fetch_array($shift_rslt))
|
||||
@@ -448,15 +471,17 @@ if ($SUBMIT)
|
||||
if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";}
|
||||
$filter_SQL = preg_replace("/\\\/",'',$filter_SQL);
|
||||
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' $LOGallowed_campaignsSQL order by list_id asc;";
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate from vicidial_lists where campaign_id='$group[$i]' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;";
|
||||
if ($DB) {$HTML_header.="$lists_stmt;\n";}
|
||||
$lists_rslt=mysql_query($lists_stmt, $link);
|
||||
while ($lists_row=mysql_fetch_array($lists_rslt))
|
||||
{
|
||||
$list_id=$lists_row["list_id"];
|
||||
$list_name=$lists_row["list_name"];
|
||||
$lists_row["list_description"]=substr($lists_row["list_description"], 0, 30);
|
||||
$list_description=$lists_row["list_description"];
|
||||
$last_calldate=$lists_row["list_lastcalldate"];
|
||||
if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;}
|
||||
|
||||
$list_start_inv=0;
|
||||
GetListCount($list_id, $inventory_ptnstr);
|
||||
@@ -479,8 +504,15 @@ if ($SUBMIT)
|
||||
|
||||
if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";}
|
||||
|
||||
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_name)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
|
||||
$CSV_body.="\"$list_id\",\"$list_name\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
|
||||
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $group[$i])." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
|
||||
$CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$group[$i]\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
|
||||
|
||||
$total_list_start_inv+=$list_start_inv;
|
||||
$total_dialable_count+=$Xdialable_count;
|
||||
$total_dialable_count_nofilter+=$Xdialable_count_nofilter;
|
||||
$total_dialable_count_oneoff+=$oneoff_count;
|
||||
$total_dialable_count_inactive+=$Xdialable_inactive_count;
|
||||
$total_total_calls+=$total_calls;
|
||||
|
||||
# $stat_stmt="SELECT call_date, dayofweek(call_date) from vicidial_log where lead_id in (SELECT lead_id from vicidial_list where list_id='$list_id' and called_count<='$called_count_limit' and status in ($inventory_statuses) $filter_SQL";
|
||||
# SELECT lead_id, count(*) as count from vicidial_log where extract(HOUR_MINUTE FROM call_date)>='900' and extract(HOUR_MINUTE FROM call_date)<='1700' and dayofweek(call_date) in (2,3,4,5,6) and lead_id in (SELECT lead_id from vicidial_list where list_id=41073) group by lead_id order by lead_id;
|
||||
@@ -548,6 +580,8 @@ if ($SUBMIT)
|
||||
}
|
||||
$shift_count=$Xdialable_count-$total_shift_count;
|
||||
$rpt_body.=" ".sprintf("%8s", $shift_count)." |";
|
||||
$total_varname="total_".$key;
|
||||
$$total_varname+=$shift_count;
|
||||
$CSV_body.=",\"$shift_count\"";
|
||||
}
|
||||
$rpt_body.="\n";
|
||||
@@ -558,7 +592,7 @@ if ($SUBMIT)
|
||||
}
|
||||
else if ($selected_list && $report_type=="LIST")
|
||||
{
|
||||
$campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;";
|
||||
$campaign_stmt="SELECT call_count_limit, call_count_target, dial_statuses, local_call_time, drop_lockout_time, v.campaign_id from vicidial_campaigns v, vicidial_lists vl where inventory_report='Y' and vl.list_id='$selected_list' and vl.campaign_id=v.campaign_id;";
|
||||
if ($DB) {$HTML_header.="$campaign_stmt;\n";}
|
||||
$campaign_rslt=mysql_query($campaign_stmt, $link);
|
||||
$campaign_row=mysql_fetch_row($campaign_rslt);
|
||||
@@ -569,7 +603,7 @@ if ($SUBMIT)
|
||||
$drop_lockout_time=$campaign_row[4];
|
||||
$campaign_id=$campaign_row[5];
|
||||
|
||||
$stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' $LOGallowed_campaignsSQL);";
|
||||
$stmt="SELECT distinct status from vicidial_statuses where completed='N' UNION SELECT distinct status from vicidial_campaign_statuses where completed='N' and campaign_id=(SELECT campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL);";
|
||||
if ($DB) {$HTML_header.="$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$inactive_dial_statuses=" ";
|
||||
@@ -598,20 +632,25 @@ if ($SUBMIT)
|
||||
if (strlen($filter_row[0])>0) {$filter_SQL=" and $filter_row[0]";} else {$filter_SQL="";}
|
||||
$filter_SQL = preg_replace("/\\\/",'',$filter_SQL);
|
||||
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' $LOGallowed_campaignsSQL order by list_id asc;";
|
||||
$lists_stmt="SELECT list_id, list_name, list_description, if(list_lastcalldate is null, '*** Not called *** ', list_lastcalldate) as list_lastcalldate, campaign_id from vicidial_lists where list_id='$selected_list' and inventory_report='Y' $LOGallowed_campaignsSQL order by list_id asc;";
|
||||
if ($DB) {$HTML_header.="$lists_stmt;\n";}
|
||||
$lists_rslt=mysql_query($lists_stmt, $link);
|
||||
while ($lists_row=mysql_fetch_array($lists_rslt))
|
||||
{
|
||||
$list_id=$lists_row["list_id"];
|
||||
$list_name=$lists_row["list_name"];
|
||||
$lists_row["list_description"]=substr($lists_row["list_description"], 0, 30);
|
||||
$list_description=$lists_row["list_description"];
|
||||
$last_calldate=$lists_row["list_lastcalldate"];
|
||||
$campaign_id=$lists_row["campaign_id"];
|
||||
if (strlen($list_description)>0) {$list_info=$list_description;} else {$list_info=$list_name;}
|
||||
$list_call_inv=0;
|
||||
GetListCount($list_id, $inventory_ptnstr);
|
||||
if ($list_start_inv>0) {$average_calls=sprintf("%.1f", $total_calls/$list_start_inv);} else {$average_calls="0.0";}
|
||||
|
||||
### For TOTAL counts, needs to be here instead of with other "total" variables further down in this particular report
|
||||
$total_total_calls+=$total_calls;
|
||||
|
||||
$Xdialable_count_nofilter = dialable_leads($DB,$link,$local_call_time,"$dial_statuses",$selected_list,$drop_lockout_time,$call_count_limit,$single_status,"");
|
||||
if (strlen($inactive_dial_statuses)>1)
|
||||
{
|
||||
@@ -632,8 +671,14 @@ if ($SUBMIT)
|
||||
|
||||
if ($list_start_inv>0) {$penetration=sprintf("%.2f", (100*($list_start_inv-$Xdialable_count)/$list_start_inv));} else {$penetration="0.00";}
|
||||
|
||||
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_name)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
|
||||
$CSV_body.="\"$list_id\",\"$list_name\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
|
||||
$rpt_body.="| ".sprintf("%9s", $list_id)." | ".sprintf("%-30s", $list_info)." | ".sprintf("%8s", $campaign_id)." | ".$last_calldate." | ".sprintf("%9s", $list_start_inv)." | ".sprintf("%8s", $Xdialable_count)." | ".sprintf("%8s", $Xdialable_count_nofilter)." | ".sprintf("%8s", $oneoff_count)." | ".sprintf("%8s", $Xdialable_inactive_count)." | ".sprintf("%8s", $average_calls)." | ".sprintf("%6s", $penetration)."% |";
|
||||
$CSV_body.="\"$list_id\",\"$list_info\",\"$last_calldate\",\"$campaign_id\",\"$list_start_inv\",\"$Xdialable_count\",\"$Xdialable_count_nofilter\",\"$oneoff_count\",\"$Xdialable_inactive_count\",\"$average_calls\",\"$penetration %\"";
|
||||
|
||||
$total_list_start_inv+=$list_start_inv;
|
||||
$total_dialable_count+=$Xdialable_count;
|
||||
$total_dialable_count_nofilter+=$Xdialable_count_nofilter;
|
||||
$total_dialable_count_oneoff+=$oneoff_count;
|
||||
$total_dialable_count_inactive+=$Xdialable_inactive_count;
|
||||
|
||||
$shift_ary2=$shift_ary;
|
||||
while (list($key, $val)=each($shift_ary2))
|
||||
@@ -707,6 +752,8 @@ if ($SUBMIT)
|
||||
}
|
||||
$shift_count=$Xdialable_count-$total_shift_count;
|
||||
$rpt_body.=" ".sprintf("%8s", $shift_count)." |";
|
||||
$total_varname="total_".$key;
|
||||
$$total_varname+=$shift_count;
|
||||
$CSV_body.=",\"$shift_count\"";
|
||||
}
|
||||
$rpt_body.="\n";
|
||||
@@ -725,7 +772,26 @@ if ($SUBMIT)
|
||||
$CSV_header.="\"Date: ".date("m/d/Y")."\",\"\",\"Time: ".date("H:i a")."\"\n\n";
|
||||
$CSV_header.="\"Call list\",\"List description\",\"Campaign\",\"Last call date\",\"Start Inv\",\"Call Inv Total\",\"Call Inv - No filter\",\"Call Inv - One-offs\",\"Call Inv - Inactive dialable statuses\",\"Dial Avg\",\"Pen. %\",".substr($CSV_header_SHIFTS,0,-1)."\n";
|
||||
|
||||
$rpt_footer="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n";
|
||||
$rpt_footer ="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n";
|
||||
|
||||
#### PRINT TOTALS ####
|
||||
if ($total_list_start_inv>0) {$total_average_call_count=sprintf("%.1f", $total_total_calls/$total_list_start_inv);} else {$average_calls="0.0";}
|
||||
if ($total_list_start_inv>0) {$total_penetration=sprintf("%.2f", (100*($total_list_start_inv-$total_dialable_count)/$total_list_start_inv));} else {$total_penetration="0.00";}
|
||||
$rpt_footer.="|".sprintf("%76s", "TOTALS")." | ".sprintf("%9s", $total_list_start_inv)." | ".sprintf("%8s", $total_dialable_count)." | ".sprintf("%8s", $total_dialable_count_nofilter)." | ".sprintf("%8s", $total_dialable_count_oneoff)." | ".sprintf("%8s", $total_dialable_count_inactive)." | ".sprintf("%8s", $total_average_call_count)." | ".sprintf("%6s", $total_penetration)."% |";
|
||||
$CSV_body.="\"\",\"\",\"\",\"TOTALS\",\"$total_list_start_inv\",\"$total_dialable_count\",\"$total_dialable_count_nofilter\",\"$total_dialable_count_oneoff\",\"$total_dialable_count_inactive\",\"$total_average_call_count\",\"$total_penetration\"";
|
||||
$b=0;
|
||||
while ($b < count($shift_ary))
|
||||
{
|
||||
$total_varname="total_".$shift_ary[$b];
|
||||
$rpt_footer.=" ".sprintf("%8s", $$total_varname)." |";
|
||||
$CSV_body.=",\"".$$total_varname."\"";
|
||||
$b++;
|
||||
}
|
||||
$CSV_body.="\n";
|
||||
$rpt_footer.="\n";
|
||||
######################
|
||||
|
||||
$rpt_footer.="+-----------+--------------------------------+----------+---------------------+-----------+----------+----------+----------+----------+----------+---------+$rpt_header_BORDER\n";
|
||||
}
|
||||
$HTML_header.="</PRE>\n";
|
||||
###############################
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#
|
||||
# 111119-1234 - First build
|
||||
# 120118-2116 - Changed headers on CSV download
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -32,6 +33,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -171,6 +174,7 @@ if (!preg_match("/\|$group\|/i",$groups_string))
|
||||
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>$report_name</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
@@ -217,6 +221,10 @@ while ($groups_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.=" ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select> ";
|
||||
$MAIN.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$MAIN.="<option selected value=\"$shift\">$shift</option>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
@@ -371,7 +379,9 @@ else
|
||||
$q++;
|
||||
|
||||
}
|
||||
|
||||
$prev_week=$daySTART[0];
|
||||
$prev_month=$daySTART[0];
|
||||
$prev_qtr=$daySTART[0];
|
||||
##########################################################################
|
||||
######### CALCULATE ALL OF THE 15-MINUTE PERIODS NEEDED FOR ALL DAYS ####
|
||||
|
||||
@@ -459,7 +469,7 @@ else
|
||||
### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$records_to_grab = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
if($hourly_breakdown) {$epoch_interval=3600;} else {$epoch_interval=86400;}
|
||||
@@ -483,7 +493,7 @@ else
|
||||
$tr[$i] = $row[4];
|
||||
$at[$i] = $row[5]; # Actual time
|
||||
|
||||
# $MAIN.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
|
||||
# $ASCII_text.= "$qs[$i] | $dt[$i] - $row[1] | $ut[$i] | $ls[$i] | $st[$i] | $tr[$i] | $at[$i]\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
@@ -616,15 +626,80 @@ else
|
||||
|
||||
###################################################
|
||||
### TOTALS SUMMARY SECTION ###
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| | TOTAL | TOTAL | TOTAL | TOTAL | AVG | AVG | AVG | TOTAL | TOTAL | TOTAL |\n";
|
||||
$MAIN.="| SHIFT | CALLS | CALLS | CALLS | ABANDON | ABANDON | ANSWER | TALK | TALK | WRAP | CALL |\n";
|
||||
$MAIN.="| DATE-TIME RANGE | OFFERED | ANSWERED | ABANDONED | PERCENT | TIME | SPEED | TIME | TIME | TIME | TIME |\n";
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| | TOTAL | TOTAL | TOTAL | TOTAL | AVG | AVG | AVG | TOTAL | TOTAL | TOTAL |\n";
|
||||
$ASCII_text.="| SHIFT | CALLS | CALLS | CALLS | ABANDON | ABANDON | ANSWER | TALK | TALK | WRAP | CALL |\n";
|
||||
$ASCII_text.="| DATE-TIME RANGE | OFFERED | ANSWERED | ABANDONED | PERCENT | TIME | SPEED | TIME | TIME | TIME | TIME |\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$CSV_text.="\"\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"TOTAL\",\"AVG\",\"AVG\",\"AVG\",\"TOTAL\",\"TOTAL\",\"TOTAL\"\n";
|
||||
$CSV_text.="\"\",\"CALLS\",\"CALLS\",\"CALLS\",\"ABANDON\",\"ABANDON\",\"ANSWER\",\"TALK\",\"TALK\",\"WRAP\",\"CALL\"\n";
|
||||
$CSV_text.="\"SHIFT DATE-TIME RANGE\",\"OFFERED\",\"ANSWERED\",\"ABANDONED\",\"PERCENT\",\"TIME\",\"SPEED\",\"TIME\",\"TIME\",\"TIME\",\"TIME\"\n";
|
||||
|
||||
##########################
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
$graph_stats=array();
|
||||
$mtd_graph_stats=array();
|
||||
$wtd_graph_stats=array();
|
||||
$qtd_graph_stats=array();
|
||||
$da=0; $wa=0; $ma=0; $qa=0;
|
||||
$max_offered=1;
|
||||
$max_answered=1;
|
||||
$max_abandoned=1;
|
||||
$max_abandonpct=1;
|
||||
$max_avgabandontime=1;
|
||||
$max_avganswerspeed=1;
|
||||
$max_avgtalktime=1;
|
||||
$max_totaltalktime=1;
|
||||
$max_totalwraptime=1;
|
||||
$max_totalcalltime=1;
|
||||
$max_wtd_offered=1;
|
||||
$max_wtd_answered=1;
|
||||
$max_wtd_abandoned=1;
|
||||
$max_wtd_abandonpct=1;
|
||||
$max_wtd_avgabandontime=1;
|
||||
$max_wtd_avganswerspeed=1;
|
||||
$max_wtd_avgtalktime=1;
|
||||
$max_wtd_totaltalktime=1;
|
||||
$max_wtd_totalwraptime=1;
|
||||
$max_wtd_totalcalltime=1;
|
||||
$max_mtd_offered=1;
|
||||
$max_mtd_answered=1;
|
||||
$max_mtd_abandoned=1;
|
||||
$max_mtd_abandonpct=1;
|
||||
$max_mtd_avgabandontime=1;
|
||||
$max_mtd_avganswerspeed=1;
|
||||
$max_mtd_avgtalktime=1;
|
||||
$max_mtd_totaltalktime=1;
|
||||
$max_mtd_totalwraptime=1;
|
||||
$max_mtd_totalcalltime=1;
|
||||
$max_qtd_offered=1;
|
||||
$max_qtd_answered=1;
|
||||
$max_qtd_abandoned=1;
|
||||
$max_qtd_abandonpct=1;
|
||||
$max_qtd_avgabandontime=1;
|
||||
$max_qtd_avganswerspeed=1;
|
||||
$max_qtd_avgtalktime=1;
|
||||
$max_qtd_totaltalktime=1;
|
||||
$max_qtd_totalwraptime=1;
|
||||
$max_qtd_totalcalltime=1;
|
||||
$GRAPH="<a name='multigroup_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'><tr><th width='10%' class='grey_graph_cell' id='multigroup_graph1'><a href='#' onClick=\"DrawGraph('OFFERED', '1'); return false;\">TOTAL CALLS OFFERED</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph2'><a href='#' onClick=\"DrawGraph('ANSWERED', '2'); return false;\">TOTAL CALLS ANSWERED</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph3'><a href='#' onClick=\"DrawGraph('ABANDONED', '3'); return false;\">TOTAL CALLS ABANDONED</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph4'><a href='#' onClick=\"DrawGraph('ABANDONPCT', '4'); return false;\">TOTAL ABANDON PERCENT</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph5'><a href='#' onClick=\"DrawGraph('AVGABANDONTIME', '5'); return false;\">AVG ABANDON TIME</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph6'><a href='#' onClick=\"DrawGraph('AVGANSWERSPEED', '6'); return false;\">AVG ANSWER SPEED</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph7'><a href='#' onClick=\"DrawGraph('AVGTALKTIME', '7'); return false;\">AVG TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph8'><a href='#' onClick=\"DrawGraph('TOTALTALKTIME', '8'); return false;\">TOTAL TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph9'><a href='#' onClick=\"DrawGraph('TOTALWRAPTIME', '9'); return false;\">TOTAL WRAP TIME</a></th><th width='10%' class='grey_graph_cell' id='multigroup_graph10'><a href='#' onClick=\"DrawGraph('TOTALCALLTIME', '10'); return false;\">TOTAL CALL TIME</a></th></tr><tr><td colspan='10' class='graph_span_cell' align='center'><span id='stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$MTD_GRAPH="<BR><BR><a name='MTD_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'><tr><th width='10%' class='grey_graph_cell' id='MTD_graph1'><a href='#' onClick=\"DrawMTDGraph('OFFERED', '1'); return false;\">TOTAL CALLS OFFERED</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph2'><a href='#' onClick=\"DrawMTDGraph('ANSWERED', '2'); return false;\">TOTAL CALLS ANSWERED</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph3'><a href='#' onClick=\"DrawMTDGraph('ABANDONED', '3'); return false;\">TOTAL CALLS ABANDONED</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph4'><a href='#' onClick=\"DrawMTDGraph('ABANDONPCT', '4'); return false;\">TOTAL ABANDON PERCENT</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph5'><a href='#' onClick=\"DrawMTDGraph('AVGABANDONTIME', '5'); return false;\">AVG ABANDON TIME</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph6'><a href='#' onClick=\"DrawMTDGraph('AVGANSWERSPEED', '6'); return false;\">AVG ANSWER SPEED</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph7'><a href='#' onClick=\"DrawMTDGraph('AVGTALKTIME', '7'); return false;\">AVG TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph8'><a href='#' onClick=\"DrawMTDGraph('TOTALTALKTIME', '8'); return false;\">TOTAL TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph9'><a href='#' onClick=\"DrawMTDGraph('TOTALWRAPTIME', '9'); return false;\">TOTAL WRAP TIME</a></th><th width='10%' class='grey_graph_cell' id='MTD_graph10'><a href='#' onClick=\"DrawMTDGraph('TOTALCALLTIME', '10'); return false;\">TOTAL CALL TIME</a></th></tr><tr><td colspan='10' class='graph_span_cell' align='center'><span id='MTD_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$WTD_GRAPH="<BR><BR><a name='WTD_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'><tr><th width='10%' class='grey_graph_cell' id='WTD_graph1'><a href='#' onClick=\"DrawWTDGraph('OFFERED', '1'); return false;\">TOTAL CALLS OFFERED</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph2'><a href='#' onClick=\"DrawWTDGraph('ANSWERED', '2'); return false;\">TOTAL CALLS ANSWERED</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph3'><a href='#' onClick=\"DrawWTDGraph('ABANDONED', '3'); return false;\">TOTAL CALLS ABANDONED</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph4'><a href='#' onClick=\"DrawWTDGraph('ABANDONPCT', '4'); return false;\">TOTAL ABANDON PERCENT</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph5'><a href='#' onClick=\"DrawWTDGraph('AVGABANDONTIME', '5'); return false;\">AVG ABANDON TIME</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph6'><a href='#' onClick=\"DrawWTDGraph('AVGANSWERSPEED', '6'); return false;\">AVG ANSWER SPEED</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph7'><a href='#' onClick=\"DrawWTDGraph('AVGTALKTIME', '7'); return false;\">AVG TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph8'><a href='#' onClick=\"DrawWTDGraph('TOTALTALKTIME', '8'); return false;\">TOTAL TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph9'><a href='#' onClick=\"DrawWTDGraph('TOTALWRAPTIME', '9'); return false;\">TOTAL WRAP TIME</a></th><th width='10%' class='grey_graph_cell' id='WTD_graph10'><a href='#' onClick=\"DrawWTDGraph('TOTALCALLTIME', '10'); return false;\">TOTAL CALL TIME</a></th></tr><tr><td colspan='10' class='graph_span_cell' align='center'><span id='WTD_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$QTD_GRAPH="<BR><BR><a name='QTD_graph'/><table border='0' cellpadding='0' cellspacing='2' width='800'><tr><th width='10%' class='grey_graph_cell' id='QTD_graph1'><a href='#' onClick=\"DrawQTDGraph('OFFERED', '1'); return false;\">TOTAL CALLS OFFERED</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph2'><a href='#' onClick=\"DrawQTDGraph('ANSWERED', '2'); return false;\">TOTAL CALLS ANSWERED</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph3'><a href='#' onClick=\"DrawQTDGraph('ABANDONED', '3'); return false;\">TOTAL CALLS ABANDONED</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph4'><a href='#' onClick=\"DrawQTDGraph('ABANDONPCT', '4'); return false;\">TOTAL ABANDON PERCENT</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph5'><a href='#' onClick=\"DrawQTDGraph('AVGABANDONTIME', '5'); return false;\">AVG ABANDON TIME</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph6'><a href='#' onClick=\"DrawQTDGraph('AVGANSWERSPEED', '6'); return false;\">AVG ANSWER SPEED</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph7'><a href='#' onClick=\"DrawQTDGraph('AVGTALKTIME', '7'); return false;\">AVG TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph8'><a href='#' onClick=\"DrawQTDGraph('TOTALTALKTIME', '8'); return false;\">TOTAL TALK TIME</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph9'><a href='#' onClick=\"DrawQTDGraph('TOTALWRAPTIME', '9'); return false;\">TOTAL WRAP TIME</a></th><th width='10%' class='grey_graph_cell' id='QTD_graph10'><a href='#' onClick=\"DrawQTDGraph('TOTALCALLTIME', '10'); return false;\">TOTAL CALL TIME</a></th></tr><tr><td colspan='10' class='graph_span_cell' align='center'><span id='QTD_stats_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' class='horizontalgraph'><caption align='top'>DAILY RPT - $query_date_BEGIN to $query_date_END</caption><tr><th class='thgraph' scope='col'>DATE/TIME RANGE</th>";
|
||||
$OFFERED_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLS OFFERED</th></tr>";
|
||||
$ANSWERED_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLS ANSWERED </th></tr>";
|
||||
$ABANDONED_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALLS ABANDONED</th></tr>";
|
||||
$ABANDONPCT_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL ABANDON PERCENT</th></tr>";
|
||||
$AVGABANDONTIME_graph=$graph_header."<th class='thgraph' scope='col'>AVG ABANDON TIME</th></tr>";
|
||||
$AVGANSWERSPEED_graph=$graph_header."<th class='thgraph' scope='col'>AVG ANSWER SPEED</th></tr>";
|
||||
$AVGTALKTIME_graph=$graph_header."<th class='thgraph' scope='col'>AVG TALK TIME</th></tr>";
|
||||
$TOTALTALKTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL TALK TIME</th></tr>";
|
||||
$TOTALWRAPTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL WRAP TIME</th></tr>";
|
||||
$TOTALCALLTIME_graph=$graph_header."<th class='thgraph' scope='col'>TOTAL CALL TIME</th></tr>";
|
||||
##########################
|
||||
|
||||
$totCALLSwtd=0;
|
||||
$totANSWERSwtd=0;
|
||||
@@ -703,7 +778,6 @@ else
|
||||
$totQUEUEdate[$d] = sprintf("%6s", $totQUEUEdate[$d]);
|
||||
*/ $totCALLSdate[$d] = sprintf("%7s", $totCALLSdate[$d]);
|
||||
|
||||
|
||||
if ($totCALLSdate[$d]>0)
|
||||
{
|
||||
$totABANDONSpctDATE[$d] = sprintf("%7.2f", (100*$totABANDONSdate[$d]/$totCALLSdate[$d]));
|
||||
@@ -716,25 +790,38 @@ else
|
||||
if ($totABANDONSdate[$d]>0)
|
||||
{
|
||||
$totABANDONSavgTIME[$d] = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]))));
|
||||
if (round($totABANDONSsecdate[$d]/$totABANDONSdate[$d])>$max_avgabandontime) {$max_avgabandontime=round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]);}
|
||||
$graph_stats[$d][11]=round($totABANDONSsecdate[$d]/$totABANDONSdate[$d]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSdate[$d]="0";
|
||||
$totABANDONSavgTIME[$d] = " 00:00";
|
||||
$graph_stats[$d][11]=0;
|
||||
}
|
||||
if ($totANSWERSdate[$d]>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]))));
|
||||
$totANSWERSavgTIME[$d] = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]))));
|
||||
if (round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d])>$max_avganswerspeed) {$max_avganswerspeed=round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]);}
|
||||
$graph_stats[$d][12]=round($totANSWERSspeeddate[$d]/$totANSWERSdate[$d]);
|
||||
$graph_stats[$d][16]=round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSdate[$d]="0";
|
||||
$totANSWERSavgspeedTIME[$d] = " 00:00";
|
||||
$totANSWERSavgTIME[$d] = " 00:00";
|
||||
$graph_stats[$d][12]=0;
|
||||
$graph_stats[$d][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIME[$d] = sprintf("%10s", floor($totANSWERSsecdate[$d]/3600).date(":i:s", mktime(0, 0, $totANSWERSsecdate[$d])));
|
||||
$totANSWERSwrapTIME[$d] = sprintf("%10s", floor(($totANSWERSdate[$d]*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSdate[$d]*15))));
|
||||
if (($totANSWERSdate[$d]*15)>$max_totalwraptime) {$max_totalwraptime=($totANSWERSdate[$d]*15);}
|
||||
$graph_stats[$d][13]=($totANSWERSdate[$d]*15);
|
||||
$graph_stats[$d][14]=($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15));
|
||||
$graph_stats[$d][15]=$totANSWERSsecdate[$d];
|
||||
|
||||
$totANSWERStotTIME[$d] = sprintf("%10s", floor(($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15)))));
|
||||
$totANSWERSdate[$d] = sprintf("%8s", $totANSWERSdate[$d]);
|
||||
$totABANDONSdate[$d] = sprintf("%9s", $totABANDONSdate[$d]);
|
||||
@@ -752,31 +839,66 @@ else
|
||||
if ($totABANDONSwtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecwtd/$totABANDONSwtd))));
|
||||
if (round($totABANDONSsecwtd/$totABANDONSwtd)>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round($totABANDONSsecwtd/$totABANDONSwtd);}
|
||||
$wtd_graph_stats[$wa][11]=round($totABANDONSsecwtd/$totABANDONSwtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEwtd = " 00:00";
|
||||
$wtd_graph_stats[$wa][11]=0;
|
||||
}
|
||||
if ($totANSWERSwtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedwtd/$totANSWERSwtd))));
|
||||
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecwtd/$totANSWERSwtd))));
|
||||
if (round($totANSWERSspeedwtd/$totANSWERSwtd)>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round($totANSWERSspeedwtd/$totANSWERSwtd);}
|
||||
$wtd_graph_stats[$wa][12]=round($totANSWERSspeedwtd/$totANSWERSwtd);
|
||||
$wtd_graph_stats[$wa][16]=round($totANSWERSsecwtd/$totANSWERSwtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEwtd = " 00:00";
|
||||
$totANSWERSavgTIMEwtd = " 00:00";
|
||||
$wtd_graph_stats[$wa][12]=0;
|
||||
$wtd_graph_stats[$wa][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEwtd = sprintf("%10s", floor($totANSWERSsecwtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
|
||||
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(($totANSWERSwtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
|
||||
if (($totANSWERSwtd*15)>$max_wtd_totalwraptime) {$max_wtd_totalwraptime=($totANSWERSwtd*15);}
|
||||
$wtd_graph_stats[$wa][13]=($totANSWERSwtd*15);
|
||||
$wtd_graph_stats[$wa][14]=($totANSWERSsecwtd+($totANSWERSwtd*15));
|
||||
$wtd_graph_stats[$wa][15]=$totANSWERSsecwtd;
|
||||
$totANSWERStotTIMEwtd = sprintf("%10s", floor(($totANSWERSsecwtd+($totANSWERSwtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
|
||||
$totANSWERSwtd = sprintf("%8s", $totANSWERSwtd);
|
||||
$totABANDONSwtd = sprintf("%9s", $totABANDONSwtd);
|
||||
$totCALLSwtd = sprintf("%7s", $totCALLSwtd);
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |\n";
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
if (trim($totCALLSwtd)>$max_wtd_offered) {$max_wtd_offered=trim($totCALLSwtd);}
|
||||
if (trim($totANSWERSwtd)>$max_wtd_answered) {$max_wtd_answered=trim($totANSWERSwtd);}
|
||||
if (trim($totABANDONSwtd)>$max_wtd_abandoned) {$max_wtd_abandoned=trim($totABANDONSwtd);}
|
||||
if (trim($totABANDONSpctwtd)>$max_wtd_abandonpct) {$max_wtd_abandonpct=trim($totABANDONSpctwtd);}
|
||||
|
||||
if (round($totANSWERSsecwtd/$totANSWERSwtd)>$max_wtd_avgtalktime) {$max_wtd_avgtalktime=round($totANSWERSsecwtd/$totANSWERSwtd);}
|
||||
if (trim($totANSWERSsecwtd)>$max_wtd_totaltalktime) {$max_wtd_totaltalktime=trim($totANSWERSsecwtd);}
|
||||
if (trim($totANSWERSsecwtd+($totANSWERSwtd*15))>$max_wtd_totalcalltime) {$max_wtd_totalcalltime=trim($totANSWERSsecwtd+($totANSWERSwtd*15));}
|
||||
$week=date("W", strtotime($dayEND[$d-1]));
|
||||
$year=substr($dayEND[$d-1],0,4);
|
||||
$wtd_graph_stats[$wa][0]="Week $week, $year";
|
||||
$wtd_graph_stats[$wa][1]=trim($totCALLSwtd);
|
||||
$wtd_graph_stats[$wa][2]=trim($totANSWERSwtd);
|
||||
$wtd_graph_stats[$wa][3]=trim($totABANDONSwtd);
|
||||
$wtd_graph_stats[$wa][4]=trim($totABANDONSpctwtd);
|
||||
$wtd_graph_stats[$wa][5]=trim($totABANDONSavgTIMEwtd);
|
||||
$wtd_graph_stats[$wa][6]=trim($totANSWERSavgspeedTIMEwtd);
|
||||
$wtd_graph_stats[$wa][7]=trim($totANSWERSavgTIMEwtd);
|
||||
$wtd_graph_stats[$wa][8]=trim($totANSWERStalkTIMEwtd);
|
||||
$wtd_graph_stats[$wa][9]=trim($totANSWERSwrapTIMEwtd);
|
||||
$wtd_graph_stats[$wa][10]=trim($totANSWERStotTIMEwtd);
|
||||
$wa++;
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$CSV_text.="\"WTD\",\"$totCALLSwtd\",\"$totANSWERSwtd\",\"$totABANDONSwtd\",\"$totABANDONSpctwtd%\",\"$totABANDONSavgTIMEwtd\",\"$totANSWERSavgspeedTIMEwtd\",\"$totANSWERSavgTIMEwtd\",\"$totANSWERStalkTIMEwtd\",\"$totANSWERSwrapTIMEwtd\",\"$totANSWERStotTIMEwtd\"\n";
|
||||
$totCALLSwtd=0;
|
||||
$totANSWERSwtd=0;
|
||||
@@ -798,31 +920,65 @@ else
|
||||
if ($totABANDONSmtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecmtd/$totABANDONSmtd))));
|
||||
if (round($totABANDONSsecmtd/$totABANDONSmtd)>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round($totABANDONSsecmtd/$totABANDONSmtd);}
|
||||
$mtd_graph_stats[$ma][11]=round($totABANDONSsecmtd/$totABANDONSmtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEmtd = " 00:00";
|
||||
$mtd_graph_stats[$ma][11]=0;
|
||||
}
|
||||
if ($totANSWERSmtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedmtd/$totANSWERSmtd))));
|
||||
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecmtd/$totANSWERSmtd))));
|
||||
if (round($totANSWERSspeedmtd/$totANSWERSmtd)>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round($totANSWERSspeedmtd/$totANSWERSmtd);}
|
||||
$mtd_graph_stats[$ma][12]=round($totANSWERSspeedmtd/$totANSWERSmtd);
|
||||
$mtd_graph_stats[$ma][16]=round($totANSWERSsecmtd/$totANSWERSmtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEmtd = " 00:00";
|
||||
$totANSWERSavgTIMEmtd = " 00:00";
|
||||
$mtd_graph_stats[$ma][12]=0;
|
||||
$mtd_graph_stats[$ma][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEmtd = sprintf("%10s", floor($totANSWERSsecmtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
|
||||
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(($totANSWERSmtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
|
||||
if (($totANSWERSmtd*15)>$max_mtd_totalwraptime) {$max_mtd_totalwraptime=($totANSWERSmtd*15);}
|
||||
$mtd_graph_stats[$ma][13]=($totANSWERSmtd*15);
|
||||
$mtd_graph_stats[$ma][14]=($totANSWERSsecmtd+($totANSWERSmtd*15));
|
||||
$mtd_graph_stats[$ma][15]=$totANSWERSsecmtd;
|
||||
$totANSWERStotTIMEmtd = sprintf("%10s", floor(($totANSWERSsecmtd+($totANSWERSmtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
|
||||
$totANSWERSmtd = sprintf("%8s", $totANSWERSmtd);
|
||||
$totABANDONSmtd = sprintf("%9s", $totABANDONSmtd);
|
||||
$totCALLSmtd = sprintf("%7s", $totCALLSmtd);
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |\n";
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
if (trim($totCALLSmtd)>$max_mtd_offered) {$max_mtd_offered=trim($totCALLSmtd);}
|
||||
if (trim($totANSWERSmtd)>$max_mtd_answered) {$max_mtd_answered=trim($totANSWERSmtd);}
|
||||
if (trim($totABANDONSmtd)>$max_mtd_abandoned) {$max_mtd_abandoned=trim($totABANDONSmtd);}
|
||||
if (trim($totABANDONSpctmtd)>$max_mtd_abandonpct) {$max_mtd_abandonpct=trim($totABANDONSpctmtd);}
|
||||
if (round($totANSWERSsecmtd/$totANSWERSmtd)>$max_mtd_avgtalktime) {$max_mtd_avgtalktime=round($totANSWERSsecmtd/$totANSWERSmtd);}
|
||||
if (trim($totANSWERSsecmtd)>$max_mtd_totaltalktime) {$max_mtd_totaltalktime=trim($totANSWERSsecmtd);}
|
||||
if (trim($totANSWERSsecmtd+($totANSWERSmtd*15))>$max_mtd_totalcalltime) {$max_mtd_totalcalltime=trim($totANSWERSsecmtd+($totANSWERSmtd*15));}
|
||||
$month=date("F", strtotime($dayEND[$d-1]));
|
||||
$year=substr($dayEND[$d-1], 0, 4);
|
||||
$mtd_graph_stats[$ma][0]="$month $year";
|
||||
$mtd_graph_stats[$ma][1]=trim($totCALLSmtd);
|
||||
$mtd_graph_stats[$ma][2]=trim($totANSWERSmtd);
|
||||
$mtd_graph_stats[$ma][3]=trim($totABANDONSmtd);
|
||||
$mtd_graph_stats[$ma][4]=trim($totABANDONSpctmtd);
|
||||
$mtd_graph_stats[$ma][5]=trim($totABANDONSavgTIMEmtd);
|
||||
$mtd_graph_stats[$ma][6]=trim($totANSWERSavgspeedTIMEmtd);
|
||||
$mtd_graph_stats[$ma][7]=trim($totANSWERSavgTIMEmtd);
|
||||
$mtd_graph_stats[$ma][8]=trim($totANSWERStalkTIMEmtd);
|
||||
$mtd_graph_stats[$ma][9]=trim($totANSWERSwrapTIMEmtd);
|
||||
$mtd_graph_stats[$ma][10]=trim($totANSWERStotTIMEmtd);
|
||||
$ma++;
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$CSV_text.="\"MTD\",\"$totCALLSmtd\",\"$totANSWERSmtd\",\"$totABANDONSmtd\",\"$totABANDONSpctmtd%\",\"$totABANDONSavgTIMEmtd\",\"$totANSWERSavgspeedTIMEmtd\",\"$totANSWERSavgTIMEmtd\",\"$totANSWERStalkTIMEmtd\",\"$totANSWERSwrapTIMEmtd\",\"$totANSWERStotTIMEmtd\"\n";
|
||||
$totCALLSmtd=0;
|
||||
$totANSWERSmtd=0;
|
||||
@@ -844,30 +1000,77 @@ else
|
||||
if ($totABANDONSqtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecqtd/$totABANDONSqtd))));
|
||||
if (round($totABANDONSsecqtd/$totABANDONSqtd)>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round($totABANDONSsecqtd/$totABANDONSqtd);}
|
||||
$qtd_graph_stats[$qa][11]=round($totABANDONSsecqtd/$totABANDONSqtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEqtd = " 00:00";
|
||||
$qtd_graph_stats[$qa][11]=0;
|
||||
}
|
||||
if ($totANSWERSqtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedqtd/$totANSWERSqtd))));
|
||||
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecqtd/$totANSWERSqtd))));
|
||||
if (round($totANSWERSspeedqtd/$totANSWERSqtd)>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round($totANSWERSspeedqtd/$totANSWERSqtd);}
|
||||
$qtd_graph_stats[$qa][12]=round($totANSWERSspeedqtd/$totANSWERSqtd);
|
||||
$qtd_graph_stats[$qa][16]=round($totANSWERSsecqtd/$totANSWERSqtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEqtd = " 00:00";
|
||||
$totANSWERSavgTIMEqtd = " 00:00";
|
||||
$qtd_graph_stats[$qa][12]=0;
|
||||
$qtd_graph_stats[$qa][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEqtd = sprintf("%10s", floor($totANSWERSsecqtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
|
||||
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(($totANSWERSqtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
|
||||
if (($totANSWERSqtd*15)>$max_qtd_totalwraptime) {$max_qtd_totalwraptime=($totANSWERSqtd*15);}
|
||||
$qtd_graph_stats[$qa][13]=($totANSWERSqtd*15);
|
||||
$qtd_graph_stats[$qa][14]=($totANSWERSsecqtd+($totANSWERSqtd*15));
|
||||
$qtd_graph_stats[$qa][15]=$totANSWERSsecqtd;
|
||||
$totANSWERStotTIMEqtd = sprintf("%10s", floor(($totANSWERSsecqtd+($totANSWERSqtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
|
||||
$totANSWERSqtd = sprintf("%8s", $totANSWERSqtd);
|
||||
$totABANDONSqtd = sprintf("%9s", $totABANDONSqtd);
|
||||
$totCALLSqtd = sprintf("%7s", $totCALLSqtd);
|
||||
|
||||
$MAIN.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |\n";
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
if (trim($totCALLSqtd)>$max_qtd_offered) {$max_qtd_offered=trim($totCALLSqtd);}
|
||||
if (trim($totANSWERSqtd)>$max_qtd_answered) {$max_qtd_answered=trim($totANSWERSqtd);}
|
||||
if (trim($totABANDONSqtd)>$max_qtd_abandoned) {$max_qtd_abandoned=trim($totABANDONSqtd);}
|
||||
if (trim($totABANDONSpctqtd)>$max_qtd_abandonpct) {$max_qtd_abandonpct=trim($totABANDONSpctqtd);}
|
||||
if (round($totANSWERSsecqtd/$totANSWERSqtd)>$max_qtd_avgtalktime) {$max_qtd_avgtalktime=round($totANSWERSsecqtd/$totANSWERSqtd);}
|
||||
if (trim($totANSWERSsecqtd)>$max_qtd_totaltalktime) {$max_qtd_totaltalktime=trim($totANSWERSsecqtd);}
|
||||
if (trim($totANSWERSsecqtd+($totANSWERSqtd*15))>$max_qtd_totalcalltime) {$max_qtd_totalcalltime=trim($totANSWERSsecqtd+($totANSWERSqtd*15));}
|
||||
$month=date("m", strtotime($dayEND[$d]));
|
||||
$year=substr($dayEND[$d], 0, 4);
|
||||
$qtr4=array(01,02,03);
|
||||
$qtr1=array(04,05,06);
|
||||
$qtr2=array(07,08,09);
|
||||
$qtr3=array(10,11,12);
|
||||
if(in_array($month,$qtr1)) {
|
||||
$qtr="1st";
|
||||
} else if(in_array($month,$qtr2)) {
|
||||
$qtr="2nd";
|
||||
} else if(in_array($month,$qtr3)) {
|
||||
$qtr="3rd";
|
||||
} else if(in_array($month,$qtr4)) {
|
||||
$qtr="4th";
|
||||
}
|
||||
$qtd_graph_stats[$qa][0]="$qtr quarter, $year";
|
||||
$qtd_graph_stats[$qa][1]=trim($totCALLSqtd);
|
||||
$qtd_graph_stats[$qa][2]=trim($totANSWERSqtd);
|
||||
$qtd_graph_stats[$qa][3]=trim($totABANDONSqtd);
|
||||
$qtd_graph_stats[$qa][4]=trim($totABANDONSpctqtd);
|
||||
$qtd_graph_stats[$qa][5]=trim($totABANDONSavgTIMEqtd);
|
||||
$qtd_graph_stats[$qa][6]=trim($totANSWERSavgspeedTIMEqtd);
|
||||
$qtd_graph_stats[$qa][7]=trim($totANSWERSavgTIMEqtd);
|
||||
$qtd_graph_stats[$qa][8]=trim($totANSWERStalkTIMEqtd);
|
||||
$qtd_graph_stats[$qa][9]=trim($totANSWERSwrapTIMEqtd);
|
||||
$qtd_graph_stats[$qa][10]=trim($totANSWERStotTIMEqtd);
|
||||
$qa++;
|
||||
|
||||
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"\n";
|
||||
$totCALLSqtd=0;
|
||||
$totANSWERSqtd=0;
|
||||
@@ -897,8 +1100,27 @@ else
|
||||
$totABANDONSqtd+=$totABANDONSdate[$d];
|
||||
$totABANDONSsecqtd+=$totABANDONSsecdate[$d];
|
||||
|
||||
if (trim($totCALLSdate[$d])>$max_offered) {$max_offered=trim($totCALLSdate[$d]);}
|
||||
if (trim($totANSWERSdate[$d])>$max_answered) {$max_answered=trim($totANSWERSdate[$d]);}
|
||||
if (trim($totABANDONSdate[$d])>$max_abandoned) {$max_abandoned=trim($totABANDONSdate[$d]);}
|
||||
if (trim($totABANDONSpctDATE[$d])>$max_abandonpct) {$max_abandonpct=trim($totABANDONSpctDATE[$d]);}
|
||||
|
||||
$MAIN.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] | $totANSWERSdate[$d] | $totABANDONSdate[$d] | $totABANDONSpctDATE[$d]%| $totABANDONSavgTIME[$d] | $totANSWERSavgspeedTIME[$d] | $totANSWERSavgTIME[$d] | $totANSWERStalkTIME[$d] | $totANSWERSwrapTIME[$d] | $totANSWERStotTIME[$d] |\n";
|
||||
if (round($totANSWERSsecdate[$d]/$totANSWERSdate[$d])>$max_avgtalktime) {$max_avgtalktime=round($totANSWERSsecdate[$d]/$totANSWERSdate[$d]);}
|
||||
if (trim($totANSWERSsecdate[$d])>$max_totaltalktime) {$max_totaltalktime=trim($totANSWERSsecdate[$d]);}
|
||||
if (trim($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15))>$max_totalcalltime) {$max_totalcalltime=trim($totANSWERSsecdate[$d]+($totANSWERSdate[$d]*15));}
|
||||
$graph_stats[$d][0]="$daySTART[$d] - $dayEND[$d]";
|
||||
$graph_stats[$d][1]=trim($totCALLSdate[$d]);
|
||||
$graph_stats[$d][2]=trim($totANSWERSdate[$d]);
|
||||
$graph_stats[$d][3]=trim($totABANDONSdate[$d]);
|
||||
$graph_stats[$d][4]=trim($totABANDONSpctDATE[$d]);
|
||||
$graph_stats[$d][5]=trim($totABANDONSavgTIME[$d]);
|
||||
$graph_stats[$d][6]=trim($totANSWERSavgspeedTIME[$d]);
|
||||
$graph_stats[$d][7]=trim($totANSWERSavgTIME[$d]);
|
||||
$graph_stats[$d][8]=trim($totANSWERStalkTIME[$d]);
|
||||
$graph_stats[$d][9]=trim($totANSWERSwrapTIME[$d]);
|
||||
$graph_stats[$d][10]=trim($totANSWERStotTIME[$d]);
|
||||
|
||||
$ASCII_text.="| $daySTART[$d] - $dayEND[$d] | $totCALLSdate[$d] | $totANSWERSdate[$d] | $totABANDONSdate[$d] | $totABANDONSpctDATE[$d]%| $totABANDONSavgTIME[$d] | $totANSWERSavgspeedTIME[$d] | $totANSWERSavgTIME[$d] | $totANSWERStalkTIME[$d] | $totANSWERSwrapTIME[$d] | $totANSWERStotTIME[$d] |\n";
|
||||
$CSV_text.="\"$daySTART[$d] - $dayEND[$d]\",\"$totCALLSdate[$d]\",\"$totANSWERSdate[$d]\",\"$totABANDONSdate[$d]\",\"$totABANDONSpctDATE[$d]%\",\"$totABANDONSavgTIME[$d]\",\"$totANSWERSavgspeedTIME[$d]\",\"$totANSWERSavgTIME[$d]\",\"$totANSWERStalkTIME[$d]\",\"$totANSWERSwrapTIME[$d]\",\"$totANSWERStotTIME[$d]\"\n";
|
||||
|
||||
$d++;
|
||||
@@ -999,30 +1221,88 @@ else
|
||||
if ($totABANDONSwtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEwtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecwtd/$totABANDONSwtd))));
|
||||
if (round($totABANDONSsecwtd/$totABANDONSwtd)>$max_wtd_avgabandontime) {$max_wtd_avgabandontime=round($totABANDONSsecwtd/$totABANDONSwtd);}
|
||||
$wtd_graph_stats[$wa][11]=round($totABANDONSsecwtd/$totABANDONSwtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEwtd = " 00:00";
|
||||
$wtd_graph_stats[$wa][11]=0;
|
||||
}
|
||||
if ($totANSWERSwtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedwtd/$totANSWERSwtd))));
|
||||
$totANSWERSavgTIMEwtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecwtd/$totANSWERSwtd))));
|
||||
if (round($totANSWERSspeedwtd/$totANSWERSwtd)>$max_wtd_avganswerspeed) {$max_wtd_avganswerspeed=round($totANSWERSspeedwtd/$totANSWERSwtd);}
|
||||
$wtd_graph_stats[$wa][12]=round($totANSWERSspeedwtd/$totANSWERSwtd);
|
||||
$wtd_graph_stats[$wa][16]=round($totANSWERSsecwtd/$totANSWERSwtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEwtd = " 00:00";
|
||||
$totANSWERSavgTIMEwtd = " 00:00";
|
||||
$wtd_graph_stats[$wa][12]=0;
|
||||
$wtd_graph_stats[$wa][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEwtd = sprintf("%10s", floor($totANSWERSsecwtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecwtd)));
|
||||
$totANSWERSwrapTIMEwtd = sprintf("%10s", floor(($totANSWERSwtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSwtd*15))));
|
||||
if (($totANSWERSwtd*15)>$max_wtd_totalwraptime) {$max_wtd_totalwraptime=($totANSWERSwtd*15);}
|
||||
$wtd_graph_stats[$wa][13]=($totANSWERSwtd*15);
|
||||
$wtd_graph_stats[$wa][14]=($totANSWERSsecwtd+($totANSWERSwtd*15));
|
||||
$wtd_graph_stats[$wa][15]=$totANSWERSsecwtd;
|
||||
$totANSWERStotTIMEwtd = sprintf("%10s", floor(($totANSWERSsecwtd+($totANSWERSwtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecwtd+($totANSWERSwtd*15)))));
|
||||
$totANSWERSwtd = sprintf("%8s", $totANSWERSwtd);
|
||||
$totABANDONSwtd = sprintf("%9s", $totABANDONSwtd);
|
||||
$totCALLSwtd = sprintf("%7s", $totCALLSwtd);
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |\n";
|
||||
if (trim($totCALLSwtd)>$max_wtd_offered) {$max_wtd_offered=trim($totCALLSwtd);}
|
||||
if (trim($totANSWERSwtd)>$max_wtd_answered) {$max_wtd_answered=trim($totANSWERSwtd);}
|
||||
if (trim($totABANDONSwtd)>$max_wtd_abandoned) {$max_wtd_abandoned=trim($totABANDONSwtd);}
|
||||
if (trim($totABANDONSpctwtd)>$max_wtd_abandonpct) {$max_wtd_abandonpct=trim($totABANDONSpctwtd);}
|
||||
|
||||
if (trim($totANSWERSavgTIMEwtd)>$max_wtd_avgtalktime) {$max_wtd_avgtalktime=trim($totANSWERSavgTIMEwtd);}
|
||||
if (trim($totANSWERSsecwtd)>$max_wtd_totaltalktime) {$max_wtd_totaltalktime=trim($totANSWERSsecwtd);}
|
||||
if (trim($totANSWERSsecwtd+($totANSWERSwtd*15))>$max_wtd_totalcalltime) {$max_wtd_totalcalltime=trim($totANSWERSsecwtd+($totANSWERSwtd*15));}
|
||||
|
||||
$week=date("W", strtotime($dayEND[$d-1]));
|
||||
$year=substr($dayEND[$d-1], 0, 4);
|
||||
$wtd_graph_stats[$wa][0]="Week $week, $year";
|
||||
$wtd_graph_stats[$wa][1]=trim($totCALLSwtd);
|
||||
$wtd_graph_stats[$wa][2]=trim($totANSWERSwtd);
|
||||
$wtd_graph_stats[$wa][3]=trim($totABANDONSwtd);
|
||||
$wtd_graph_stats[$wa][4]=trim($totABANDONSpctwtd);
|
||||
$wtd_graph_stats[$wa][5]=trim($totABANDONSavgTIMEwtd);
|
||||
$wtd_graph_stats[$wa][6]=trim($totANSWERSavgspeedTIMEwtd);
|
||||
$wtd_graph_stats[$wa][7]=trim($totANSWERSavgTIMEwtd);
|
||||
$wtd_graph_stats[$wa][8]=trim($totANSWERStalkTIMEwtd);
|
||||
$wtd_graph_stats[$wa][9]=trim($totANSWERSwrapTIMEwtd);
|
||||
$wtd_graph_stats[$wa][10]=trim($totANSWERStotTIMEwtd);
|
||||
$wtd_OFFERED_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE', $OFFERED_graph);
|
||||
$wtd_ANSWERED_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$ANSWERED_graph);
|
||||
$wtd_ABANDONED_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$ABANDONED_graph);
|
||||
$wtd_ABANDONPCT_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$ABANDONPCT_graph);
|
||||
$wtd_AVGABANDONTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$AVGABANDONTIME_graph);
|
||||
$wtd_AVGANSWERSPEED_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$AVGANSWERSPEED_graph);
|
||||
$wtd_AVGTALKTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$AVGTALKTIME_graph);
|
||||
$wtd_TOTALTALKTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$TOTALTALKTIME_graph);
|
||||
$wtd_TOTALWRAPTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$TOTALWRAPTIME_graph);
|
||||
$wtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'WEEK-TO-DATE',$TOTALCALLTIME_graph);
|
||||
for ($q=0; $q<count($wtd_graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($wtd_graph_stats)) {$class=" last";} else {$class="";}
|
||||
$wtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][1]/$max_wtd_offered)."' height='16' />".$wtd_graph_stats[$q][1]."</td></tr>";
|
||||
$wtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][2]/$max_wtd_answered)."' height='16' />".$wtd_graph_stats[$q][2]."</td></tr>";
|
||||
$wtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][3]/$max_wtd_abandoned)."' height='16' />".$wtd_graph_stats[$q][3]."</td></tr>";
|
||||
$wtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][4]/$max_wtd_abandonpct)."' height='16' />".$wtd_graph_stats[$q][4]."% </td></tr>";
|
||||
$wtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][11]/$max_wtd_avgabandontime)."' height='16' />".$wtd_graph_stats[$q][5]."</td></tr>";
|
||||
$wtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][12]/$max_wtd_avganswerspeed)."' height='16' />".$wtd_graph_stats[$q][6]."</td></tr>";
|
||||
$wtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][16]/$max_wtd_avgtalktime)."' height='16' />".$wtd_graph_stats[$q][7]."</td></tr>";
|
||||
$wtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][15]/$max_wtd_totaltalktime)."' height='16' />".$wtd_graph_stats[$q][8]."</td></tr>";
|
||||
$wtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][13]/$max_wtd_totalwraptime)."' height='16' />".$wtd_graph_stats[$q][9]."</td></tr>";
|
||||
$wtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$wtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$wtd_graph_stats[$q][14]/$max_wtd_totalcalltime)."' height='16' />".$wtd_graph_stats[$q][10]."</td></tr>";
|
||||
}
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| WTD | $totCALLSwtd | $totANSWERSwtd | $totABANDONSwtd | $totABANDONSpctwtd%| $totABANDONSavgTIMEwtd | $totANSWERSavgspeedTIMEwtd | $totANSWERSavgTIMEwtd | $totANSWERStalkTIMEwtd | $totANSWERSwrapTIMEwtd | $totANSWERStotTIMEwtd |\n";
|
||||
$CSV_text.="\"WTD\",\"$totCALLSwtd\",\"$totANSWERSwtd\",\"$totABANDONSwtd\",\"$totABANDONSpctwtd%\",\"$totABANDONSavgTIMEwtd\",\"$totANSWERSavgspeedTIMEwtd\",\"$totANSWERSavgTIMEwtd\",\"$totANSWERStalkTIMEwtd\",\"$totANSWERSwrapTIMEwtd\",\"$totANSWERStotTIMEwtd\"\n";
|
||||
$totCALLSwtd=0;
|
||||
$totANSWERSwtd=0;
|
||||
@@ -1045,30 +1325,98 @@ else
|
||||
if ($totABANDONSmtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEmtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecmtd/$totABANDONSmtd))));
|
||||
if (round($totABANDONSsecmtd/$totABANDONSmtd)>$max_mtd_avgabandontime) {$max_mtd_avgabandontime=round($totABANDONSsecmtd/$totABANDONSmtd);}
|
||||
$mtd_graph_stats[$ma][11]=round($totABANDONSsecmtd/$totABANDONSmtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEmtd = " 00:00";
|
||||
$mtd_graph_stats[$ma][11]=0;
|
||||
}
|
||||
if ($totANSWERSmtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedmtd/$totANSWERSmtd))));
|
||||
$totANSWERSavgTIMEmtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecmtd/$totANSWERSmtd))));
|
||||
if (round($totANSWERSspeedmtd/$totANSWERSmtd)>$max_mtd_avganswerspeed) {$max_mtd_avganswerspeed=round($totANSWERSspeedmtd/$totANSWERSmtd);}
|
||||
$mtd_graph_stats[$ma][12]=round($totANSWERSspeedmtd/$totANSWERSmtd);
|
||||
$mtd_graph_stats[$ma][16]=round($totANSWERSsecmtd/$totANSWERSmtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEmtd = " 00:00";
|
||||
$totANSWERSavgTIMEmtd = " 00:00";
|
||||
$mtd_graph_stats[$ma][12]=0;
|
||||
$mtd_graph_stats[$ma][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEmtd = sprintf("%10s", floor($totANSWERSsecmtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecmtd)));
|
||||
$totANSWERSwrapTIMEmtd = sprintf("%10s", floor(($totANSWERSmtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSmtd*15))));
|
||||
if (($totANSWERSmtd*15)>$max_mtd_totalwraptime) {$max_mtd_totalwraptime=($totANSWERSmtd*15);}
|
||||
$mtd_graph_stats[$ma][13]=($totANSWERSmtd*15);
|
||||
$mtd_graph_stats[$ma][14]=($totANSWERSsecmtd+($totANSWERSmtd*15));
|
||||
$mtd_graph_stats[$ma][15]=$totANSWERSsecmtd;
|
||||
$totANSWERStotTIMEmtd = sprintf("%10s", floor(($totANSWERSsecmtd+($totANSWERSmtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecmtd+($totANSWERSmtd*15)))));
|
||||
$totANSWERSmtd = sprintf("%8s", $totANSWERSmtd);
|
||||
$totABANDONSmtd = sprintf("%9s", $totABANDONSmtd);
|
||||
$totCALLSmtd = sprintf("%7s", $totCALLSmtd);
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |\n";
|
||||
if (trim($totCALLSmtd)>$max_mtd_offered) {$max_mtd_offered=trim($totCALLSmtd);}
|
||||
if (trim($totANSWERSmtd)>$max_mtd_answered) {$max_mtd_answered=trim($totANSWERSmtd);}
|
||||
if (trim($totABANDONSmtd)>$max_mtd_abandoned) {$max_mtd_abandoned=trim($totABANDONSmtd);}
|
||||
if (trim($totABANDONSpctmtd)>$max_mtd_abandonpct) {$max_mtd_abandonpct=trim($totABANDONSpctmtd);}
|
||||
|
||||
if (round($totANSWERSsecmtd/$totANSWERSmtd)>$max_mtd_avgtalktime) {$max_mtd_avgtalktime=round($totANSWERSsecmtd/$totANSWERSmtd);}
|
||||
if (trim($totANSWERSsecmtd)>$max_mtd_totaltalktime) {$max_mtd_totaltalktime=trim($totANSWERSsecmtd);}
|
||||
if (trim($totANSWERSsecmtd+($totANSWERSmtd*15))>$max_mtd_totalcalltime) {$max_mtd_totalcalltime=trim($totANSWERSsecmtd+($totANSWERSmtd*15));}
|
||||
|
||||
$month=date("F", strtotime($dayEND[$d-1]));
|
||||
$year=substr($dayEND[$d-1], 0, 4);
|
||||
$mtd_graph_stats[$ma][0]="$month $year";
|
||||
$mtd_graph_stats[$ma][1]=trim($totCALLSmtd);
|
||||
$mtd_graph_stats[$ma][2]=trim($totANSWERSmtd);
|
||||
$mtd_graph_stats[$ma][3]=trim($totABANDONSmtd);
|
||||
$mtd_graph_stats[$ma][4]=trim($totABANDONSpctmtd);
|
||||
$mtd_graph_stats[$ma][5]=trim($totABANDONSavgTIMEmtd);
|
||||
$mtd_graph_stats[$ma][6]=trim($totANSWERSavgspeedTIMEmtd);
|
||||
$mtd_graph_stats[$ma][7]=trim($totANSWERSavgTIMEmtd);
|
||||
$mtd_graph_stats[$ma][8]=trim($totANSWERStalkTIMEmtd);
|
||||
$mtd_graph_stats[$ma][9]=trim($totANSWERSwrapTIMEmtd);
|
||||
$mtd_graph_stats[$ma][10]=trim($totANSWERStotTIMEmtd);
|
||||
$mtd_OFFERED_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$OFFERED_graph);
|
||||
$mtd_ANSWERED_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$ANSWERED_graph);
|
||||
$mtd_ABANDONED_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$ABANDONED_graph);
|
||||
$mtd_ABANDONPCT_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$ABANDONPCT_graph);
|
||||
$mtd_AVGABANDONTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$AVGABANDONTIME_graph);
|
||||
$mtd_AVGANSWERSPEED_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$AVGANSWERSPEED_graph);
|
||||
$mtd_AVGTALKTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$AVGTALKTIME_graph);
|
||||
$mtd_TOTALTALKTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$TOTALTALKTIME_graph);
|
||||
$mtd_TOTALWRAPTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$TOTALWRAPTIME_graph);
|
||||
$mtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'MONTH-TO-DATE',$TOTALCALLTIME_graph);
|
||||
for ($q=0; $q<count($mtd_graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($mtd_graph_stats)) {$class=" last";} else {$class="";}
|
||||
$mtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][1]/$max_mtd_offered)."' height='16' />".$mtd_graph_stats[$q][1]."</td></tr>";
|
||||
$mtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][2]/$max_mtd_answered)."' height='16' />".$mtd_graph_stats[$q][2]."</td></tr>";
|
||||
$mtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][3]/$max_mtd_abandoned)."' height='16' />".$mtd_graph_stats[$q][3]."</td></tr>";
|
||||
$mtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][4]/$max_mtd_abandonpct)."' height='16' />".$mtd_graph_stats[$q][4]."%</td></tr>";
|
||||
$mtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][11]/$max_mtd_avgabandontime)."' height='16' />".$mtd_graph_stats[$q][5]."</td></tr>";
|
||||
$mtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][12]/$max_mtd_avganswerspeed)."' height='16' />".$mtd_graph_stats[$q][6]."</td></tr>";
|
||||
$mtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][16]/$max_mtd_avgtalktime)."' height='16' />".$mtd_graph_stats[$q][7]."</td></tr>";
|
||||
$mtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][15]/$max_mtd_totaltalktime)."' height='16' />".$mtd_graph_stats[$q][8]."</td></tr>";
|
||||
$mtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][13]/$max_mtd_totalwraptime)."' height='16' />".$mtd_graph_stats[$q][9]."</td></tr>";
|
||||
$mtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$mtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$mtd_graph_stats[$q][14]/$max_mtd_totalcalltime)."' height='16' />".$mtd_graph_stats[$q][10]."</td></tr>";
|
||||
$graph_totCALLSmtd+=$mtd_graph_stats[$q][1];
|
||||
$graph_totANSWERSmtd+=$mtd_graph_stats[$q][2];
|
||||
$graph_totABANDONSmtd+=$mtd_graph_stats[$q][3];
|
||||
$graph_totABANDONSpctmtd+=$mtd_graph_stats[$q][4];
|
||||
$graph_totABANDONSavgTIMEmtd+=$mtd_graph_stats[$q][5];
|
||||
$graph_totANSWERSavgspeedTIMEmtd+=$mtd_graph_stats[$q][6];
|
||||
$graph_totANSWERSavgTIMEmtd+=$mtd_graph_stats[$q][7];
|
||||
$graph_totANSWERStalkTIMEmtd+=$mtd_graph_stats[$q][8];
|
||||
$graph_totANSWERSwrapTIMEmtd+=$mtd_graph_stats[$q][9];
|
||||
$graph_totANSWERStotTIMEmtd+=$mtd_graph_stats[$q][10];
|
||||
}
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| MTD | $totCALLSmtd | $totANSWERSmtd | $totABANDONSmtd | $totABANDONSpctmtd%| $totABANDONSavgTIMEmtd | $totANSWERSavgspeedTIMEmtd | $totANSWERSavgTIMEmtd | $totANSWERStalkTIMEmtd | $totANSWERSwrapTIMEmtd | $totANSWERStotTIMEmtd |\n";
|
||||
$CSV_text.="\"MTD\",\"$totCALLSmtd\",\"$totANSWERSmtd\",\"$totABANDONSmtd\",\"$totABANDONSpctmtd%\",\"$totABANDONSavgTIMEmtd\",\"$totANSWERSavgspeedTIMEmtd\",\"$totANSWERSavgTIMEmtd\",\"$totANSWERStalkTIMEmtd\",\"$totANSWERSwrapTIMEmtd\",\"$totANSWERStotTIMEmtd\"\n";
|
||||
$totCALLSmtd=0;
|
||||
$totANSWERSmtd=0;
|
||||
@@ -1090,30 +1438,111 @@ else
|
||||
if ($totABANDONSqtd>0)
|
||||
{
|
||||
$totABANDONSavgTIMEqtd = sprintf("%7s", date("i:s", mktime(0, 0, round($totABANDONSsecqtd/$totABANDONSqtd))));
|
||||
if (round($totABANDONSsecqtd/$totABANDONSqtd)>$max_qtd_avgabandontime) {$max_qtd_avgabandontime=round($totABANDONSsecqtd/$totABANDONSqtd);}
|
||||
$qtd_graph_stats[$qa][11]=round($totABANDONSsecqtd/$totABANDONSqtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totABANDONSavgTIMEqtd = " 00:00";
|
||||
$qtd_graph_stats[$qa][11]=0;
|
||||
}
|
||||
if ($totANSWERSqtd>0)
|
||||
{
|
||||
$totANSWERSavgspeedTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSspeedqtd/$totANSWERSqtd))));
|
||||
$totANSWERSavgTIMEqtd = sprintf("%6s", date("i:s", mktime(0, 0, round($totANSWERSsecqtd/$totANSWERSqtd))));
|
||||
}
|
||||
if (round($totANSWERSspeedqtd/$totANSWERSqtd)>$max_qtd_avganswerspeed) {$max_qtd_avganswerspeed=round($totANSWERSspeedqtd/$totANSWERSqtd);}
|
||||
$qtd_graph_stats[$qa][12]=round($totANSWERSspeedqtd/$totANSWERSqtd);
|
||||
$qtd_graph_stats[$qa][16]=round($totANSWERSsecqtd/$totANSWERSqtd);
|
||||
}
|
||||
else
|
||||
{
|
||||
$totANSWERSavgspeedTIMEqtd = " 00:00";
|
||||
$totANSWERSavgTIMEqtd = " 00:00";
|
||||
$qtd_graph_stats[$qa][12]=0;
|
||||
$qtd_graph_stats[$qa][16]=0;
|
||||
}
|
||||
$totANSWERStalkTIMEqtd = sprintf("%10s", floor($totANSWERSsecqtd/3600).date(":i:s", mktime(0, 0, $totANSWERSsecqtd)));
|
||||
$totANSWERSwrapTIMEqtd = sprintf("%10s", floor(($totANSWERSqtd*15)/3600).date(":i:s", mktime(0, 0, ($totANSWERSqtd*15))));
|
||||
if (($totANSWERSqtd*15)>$max_qtd_totalwraptime) {$max_qtd_totalwraptime=($totANSWERSqtd*15);}
|
||||
$qtd_graph_stats[$qa][13]=($totANSWERSqtd*15);
|
||||
$qtd_graph_stats[$qa][14]=($totANSWERSsecqtd+($totANSWERSqtd*15));
|
||||
$qtd_graph_stats[$qa][15]=$totANSWERSsecqtd;
|
||||
$totANSWERStotTIMEqtd = sprintf("%10s", floor(($totANSWERSsecqtd+($totANSWERSqtd*15))/3600).date(":i:s", mktime(0, 0, ($totANSWERSsecqtd+($totANSWERSqtd*15)))));
|
||||
$totANSWERSqtd = sprintf("%8s", $totANSWERSqtd);
|
||||
$totABANDONSqtd = sprintf("%9s", $totABANDONSqtd);
|
||||
$totCALLSqtd = sprintf("%7s", $totCALLSqtd);
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |\n";
|
||||
if (trim($totCALLSqtd)>$max_qtd_offered) {$max_qtd_offered=trim($totCALLSqtd);}
|
||||
if (trim($totANSWERSqtd)>$max_qtd_answered) {$max_qtd_answered=trim($totANSWERSqtd);}
|
||||
if (trim($totABANDONSqtd)>$max_qtd_abandoned) {$max_qtd_abandoned=trim($totABANDONSqtd);}
|
||||
if (trim($totABANDONSpctqtd)>$max_qtd_abandonpct) {$max_qtd_abandonpct=trim($totABANDONSpctqtd);}
|
||||
|
||||
if (round($totANSWERSsecqtd/$totANSWERSqtd)>$max_qtd_avgtalktime) {$max_qtd_avgtalktime=round($totANSWERSsecqtd/$totANSWERSqtd);}
|
||||
if (trim($totANSWERSsecqtd)>$max_qtd_totaltalktime) {$max_qtd_totaltalktime=trim($totANSWERSsecqtd);}
|
||||
if (trim($totANSWERSsecqtd+($totANSWERSqtd*15))>$max_qtd_totalcalltime) {$max_qtd_totalcalltime=trim($totANSWERSsecqtd+($totANSWERSqtd*15));}
|
||||
|
||||
$month=date("m", strtotime($dayEND[$d-1]));
|
||||
$year=substr($dayEND[$d-1], 0, 4);
|
||||
$qtr1=array(01,02,03);
|
||||
$qtr2=array(04,05,06);
|
||||
$qtr3=array(07,08,09);
|
||||
$qtr4=array(10,11,12);
|
||||
if(in_array($month,$qtr1)) {
|
||||
$qtr="1st";
|
||||
} else if(in_array($month,$qtr2)) {
|
||||
$qtr="2nd";
|
||||
} else if(in_array($month,$qtr3)) {
|
||||
$qtr="3rd";
|
||||
} else if(in_array($month,$qtr4)) {
|
||||
$qtr="4th";
|
||||
}
|
||||
$qtd_graph_stats[$qa][0]="$qtr quarter, $year";
|
||||
$qtd_graph_stats[$qa][1]=trim($totCALLSqtd);
|
||||
$qtd_graph_stats[$qa][2]=trim($totANSWERSqtd);
|
||||
$qtd_graph_stats[$qa][3]=trim($totABANDONSqtd);
|
||||
$qtd_graph_stats[$qa][4]=trim($totABANDONSpctqtd);
|
||||
$qtd_graph_stats[$qa][5]=trim($totABANDONSavgTIMEqtd);
|
||||
$qtd_graph_stats[$qa][6]=trim($totANSWERSavgspeedTIMEqtd);
|
||||
$qtd_graph_stats[$qa][7]=trim($totANSWERSavgTIMEqtd);
|
||||
$qtd_graph_stats[$qa][8]=trim($totANSWERStalkTIMEqtd);
|
||||
$qtd_graph_stats[$qa][9]=trim($totANSWERSwrapTIMEqtd);
|
||||
$qtd_graph_stats[$qa][10]=trim($totANSWERStotTIMEqtd);
|
||||
$qtd_OFFERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$OFFERED_graph);
|
||||
$qtd_ANSWERED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ANSWERED_graph);
|
||||
$qtd_ABANDONED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONED_graph);
|
||||
$qtd_ABANDONPCT_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$ABANDONPCT_graph);
|
||||
$qtd_AVGABANDONTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGABANDONTIME_graph);
|
||||
$qtd_AVGANSWERSPEED_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGANSWERSPEED_graph);
|
||||
$qtd_AVGTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$AVGTALKTIME_graph);
|
||||
$qtd_TOTALTALKTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALTALKTIME_graph);
|
||||
$qtd_TOTALWRAPTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALWRAPTIME_graph);
|
||||
$qtd_TOTALCALLTIME_graph=preg_replace('/DAILY/', 'QUARTER-TO-DATE',$TOTALCALLTIME_graph);
|
||||
for ($q=0; $q<count($qtd_graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($qtd_graph_stats)) {$class=" last";} else {$class="";}
|
||||
$qtd_OFFERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][1]/$max_qtd_offered)."' height='16' />".$qtd_graph_stats[$q][1]."</td></tr>";
|
||||
$qtd_ANSWERED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][2]/$max_qtd_answered)."' height='16' />".$qtd_graph_stats[$q][2]."</td></tr>";
|
||||
$qtd_ABANDONED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][3]/$max_qtd_abandoned)."' height='16' />".$qtd_graph_stats[$q][3]."</td></tr>";
|
||||
$qtd_ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][4]/$max_qtd_abandonpct)."' height='16' />".$qtd_graph_stats[$q][4]."%</td></tr>";
|
||||
$qtd_AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][11]/$max_qtd_avgabandontime)."' height='16' />".$qtd_graph_stats[$q][5]."</td></tr>";
|
||||
$qtd_AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][12]/$max_qtd_avganswerspeed)."' height='16' />".$qtd_graph_stats[$q][6]."</td></tr>";
|
||||
$qtd_AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][16]/$max_qtd_avgtalktime)."' height='16' />".$qtd_graph_stats[$q][7]."</td></tr>";
|
||||
$qtd_TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][15]/$max_qtd_totaltalktime)."' height='16' />".$qtd_graph_stats[$q][8]."</td></tr>";
|
||||
$qtd_TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][13]/$max_qtd_totalwraptime)."' height='16' />".$qtd_graph_stats[$q][9]."</td></tr>";
|
||||
$qtd_TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$qtd_graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$qtd_graph_stats[$q][14]/$max_qtd_totalcalltime)."' height='16' />".$qtd_graph_stats[$q][10]."</td></tr>";
|
||||
$graph_totCALLSqtd+=$qtd_graph_stats[$q][1];
|
||||
$graph_totANSWERSqtd+=$qtd_graph_stats[$q][2];
|
||||
$graph_totABANDONSqtd+=$qtd_graph_stats[$q][3];
|
||||
$graph_totABANDONSpctqtd+=$qtd_graph_stats[$q][4];
|
||||
$graph_totABANDONSavgTIMEqtd+=$qtd_graph_stats[$q][5];
|
||||
$graph_totANSWERSavgspeedTIMEqtd+=$qtd_graph_stats[$q][6];
|
||||
$graph_totANSWERSavgTIMEqtd+=$qtd_graph_stats[$q][7];
|
||||
$graph_totANSWERStalkTIMEqtd+=$qtd_graph_stats[$q][8];
|
||||
$graph_totANSWERSwrapTIMEqtd+=$qtd_graph_stats[$q][9];
|
||||
$graph_totANSWERStotTIMEqtd+=$qtd_graph_stats[$q][10];
|
||||
}
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| QTD | $totCALLSqtd | $totANSWERSqtd | $totABANDONSqtd | $totABANDONSpctqtd%| $totABANDONSavgTIMEqtd | $totANSWERSavgspeedTIMEqtd | $totANSWERSavgTIMEqtd | $totANSWERStalkTIMEqtd | $totANSWERSwrapTIMEqtd | $totANSWERStotTIMEqtd |\n";
|
||||
$CSV_text.="\"QTD\",\"$totCALLSqtd\",\"$totANSWERSqtd\",\"$totABANDONSqtd\",\"$totABANDONSpctqtd%\",\"$totABANDONSavgTIMEqtd\",\"$totANSWERSavgspeedTIMEqtd\",\"$totANSWERSavgTIMEqtd\",\"$totANSWERStalkTIMEqtd\",\"$totANSWERSwrapTIMEqtd\",\"$totANSWERStotTIMEqtd\"\n";
|
||||
$totCALLSqtd=0;
|
||||
$totANSWERSqtd=0;
|
||||
@@ -1124,9 +1553,152 @@ else
|
||||
# }
|
||||
}
|
||||
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$MAIN.="| TOTALS | $FtotCALLS | $FtotANSWERS | $FtotABANDONS | $FtotABANDONSpct%| $FtotABANDONSavgTIME | $FtotANSWERSavgspeedTIME | $FtotANSWERSavgTIME | $FtotANSWERStalkTIME | $FtotANSWERSwrapTIME | $FtotANSWERStotTIME |\n";
|
||||
$MAIN.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
for ($q=0; $q<count($graph_stats); $q++) {
|
||||
if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$OFFERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_offered)."' height='16' />".$graph_stats[$q][1]."</td></tr>";
|
||||
$ANSWERED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][2]/$max_answered)."' height='16' />".$graph_stats[$q][2]."</td></tr>";
|
||||
$ABANDONED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][3]/$max_abandoned)."' height='16' />".$graph_stats[$q][3]."</td></tr>";
|
||||
$ABANDONPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][4]/$max_abandonpct)."' height='16' />".$graph_stats[$q][4]."%</td></tr>";
|
||||
$AVGABANDONTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][11]/$max_avgabandontime)."' height='16' />".$graph_stats[$q][5]."</td></tr>";
|
||||
$AVGANSWERSPEED_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][12]/$max_avganswerspeed)."' height='16' />".$graph_stats[$q][6]."</td></tr>";
|
||||
$AVGTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][16]/$max_avgtalktime)."' height='16' />".$graph_stats[$q][7]."</td></tr>";
|
||||
$TOTALTALKTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][15]/$max_totaltalktime)."' height='16' />".$graph_stats[$q][8]."</td></tr>";
|
||||
$TOTALWRAPTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][13]/$max_totalwraptime)."' height='16' />".$graph_stats[$q][9]."</td></tr>";
|
||||
$TOTALCALLTIME_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][14]/$max_totalcalltime)."' height='16' />".$graph_stats[$q][10]."</td></tr>";
|
||||
}
|
||||
$OFFERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
|
||||
$ANSWERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERS)."</th></tr></table>";
|
||||
$ABANDONED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONS)."</th></tr></table>";
|
||||
$ABANDONPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSpct)."%</th></tr></table>";
|
||||
$AVGABANDONTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSavgTIME)."</th></tr></table>";
|
||||
$AVGANSWERSPEED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgspeedTIME)."</th></tr></table>";
|
||||
$AVGTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgTIME)."</th></tr></table>";
|
||||
$TOTALTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStalkTIME)."</th></tr></table>";
|
||||
$TOTALWRAPTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSwrapTIME)."</th></tr></table>";
|
||||
$TOTALCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStotTIME)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawGraph('OFFERED', '1');\n";
|
||||
$JS_text.="function DrawGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var OFFERED_graph=\"$OFFERED_graph\";\n";
|
||||
$JS_text.=" var ANSWERED_graph=\"$ANSWERED_graph\";\n";
|
||||
$JS_text.=" var ABANDONED_graph=\"$ABANDONED_graph\";\n";
|
||||
$JS_text.=" var ABANDONPCT_graph=\"$ABANDONPCT_graph\";\n";
|
||||
$JS_text.=" var AVGABANDONTIME_graph=\"$AVGABANDONTIME_graph\";\n";
|
||||
$JS_text.=" var AVGANSWERSPEED_graph=\"$AVGANSWERSPEED_graph\";\n";
|
||||
$JS_text.=" var AVGTALKTIME_graph=\"$AVGTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALTALKTIME_graph=\"$TOTALTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALWRAPTIME_graph=\"$TOTALWRAPTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALCALLTIME_graph=\"$TOTALCALLTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=10; i++) {\n";
|
||||
$JS_text.=" var cellID=\"multigroup_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"multigroup_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$wtd_OFFERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
|
||||
$wtd_ANSWERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERS)."</th></tr></table>";
|
||||
$wtd_ABANDONED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONS)."</th></tr></table>";
|
||||
$wtd_ABANDONPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSpct)."%</th></tr></table>";
|
||||
$wtd_AVGABANDONTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSavgTIME)."</th></tr></table>";
|
||||
$wtd_AVGANSWERSPEED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgspeedTIME)."</th></tr></table>";
|
||||
$wtd_AVGTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgTIME)."</th></tr></table>";
|
||||
$wtd_TOTALTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStalkTIME)."</th></tr></table>";
|
||||
$wtd_TOTALWRAPTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSwrapTIME)."</th></tr></table>";
|
||||
$wtd_TOTALCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStotTIME)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawWTDGraph('OFFERED', '1');\n";
|
||||
$JS_text.="function DrawWTDGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var OFFERED_graph=\"$wtd_OFFERED_graph\";\n";
|
||||
$JS_text.=" var ANSWERED_graph=\"$wtd_ANSWERED_graph\";\n";
|
||||
$JS_text.=" var ABANDONED_graph=\"$wtd_ABANDONED_graph\";\n";
|
||||
$JS_text.=" var ABANDONPCT_graph=\"$wtd_ABANDONPCT_graph\";\n";
|
||||
$JS_text.=" var AVGABANDONTIME_graph=\"$wtd_AVGABANDONTIME_graph\";\n";
|
||||
$JS_text.=" var AVGANSWERSPEED_graph=\"$wtd_AVGANSWERSPEED_graph\";\n";
|
||||
$JS_text.=" var AVGTALKTIME_graph=\"$wtd_AVGTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALTALKTIME_graph=\"$wtd_TOTALTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALWRAPTIME_graph=\"$wtd_TOTALWRAPTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALCALLTIME_graph=\"$wtd_TOTALCALLTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=10; i++) {\n";
|
||||
$JS_text.=" var cellID=\"WTD_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"WTD_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('WTD_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$mtd_OFFERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
|
||||
$mtd_ANSWERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERS)."</th></tr></table>";
|
||||
$mtd_ABANDONED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONS)."</th></tr></table>";
|
||||
$mtd_ABANDONPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSpct)."%</th></tr></table>";
|
||||
$mtd_AVGABANDONTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSavgTIME)."</th></tr></table>";
|
||||
$mtd_AVGANSWERSPEED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgspeedTIME)."</th></tr></table>";
|
||||
$mtd_AVGTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgTIME)."</th></tr></table>";
|
||||
$mtd_TOTALTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStalkTIME)."</th></tr></table>";
|
||||
$mtd_TOTALWRAPTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSwrapTIME)."</th></tr></table>";
|
||||
$mtd_TOTALCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStotTIME)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawMTDGraph('OFFERED', '1');\n";
|
||||
$JS_text.="function DrawMTDGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var OFFERED_graph=\"$mtd_OFFERED_graph\";\n";
|
||||
$JS_text.=" var ANSWERED_graph=\"$mtd_ANSWERED_graph\";\n";
|
||||
$JS_text.=" var ABANDONED_graph=\"$mtd_ABANDONED_graph\";\n";
|
||||
$JS_text.=" var ABANDONPCT_graph=\"$mtd_ABANDONPCT_graph\";\n";
|
||||
$JS_text.=" var AVGABANDONTIME_graph=\"$mtd_AVGABANDONTIME_graph\";\n";
|
||||
$JS_text.=" var AVGANSWERSPEED_graph=\"$mtd_AVGANSWERSPEED_graph\";\n";
|
||||
$JS_text.=" var AVGTALKTIME_graph=\"$mtd_AVGTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALTALKTIME_graph=\"$mtd_TOTALTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALWRAPTIME_graph=\"$mtd_TOTALWRAPTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALCALLTIME_graph=\"$mtd_TOTALCALLTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=10; i++) {\n";
|
||||
$JS_text.=" var cellID=\"MTD_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"MTD_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('MTD_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$qtd_OFFERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotCALLS)."</th></tr></table>";
|
||||
$qtd_ANSWERED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERS)."</th></tr></table>";
|
||||
$qtd_ABANDONED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONS)."</th></tr></table>";
|
||||
$qtd_ABANDONPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSpct)."%</th></tr></table>";
|
||||
$qtd_AVGABANDONTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotABANDONSavgTIME)."</th></tr></table>";
|
||||
$qtd_AVGANSWERSPEED_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgspeedTIME)."</th></tr></table>";
|
||||
$qtd_AVGTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSavgTIME)."</th></tr></table>";
|
||||
$qtd_TOTALTALKTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStalkTIME)."</th></tr></table>";
|
||||
$qtd_TOTALWRAPTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERSwrapTIME)."</th></tr></table>";
|
||||
$qtd_TOTALCALLTIME_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($FtotANSWERStotTIME)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawQTDGraph('OFFERED', '1');\n";
|
||||
$JS_text.="function DrawQTDGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var OFFERED_graph=\"$qtd_OFFERED_graph\";\n";
|
||||
$JS_text.=" var ANSWERED_graph=\"$qtd_ANSWERED_graph\";\n";
|
||||
$JS_text.=" var ABANDONED_graph=\"$qtd_ABANDONED_graph\";\n";
|
||||
$JS_text.=" var ABANDONPCT_graph=\"$qtd_ABANDONPCT_graph\";\n";
|
||||
$JS_text.=" var AVGABANDONTIME_graph=\"$qtd_AVGABANDONTIME_graph\";\n";
|
||||
$JS_text.=" var AVGANSWERSPEED_graph=\"$qtd_AVGANSWERSPEED_graph\";\n";
|
||||
$JS_text.=" var AVGTALKTIME_graph=\"$qtd_AVGTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALTALKTIME_graph=\"$qtd_TOTALTALKTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALWRAPTIME_graph=\"$qtd_TOTALWRAPTIME_graph\";\n";
|
||||
$JS_text.=" var TOTALCALLTIME_graph=\"$qtd_TOTALCALLTIME_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=10; i++) {\n";
|
||||
$JS_text.=" var cellID=\"QTD_graph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"QTD_graph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('QTD_stats_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
|
||||
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$ASCII_text.="| TOTALS | $FtotCALLS | $FtotANSWERS | $FtotABANDONS | $FtotABANDONSpct%| $FtotABANDONSavgTIME | $FtotANSWERSavgspeedTIME | $FtotANSWERSavgTIME | $FtotANSWERStalkTIME | $FtotANSWERSwrapTIME | $FtotANSWERStotTIME |\n";
|
||||
$ASCII_text.="+-------------------------------------------+---------+----------+-----------+---------+---------+--------+--------+------------+------------+------------+\n";
|
||||
$CSV_text.="\"TOTALS\",\"$FtotCALLS\",\"$FtotANSWERS\",\"$FtotABANDONS\",\"$FtotABANDONSpct%\",\"$FtotABANDONSavgTIME\",\"$FtotANSWERSavgspeedTIME\",\"$FtotANSWERSavgTIME\",\"$FtotANSWERStalkTIME\",\"$FtotANSWERSwrapTIME\",\"$FtotANSWERStotTIME\"\n";
|
||||
|
||||
## FORMAT OUTPUT ##
|
||||
@@ -1157,6 +1729,19 @@ else
|
||||
$i++;
|
||||
}
|
||||
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$MAIN.=$JS_text.$GRAPH.$WTD_GRAPH.$MTD_GRAPH.$QTD_GRAPH;
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=$ASCII_text;
|
||||
}
|
||||
|
||||
if ($hi_hour_count < 1)
|
||||
{$hour_multiplier = 0;}
|
||||
else
|
||||
|
||||
@@ -6,13 +6,14 @@
|
||||
# QC statuses of QCFAIL, QCCANC and sales are defined by the Sale=Y status
|
||||
# flags being set on those statuses.
|
||||
#
|
||||
# Copyright (C) 2011 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
# 110802-2041 - First build
|
||||
# 110804-0049 - Added First Call Resolution
|
||||
# 111104-1259 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-1424 - Added new colums and PRECAL to System Time
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -411,6 +412,7 @@ if ($SUBMIT=="SUBMIT")
|
||||
$group_average_contact_time=0;
|
||||
$group_talk_time=0;
|
||||
$group_system_time=0;
|
||||
$group_nonpause_time=0;
|
||||
$group_calls=0;
|
||||
$group_leads=0;
|
||||
$group_contacts=0;
|
||||
@@ -434,10 +436,10 @@ if ($SUBMIT=="SUBMIT")
|
||||
if (mysql_num_rows($user_rslt)>0)
|
||||
{
|
||||
$j=0;
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | System Time | Talk Time | Sales | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="| Agent Name | Agent ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$CSV_text.="\"\",\"Agent Name\",\"Agent ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"\n";
|
||||
while ($user_row=mysql_fetch_array($user_rslt))
|
||||
{
|
||||
$j++;
|
||||
@@ -448,6 +450,7 @@ if ($SUBMIT=="SUBMIT")
|
||||
$leads=0;
|
||||
$system_time=0;
|
||||
$talk_time=0;
|
||||
$nonpause_time=0;
|
||||
# For each user
|
||||
$user=$user_row["user"];
|
||||
$sale_array[$user]+=0; # For agents with no sales logged
|
||||
@@ -468,28 +471,35 @@ if ($SUBMIT=="SUBMIT")
|
||||
$callback_row=mysql_fetch_row($callback_rslt);
|
||||
$callbacks=$callback_row[0];
|
||||
|
||||
$stat_stmt="select val.status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact";
|
||||
$stat_stmt="select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_statuses vs where val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and vs.status in (select status from vicidial_statuses) and val.campaign_id in ($group_SQL_str) group by status, customer_contact UNION select val.status, val.sub_status, vs.customer_contact, sum(val.talk_sec), sum(val.pause_sec), sum(val.wait_sec), sum(val.dispo_sec), sum(val.dead_sec), count(*) from vicidial_agent_log val, vicidial_campaign_statuses vs where val.campaign_id in ($group_SQL_str) and val.user='$user' and val.user_group='$user_group[$i]' and val.event_time>='$query_date' and val.event_time<='$end_date' and val.status=vs.status and val.campaign_id=vs.campaign_id and vs.status in (select distinct status from vicidial_campaign_statuses where ".substr($group_SQL, 4).") group by status, customer_contact";
|
||||
if ($DB) {$HTML_text.="$stat_stmt\n";}
|
||||
$stat_rslt=mysql_query($stat_stmt, $link);
|
||||
while ($stat_row=mysql_fetch_row($stat_rslt))
|
||||
{
|
||||
if ($stat_row[1]=="Y")
|
||||
if ($stat_row[2]=="Y")
|
||||
{
|
||||
$contacts+=$stat_row[7];
|
||||
$contact_talk_time+=($stat_row[2]-$stat_row[6]);
|
||||
$contacts+=$stat_row[8];
|
||||
$contact_talk_time+=($stat_row[3]-$stat_row[7]);
|
||||
|
||||
$group_contact_talk_time+=($stat_row[2]-$stat_row[6]);
|
||||
$group_contact_talk_time+=($stat_row[3]-$stat_row[7]);
|
||||
}
|
||||
# if ($stat_row[2]=="Y") {$callbacks+=$stat_row[8];}
|
||||
$calls+=$stat_row[7];
|
||||
$talk_time+=($stat_row[2]-$stat_row[6]);
|
||||
$system_time+=($stat_row[2]+$stat_row[4]+$stat_row[5]);
|
||||
$calls+=$stat_row[8];
|
||||
$talk_time+=($stat_row[3]-$stat_row[7]);
|
||||
$system_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]);
|
||||
$nonpause_time+=($stat_row[3]+$stat_row[5]+$stat_row[6]);
|
||||
if ($stat_row[1]=="PRECAL")
|
||||
{
|
||||
$nonpause_time+=$stat_row[4];
|
||||
}
|
||||
}
|
||||
$user_talk_time = sec_convert($talk_time,'H');
|
||||
$group_talk_time+=$talk_time;
|
||||
$user_system_time = sec_convert($system_time,'H');
|
||||
$talk_hours=$talk_time/3600;
|
||||
$group_system_time+=$system_time;
|
||||
$user_nonpause_time = sec_convert($nonpause_time,'H');
|
||||
$group_nonpause_time+=$nonpause_time;
|
||||
|
||||
if ($sale_array[$user]>0) {$average_sale_time=sec_convert(round($sales_talk_time_array[$user]/$sale_array[$user]), 'H');} else {$average_sale_time="00:00";}
|
||||
$group_sales_talk_time+=$sales_talk_time_array[$user];
|
||||
@@ -509,9 +519,19 @@ if ($SUBMIT=="SUBMIT")
|
||||
$contact_ratio="0.00";
|
||||
}
|
||||
$HTML_text.=" | ".sprintf("%12s", $contact_ratio)."%";
|
||||
$HTML_text.=" | ".sprintf("%13s", $user_nonpause_time);
|
||||
$HTML_text.=" | ".sprintf("%11s", $user_system_time);
|
||||
$HTML_text.=" | ".sprintf("%9s", $user_talk_time);
|
||||
$HTML_text.=" | ".sprintf("%5s", $sale_array[$user]); $group_sales+=$sale_array[$user];
|
||||
if ($nonpause_time>0)
|
||||
{
|
||||
$sales_per_working_hours=sprintf("%.2f", ($sale_array[$user]/($nonpause_time/3600)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sales_per_working_hours="0.00";
|
||||
}
|
||||
$HTML_text.=" | ".sprintf("%22s", $sales_per_working_hours);
|
||||
if ($leads>0)
|
||||
{
|
||||
$sales_ratio=sprintf("%.2f", (100*$sale_array[$user]/$leads));
|
||||
@@ -553,7 +573,7 @@ if ($SUBMIT=="SUBMIT")
|
||||
$HTML_text.=" | ".sprintf("%21s", $stcall); # first call resolution
|
||||
$HTML_text.=" | ".sprintf("%17s", $average_sale_time);
|
||||
$HTML_text.=" | ".sprintf("%20s", $average_contact_time)." |\n";
|
||||
$CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"\n";
|
||||
$CSV_text.="\"$j\",\"$user_row[full_name]\",\"$user\",\"$calls\",\"$leads\",\"$contacts\",\"$contact_ratio %\",\"$user_nonpause_time\",\"$user_system_time\",\"$user_talk_time\",\"$sale_array[$user]\",\"$sales_per_working_hours\",\"$sales_ratio\",\"$sale_contact_ratio\",\"$sales_per_hour\",\"$incomplete_array[$user]\",\"$cancel_array[$user]\",\"$callbacks\",\"$stcall\",\"$average_sale_time\",\"$average_contact_time\"\n";
|
||||
}
|
||||
|
||||
##### GROUP TOTALS #############
|
||||
@@ -578,7 +598,7 @@ if ($SUBMIT=="SUBMIT")
|
||||
$GROUP_text.="| ".sprintf("%40s", "$group_name");
|
||||
$GROUP_text.=" | ".sprintf("%10s", "$user_group[$i]");
|
||||
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="| ".sprintf("%40s", "");
|
||||
$HTML_text.=" | ".sprintf("%10s", "TOTALS:");
|
||||
|
||||
@@ -594,9 +614,19 @@ if ($SUBMIT=="SUBMIT")
|
||||
$group_contact_ratio="0.00";
|
||||
}
|
||||
$TOTAL_text.=" | ".sprintf("%12s", $group_contact_ratio)."%";
|
||||
$TOTAL_text.=" | ".sprintf("%13s", sec_convert($group_nonpause_time,'H'));
|
||||
$TOTAL_text.=" | ".sprintf("%11s", sec_convert($group_system_time,'H'));
|
||||
$TOTAL_text.=" | ".sprintf("%9s", sec_convert($group_talk_time,'H'));
|
||||
$TOTAL_text.=" | ".sprintf("%5s", $group_sales);
|
||||
if ($group_nonpause_time>0)
|
||||
{
|
||||
$sales_per_working_hours=sprintf("%.2f", ($group_sales/($group_nonpause_time/3600)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sales_per_working_hours="0.00";
|
||||
}
|
||||
$TOTAL_text.=" | ".sprintf("%22s", $sales_per_working_hours);
|
||||
if ($group_leads>0)
|
||||
{
|
||||
$group_sales_ratio=sprintf("%.2f", (100*$group_sales/$group_leads));
|
||||
@@ -642,17 +672,18 @@ if ($SUBMIT=="SUBMIT")
|
||||
$HTML_text.=$TOTAL_text;
|
||||
$GROUP_text.=$TOTAL_text;
|
||||
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="\n\n";
|
||||
|
||||
$CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"\n";
|
||||
$GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"\n";
|
||||
$CSV_text.="\"\",\"\",\"TOTALS:\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"\n";
|
||||
$GROUP_CSV_text.="\"$i\",\"$group_name\",\"$user_group[$i]\",\"$group_calls\",\"$group_leads\",\"$group_contacts\",\"$group_contact_ratio %\",\"".sec_convert($group_nonpause_time,'H')."\",\"".sec_convert($group_system_time,'H')."\",\"".sec_convert($group_talk_time,'H')."\",\"$group_sales\",\"$sales_per_working_hours\",\"$group_sales_ratio\",\"$group_sale_contact_ratio\",\"$group_sales_per_hour\",\"$group_inc_sales\",\"$group_cnc_sales\",\"$group_callbacks\",\"$group_stcall\",\"$group_average_sale_time\",\"$group_average_contact_time\"\n";
|
||||
$CSV_text.="\n\n";
|
||||
|
||||
$total_calls+=$group_calls;
|
||||
$total_leads+=$group_leads;
|
||||
$total_contacts+=$group_contacts;
|
||||
$total_system_time+=$group_system_time;
|
||||
$total_nonpause_time+=$group_nonpause_time;
|
||||
$total_talk_time+=$group_talk_time;
|
||||
$total_sales+=$group_sales;
|
||||
$total_inc_sales+=$group_inc_sales;
|
||||
@@ -672,11 +703,11 @@ if ($SUBMIT=="SUBMIT")
|
||||
}
|
||||
|
||||
$HTML_text.="--- <B>CALL CENTER TOTAL</B>\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="| Team Name | Team ID | Calls | Leads | Contacts | Contact Ratio | System Time | Talk Time | Sales | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="| Team Name | Team ID | Calls | Leads | Contacts | Contact Ratio | Nonpause Time | System Time | Talk Time | Sales | Sales per Working Hour | Sales to Leads Ratio | Sales to Contacts Ratio | Sales Per Hour | Incomplete Sales | Cancelled Sales | Callbacks | First Call Resolution | Average Sale Time | Average Contact Time |\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.=$GROUP_text;
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
|
||||
if ($total_sales>0)
|
||||
{
|
||||
@@ -710,9 +741,19 @@ if ($SUBMIT=="SUBMIT")
|
||||
$total_contact_ratio="0.00";
|
||||
}
|
||||
$HTML_text.=" | ".sprintf("%12s", $total_contact_ratio)."%";
|
||||
$HTML_text.=" | ".sprintf("%13s", sec_convert($total_nonpause_time,'H'));
|
||||
$HTML_text.=" | ".sprintf("%11s", sec_convert($total_system_time,'H'));
|
||||
$HTML_text.=" | ".sprintf("%9s", sec_convert($total_talk_time,'H'));
|
||||
$HTML_text.=" | ".sprintf("%5s", $total_sales);
|
||||
if ($total_nonpause_time>0)
|
||||
{
|
||||
$sales_per_working_hours=sprintf("%.2f", ($total_sales/($total_nonpause_time/3600)));
|
||||
}
|
||||
else
|
||||
{
|
||||
$sales_per_working_hours="0.00";
|
||||
}
|
||||
$HTML_text.=" | ".sprintf("%22s", $sales_per_working_hours);
|
||||
if ($total_leads>0)
|
||||
{
|
||||
$total_sales_ratio=sprintf("%.2f", (100*$total_sales/$total_leads));
|
||||
@@ -754,15 +795,15 @@ if ($SUBMIT=="SUBMIT")
|
||||
$HTML_text.=" | ".sprintf("%21s", $total_stcall); # first call resolution
|
||||
$HTML_text.=" | ".sprintf("%17s", $total_average_sale_time);
|
||||
$HTML_text.=" | ".sprintf("%20s", $total_average_contact_time)." |\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+-------------+-----------+-------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="+------------------------------------------+------------+-------+-------+----------+---------------+---------------+-------------+-----------+-------+------------------------+----------------------+-------------------------+----------------+------------------+-----------------+-----------+-----------------------+-------------------+----------------------+\n";
|
||||
$HTML_text.="</FONT></PRE>";
|
||||
$HTML_text.="</BODY>\n";
|
||||
$HTML_text.="</HTML>\n";
|
||||
|
||||
$CSV_text.="\"\",\"CALL CENTER TOTAL\"\n";
|
||||
$CSV_text.="\"\",\"Team Name\",\"Team ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"\n";
|
||||
$CSV_text.="\"\",\"Team Name\",\"Team ID\",\"Calls\",\"Leads\",\"Contacts\",\"Contact Ratio\",\"Nonpause Time\",\"System Time\",\"Talk Time\",\"Sales\",\"Sales per Working Hour\",\"Sales to Leads Ratio\",\"Sales to Contacts Ratio\",\"Sales Per Hour\",\"Incomplete Sales\",\"Cancelled Sales\",\"Callbacks\",\"First Call Resolution\",\"Average Sale Time\",\"Average Contact Time\"\n";
|
||||
$CSV_text.=$GROUP_CSV_text;
|
||||
$CSV_text.="\"\",\"\",\"TOTALS:\",\"$total_calls\",\"$total_leads\",\"$total_contacts\",\"$total_contact_ratio %\",\"".sec_convert($total_system_time,'H')."\",\"".sec_convert($total_talk_time,'H')."\",\"$total_sales\",\"$total_sales_ratio\",\"$total_sale_contact_ratio\",\"$total_sales_per_hour\",\"$total_inc_sales\",\"$total_cnc_sales\",\"$total_callbacks\",\"$total_stcall\",\"$total_average_sale_time\",\"$total_average_contact_time\"\n";
|
||||
$CSV_text.="\"\",\"\",\"TOTALS:\",\"$total_calls\",\"$total_leads\",\"$total_contacts\",\"$total_contact_ratio %\",\"".sec_convert($total_nonpause_time,'H')."\",\"".sec_convert($total_system_time,'H')."\",\"".sec_convert($total_talk_time,'H')."\",\"$total_sales\",\"$sales_per_working_hours\",\"$total_sales_ratio\",\"$total_sale_contact_ratio\",\"$total_sales_per_hour\",\"$total_inc_sales\",\"$total_cnc_sales\",\"$total_callbacks\",\"$total_stcall\",\"$total_average_sale_time\",\"$total_average_contact_time\"\n";
|
||||
}
|
||||
|
||||
if ($file_download>0)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_timeonVDADall.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||
#
|
||||
@@ -75,10 +75,11 @@
|
||||
# 110303-2125 - Added agent on-hook phone indication and RING status and color
|
||||
# 110314-1735 - Fixed another query that was causing load spikes on systems with millions of log entries
|
||||
# 111103-1220 - Added admin_hide_phone_data and admin_hide_lead_data options
|
||||
# 120223-1934 - Added user group options
|
||||
#
|
||||
|
||||
$version = '2.4-66';
|
||||
$build = '111103-1220';
|
||||
$version = '2.4-67';
|
||||
$build = '120223-1934';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -150,6 +151,8 @@ if (isset($_GET["RTuser"])) {$RTuser=$_GET["RTuser"];}
|
||||
elseif (isset($_POST["RTuser"])) {$RTuser=$_POST["RTuser"];}
|
||||
if (isset($_GET["RTpass"])) {$RTpass=$_GET["RTpass"];}
|
||||
elseif (isset($_POST["RTpass"])) {$RTpass=$_POST["RTpass"];}
|
||||
if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];}
|
||||
elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];}
|
||||
|
||||
|
||||
$report_name = 'Real-Time Main Report';
|
||||
@@ -184,6 +187,7 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if (!isset($RR)) {$RR=40;}
|
||||
if (!isset($group)) {$group='ALL-ACTIVE';}
|
||||
if (!isset($user_group_filter)) {$user_group_filter='';}
|
||||
if (!isset($usergroup)) {$usergroup='';}
|
||||
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
|
||||
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
|
||||
@@ -293,6 +297,86 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($auth)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfull_name =$row[3];
|
||||
$LOGuser_level =$row[4];
|
||||
$LOGuser_group =$row[5];
|
||||
$LOGdelete_users =$row[8];
|
||||
$LOGdelete_user_groups =$row[9];
|
||||
$LOGdelete_lists =$row[10];
|
||||
$LOGdelete_campaigns =$row[11];
|
||||
$LOGdelete_ingroups =$row[12];
|
||||
$LOGdelete_remote_agents =$row[13];
|
||||
$LOGload_leads =$row[14];
|
||||
$LOGcampaign_detail =$row[15];
|
||||
$LOGast_admin_access =$row[16];
|
||||
$LOGast_delete_phones =$row[17];
|
||||
$LOGdelete_scripts =$row[18];
|
||||
$LOGdelete_filters =$row[29];
|
||||
$LOGalter_agent_interface =$row[30];
|
||||
$LOGdelete_call_times =$row[32];
|
||||
$LOGmodify_call_times =$row[33];
|
||||
$LOGmodify_users =$row[34];
|
||||
$LOGmodify_campaigns =$row[35];
|
||||
$LOGmodify_lists =$row[36];
|
||||
$LOGmodify_scripts =$row[37];
|
||||
$LOGmodify_filters =$row[38];
|
||||
$LOGmodify_ingroups =$row[39];
|
||||
$LOGmodify_usergroups =$row[40];
|
||||
$LOGmodify_remoteagents =$row[41];
|
||||
$LOGmodify_servers =$row[42];
|
||||
$LOGview_reports =$row[43];
|
||||
$LOGmodify_dids =$row[56];
|
||||
$LOGdelete_dids =$row[57];
|
||||
$LOGmanager_shift_enforcement_override=$row[61];
|
||||
$LOGexport_reports =$row[64];
|
||||
$LOGdelete_from_dnc =$row[65];
|
||||
$LOGcallcard_admin =$row[70];
|
||||
$LOGforce_change_password =$row[71];
|
||||
$LOGmodify_shifts =$row[72];
|
||||
$LOGmodify_phones =$row[73];
|
||||
$LOGmodify_carriers =$row[74];
|
||||
$LOGmodify_labels =$row[75];
|
||||
$LOGmodify_statuses =$row[76];
|
||||
$LOGmodify_voicemail =$row[77];
|
||||
$LOGmodify_audiostore =$row[78];
|
||||
$LOGmodify_moh =$row[79];
|
||||
$LOGmodify_tts =$row[80];
|
||||
$LOGmodify_contacts =$row[81];
|
||||
$LOGmodify_same_user_level =$row[82];
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGadmin_viewable_groupsSQL='';
|
||||
$valLOGadmin_viewable_groupsSQL='';
|
||||
$vmLOGadmin_viewable_groupsSQL='';
|
||||
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
|
||||
{
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
|
||||
$LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
}
|
||||
else
|
||||
{$admin_viewable_groupsALL=1;}
|
||||
|
||||
}
|
||||
|
||||
# and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) )
|
||||
if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) )
|
||||
{
|
||||
@@ -373,6 +457,22 @@ while($i < $group_ct)
|
||||
}
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
|
||||
$i=0;
|
||||
$user_group_string='|';
|
||||
$user_group_ct = count($user_group_filter);
|
||||
while($i < $user_group_ct)
|
||||
{
|
||||
# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) )
|
||||
# {
|
||||
$user_group_string .= "$user_group_filter[$i]|";
|
||||
$user_group_SQL .= "'$user_group_filter[$i]',";
|
||||
$usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]";
|
||||
# }
|
||||
|
||||
$i++;
|
||||
}
|
||||
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
|
||||
|
||||
### if no campaigns selected, display all
|
||||
if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
{
|
||||
@@ -381,6 +481,13 @@ if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
$group = 'ALL-ACTIVE';
|
||||
$groupQS .= "&groups[]=ALL-ACTIVE";
|
||||
}
|
||||
### if no user groups selected, display all
|
||||
if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) )
|
||||
{
|
||||
$user_group_filter[0] = 'ALL-GROUPS';
|
||||
$user_group_string = '|ALL-GROUPS|';
|
||||
$usergroupQS .= "&user_group_filter[]=ALL-GROUPS";
|
||||
}
|
||||
|
||||
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
||||
{
|
||||
@@ -402,14 +509,40 @@ else
|
||||
$group_SQLand = "and campaign_id IN($group_SQL)";
|
||||
$group_SQLwhere = "where campaign_id IN($group_SQL)";
|
||||
}
|
||||
### USER GROUP STUFF
|
||||
if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) )
|
||||
{
|
||||
$all_active_groups = 0;
|
||||
$user_group_SQL = "''";
|
||||
# $user_group_SQLand = "and FALSE";
|
||||
# $user_group_SQLwhere = "where FALSE";
|
||||
}
|
||||
elseif ( eregi('ALL-GROUPS',$user_group_string) )
|
||||
{
|
||||
$all_active_groups = 1;
|
||||
# $user_group_SQL = '';
|
||||
$user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'";
|
||||
# $group_SQLand = "and campaign_id IN($allactivecampaigns)";
|
||||
# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$all_active_groups = 0;
|
||||
# $user_group_SQLand = "and user_group IN($user_group_SQL)";
|
||||
# $user_group_SQLwhere = "where user_group IN($user_group_SQL)";
|
||||
}
|
||||
|
||||
|
||||
$stmt="select user_group from vicidial_user_groups;";
|
||||
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$usergroups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$usergroups[$i]='ALL-GROUPS';
|
||||
$usergroupnames[$i] = 'All user groups';
|
||||
$i++;
|
||||
$usergroups_to_print++;
|
||||
while ($i < $usergroups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
@@ -436,6 +569,20 @@ while ($groups_to_print > $o)
|
||||
}
|
||||
$select_list .= "</SELECT>";
|
||||
$select_list .= "<BR><font size=1>(To select more than 1 campaign, hold down the Ctrl key and click)<font>";
|
||||
|
||||
$select_list .= "<BR><BR>Select User Groups: <BR>";
|
||||
$select_list .= "<SELECT SIZE=8 NAME=user_group_filter[] ID=user_group_filter[] multiple>";
|
||||
$o=0;
|
||||
while ($o < $usergroups_to_print)
|
||||
{
|
||||
if (ereg("\|$usergroups[$o]\|",$user_group_filter_string))
|
||||
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
|
||||
else
|
||||
{$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
|
||||
$o++;
|
||||
}
|
||||
$select_list .= "</SELECT>";
|
||||
|
||||
$select_list .= "</TD><TD VALIGN=TOP ALIGN=CENTER>";
|
||||
$select_list .= "<a href=\"#\" onclick=\"closeDiv(\'campaign_select_list\');\">Close Panel</a><BR><BR>";
|
||||
$select_list .= "<TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>";
|
||||
@@ -1600,7 +1747,7 @@ else
|
||||
|
||||
if ($adastats>1)
|
||||
{
|
||||
$min_link='<a href=\"$PHP_SELF?$groupQS&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a>';
|
||||
$min_link='<a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=4&DB=$DB&adastats=1\"><font size=1>- min </font></a>';
|
||||
if ($RTajax > 0)
|
||||
{$min_link='';}
|
||||
|
||||
@@ -1718,60 +1865,60 @@ if ($RTajax < 1)
|
||||
{
|
||||
if ($adastats<2)
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW MORE</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=2&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW MORE</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW LESS</font></a>";
|
||||
echo "<a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=1&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>+ VIEW LESS</font></a>";
|
||||
}
|
||||
if ($UGdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE USER GROUP</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=0&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE USER GROUP</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>VIEW USER GROUP</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=1&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>VIEW USER GROUP</font></a>";
|
||||
}
|
||||
if ($SERVdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE SERVER INFO</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=0&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE SERVER INFO</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW SERVER INFO</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=1&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW SERVER INFO</font></a>";
|
||||
}
|
||||
if ($CALLSdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE WAITING CALLS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=0&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE WAITING CALLS</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW WAITING CALLS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=1&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW WAITING CALLS</font></a>";
|
||||
}
|
||||
|
||||
if ($ALLINGROUPstats>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=0&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE IN-GROUP STATS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=0&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE IN-GROUP STATS</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=1&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW IN-GROUP STATS</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=1&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW IN-GROUP STATS</font></a>";
|
||||
}
|
||||
if ($PHONEdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=0&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE PHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=0&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE PHONES</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=1&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW PHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=1&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW PHONES</font></a>";
|
||||
}
|
||||
if ($CUSTPHONEdisplay>0)
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=0&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE CUSTPHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=0&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>HIDE CUSTPHONES</font></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=1&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW CUSTPHONES</font></a>";
|
||||
echo " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=1&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\"><font size=1>SHOW CUSTPHONES</font></a>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2048,13 +2195,13 @@ $HTbegin = "|";
|
||||
$HDstation = "----------------+";
|
||||
$HTstation = " STATION |";
|
||||
$HDphone = "-------------+";
|
||||
$HTphone = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">PHONE</a> |";
|
||||
$HTphone = " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$phoneord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">PHONE</a> |";
|
||||
if ($RTajax > 0)
|
||||
{$HTphone = " <a href=\"#\" onclick=\"update_variables('orderby','phone');\">PHONE</a> |";}
|
||||
$HDuser = "------------------------+";
|
||||
|
||||
|
||||
$HTuser = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER</a> ";
|
||||
$HTuser = " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$userord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER</a> ";
|
||||
if ($RTajax > 0)
|
||||
{$HTuser = " <a href=\"#\" onclick=\"update_variables('orderby','user');\">USER</a> ";}
|
||||
if ($UidORname>0)
|
||||
@@ -2063,7 +2210,7 @@ if ($UidORname>0)
|
||||
{$HTuser .= "<a href=\"#\" onclick=\"update_variables('UidORname','');\">SHOW ID</a> ";}
|
||||
else
|
||||
{
|
||||
$HTuser .= "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW ID</a> ";
|
||||
$HTuser .= "<a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=0&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW ID</a> ";
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2072,7 +2219,7 @@ else
|
||||
{$HTuser .= "<a href=\"#\" onclick=\"update_variables('UidORname','');\">SHOW NAME</a>";}
|
||||
else
|
||||
{
|
||||
$HTuser .= "<a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW NAME</a>";
|
||||
$HTuser .= "<a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=1&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SHOW NAME</a>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2080,7 +2227,7 @@ $HTuser .= " INFO |";
|
||||
|
||||
|
||||
$HDusergroup = "--------------+";
|
||||
$HTusergroup = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER GROUP</a> |";
|
||||
$HTusergroup = " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$groupord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">USER GROUP</a> |";
|
||||
if ($RTajax > 0)
|
||||
{$HTusergroup = " <a href=\"#\" onclick=\"update_variables('orderby','group');\">USER GROUP</a> |";}
|
||||
$HDsessionid = "------------------+";
|
||||
@@ -2096,11 +2243,11 @@ $HTserver_ip = " SERVER IP |";
|
||||
$HDcall_server_ip = "-----------------+";
|
||||
$HTcall_server_ip = " CALL SERVER IP |";
|
||||
$HDtime = "---------+";
|
||||
$HTtime = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">MM:SS</a> |";
|
||||
$HTtime = " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$timeord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">MM:SS</a> |";
|
||||
if ($RTajax > 0)
|
||||
{$HTtime = " <a href=\"#\" onclick=\"update_variables('orderby','time');\">MM:SS</a> |";}
|
||||
$HDcampaign = "------------+";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">CAMPAIGN</a> |";
|
||||
$HTcampaign = " <a href=\"$PHP_SELF?$usergroupQS$groupQS&RR=$RR&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$campaignord&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">CAMPAIGN</a> |";
|
||||
if ($RTajax > 0)
|
||||
{$HTcampaign = " <a href=\"#\" onclick=\"update_variables('orderby','campaign');\">CAMPAIGN</a> |";}
|
||||
$HDcalls = "-------+";
|
||||
@@ -2189,8 +2336,11 @@ else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";}
|
||||
if (strlen($usergroup)<1) {$usergroupSQL = '';}
|
||||
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
|
||||
|
||||
if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';}
|
||||
else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";}
|
||||
|
||||
$ring_agents=0;
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL order by $orderSQL;";
|
||||
$stmt="select extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user $UgroupSQL $usergroupSQL $user_group_filter_SQL order by $orderSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$talking_to_print = mysql_num_rows($rslt);
|
||||
|
||||
@@ -1724,6 +1724,11 @@ if (isset($_GET["territory_reset"])) {$territory_reset=$_GET["territory_reset"
|
||||
elseif (isset($_POST["territory_reset"])) {$territory_reset=$_POST["territory_reset"];}
|
||||
if (isset($_GET["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_GET["hopper_vlc_dup_check"];}
|
||||
elseif (isset($_POST["hopper_vlc_dup_check"])) {$hopper_vlc_dup_check=$_POST["hopper_vlc_dup_check"];}
|
||||
if (isset($_GET["inventory_report"])) {$inventory_report=$_GET["inventory_report"];}
|
||||
elseif (isset($_POST["inventory_report"])) {$inventory_report=$_POST["inventory_report"];}
|
||||
if (isset($_GET["report_rank"])) {$report_rank=$_GET["report_rank"];}
|
||||
elseif (isset($_POST["report_rank"])) {$report_rank=$_POST["report_rank"];}
|
||||
|
||||
|
||||
|
||||
if (isset($script_id)) {$script_id= strtoupper($script_id);}
|
||||
@@ -2009,6 +2014,7 @@ if ($non_latin < 1)
|
||||
$modify_same_user_level = ereg_replace("[^0-9]","",$modify_same_user_level);
|
||||
$admin_hide_lead_data = ereg_replace("[^0-9]","",$admin_hide_lead_data);
|
||||
$max_calls_count = ereg_replace("[^0-9]","",$max_calls_count);
|
||||
$report_rank = ereg_replace("[^0-9]","",$report_rank);
|
||||
|
||||
$drop_call_seconds = ereg_replace("[^-0-9]","",$drop_call_seconds);
|
||||
|
||||
@@ -2107,6 +2113,7 @@ if ($non_latin < 1)
|
||||
$completed = ereg_replace("[^NY]","",$completed);
|
||||
$report_option = ereg_replace("[^NY]","",$report_option);
|
||||
$hopper_vlc_dup_check = ereg_replace("[^NY]","",$hopper_vlc_dup_check);
|
||||
$inventory_report = ereg_replace("[^NY]","",$inventory_report);
|
||||
|
||||
$qc_enabled = ereg_replace("[^0-9NY]","",$qc_enabled);
|
||||
$active = ereg_replace("[^0-9NY]","",$active);
|
||||
@@ -3035,12 +3042,13 @@ else
|
||||
# 120207-1955 - Added List territory reset function
|
||||
# 120213-1512 - Added remote agent max stats display and campaign VLC hopper dup check option
|
||||
# 120221-0054 - Fixed Call Time and User Group restrictions on several pages
|
||||
# 120221-1647 - Added inventory report options to lists and shifts
|
||||
#
|
||||
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time
|
||||
|
||||
$admin_version = '2.4-360a';
|
||||
$build = '120221-0054';
|
||||
$admin_version = '2.4-361a';
|
||||
$build = '120221-1647';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -3097,7 +3105,7 @@ if ($force_logout)
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refresh,nocache_admin FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,auto_dial_limit,user_territories_active,allow_custom_dialplan,callcard_enabled,admin_modify_refresh,nocache_admin,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -3111,6 +3119,7 @@ if ($qm_conf_ct > 0)
|
||||
$SScallcard_enabled = $row[4];
|
||||
$SSadmin_modify_refresh = $row[5];
|
||||
$SSnocache_admin = $row[6];
|
||||
$SSwebroot_writable = $row[7];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -3135,7 +3144,7 @@ if ( ($reports_auth > 0) and ($auth < 1) )
|
||||
$reports_only_user=1;
|
||||
}
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($SSwebroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -3266,7 +3275,7 @@ if ( ($auth > 0) or ($reports_auth > 0) )
|
||||
$o++;
|
||||
}
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($SSwebroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfull_name|\n");
|
||||
fclose($fp);
|
||||
@@ -3297,9 +3306,9 @@ if ( ($auth > 0) or ($reports_auth > 0) )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($SSwebroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -5709,6 +5718,11 @@ if ($ADD==99999)
|
||||
<BR>
|
||||
<B>Xfer-Conf Number Override -</B> These five fields allow for you to override the Transfer Conference number presets when the lead is from this list. Default is blank.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_lists-inventory_report">
|
||||
<BR>
|
||||
<B>Inventory Report -</B> If the Inventory Report is enabled on your system, this option will determine whether this list is included in the report or not. Default is Y for yes.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_lists-time_zone_setting">
|
||||
<BR>
|
||||
@@ -6980,6 +6994,10 @@ if ($ADD==99999)
|
||||
<A NAME="vicidial_shifts-report_option">
|
||||
<B>Report Option -</B> This option allows this specific shift to show up in selected reports that support this option.
|
||||
|
||||
<BR>
|
||||
<A NAME="vicidial_shifts-report_rank">
|
||||
<B>Report Rank -</B> This option allows you to rank shifts in selected reports that support this option.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -15583,7 +15601,7 @@ if ($ADD==411)
|
||||
|
||||
echo "<br><B>LIST MODIFIED: $list_id</B>\n";
|
||||
|
||||
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting' where list_id='$list_id';";
|
||||
$stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override',campaign_cid_override='$campaign_cid_override',am_message_exten_override='$am_message_exten_override',drop_inbound_group_override='$drop_inbound_group_override',xferconf_a_number='$xferconf_a_number',xferconf_b_number='$xferconf_b_number',xferconf_c_number='$xferconf_c_number',xferconf_d_number='$xferconf_d_number',xferconf_e_number='$xferconf_e_number',web_form_address='" . mysql_real_escape_string($web_form_address) . "',web_form_address_two='" . mysql_real_escape_string($web_form_address_two) . "',time_zone_setting='$time_zone_setting',inventory_report='$inventory_report' where list_id='$list_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -16543,7 +16561,7 @@ if ($ADD==431111111)
|
||||
$p++;
|
||||
}
|
||||
$shift_start_time = preg_replace('/\D/', '', $shift_start_time);
|
||||
$stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays',report_option='$report_option',user_group='$user_group' where shift_id='$shift_id';";
|
||||
$stmt="UPDATE vicidial_shifts set shift_name='$shift_name', shift_start_time='$shift_start_time', shift_length='$shift_length', shift_weekdays='$SHIFT_weekdays',report_option='$report_option',user_group='$user_group',report_rank='$report_rank' where shift_id='$shift_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "<br><B>SHIFT MODIFIED</B>\n";
|
||||
@@ -24074,7 +24092,7 @@ if ($ADD==311)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override,campaign_cid_override,am_message_exten_override,drop_inbound_group_override,xferconf_a_number,xferconf_b_number,xferconf_c_number,xferconf_d_number,xferconf_e_number,web_form_address,web_form_address_two,time_zone_setting,inventory_report from vicidial_lists where list_id='$list_id' $LOGallowed_campaignsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$list_name = $row[1];
|
||||
@@ -24096,6 +24114,7 @@ if ($ADD==311)
|
||||
$web_form_address = $row[17];
|
||||
$web_form_address_two = $row[18];
|
||||
$time_zone_setting = $row[19];
|
||||
$inventory_report = $row[20];
|
||||
|
||||
# grab names of global statuses and statuses in the selected campaign
|
||||
$stmt="SELECT status,status_name,selectable,human_answered,category,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed from vicidial_statuses order by status;";
|
||||
@@ -24221,6 +24240,8 @@ if ($ADD==311)
|
||||
|
||||
echo "<tr bgcolor=#8EBCFD><td align=right>Transfer-Conf Number 5 Override: </td><td align=left><input type=text name=xferconf_e_number size=20 maxlength=50 value=\"$xferconf_e_number\">$NWB#vicidial_lists-xferconf_a_dtmf$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Inventory Report: </td><td align=left><select size=1 name=inventory_report><option>Y</option><option>N</option><option SELECTED>$inventory_report</option></select>$NWB#vicidial_lists-inventory_report$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Time Zone Setting: </td><td align=left><select size=1 name=time_zone_setting><option>COUNTRY_AND_AREA_CODE</option><option>POSTAL_CODE</option><option>NANPA_PREFIX</option><option>OWNER_TIME_ZONE_CODE</option><option SELECTED>$time_zone_setting</option></select>$NWB#vicidial_lists-time_zone_setting$NWE</td></tr>\n";
|
||||
|
||||
|
||||
@@ -27946,7 +27967,7 @@ if ($ADD==331111111)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays,report_option,user_group from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL;";
|
||||
$stmt="SELECT shift_id,shift_name,shift_start_time,shift_length,shift_weekdays,report_option,user_group,report_rank from vicidial_shifts where shift_id='$shift_id' $LOGadmin_viewable_groupsSQL;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$shift_name = $row[1];
|
||||
@@ -27955,6 +27976,7 @@ if ($ADD==331111111)
|
||||
$shift_weekdays = $row[4];
|
||||
$report_option = $row[5];
|
||||
$user_group = $row[6];
|
||||
$report_rank = $row[7];
|
||||
|
||||
$shift_start_hour = substr($shift_start_time,0,2);
|
||||
$shift_start_min = substr($shift_start_time,2,2);
|
||||
@@ -28016,6 +28038,16 @@ if ($ADD==331111111)
|
||||
echo ">Saturday<BR>\n";
|
||||
echo "</td></tr>\n";
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Report Option: </td><td align=left><select size=1 name=report_option><option>Y</option><option>N</option><option SELECTED>$report_option</option></select>$NWB#vicidial_shifts-report_option$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=right>Report Rank: </td><td align=left><select size=1 name=report_rank><option SELECTED>$report_rank</option>";
|
||||
$k=1;
|
||||
while ($k < 100)
|
||||
{
|
||||
echo "<option>$k</option>\n";
|
||||
$k++;
|
||||
}
|
||||
echo "</select>$NWB#vicidial_shifts-report_rank$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
|
||||
echo "</TABLE></center>\n";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# admin_campaign_multi_alt.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this screen will control the campaign settings needed for alternate number
|
||||
# dialing using multiple leads with the same account number and different phone
|
||||
@@ -12,10 +12,11 @@
|
||||
# changes:
|
||||
# 110317-1219 - First Build
|
||||
# 110406-1818 - Updated logging
|
||||
# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$admin_version = '2.4-2';
|
||||
$build = '110406-1818';
|
||||
$admin_version = '2.4-3';
|
||||
$build = '120223-2335';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -43,6 +44,21 @@ if (strlen($DB) < 1)
|
||||
{$DB=0;}
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ss_conf_ct = mysql_num_rows($rslt);
|
||||
if ($ss_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
@@ -61,20 +77,6 @@ $STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ss_conf_ct = mysql_num_rows($rslt);
|
||||
if ($ss_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_campaigns='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
@@ -88,7 +90,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$camp_multi=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -116,17 +118,17 @@ else
|
||||
$LOGmodify_campaigns = $row[1];
|
||||
$LOGuser_level = $row[2];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,11 @@
|
||||
# 110424-0926 - Added option for time zone code in the owner field
|
||||
# 110705-1947 - Added USACAN check for prefix and areacode
|
||||
# 120221-0140 - Added User Group restrictions
|
||||
# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$version = '2.4-42';
|
||||
$build = '120221-0140';
|
||||
$version = '2.4-43';
|
||||
$build = '120223-2318';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -154,7 +155,7 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -164,6 +165,7 @@ if ($qm_conf_ct > 0)
|
||||
$non_latin = $row[0];
|
||||
$admin_web_directory = $row[1];
|
||||
$custom_fields_enabled = $row[2];
|
||||
$webroot_writable = $row[3];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -192,7 +194,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
@@ -225,17 +227,17 @@ else
|
||||
echo "You do not have permissions to load leads\n";
|
||||
exit;
|
||||
}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
@@ -538,7 +540,7 @@ if ($OK_to_process)
|
||||
$total=0; $good=0; $bad=0; $dup=0; $post=0; $phone_list='';
|
||||
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
$stmt_file=fopen("listloader_stmts.txt", "w");
|
||||
}
|
||||
@@ -903,7 +905,7 @@ if ($OK_to_process)
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$lead_id = mysql_insert_id($link);
|
||||
if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
|
||||
@@ -919,7 +921,7 @@ if ($OK_to_process)
|
||||
### insert good record into vicidial_list table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -967,7 +969,7 @@ if ($OK_to_process)
|
||||
{
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
|
||||
@@ -1030,7 +1032,7 @@ if (($leadfile) && ($LF_path))
|
||||
$lead_file = "/tmp/vicidial_temp_file.txt";
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
$buffer=fgets($file, 4096);
|
||||
@@ -1318,7 +1320,7 @@ if (($leadfile) && ($LF_path))
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -1365,7 +1367,7 @@ if (($leadfile) && ($LF_path))
|
||||
{
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
### LOG INSERTION Admin Log Table ###
|
||||
@@ -1474,7 +1476,7 @@ if (($leadfile) && ($LF_path))
|
||||
$lead_file = "/tmp/vicidial_temp_file.txt";
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
$buffer=fgets($file, 4096);
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
# 110730-1106 - Added mysql reserved words check for add-field action
|
||||
# 111025-1432 - Fixed case sensitivity on list fields
|
||||
# 120122-1349 - Force vicidial_list custom field labels to be all lower case
|
||||
# 120223-2315 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$admin_version = '2.4-15';
|
||||
$build = '120122-1349';
|
||||
$admin_version = '2.4-16';
|
||||
$build = '120223-2315';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -79,6 +80,26 @@ if (isset($_GET["ConFiRm"])) {$ConFiRm=$_GET["ConFiRm"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,custom_fields_enabled FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$SScustom_fields_enabled = $row[4];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
if ( (strlen($action) < 2) and ($list_id > 99) )
|
||||
{$action = 'MODIFY_CUSTOM_FIELDS';}
|
||||
@@ -137,21 +158,6 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_
|
||||
$mysql_reserved_words =
|
||||
'|accessible|action|add|all|alter|analyze|and|as|asc|asensitive|before|between|bigint|binary|bit|blob|both|by|call|cascade|case|change|char|character|check|collate|column|condition|constraint|continue|convert|create|cross|current_date|current_time|current_timestamp|current_user|cursor|database|databases|date|day_hour|day_microsecond|day_minute|day_second|dec|decimal|declare|default|delayed|delete|desc|describe|deterministic|distinct|distinctrow|div|double|drop|dual|each|else|elseif|enclosed|enum|escaped|exists|exit|explain|false|fetch|float|float4|float8|for|force|foreign|from|fulltext|grant|group|having|high_priority|hour_microsecond|hour_minute|hour_second|if|ignore|in|index|infile|inner|inout|insensitive|insert|int|int1|int2|int3|int4|int8|integer|interval|into|is|iterate|join|key|keys|kill|leading|leave|left|like|limit|linear|lines|load|localtime|localtimestamp|lock|long|longblob|longtext|loop|low_priority|master_ssl_verify_server_cert|match|mediumblob|mediumint|mediumtext|middleint|minute_microsecond|minute_second|mod|modifies|mysql|natural|no|no_write_to_binlog|not|null|numeric|on|optimize|option|optionally|or|order|out|outer|outfile|precision|primary|procedure|purge|range|read|read_only|read_write|reads|real|references|regexp|release|remove|rename|repeat|replace|require|restrict|return|revoke|right|rlike|schema|schemas|second_microsecond|select|sensitive|separator|set|show|smallint|spatial|specific|sql|sql_big_result|sql_calc_found_rows|sql_small_result|sqlexception|sqlstate|sqlwarning|ssl|starting|straight_join|table|terminated|text|then|time|timestamp|tinyblob|tinyint|tinytext|to|trailing|trigger|true|undo|union|unique|unlock|unsigned|update|usage|use|using|utc_date|utc_time|utc_timestamp|values|varbinary|varchar|varcharacter|varying|when|where|while|with|write|xor|year_month|zerofill|';
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ss_conf_ct = mysql_num_rows($rslt);
|
||||
if ($ss_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$SScustom_fields_enabled = $row[1];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and modify_leads='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
@@ -159,7 +165,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -188,17 +194,17 @@ else
|
||||
$LOGcustom_fields_modify = $row[2];
|
||||
$LOGuser_level = $row[3];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# just needs to enter the leadID and then they can view and modify the
|
||||
# information in the record for that lead
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -45,6 +45,7 @@
|
||||
# 110215-1717 - Changed empty lead_id behavior to be add-a-lead functionality
|
||||
# 110525-1827 - Added ivr log records display
|
||||
# 111103-1533 - Added admin_hide_phone_data and admin_hide_lead_data options
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -164,7 +165,7 @@ $NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,custom_fields_enabled FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,custom_fields_enabled,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -173,6 +174,7 @@ if ($qm_conf_ct > 0)
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$custom_fields_enabled = $row[1];
|
||||
$webroot_writable = $row[2];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -201,7 +203,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -227,17 +229,17 @@ else
|
||||
$LOGadmin_hide_lead_data = $row[2];
|
||||
$LOGadmin_hide_phone_data = $row[3];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,10 +10,11 @@
|
||||
# 110712-0932 - Added extension suffix exception for non-SIP/IAX phones, added HELP
|
||||
# 120104-2023 - Added webphone options
|
||||
# 120209-1545 - Added phone context option
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$admin_version = '2.4-4';
|
||||
$build = '120209-1545';
|
||||
$admin_version = '2.4-5';
|
||||
$build = '120223-2249';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -93,14 +94,15 @@ $NOW_TIME = date("Y-m-d H:i:s");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$ss_conf_ct = mysql_num_rows($rslt);
|
||||
if ($ss_conf_ct > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -112,7 +114,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -141,17 +143,17 @@ else
|
||||
$LOGast_admin_access = $row[2];
|
||||
$LOGuser_level = $row[3];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
# 110218-1237 - Added vicidial_lead_search_log logging
|
||||
# 111103-1239 - Added admin_hide_phone_data and admin_hide_lead_data options
|
||||
# 120221-0118 - Added User Group campaign list restrictions to search queries
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -63,6 +64,26 @@ if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];}
|
||||
if (isset($_GET["alt_phone_search"])) {$alt_phone_search=$_GET["alt_phone_search"];}
|
||||
elseif (isset($_POST["alt_phone_search"])) {$alt_phone_search=$_POST["alt_phone_search"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
$phone = ereg_replace("[^0-9]","",$phone);
|
||||
@@ -80,7 +101,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
|
||||
$date = date("r");
|
||||
@@ -109,17 +130,17 @@ else
|
||||
$LOGadmin_hide_phone_data = $row[3];
|
||||
$LOGuser_group = $row[4];
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# closer-fronter_popup.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system.
|
||||
# CHANGES
|
||||
@@ -9,6 +9,7 @@
|
||||
# 60620-1020 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 61201-1114 - Added lead_id and user to recording_log entry
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -136,13 +137,13 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
{
|
||||
$office_no=strtoupper($user);
|
||||
$password=strtoupper($pass);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) )
|
||||
@@ -161,7 +162,7 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n");
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# closer-fronter_popup2.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system.
|
||||
# CHANGES
|
||||
@@ -9,6 +9,7 @@
|
||||
# 60620-1025 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 61201-1114 - Added lead_id and user to recording_log entry
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -148,13 +149,13 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
{
|
||||
$office_no=strtoupper($user);
|
||||
$password=strtoupper($pass);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|$pass|$ip|$browser|$LOGfullname|\n");
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user' and pass='$pass'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
if ( (strlen($customer_zap_channel)>2) and ( (eregi('zap',$customer_zap_channel)) or (eregi('iax',$customer_zap_channel)) ) )
|
||||
@@ -175,7 +176,7 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|$pass|$ip|$browser|\n");
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$user|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# closer.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available)
|
||||
# CHANGES
|
||||
@@ -9,6 +9,7 @@
|
||||
# 60620-1032 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -49,6 +50,26 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
@@ -57,44 +78,48 @@ $TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$popup_page = './closer_popup.php';
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# closer_dispo.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the closer disposition screen of a call that has been grabbed. This
|
||||
# allows the closer to modify customer information and disposition the call
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# 60619-1641 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -84,6 +85,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -98,45 +118,49 @@ $ext_context = 'demo';
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# closer_popup.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the closer popup of a specific call that grabs the call and allows you
|
||||
# to go and fetch info on that caller in the local CRM system.
|
||||
@@ -10,6 +10,7 @@
|
||||
#
|
||||
# 60620-1029 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -50,6 +51,27 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
@@ -64,45 +86,49 @@ $FILE_datetime = $STARTtime;
|
||||
|
||||
$ext_context = 'demo';
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,9 +239,9 @@ if ($parked_count > 0)
|
||||
|
||||
$stmt="UPDATE park_log set grab_time='$NOW_TIME',status='TALKING',extension='" . mysql_real_escape_string($extension) . "',user='$PHP_AUTH_USER' where parked_time='" . mysql_real_escape_string($parked_time) . "' and server_ip='" . mysql_real_escape_string($server_ip) . "' and channel='" . mysql_real_escape_string($channel) . "'";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$fp = fopen ("./closer_SQL_updates.txt", "a");
|
||||
fwrite ($fp, "$date|$PHP_AUTH_USER|$stmt|\n");
|
||||
fclose($fp);
|
||||
# $fp = fopen ("./closer_SQL_updates.txt", "a");
|
||||
# fwrite ($fp, "$date|$PHP_AUTH_USER|$stmt|\n");
|
||||
# fclose($fp);
|
||||
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
@@ -65,7 +65,7 @@ $conf_silent_prefix = '7';
|
||||
$local_AMP = '@';
|
||||
$ext_context = 'default';
|
||||
$recording_exten = '8309';
|
||||
$WeBRooTWritablE = '1';
|
||||
$webroot_writable = '0';
|
||||
$non_latin = '0'; # set to 1 for UTF rules
|
||||
$AM_shift_BEGIN = '03:45:00';
|
||||
$AM_shift_END = '17:45:00';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# fcstats.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -19,6 +19,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1828 - Added download option
|
||||
# 111104-1213 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -40,6 +41,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
@@ -49,6 +52,8 @@ if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$report_name = 'Fronter - Closer Report';
|
||||
$db_source = 'M';
|
||||
$JS_text="<script language='Javascript'>\n";
|
||||
$JS_onload="onload = function() {\n";
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -172,6 +177,7 @@ $HTML_head.=" </STYLE>\n";
|
||||
$HTML_head.="\n";
|
||||
$HTML_head.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HTML_head.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
|
||||
#if (strlen($group) > 0)
|
||||
# {
|
||||
@@ -218,6 +224,10 @@ $HTML_text.="<SELECT SIZE=1 NAME=group>\n";
|
||||
$o++;
|
||||
}
|
||||
$HTML_text.="</SELECT>\n";
|
||||
$HTML_text.=" ";
|
||||
$HTML_text.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$HTML_text.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n";
|
||||
$HTML_text.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$HTML_text.="<option selected value=\"$shift\">$shift</option>\n";
|
||||
$HTML_text.="<option value=\"\">--</option>\n";
|
||||
@@ -227,7 +237,7 @@ $HTML_text.="<option value=\"ALL\">ALL</option>\n";
|
||||
$HTML_text.="</SELECT>\n";
|
||||
$HTML_text.="<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
$HTML_text.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?query_date=$query_date&group=$group&shift=$shift&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?query_date=$query_date&group=$group&shift=$shift&file_download=1\">DOWNLOAD</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">MODIFY</a> | <a href=\"./admin.php?ADD=999999\">REPORTS</a><BR/>Display as:<BR><input type='radio' name='report_display_type' value='ASCII' checked>ASCII<BR/><input type='radio' name='report_display_type' value='HTML' >HTML<BR/></FONT>\n";
|
||||
$HTML_text.="</FORM>\n\n";
|
||||
|
||||
$HTML_text.="<PRE><FONT SIZE=2>\n\n";
|
||||
@@ -321,17 +331,37 @@ $CSV_fronter_header.="\"AGENT\",\"SUCCESS\",\"XFERS\",\"SUCCESS%\",\"SALE\",\"DR
|
||||
$CSV_fronter_lines="";
|
||||
$CSV_fronter_footer="";
|
||||
|
||||
$HTML_text.="\n";
|
||||
$HTML_text.="---------- FRONTER STATS\n";
|
||||
$HTML_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$HTML_text.="| AGENT |SUCCESS| XFERS |SUCCESS%| SALE | DROP |OTHER |\n";
|
||||
$HTML_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- FRONTER STATS\n";
|
||||
$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$ASCII_text.="| AGENT |SUCCESS| XFERS |SUCCESS%| SALE | DROP |OTHER |\n";
|
||||
$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
|
||||
######## GRAPHING #########
|
||||
$graph_stats=array();
|
||||
$max_success=1;
|
||||
$max_xfers=1;
|
||||
$max_success_pct=1;
|
||||
$max_sales=1;
|
||||
$max_drops=1;
|
||||
$max_other=1;
|
||||
$GRAPH="<a name='frontergraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='16%' class='grey_graph_cell' id='frontergraph1'><a href='#' onClick=\"DrawFronterGraph('SUCCESS', '1'); return false;\">SUCCESS</a></th><th width='17%' class='grey_graph_cell' id='frontergraph2'><a href='#' onClick=\"DrawFronterGraph('XFERS', '2'); return false;\">XFERS</a></th><th width='17%' class='grey_graph_cell' id='frontergraph3'><a href='#' onClick=\"DrawFronterGraph('SUCCESSPCT', '3'); return false;\">SUCCESS %</a></th><th width='16%' class='grey_graph_cell' id='frontergraph4'><a href='#' onClick=\"DrawFronterGraph('SALE', '4'); return false;\">SALE</a></th><th width='17%' class='grey_graph_cell' id='frontergraph5'><a href='#' onClick=\"DrawFronterGraph('DROP', '5'); return false;\">DROP</a></th><th width='17%' class='grey_graph_cell' id='frontergraph6'><a href='#' onClick=\"DrawFronterGraph('OTHER', '6'); return false;\">OTHER</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='6' class='graph_span_cell'><span id='fronter_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>FRONTER STATS</caption><tr><th class='thgraph' scope='col'>AGENT</th>";
|
||||
$SUCCESS_graph=$graph_header."<th class='thgraph' scope='col'>SUCCESS </th></tr>";
|
||||
$XFERS_graph=$graph_header."<th class='thgraph' scope='col'>XFERS</th></tr>";
|
||||
$SUCCESSPCT_graph=$graph_header."<th class='thgraph' scope='col'>SUCCESS %</th></tr>";
|
||||
$SALE_graph=$graph_header."<th class='thgraph' scope='col'>SALE</th></tr>";
|
||||
$DROP_graph=$graph_header."<th class='thgraph' scope='col'>DROP</th></tr>";
|
||||
$OTHER_graph=$graph_header."<th class='thgraph' scope='col'>OTHER</th></tr>";
|
||||
###########################
|
||||
|
||||
#$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;";
|
||||
$stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
@@ -354,7 +384,7 @@ while ($i < $users_to_print)
|
||||
$stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$names_to_print = mysql_num_rows($rslt);
|
||||
if ($names_to_print > 0)
|
||||
{
|
||||
@@ -375,7 +405,7 @@ while ($i < $users_to_print)
|
||||
$stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysql_real_escape_string($group) . "' and vx.campaign_id='" . mysql_real_escape_string($group) . "' and vx.user='$userRAW[$i]' and vc.lead_id=vx.lead_id and vc.xfercallid=vx.xfercallid group by vc.status;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$lead_ids_to_print = mysql_num_rows($rslt);
|
||||
$j=0;
|
||||
while ($j < $lead_ids_to_print)
|
||||
@@ -414,6 +444,19 @@ while ($i < $users_to_print)
|
||||
$Spct = round($Spct, 2);
|
||||
$Spct = sprintf("%01.2f", $Spct);
|
||||
|
||||
if ($sales>$max_success) {$max_success=$sales;}
|
||||
if ($USERcalls[$i]>$max_xfers) {$max_xfers=$USERcalls[$i];}
|
||||
if ($Spct>$max_success_pct) {$max_success_pct=$Spct;}
|
||||
if ($A1>$max_sales) {$max_sales=$A1;}
|
||||
if ($DROP>$max_drops) {$max_drops=$DROP;}
|
||||
if ($OTHER>$max_other) {$max_other=$OTHER;}
|
||||
$graph_stats[$i][0]="$user[$i] - $full_name[$i]";
|
||||
$graph_stats[$i][1]=$sales;
|
||||
$graph_stats[$i][2]=$USERcalls[$i];
|
||||
$graph_stats[$i][3]=$Spct;
|
||||
$graph_stats[$i][4]=$A1;
|
||||
$graph_stats[$i][5]=$DROP;
|
||||
$graph_stats[$i][6]=$OTHER;
|
||||
|
||||
$A1 = sprintf("%4s", $A1);
|
||||
$A2 = sprintf("%4s", $A2);
|
||||
@@ -429,7 +472,7 @@ while ($i < $users_to_print)
|
||||
$sales = sprintf("%5s", $sales);
|
||||
$Spct = sprintf("%6s", $Spct);
|
||||
|
||||
$HTML_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n";
|
||||
$ASCII_text.="| $user[$i] - $full_name[$i] | $sales | $USERcalls[$i] | $Spct%| $A1 | $DROP | $OTHER |\n";
|
||||
$CSV_fronter_lines.="\"$user[$i] - $full_name[$i]\",\"$sales\",\"$USERcalls[$i]\",\"$Spct%\",\"$A1\",\"$DROP\",\"$OTHER\"\n";
|
||||
|
||||
$i++;
|
||||
@@ -460,7 +503,7 @@ $totOTHER = sprintf("%5s", $totOTHER);
|
||||
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$row=mysql_fetch_row($rslt);
|
||||
|
||||
$AVGwait = $row[0];
|
||||
@@ -475,16 +518,49 @@ $AVGwait_MS = "$AVGwait_M_int:$AVGwait_S";
|
||||
$AVGwait = sprintf("%6s", $AVGwait_MS);
|
||||
|
||||
|
||||
$HTML_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$HTML_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n";
|
||||
$HTML_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$HTML_text.="| Average time in Queue for customers: $AVGwait |\n";
|
||||
$HTML_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$ASCII_text.="| TOTAL FRONTERS: $TOTagents | $TOTsales | $TOTcalls | $totSpct%|$totA1 |$totDROP |$totOTHER |\n";
|
||||
$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
$ASCII_text.="| Average time in Queue for customers: $AVGwait |\n";
|
||||
$ASCII_text.="+--------------------------+-------+--------+--------+------+------+------+\n";
|
||||
|
||||
$CSV_fronter_footer.="\"TOTAL FRONTERS: $TOTagents\",\"$TOTsales\",\"$TOTcalls\",\"$totSpct%\",\"$totA1\",\"$totDROP\",\"$totOTHER\"\n";
|
||||
$CSV_fronter_footer.="\"Average time in Queue for customers: $AVGwait\"\n\n\n";
|
||||
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$SUCCESS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_success)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$XFERS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_xfers)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
|
||||
$SUCCESSPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_success_pct)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
|
||||
$SALE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_sales)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
|
||||
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_drops)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
|
||||
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_other)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
|
||||
}
|
||||
$SUCCESS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTsales)."</th></tr></table>";
|
||||
$XFERS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$SUCCESSPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totSpct)."%</th></tr></table>";
|
||||
$SALE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totA1)."</th></tr></table>";
|
||||
$DROP_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totDROP)."</th></tr></table>";
|
||||
$OTHER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totOTHER)."</th></tr></table>";
|
||||
$JS_onload.="\tDrawFronterGraph('SUCCESS', '1');\n";
|
||||
$JS_text.="function DrawFronterGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var SUCCESS_graph=\"$SUCCESS_graph\";\n";
|
||||
$JS_text.=" var XFERS_graph=\"$XFERS_graph\";\n";
|
||||
$JS_text.=" var SUCCESSPCT_graph=\"$SUCCESSPCT_graph\";\n";
|
||||
$JS_text.=" var SALE_graph=\"$SALE_graph\";\n";
|
||||
$JS_text.=" var DROP_graph=\"$DROP_graph\";\n";
|
||||
$JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=6; i++) {\n";
|
||||
$JS_text.=" var cellID=\"frontergraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"frontergraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('fronter_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
##############################
|
||||
######### CLOSER STATS
|
||||
@@ -508,20 +584,38 @@ $CSV_closer_header="";
|
||||
$CSV_closer_lines="";
|
||||
$CSV_closer_footer="";
|
||||
|
||||
$HTML_text.="\n";
|
||||
$HTML_text.="---------- CLOSER STATS\n";
|
||||
$HTML_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$HTML_text.="| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n";
|
||||
$HTML_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$ASCII_text.="\n";
|
||||
$ASCII_text.="---------- CLOSER STATS\n";
|
||||
$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$ASCII_text.="| AGENT | CALLS | SALE | DROP |OTHER | SALE | CONV %|\n";
|
||||
$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
|
||||
$CSV_closer_header="\"CLOSER STATS\"\n";
|
||||
$CSV_closer_header.="\"AGENT\",\"CALLS\",\"SALE\",\"DROP\",\"OTHER\",\"SALE\",\"CONV %\"\n";
|
||||
|
||||
######## GRAPHING #########
|
||||
$max_calls=1;
|
||||
$max_sales=1;
|
||||
$max_drops=1;
|
||||
$max_other=1;
|
||||
$max_sales2=1;
|
||||
$max_conv_pct=1;
|
||||
$GRAPH="<BR><BR><a name='closergraph'/><table border='0' cellpadding='0' cellspacing='2' width='800'>";
|
||||
$GRAPH.="<tr><th width='16%' class='grey_graph_cell' id='closergraph1'><a href='#' onClick=\"DrawCloserGraph('CALLS', '1'); return false;\">CALLS</a></th><th width='17%' class='grey_graph_cell' id='closergraph2'><a href='#' onClick=\"DrawCloserGraph('SALES', '2'); return false;\">SALES</a></th><th width='17%' class='grey_graph_cell' id='closergraph3'><a href='#' onClick=\"DrawCloserGraph('DROP', '3'); return false;\">DROP</a></th><th width='16%' class='grey_graph_cell' id='closergraph4'><a href='#' onClick=\"DrawCloserGraph('OTHER', '4'); return false;\">OTHER</a></th><th width='17%' class='grey_graph_cell' id='closergraph5'><a href='#' onClick=\"DrawCloserGraph('SALES2', '5'); return false;\">SALES</a></th><th width='17%' class='grey_graph_cell' id='closergraph6'><a href='#' onClick=\"DrawCloserGraph('CONVPCT', '6'); return false;\">CONV %</a></th></tr>";
|
||||
$GRAPH.="<tr><td colspan='6' class='graph_span_cell'><span id='closer_graph'><BR> <BR></span></td></tr></table><BR><BR>";
|
||||
$graph_header="<table cellspacing='0' cellpadding='0' summary='STATUS' class='horizontalgraph'><caption align='top'>CLOSER STATS</caption><tr><th class='thgraph' scope='col'>AGENT</th>";
|
||||
$CALLS_graph=$graph_header."<th class='thgraph' scope='col'>CALLS </th></tr>";
|
||||
$SALES_graph=$graph_header."<th class='thgraph' scope='col'>SALES</th></tr>";
|
||||
$DROP_graph=$graph_header."<th class='thgraph' scope='col'>DROP</th></tr>";
|
||||
$OTHER_graph=$graph_header."<th class='thgraph' scope='col'>OTHER</th></tr>";
|
||||
$SALES2_graph=$graph_header."<th class='thgraph' scope='col'>SALES</th></tr>";
|
||||
$CONVPCT_graph=$graph_header."<th class='thgraph' scope='col'>CONV %</th></tr>";
|
||||
###########################
|
||||
|
||||
$stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user is not null group by user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$users_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $users_to_print)
|
||||
@@ -543,7 +637,7 @@ while ($i < $users_to_print)
|
||||
$stmt="select full_name from vicidial_users where user='$userRAW[$i]' $LOGadmin_viewable_groupsSQL;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$names_to_print = mysql_num_rows($rslt);
|
||||
if ($names_to_print > 0)
|
||||
{
|
||||
@@ -564,7 +658,7 @@ while ($i < $users_to_print)
|
||||
$stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysql_real_escape_string($group) . "' and user='$userRAW[$i]' group by status;";
|
||||
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$lead_ids_to_print = mysql_num_rows($rslt);
|
||||
$j=0;
|
||||
while ($j < $lead_ids_to_print)
|
||||
@@ -647,6 +741,19 @@ while ($i < $users_to_print)
|
||||
$ppc = sprintf("%01.2f", $ppc);
|
||||
$ppc = sprintf("%4s", $ppc);
|
||||
|
||||
if ($USERcalls[$i]>$max_calls) {$max_calls=$USERcalls[$i];}
|
||||
if ($A1>$max_sales) {$max_sales=$A1;}
|
||||
if ($DROP>$max_drops) {$max_drops=$DROP;}
|
||||
if ($OTHER>$max_other) {$max_other=$OTHER;}
|
||||
if ($sales>$max_sales2) {$max_sales=$sales;}
|
||||
if ($Cpct>$max_conv_pct) {$max_conv_pct=$Cpct;}
|
||||
$graph_stats[$i][0]="$user[$i] - $full_name[$i]";
|
||||
$graph_stats[$i][1]=$USERcalls[$i];
|
||||
$graph_stats[$i][2]=$A1;
|
||||
$graph_stats[$i][3]=$DROP;
|
||||
$graph_stats[$i][4]=$OTHER;
|
||||
$graph_stats[$i][5]=$sales;
|
||||
$graph_stats[$i][6]=$Cpct;
|
||||
|
||||
$A1 = sprintf("%4s", $A1);
|
||||
$A2 = sprintf("%4s", $A2);
|
||||
@@ -661,7 +768,7 @@ while ($i < $users_to_print)
|
||||
$OTHER = sprintf("%4s", $OTHER);
|
||||
$sales = sprintf("%4s", $sales);
|
||||
|
||||
$HTML_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n";
|
||||
$ASCII_text.="| $user[$i] - $full_name[$i] | $USERcalls[$i] | $A1 | $DROP | $OTHER | $sales |$Cpct%|\n";
|
||||
$CSV_closer_lines.="\"$user[$i] - $full_name[$i]\",\"$USERcalls[$i]\",\"$A1\",\"$DROP\",\"$OTHER\",\"$sales\",\"$Cpct%\"\n";
|
||||
|
||||
$i++;
|
||||
@@ -707,14 +814,59 @@ $totDROP = sprintf("%5s", $totDROP);
|
||||
$totOTHER = sprintf("%5s", $totOTHER);
|
||||
$TOTsales = sprintf("%5s", $TOTsales);
|
||||
|
||||
$HTML_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$HTML_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n";
|
||||
$HTML_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
$ASCII_text.="| TOTAL CLOSERS: $TOTagents | $TOTcalls |$totA1 |$totDROP |$totOTHER |$TOTsales |$totCpct%|\n";
|
||||
$ASCII_text.="+--------------------------+--------+------+------+------+------+-------+\n";
|
||||
|
||||
$CSV_closer_footer.="\"TOTAL CLOSERS: $TOTagents\",\"$TOTcalls\",\"$totA1\",\"$totDROP\",\"$totOTHER\",\"$TOTsales\",\"$totCpct%\"\n";
|
||||
|
||||
for ($d=0; $d<count($graph_stats); $d++) {
|
||||
if ($d==0) {$class=" first";} else if (($d+1)==count($graph_stats)) {$class=" last";} else {$class="";}
|
||||
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][1]/$max_calls)."' height='16' />".$graph_stats[$d][1]."</td></tr>";
|
||||
$SALES_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][2]/$max_sales)."' height='16' />".$graph_stats[$d][2]."</td></tr>";
|
||||
$DROP_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][3]/$max_drops)."' height='16' />".$graph_stats[$d][3]."</td></tr>";
|
||||
$OTHER_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][4]/$max_other)."' height='16' />".$graph_stats[$d][4]."</td></tr>";
|
||||
$SALES2_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][5]/$max_sales2)."' height='16' />".$graph_stats[$d][5]."</td></tr>";
|
||||
$CONVPCT_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$d][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$d][6]/$max_conv_pct)."' height='16' />".$graph_stats[$d][6]."%</td></tr>";
|
||||
}
|
||||
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTcalls)."</th></tr></table>";
|
||||
$SALES_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totA1)."</th></tr></table>";
|
||||
$DROP_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totDROP)."</th></tr></table>";
|
||||
$OTHER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totOTHER)."</th></tr></table>";
|
||||
$SALES2_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($TOTsales)."</th></tr></table>";
|
||||
$CONVPCT_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($totCpct)."%</th></tr></table>";
|
||||
$JS_onload.="\tDrawCloserGraph('CALLS', '1');\n";
|
||||
$JS_text.="function DrawCloserGraph(graph, th_id) {\n";
|
||||
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
|
||||
$JS_text.=" var SALES_graph=\"$SALES_graph\";\n";
|
||||
$JS_text.=" var DROP_graph=\"$DROP_graph\";\n";
|
||||
$JS_text.=" var OTHER_graph=\"$OTHER_graph\";\n";
|
||||
$JS_text.=" var SALES2_graph=\"$SALES2_graph\";\n";
|
||||
$JS_text.=" var CONVPCT_graph=\"$CONVPCT_graph\";\n";
|
||||
$JS_text.="\n";
|
||||
$JS_text.=" for (var i=1; i<=6; i++) {\n";
|
||||
$JS_text.=" var cellID=\"closergraph\"+i;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#DDDDDD';\n";
|
||||
$JS_text.=" }\n";
|
||||
$JS_text.=" var cellID=\"closergraph\"+th_id;\n";
|
||||
$JS_text.=" document.getElementById(cellID).style.backgroundColor='#999999';\n";
|
||||
$JS_text.=" var graph_to_display=eval(graph+\"_graph\");\n";
|
||||
$JS_text.=" document.getElementById('closer_graph').innerHTML=graph_to_display;\n";
|
||||
$JS_text.="}\n";
|
||||
$GRAPH_text.=$GRAPH;
|
||||
|
||||
|
||||
$ENDtime = date("U");
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$HTML_text.=$GRAPH_text;
|
||||
}
|
||||
else
|
||||
{
|
||||
$HTML_text.=$ASCII_text;
|
||||
}
|
||||
|
||||
if ($DB) {$HTML_text.="\nRun Time: $RUNtime seconds|$db_source\n";}
|
||||
|
||||
$HTML_text.="</PRE>\n";
|
||||
@@ -746,7 +898,12 @@ if ($file_download > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
$JS_onload.="}\n";
|
||||
$JS_text.=$JS_onload;
|
||||
$JS_text.="</script>\n";
|
||||
|
||||
echo $HTML_head;
|
||||
echo $JS_text;
|
||||
require("admin_header.php");
|
||||
echo $HTML_text;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# 90310-2138 - Added admin header
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120221-0159 - Added User Group restrictions
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -107,13 +108,19 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
$LOGfullname = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
td.value {
|
||||
background-image: url(images/gridline58.gif);
|
||||
background-repeat: repeat-x;
|
||||
background-position: left top;
|
||||
border-left: 1px solid #e5e5e5;
|
||||
border-right: 1px solid #e5e5e5;
|
||||
padding:0;
|
||||
border-bottom: none;
|
||||
background-color:transparent;
|
||||
}
|
||||
td.graph {
|
||||
padding: 4px 6px;
|
||||
border-bottom:1px solid #e5e5e5;
|
||||
border-left:1px solid #e5e5e5;
|
||||
background-color:#fff;
|
||||
}
|
||||
td.value img {
|
||||
vertical-align: middle;
|
||||
margin: 2px 2px 2px 0;
|
||||
height: 10px;
|
||||
}
|
||||
th.thgraph {
|
||||
text-align: left;
|
||||
vertical-align:top;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 60%;
|
||||
}
|
||||
.grey_graph_cell {
|
||||
background-color:#ddd;
|
||||
}
|
||||
.graph_span_cell {
|
||||
background-color:#eee;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
th.column_header {
|
||||
text-align: left;
|
||||
vertical-align:top;
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 70%;
|
||||
}
|
||||
td.chart_td {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size: 60%;
|
||||
white-space:nowrap;
|
||||
padding-right: 10px;
|
||||
}
|
||||
td.last {
|
||||
border-bottom:1px solid #e5e5e5;
|
||||
}
|
||||
td.first {
|
||||
border-top:1px solid #e5e5e5;
|
||||
}
|
||||
.auraltext
|
||||
{
|
||||
position: absolute;
|
||||
font-size: 0;
|
||||
left: -1000px;
|
||||
}
|
||||
table.horizontalgraph {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
background-image:url(images/bg_fade2.png);
|
||||
background-position:left top;
|
||||
width: 33em;
|
||||
}
|
||||
caption {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
font-size:90%;
|
||||
font-style:italic;
|
||||
}
|
||||
|
||||
.overlap_barGraph {
|
||||
font-family: Verdana, Arial, Helvetica, sans-serif;
|
||||
text-align: left;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.overlap_barGraph li {
|
||||
background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right;
|
||||
border: 1px solid #555;
|
||||
border-bottom: none;
|
||||
bottom: 0.01em;
|
||||
color: #FFF;
|
||||
margin: 0;
|
||||
padding: 0 0 0 0;
|
||||
position: absolute;
|
||||
list-style: none;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.overlap_barGraph li.p1{
|
||||
background: #999 url(images/bar.png) repeat-x top right;
|
||||
color: #FFF;
|
||||
white-space:nowrap;
|
||||
font-weight: bold;
|
||||
}
|
||||
.overlap_barGraph li.p2{
|
||||
background: #666 url(images/bar_blue.png) repeat-x top right;
|
||||
color: #FFF;
|
||||
white-space:nowrap;
|
||||
font-weight: bold;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 204 B |
Binary file not shown.
|
After Width: | Height: | Size: 201 B |
Binary file not shown.
|
After Width: | Height: | Size: 203 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
@@ -0,0 +1,183 @@
|
||||
/* This notice must remain at all times.
|
||||
|
||||
graph.js
|
||||
Copyright (c) Balamurugan S, 2005. sbalamurugan @ hotmail.com
|
||||
Development support by Jexp, Inc http://www.jexp.com
|
||||
|
||||
This package is free software. It is distributed under GPL - legalese removed, it means that you can use this for any purpose, but cannot charge for this software. Any enhancements you make to this piece of code, should be made available free to the general public!
|
||||
|
||||
Latest version can be downloaded from http://www.sbmkpm.com
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
line.js provides a simple mechanism to draw line graphs. It uses
|
||||
wz_jsgraphics.js which is copyright of its author.
|
||||
|
||||
Usage:
|
||||
var g = new line_graph();
|
||||
g.add("title1",value);
|
||||
g.add("title2",value2);
|
||||
|
||||
g.render("canvas_name", "graph title");
|
||||
|
||||
//where canvas_name is a div defined INSIDE body tag
|
||||
<body>
|
||||
<div id="canvas_name" style="overflow: auto; position:relative;height:300px;width:400px;"></div>
|
||||
|
||||
|
||||
*/
|
||||
|
||||
hD="0123456789ABCDEF";
|
||||
|
||||
function d2h(d)
|
||||
{
|
||||
var h = hD.substr(d&15,1);
|
||||
while(d>15) {d>>=4;h=hD.substr(d&15,1)+h;}
|
||||
return h;
|
||||
}
|
||||
|
||||
function h2d(h)
|
||||
{
|
||||
return parseInt(h,16);
|
||||
}
|
||||
|
||||
function line_graph(dw)
|
||||
{
|
||||
this.ct = 0;
|
||||
|
||||
this.data = new Array();
|
||||
this.x_name = new Array();
|
||||
this.max = -64000; //MAX INT
|
||||
|
||||
this.c_array = new Array();
|
||||
this.c_array[0] = new Array(255, 192, 95);
|
||||
this.c_array[1] = new Array(80, 127, 175);
|
||||
this.c_array[2] = new Array(159, 87, 112);
|
||||
this.c_array[3] = new Array(111, 120, 96);
|
||||
this.c_array[4] = new Array(224, 119, 96);
|
||||
this.c_array[5] = new Array(80, 159, 144);
|
||||
this.c_array[6] = new Array(207, 88, 95);
|
||||
this.c_array[7] = new Array(64, 135, 96);
|
||||
this.c_array[8] = new Array(239, 160, 95);
|
||||
this.c_array[9] = new Array(144, 151, 80);
|
||||
this.c_array[10] = new Array(255, 136, 80);
|
||||
|
||||
this.getColor = function()
|
||||
{
|
||||
if(this.ct >= (this.c_array.length-1))
|
||||
this.ct = 0;
|
||||
else
|
||||
this.ct++;
|
||||
|
||||
return "#" + d2h(this.c_array[this.ct][0]) + d2h(this.c_array[this.ct][1]) + d2h(this.c_array[this.ct][2]);
|
||||
}
|
||||
|
||||
|
||||
this.add = function(x_name, value)
|
||||
{
|
||||
this.x_name.push(x_name);
|
||||
this.data.push(parseInt(value,10));
|
||||
|
||||
if(value > this.max)
|
||||
this.max = parseInt(value,10);
|
||||
}
|
||||
|
||||
this.render = function(canvas, title)
|
||||
{
|
||||
var jg = new jsGraphics(canvas);
|
||||
|
||||
var h = 250;
|
||||
var sx = 40;
|
||||
// var dw = 6;
|
||||
var shadow = 0;
|
||||
var fnt = 8;
|
||||
|
||||
var rtmax = sx + 10 + (dw+Math.round((dw/2))+shadow)*(this.data.length);
|
||||
|
||||
// Draw markers
|
||||
var i;
|
||||
jg.setColor("black");
|
||||
for(i = 1 ; i <= 5 ; i++)
|
||||
{
|
||||
|
||||
// Joe J - tweak to make the y-axis intervals less nutty
|
||||
if (this.max<=50) {
|
||||
while (this.max%5!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=100) {
|
||||
while (this.max%10!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=250) {
|
||||
while (this.max%25!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=500) {
|
||||
while (this.max%50!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=1000) {
|
||||
while (this.max%100!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=2500) {
|
||||
while (this.max%250!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else if (this.max<=5000) {
|
||||
while (this.max%500!=0) {
|
||||
this.max++;
|
||||
}
|
||||
} else {
|
||||
while (this.max%1000!=0) {
|
||||
this.max++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
jg.drawLine(0,Math.round((h/5*i)),rtmax+20,Math.round((h/5*i)));
|
||||
var ff = Math.round(this.max - (this.max / 5 * i));
|
||||
jg.drawString(ff,4,Math.round((h/5*i)-2));
|
||||
}
|
||||
|
||||
// Draw the bar graph
|
||||
var color = this.getColor();
|
||||
var oldx, oldy;
|
||||
jg.setStroke(1);
|
||||
|
||||
for(i = 0; i < this.data.length; i++)
|
||||
{
|
||||
var ht1 = Math.round(this.data[i]*h/this.max);
|
||||
|
||||
if (this.x_name[i].match(/\+/))
|
||||
{
|
||||
sx+=(2*dw);
|
||||
}
|
||||
|
||||
if(i >= 1)
|
||||
{
|
||||
jg.setColor(color);
|
||||
jg.drawLine(oldx, h-oldy, sx, h-ht1);
|
||||
}
|
||||
|
||||
jg.setColor("red");
|
||||
jg.fillEllipse(sx-2, h-ht1-2, 5, 5);
|
||||
|
||||
jg.setColor("black");
|
||||
jg.drawString(this.x_name[i], sx, h);
|
||||
|
||||
oldx = sx;
|
||||
oldy = ht1;
|
||||
|
||||
sx = sx+dw+Math.round(dw/2)+shadow;
|
||||
}
|
||||
|
||||
jg.setFont("Verdana", fnt, Font.BOLD);
|
||||
jg.drawStringRect(title, 0, h+fnt+4, rtmax+20, "left");
|
||||
jg.paint();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# listloaderMAIN.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the main frame page for the lead loading section. This is where you
|
||||
# would upload a file and have it inserted into vicidial_list
|
||||
@@ -10,6 +10,7 @@
|
||||
# 60620-1149 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 60822-1105 - fixed for nonwritable directories
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -18,6 +19,26 @@ $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
@@ -32,12 +53,12 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-LEAD-LOADER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -51,27 +72,27 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGload_leads =$row[0];
|
||||
$stmt="SELECT load_leads from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGload_leads =$row[0];
|
||||
|
||||
if ($LOGload_leads < 1)
|
||||
{
|
||||
echo "You do not have permissions to load leads\n";
|
||||
exit;
|
||||
}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# new_listloader_superL.php
|
||||
#
|
||||
# Copyright (C) 2010 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# AST GUI lead loader from formatted file
|
||||
#
|
||||
@@ -34,11 +34,12 @@
|
||||
# 100630-1609 - Added a check for invalid ListIds and filtered out ' " ; ` \ from the field <mikec>
|
||||
# 100705-1507 - Added custom fields to field chooser, only when liast_id_override is used and only with TXT and CSV file formats
|
||||
# 100712-1416 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any
|
||||
# 120223-2148 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
# make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time.
|
||||
|
||||
$version = '2.4-37';
|
||||
$build = '100712-1416';
|
||||
$version = '2.4-38';
|
||||
$build = '120223-2148';
|
||||
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -143,7 +144,7 @@ $vicidial_list_fields = '|lead_id|vendor_lead_code|source_id|list_id|gmt_offset_
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,admin_web_directory,custom_fields_enabled,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -153,6 +154,7 @@ if ($qm_conf_ct > 0)
|
||||
$non_latin = $row[0];
|
||||
$admin_web_directory = $row[1];
|
||||
$custom_fields_enabled = $row[2];
|
||||
$webroot_writable = $row[3];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -181,7 +183,7 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if ($WeBRooTWritablE > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
if ($webroot_writable > 0) {$fp = fopen ("./project_auth_entries.txt", "a");}
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
@@ -213,17 +215,17 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
echo "You do not have permissions to load leads\n";
|
||||
exit;
|
||||
}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "LIST_LOAD|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "LIST_LOAD|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -409,7 +411,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) {
|
||||
# copy($leadfile, "./vicidial_temp_file.txt");
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
$stmt_file=fopen("listloader_stmts.txt", "w");
|
||||
}
|
||||
@@ -724,7 +726,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$lead_id = mysql_insert_id($link);
|
||||
if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
|
||||
@@ -740,7 +742,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
### insert good record into vicidial_list table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -778,7 +780,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
if ($multi_insert_counter!=0) {
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
|
||||
@@ -813,7 +815,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
# copy($leadfile, "./vicidial_temp_file.csv");
|
||||
$file=fopen("$lead_file", "r");
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
|
||||
@@ -1112,7 +1114,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
$affected_rows = mysql_affected_rows($link);
|
||||
$lead_id = mysql_insert_id($link);
|
||||
if ($DB > 0) {echo "<!-- $affected_rows|$lead_id|$stmtZ -->";}
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
|
||||
@@ -1128,7 +1130,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -1164,7 +1166,7 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
if ($multi_insert_counter!=0) {
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
print "<BR><BR>Done</B> GOOD: $good BAD: $bad TOTAL: $total</font></center>";
|
||||
@@ -1187,7 +1189,7 @@ if ($leadfile) {
|
||||
|
||||
if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name)) {
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt");
|
||||
$lead_file = "./vicidial_temp_file.txt";
|
||||
@@ -1198,7 +1200,7 @@ if ($leadfile) {
|
||||
$lead_file = "/tmp/vicidial_temp_file.txt";
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
$buffer=fgets($file, 4096);
|
||||
@@ -1443,7 +1445,7 @@ if ($leadfile) {
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -1479,7 +1481,7 @@ if ($leadfile) {
|
||||
if ($multi_insert_counter!=0) {
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
|
||||
@@ -1490,7 +1492,7 @@ if ($leadfile) {
|
||||
}
|
||||
} else if (!eregi(".csv", $leadfile_name))
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls");
|
||||
$lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls";
|
||||
@@ -1515,7 +1517,7 @@ if ($leadfile) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv");
|
||||
$lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv";
|
||||
@@ -1526,7 +1528,7 @@ if ($leadfile) {
|
||||
$lead_file = "/tmp/vicidial_temp_file.csv";
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
|
||||
@@ -1754,7 +1756,7 @@ if ($leadfile) {
|
||||
### insert good deal into pending_transactions table ###
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments',0,'2008-01-01 00:00:00','$rank','$owner','0');";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
$multistmt='';
|
||||
$multi_insert_counter=0;
|
||||
@@ -1789,7 +1791,7 @@ if ($leadfile) {
|
||||
if ($multi_insert_counter!=0) {
|
||||
$stmtZ = "INSERT INTO vicidial_list (lead_id,entry_date,modify_date,status,user,vendor_lead_code,source_id,list_id,gmt_offset_now,called_since_last_reset,phone_code,phone_number,title,first_name,middle_initial,last_name,address1,address2,address3,city,state,province,postal_code,country_code,gender,date_of_birth,alt_phone,email,security_phrase,comments,called_count,last_local_call_time,rank,owner,entry_list_id) values".substr($multistmt, 0, -1).";";
|
||||
mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
}
|
||||
|
||||
@@ -1865,7 +1867,7 @@ if ($leadfile) {
|
||||
|
||||
if (!eregi(".csv", $leadfile_name) && !eregi(".xls", $leadfile_name))
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt");
|
||||
$lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.txt";
|
||||
@@ -1876,7 +1878,7 @@ if ($leadfile) {
|
||||
$lead_file = "/tmp/vicidial_temp_file.txt";
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
$buffer=fgets($file, 4096);
|
||||
@@ -1924,7 +1926,7 @@ if ($leadfile) {
|
||||
}
|
||||
else if (!eregi(".csv", $leadfile_name))
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls");
|
||||
$lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.xls";
|
||||
@@ -1947,7 +1949,7 @@ if ($leadfile) {
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
copy($LF_path, "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv");
|
||||
$lead_file = "$WeBServeRRooT/$admin_web_directory/vicidial_temp_file.csv";
|
||||
@@ -1959,7 +1961,7 @@ if ($leadfile) {
|
||||
}
|
||||
$file=fopen("$lead_file", "r");
|
||||
|
||||
if ($WeBRooTWritablE > 0)
|
||||
if ($webroot_writable > 0)
|
||||
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
|
||||
|
||||
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing CSV file... \n";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# phone_stats.php.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# changes:
|
||||
@@ -9,6 +9,7 @@
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 60927-1548 - Changed to vicidial_users for authentication
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -37,6 +38,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
@@ -47,37 +67,38 @@ $admin_page = './admin.php';
|
||||
if (!isset($begin_date)) {$begin_date = $TODAY;}
|
||||
if (!isset($end_date)) {$end_date = $TODAY;}
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-ASTERISK\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "ASTERISK|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
##### get server listing for dynamic pulldown
|
||||
$stmt="SELECT fullname from phones where server_ip='$server_ip' and extension='$extension'";
|
||||
$rsltx=mysql_query($stmt, $link);
|
||||
@@ -86,8 +107,11 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "ASTERISK|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# realtime_report.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# live real-time stats for the VICIDIAL Auto-Dialer all servers
|
||||
#
|
||||
@@ -19,10 +19,11 @@
|
||||
# 110316-2216 - Added Agent, Carrier and Preset options.php settings
|
||||
# 110516-2128 - IE fix
|
||||
# 110526-1807 - Added webphone_auto_answer option
|
||||
# 120223-1917 - Added multi-user-group options
|
||||
#
|
||||
|
||||
$version = '2.4-8';
|
||||
$build = '110526-1807';
|
||||
$version = '2.4-9';
|
||||
$build = '120223-1917';
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -44,6 +45,8 @@ if (isset($_GET["groups"])) {$groups=$_GET["groups"];}
|
||||
elseif (isset($_POST["groups"])) {$groups=$_POST["groups"];}
|
||||
if (isset($_GET["usergroup"])) {$usergroup=$_GET["usergroup"];}
|
||||
elseif (isset($_POST["usergroup"])) {$usergroup=$_POST["usergroup"];}
|
||||
if (isset($_GET["user_group_filter"])) {$user_group_filter=$_GET["user_group_filter"];}
|
||||
elseif (isset($_POST["user_group_filter"])) {$user_group_filter=$_POST["user_group_filter"];}
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["adastats"])) {$adastats=$_GET["adastats"];}
|
||||
@@ -265,6 +268,86 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($auth)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,callcard_admin,force_change_password,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,modify_contacts,modify_same_user_level from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfull_name =$row[3];
|
||||
$LOGuser_level =$row[4];
|
||||
$LOGuser_group =$row[5];
|
||||
$LOGdelete_users =$row[8];
|
||||
$LOGdelete_user_groups =$row[9];
|
||||
$LOGdelete_lists =$row[10];
|
||||
$LOGdelete_campaigns =$row[11];
|
||||
$LOGdelete_ingroups =$row[12];
|
||||
$LOGdelete_remote_agents =$row[13];
|
||||
$LOGload_leads =$row[14];
|
||||
$LOGcampaign_detail =$row[15];
|
||||
$LOGast_admin_access =$row[16];
|
||||
$LOGast_delete_phones =$row[17];
|
||||
$LOGdelete_scripts =$row[18];
|
||||
$LOGdelete_filters =$row[29];
|
||||
$LOGalter_agent_interface =$row[30];
|
||||
$LOGdelete_call_times =$row[32];
|
||||
$LOGmodify_call_times =$row[33];
|
||||
$LOGmodify_users =$row[34];
|
||||
$LOGmodify_campaigns =$row[35];
|
||||
$LOGmodify_lists =$row[36];
|
||||
$LOGmodify_scripts =$row[37];
|
||||
$LOGmodify_filters =$row[38];
|
||||
$LOGmodify_ingroups =$row[39];
|
||||
$LOGmodify_usergroups =$row[40];
|
||||
$LOGmodify_remoteagents =$row[41];
|
||||
$LOGmodify_servers =$row[42];
|
||||
$LOGview_reports =$row[43];
|
||||
$LOGmodify_dids =$row[56];
|
||||
$LOGdelete_dids =$row[57];
|
||||
$LOGmanager_shift_enforcement_override=$row[61];
|
||||
$LOGexport_reports =$row[64];
|
||||
$LOGdelete_from_dnc =$row[65];
|
||||
$LOGcallcard_admin =$row[70];
|
||||
$LOGforce_change_password =$row[71];
|
||||
$LOGmodify_shifts =$row[72];
|
||||
$LOGmodify_phones =$row[73];
|
||||
$LOGmodify_carriers =$row[74];
|
||||
$LOGmodify_labels =$row[75];
|
||||
$LOGmodify_statuses =$row[76];
|
||||
$LOGmodify_voicemail =$row[77];
|
||||
$LOGmodify_audiostore =$row[78];
|
||||
$LOGmodify_moh =$row[79];
|
||||
$LOGmodify_tts =$row[80];
|
||||
$LOGmodify_contacts =$row[81];
|
||||
$LOGmodify_same_user_level =$row[82];
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGadmin_viewable_groupsSQL='';
|
||||
$valLOGadmin_viewable_groupsSQL='';
|
||||
$vmLOGadmin_viewable_groupsSQL='';
|
||||
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
|
||||
{
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
|
||||
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
|
||||
$LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
$vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')";
|
||||
}
|
||||
else
|
||||
{$admin_viewable_groupsALL=1;}
|
||||
|
||||
}
|
||||
|
||||
# and (preg_match("/MONITOR|BARGE|HIJACK/",$monitor_active) ) )
|
||||
if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) )
|
||||
{
|
||||
@@ -346,6 +429,22 @@ while($i < $group_ct)
|
||||
}
|
||||
$group_SQL = eregi_replace(",$",'',$group_SQL);
|
||||
|
||||
$i=0;
|
||||
$user_group_string='|';
|
||||
$user_group_ct = count($user_group_filter);
|
||||
while($i < $user_group_ct)
|
||||
{
|
||||
# if ( (preg_match("/ $user_group_filter[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/ALL-/",$LOGallowed_campaigns)) )
|
||||
# {
|
||||
$user_group_string .= "$user_group_filter[$i]|";
|
||||
$user_group_SQL .= "'$user_group_filter[$i]',";
|
||||
$usergroupQS .= "&user_group_filter[]=$user_group_filter[$i]";
|
||||
# }
|
||||
|
||||
$i++;
|
||||
}
|
||||
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL);
|
||||
|
||||
### if no campaigns selected, display all
|
||||
if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
{
|
||||
@@ -354,6 +453,15 @@ if ( ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||
$group = 'ALL-ACTIVE';
|
||||
$groupQS .= "&groups[]=ALL-ACTIVE";
|
||||
}
|
||||
### if no user groups selected, display all
|
||||
$user_group_none=0;
|
||||
if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) )
|
||||
{
|
||||
$user_group_filter[0] = 'ALL-GROUPS';
|
||||
$user_group_string = '|ALL-GROUPS|';
|
||||
$usergroupQS .= "&user_group_filter[]=ALL-GROUPS";
|
||||
$user_group_none=1;
|
||||
}
|
||||
|
||||
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) )
|
||||
{
|
||||
@@ -376,17 +484,43 @@ else
|
||||
$group_SQLwhere = "where campaign_id IN($group_SQL)";
|
||||
}
|
||||
|
||||
if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) )
|
||||
{
|
||||
$all_active_groups = 0;
|
||||
$user_group_SQL = "''";
|
||||
# $user_group_SQLand = "and FALSE";
|
||||
# $user_group_SQLwhere = "where FALSE";
|
||||
}
|
||||
elseif ( eregi('ALL-GROUPS',$user_group_string) )
|
||||
{
|
||||
$all_active_groups = 1;
|
||||
# $user_group_SQL = '';
|
||||
$user_group_SQL = "'$rawLOGadmin_viewable_groupsSQL'";
|
||||
# $group_SQLand = "and campaign_id IN($allactivecampaigns)";
|
||||
# $group_SQLwhere = "where campaign_id IN($allactivecampaigns)";
|
||||
}
|
||||
else
|
||||
{
|
||||
$all_active_groups = 0;
|
||||
# $user_group_SQLand = "and user_group IN($user_group_SQL)";
|
||||
# $user_group_SQLwhere = "where user_group IN($user_group_SQL)";
|
||||
}
|
||||
|
||||
$stmt="select user_group from vicidial_user_groups;";
|
||||
$stmt="select user_group, group_name from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if (!isset($DB)) {$DB=0;}
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$usergroups_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
$usergroups[$i]='ALL-GROUPS';
|
||||
$usergroupnames[$i] = 'All user groups';
|
||||
$i++;
|
||||
$usergroups_to_print++;
|
||||
while ($i < $usergroups_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$usergroups[$i] =$row[0];
|
||||
$usergroupnames[$i] =$row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -397,7 +531,7 @@ $NFE = '</font></b>';
|
||||
$F=''; $FG=''; $B=''; $BG='';
|
||||
|
||||
$select_list = "<TABLE WIDTH=700 CELLPADDING=5 BGCOLOR=\"#D9E6FE\"><TR><TD VALIGN=TOP>Select Campaigns: <BR>";
|
||||
$select_list .= "<SELECT SIZE=15 NAME=groups[] ID=groups[] multiple>";
|
||||
$select_list .= "<SELECT SIZE=8 NAME=groups[] ID=groups[] multiple>";
|
||||
$o=0;
|
||||
while ($groups_to_print > $o)
|
||||
{
|
||||
@@ -408,7 +542,26 @@ while ($groups_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
$select_list .= "</SELECT>";
|
||||
$select_list .= "<BR><font size=1>(To select more than 1 campaign, hold down the Ctrl key and click)<font>";
|
||||
$select_list .= "<BR><font size=1>(To select more than 1 campaign, hold down the Ctrl key and click)</font>";
|
||||
|
||||
$select_list .= "<BR><BR>Select User Groups: <BR>";
|
||||
$select_list .= "<SELECT SIZE=8 NAME=user_group_filter[] ID=user_group_filter[] multiple>";
|
||||
$o=0;
|
||||
while ($o < $usergroups_to_print)
|
||||
{
|
||||
if (ereg("\|$usergroups[$o]\|",$user_group_filter_string))
|
||||
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
|
||||
else
|
||||
{
|
||||
if ( ($user_group_none > 0) and ($usergroups[$o] == 'ALL-GROUPS') )
|
||||
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
|
||||
else
|
||||
{$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
|
||||
}
|
||||
$o++;
|
||||
}
|
||||
$select_list .= "</SELECT>";
|
||||
|
||||
$select_list .= "</TD><TD VALIGN=TOP ALIGN=CENTER>";
|
||||
$select_list .= "<a href=\"#\" onclick=\"hideDiv(\'campaign_select_list\');\">Close Panel</a><BR><BR>";
|
||||
$select_list .= "<TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>";
|
||||
@@ -710,6 +863,7 @@ var user = '<?php echo $PHP_AUTH_USER ?>';
|
||||
var pass = '<?php echo $PHP_AUTH_PW ?>';
|
||||
var RR = '<?php echo $RR ?>';
|
||||
var groupQS = '<?php echo $groupQS ?>';
|
||||
var usergroupQS = '<?php echo $usergroupQS ?>';
|
||||
var DB = '<?php echo $DB ?>';
|
||||
var adastats = '<?php echo $adastats ?>';
|
||||
var SIPmonitorLINK = '<?php echo $SIPmonitorLINK ?>';
|
||||
@@ -1014,7 +1168,7 @@ function gather_realtime_content()
|
||||
}
|
||||
if (xmlhttp)
|
||||
{
|
||||
RTupdate_query = "RTajax=1&DB=" + DB + "" + groupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "";
|
||||
RTupdate_query = "RTajax=1&DB=" + DB + "" + groupQS + usergroupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "";
|
||||
|
||||
xmlhttp.open('POST', 'AST_timeonVDADall.php');
|
||||
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
|
||||
@@ -1160,12 +1314,30 @@ function update_variables(task_option,task_choice,force_reload)
|
||||
}
|
||||
}
|
||||
groupQS = temp_camp_choices;
|
||||
|
||||
var temp_usergroup_choices = '';
|
||||
var selCampObj = document.getElementById('user_group_filter[]');
|
||||
var i;
|
||||
var count = 0;
|
||||
var selected_all=0;
|
||||
for (i=0; i<selCampObj.options.length; i++)
|
||||
{
|
||||
if ( (selCampObj.options[i].selected) && (selected_all < 1) )
|
||||
{
|
||||
temp_usergroup_choices = temp_usergroup_choices + '&user_group_filter[]=' + selCampObj.options[i].value;
|
||||
count++;
|
||||
if (selCampObj.options[i].value == 'ALL-ACTIVE')
|
||||
{selected_all++;}
|
||||
}
|
||||
}
|
||||
usergroupQS = temp_usergroup_choices;
|
||||
|
||||
hideDiv('campaign_select_list');
|
||||
|
||||
// force a reload if the phone is changed
|
||||
if ( (temp_monitor_phone != monitor_phone) || (force_reload=='YES') )
|
||||
{
|
||||
reload_url = PHP_SELF + "?RR=" + RR + "&DB=" + DB + "" + groupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + temp_monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "";
|
||||
reload_url = PHP_SELF + "?RR=" + RR + "&DB=" + DB + "" + groupQS + usergroupQS + "&adastats=" + adastats + "&SIPmonitorLINK=" + SIPmonitorLINK + "&IAXmonitorLINK=" + IAXmonitorLINK + "&usergroup=" + usergroup + "&UGdisplay=" + UGdisplay + "&UidORname=" + UidORname + "&orderby=" + orderby + "&SERVdisplay=" + SERVdisplay + "&CALLSdisplay=" + CALLSdisplay + "&PHONEdisplay=" + PHONEdisplay + "&CUSTPHONEdisplay=" + CUSTPHONEdisplay + "&with_inbound=" + with_inbound + "&monitor_active=" + monitor_active + "&monitor_phone=" + temp_monitor_phone + "&ALLINGROUPstats=" + ALLINGROUPstats + "&DROPINGROUPstats=" + DROPINGROUPstats + "&NOLEADSalert=" + NOLEADSalert + "&CARRIERstats=" + CARRIERstats + "&PRESETstats=" + PRESETstats + "&AGENTtimeSTATS=" + AGENTtimeSTATS + "";
|
||||
|
||||
// alert('|' + temp_monitor_phone + '|' + monitor_phone + '|\n' + reload_url);
|
||||
window.location.href = reload_url;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# record_conf_1_hour.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# grab: $server_ip $station $session_id
|
||||
#
|
||||
@@ -10,6 +10,7 @@
|
||||
# 60620-1011 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# - Added required user/pass to gain access to this page
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -30,16 +31,35 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
@@ -53,26 +73,25 @@ $MYSQL_datetime = date("Y-m-d H:i:s");
|
||||
$FILE_datetime = date("Ymd-His_");
|
||||
$secX = $STARTtime;
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
@@ -81,20 +100,25 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$user';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -24,13 +24,14 @@
|
||||
### remove temp files
|
||||
# 1 7 * * * /usr/bin/find /usr/local/apache2/htdocs/vicidial/temp/ -maxdepth 1 -type f -mtime +1 -print | xargs rm -f
|
||||
#
|
||||
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
|
||||
# CHANGES
|
||||
# 71015-0845 - First build
|
||||
# 71112-1347 - added GSM option
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2129 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$STARTtime = date("U");
|
||||
@@ -48,24 +49,24 @@ if (isset($_GET["QUERY_recid"])) {$QUERY_recid=$_GET["QUERY_recid"];}
|
||||
$web_server = '1.1.1.1';
|
||||
$US='_';
|
||||
|
||||
if( (eregi("VDC",$PHP_AUTH_USER)) or (eregi("VDC",$PHP_AUTH_PW)) )
|
||||
if( (eregi("VDC",$PHP_AUTH_USER)) or (eregi("VDC",$PHP_AUTH_PW)) )
|
||||
{
|
||||
# $package='';
|
||||
# $package='';
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-VERIF\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
Header("WWW-Authenticate: Basic realm=\"VICI-VERIF\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$fp = fopen ("/usr/local/apache2/htdocs/vicidial/auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
fwrite ($fp, "AUTH|VDC |$date|$username|$passwd|$ip|$QUERY_recid|$browser|\n");
|
||||
fclose($fp);
|
||||
# $fp = fopen ("/usr/local/apache2/htdocs/vicidial/auth_entries.txt", "a");
|
||||
# $date = date("r");
|
||||
# $ip = getenv("REMOTE_ADDR");
|
||||
# $browser = getenv("HTTP_USER_AGENT");
|
||||
# fwrite ($fp, "AUTH|VDC |$date|$username|$passwd|$ip|$QUERY_recid|$browser|\n");
|
||||
# fclose($fp);
|
||||
|
||||
?>
|
||||
<html>
|
||||
@@ -82,74 +83,73 @@ echo "<br><br>\n";
|
||||
#echo "<center>\n";
|
||||
|
||||
if (strlen($QUERY_recid)<10)
|
||||
{
|
||||
echo "Please enter a recording ID(customer phone number) below:\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$logs_to_print=0;
|
||||
echo "<B>searching for: $QUERY_recid</B>\n";
|
||||
echo "<PRE>\n";
|
||||
|
||||
$stmt="select recording_id,lead_id,user,filename,location,start_time,length_in_sec from recording_log where filename LIKE \"%$QUERY_recid%\" order by recording_id desc LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $linkAST);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
#echo "|$stmt|";
|
||||
|
||||
$u=0;
|
||||
if ($logs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$phone = $QUERY_recid;
|
||||
$recording_id = $row[0];
|
||||
$lead_id = $row[1];
|
||||
$user = $row[2];
|
||||
$filename = $row[3];
|
||||
$location = $row[4];
|
||||
$start_time = $row[5];
|
||||
$length_in_sec = $row[6];
|
||||
$AUDname = explode("/",$location);
|
||||
$AUDnamect = (count($AUDname)) - 1;
|
||||
|
||||
|
||||
eregi_replace('10.10.10.16','10.10.10.16',$AUDname[$AUDnamect]);
|
||||
|
||||
echo "Call Date/Time: $start_time\n";
|
||||
echo "Recording Length: $length_in_sec\n";
|
||||
echo "Phone Number: $phone\n";
|
||||
echo "Recording ID: $recording_id\n";
|
||||
echo "Agent: $user\n";
|
||||
# echo "filename: $filename\n";
|
||||
# echo "Location: $location\n";
|
||||
# echo "AUDname: $AUDname[$AUDnamect]\n";
|
||||
echo "Unique ID: $lead_id\n";
|
||||
|
||||
$fileGSM=$AUDname[$AUDnamect];
|
||||
$locationGSM=$location;
|
||||
$fileGSM = eregi_replace('.wav','.gsm',$fileGSM);
|
||||
if (!eregi('gsm',$locationGSM))
|
||||
{
|
||||
$locationGSM = eregi_replace('10.10.10.16','10.10.10.16/GSM',$locationGSM);
|
||||
$locationGSM = eregi_replace('.wav','.gsm',$locationGSM);
|
||||
}
|
||||
passthru("/usr/local/apache2/htdocs/vicidial/wget --output-document=/usr/local/apache2/htdocs/vicidial/temp/$AUDname[$AUDnamect] $location\n");
|
||||
passthru("/usr/local/apache2/htdocs/vicidial/wget --output-document=/usr/local/apache2/htdocs/vicidial/temp/$fileGSM $locationGSM\n");
|
||||
|
||||
echo "Link Uncompressed WAV: <a href=\"./temp/$AUDname[$AUDnamect]\">$AUDname[$AUDnamect]</a>\n";
|
||||
echo "Link Compressed GSM: <a href=\"./temp/$fileGSM\">$fileGSM</a>\n";
|
||||
|
||||
echo "Please enter a recording ID(customer phone number) below:\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "ERROR: $QUERY_recid\n";
|
||||
$logs_to_print=0;
|
||||
echo "<B>searching for: $QUERY_recid</B>\n";
|
||||
echo "<PRE>\n";
|
||||
|
||||
$stmt="select recording_id,lead_id,user,filename,location,start_time,length_in_sec from recording_log where filename LIKE \"%$QUERY_recid%\" order by recording_id desc LIMIT 1;";
|
||||
$rslt=mysql_query($stmt, $linkAST);
|
||||
$logs_to_print = mysql_num_rows($rslt);
|
||||
#echo "|$stmt|";
|
||||
|
||||
$u=0;
|
||||
if ($logs_to_print)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$phone = $QUERY_recid;
|
||||
$recording_id = $row[0];
|
||||
$lead_id = $row[1];
|
||||
$user = $row[2];
|
||||
$filename = $row[3];
|
||||
$location = $row[4];
|
||||
$start_time = $row[5];
|
||||
$length_in_sec = $row[6];
|
||||
$AUDname = explode("/",$location);
|
||||
$AUDnamect = (count($AUDname)) - 1;
|
||||
|
||||
|
||||
eregi_replace('10.10.10.16','10.10.10.16',$AUDname[$AUDnamect]);
|
||||
|
||||
echo "Call Date/Time: $start_time\n";
|
||||
echo "Recording Length: $length_in_sec\n";
|
||||
echo "Phone Number: $phone\n";
|
||||
echo "Recording ID: $recording_id\n";
|
||||
echo "Agent: $user\n";
|
||||
# echo "filename: $filename\n";
|
||||
# echo "Location: $location\n";
|
||||
# echo "AUDname: $AUDname[$AUDnamect]\n";
|
||||
echo "Unique ID: $lead_id\n";
|
||||
|
||||
$fileGSM=$AUDname[$AUDnamect];
|
||||
$locationGSM=$location;
|
||||
$fileGSM = eregi_replace('.wav','.gsm',$fileGSM);
|
||||
if (!eregi('gsm',$locationGSM))
|
||||
{
|
||||
$locationGSM = eregi_replace('10.10.10.16','10.10.10.16/GSM',$locationGSM);
|
||||
$locationGSM = eregi_replace('.wav','.gsm',$locationGSM);
|
||||
}
|
||||
passthru("/usr/local/apache2/htdocs/vicidial/wget --output-document=/usr/local/apache2/htdocs/vicidial/temp/$AUDname[$AUDnamect] $location\n");
|
||||
passthru("/usr/local/apache2/htdocs/vicidial/wget --output-document=/usr/local/apache2/htdocs/vicidial/temp/$fileGSM $locationGSM\n");
|
||||
|
||||
echo "Link Uncompressed WAV: <a href=\"./temp/$AUDname[$AUDnamect]\">$AUDname[$AUDnamect]</a>\n";
|
||||
echo "Link Compressed GSM: <a href=\"./temp/$fileGSM\">$fileGSM</a>\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
echo "ERROR: $QUERY_recid\n";
|
||||
}
|
||||
|
||||
|
||||
echo "</PRE>\n";
|
||||
|
||||
}
|
||||
|
||||
|
||||
echo "</PRE>\n";
|
||||
|
||||
}
|
||||
|
||||
$ENDtime = date("U");
|
||||
|
||||
$RUNtime = ($ENDtime - $STARTtime);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# remote_dispo.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# this is the remote agent disposition screen for calls sent to remote agents.
|
||||
# This allows the remote agent to modify customer information and disposition
|
||||
@@ -11,6 +11,7 @@
|
||||
#
|
||||
# 60619-1626 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
|
||||
@@ -100,6 +101,25 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $qm_conf_ct)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$i++;
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$STARTtime = date("U");
|
||||
$TODAY = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
@@ -114,46 +134,49 @@ $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW);
|
||||
|
||||
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 2;";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$auth=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"VICIDIAL-CLOSER\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
$fullname = $row[0];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VD_CLOSER|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# timeclock_edit.php
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -9,6 +9,7 @@
|
||||
# 80701-1323 - functional beta version done
|
||||
# 90310-2109 - Added admin header
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -110,7 +111,7 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
$modify_timeclock_log = $row[1];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -118,7 +119,7 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# timeclock_report.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -17,6 +17,7 @@
|
||||
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
|
||||
# 110703-1830 - Added download option
|
||||
# 111104-1314 - Added user_group restrictions for selecting in-groups
|
||||
# 120224-0910 - Added HTML display option with bar graphs
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -45,6 +46,8 @@ 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["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
if (strlen($order)<2) {$order='hours_down';}
|
||||
@@ -204,6 +207,7 @@ $HEADER.="-->\n";
|
||||
$HEADER.="</style>\n";
|
||||
$HEADER.="<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
$HEADER.="<link rel=\"stylesheet\" href=\"horizontalbargraph.css\">\n";
|
||||
$HEADER.="<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
$HEADER.="<TITLE>\n";
|
||||
|
||||
@@ -305,8 +309,13 @@ $MAIN.="<SELECT SIZE=5 NAME=user_group[] multiple>\n";
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
|
||||
$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP>\n";
|
||||
$MAIN.="<font class=\"select_bold\"><B>Order:</B></font><BR>\n";
|
||||
$MAIN.="</TD></TD><TD ALIGN=LEFT VALIGN=TOP><font class=\"select_bold\">";
|
||||
$MAIN.="Display as:<BR>";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>TEXT</option><option value='HTML'>HTML</option></select>\n<BR>\n";
|
||||
$MAIN.="</font></TD><TD ALIGN=LEFT VALIGN=TOP>\n";
|
||||
$MAIN.="<font class=\"select_bold\"><B>Order:</B><BR>\n";
|
||||
$MAIN.="<SELECT SIZE=1 NAME=order>\n";
|
||||
$MAIN.="<option selected value=\"$order\">$order</option>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
@@ -318,7 +327,9 @@ $MAIN.="<option>name_up</option>\n";
|
||||
$MAIN.="<option>name_down</option>\n";
|
||||
$MAIN.="<option>group_up</option>\n";
|
||||
$MAIN.="<option>group_down</option>\n";
|
||||
$MAIN.="</SELECT><BR><CENTER>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</font><CENTER>\n";
|
||||
|
||||
|
||||
$MAIN.="</TD><TD ALIGN=LEFT VALIGN=TOP>\n";
|
||||
$MAIN.="<font class=\"select_bold\"><B>User:</B></font><BR>\n";
|
||||
@@ -337,27 +348,12 @@ $MAIN.="<PRE><FONT SIZE=3>\n";
|
||||
|
||||
$MAIN.="User Timeclock Report $NOW_TIME\n";
|
||||
|
||||
|
||||
$MAIN.="Time range: $query_date to $end_date\n\n";
|
||||
$MAIN.="---------- USER TIMECLOCK DETAILS -------------\n";
|
||||
$MAIN.="These totals do NOT include any active sessions\n</PRE>\n";
|
||||
|
||||
$CSV_text.="\"User Timeclock Report - $NOW_TIME\"\n";
|
||||
$CSV_text.="\"Time range: $query_date to $end_date\"\n";
|
||||
$CSV_text.="\"---------- USER TIMECLOCK DETAILS -------------\"\n";
|
||||
$CSV_text.="\"These totals do NOT include any active sessions\"\n\n";
|
||||
|
||||
|
||||
$MAIN.="<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> USER </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> NAME </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> GROUP </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> HOURS </TD>\n";
|
||||
$MAIN.="</TR>\n";
|
||||
|
||||
$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n";
|
||||
|
||||
$order_SQL='';
|
||||
if ($order == 'hours_up') {$order_SQL = "order by login";}
|
||||
if ($order == 'hours_down') {$order_SQL = "order by login desc";}
|
||||
@@ -372,79 +368,145 @@ if (strlen($user) > 0) {$user_SQL = "and vicidial_timeclock_log.user='$user'";}
|
||||
else {$user_SQL='';}
|
||||
|
||||
$stmt="select vicidial_users.user,full_name,sum(login_sec) as login,vicidial_timeclock_log.user_group from vicidial_users,vicidial_timeclock_log where event IN('LOGIN','START') and event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and vicidial_users.user=vicidial_timeclock_log.user $user_SQL $user_group_SQL group by vicidial_users.user,vicidial_timeclock_log.user_group $order_SQL limit 100000;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$dbHOURS=0;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_id[$i] = $row[0];
|
||||
$full_name[$i] = $row[1];
|
||||
$login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]);
|
||||
$u_group[$i] = $row[3];
|
||||
|
||||
if ($login_sec[$i] > 0)
|
||||
|
||||
if (!$report_display_type || $report_display_type=="TEXT")
|
||||
{
|
||||
$MAIN.="Time range: $query_date to $end_date\n\n";
|
||||
$MAIN.="---------- USER TIMECLOCK DETAILS -------------\n";
|
||||
$MAIN.="These totals do NOT include any active sessions\n</PRE>\n";
|
||||
$MAIN.="<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=3><TR BGCOLOR=BLACK>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\">#</TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> USER </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> NAME </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> GROUP </TD>\n";
|
||||
$MAIN.="<TD ALIGN=CENTER><FONT class=\"header_white\"> HOURS </TD>\n";
|
||||
$MAIN.="</TR>\n";
|
||||
|
||||
$CSV_text.="\"\",\"#\",\"USER\",\"NAME\",\"GROUP\",\"HOURS\"\n";
|
||||
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$rows_to_print = mysql_num_rows($rslt);
|
||||
$i=0;
|
||||
|
||||
while ($i < $rows_to_print)
|
||||
{
|
||||
$dbHOURS = ($login_sec[$i] / 3600);
|
||||
$dbHOURS = round($dbHOURS, 2);
|
||||
$dbHOURS = sprintf("%01.2f", $dbHOURS);
|
||||
$dbHOURS=0;
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$user_id[$i] = $row[0];
|
||||
$full_name[$i] = $row[1];
|
||||
$login_sec[$i] = $row[2]; $TOTlogin_sec = ($TOTlogin_sec + $row[2]);
|
||||
$u_group[$i] = $row[3];
|
||||
|
||||
if ($login_sec[$i] > 0)
|
||||
{
|
||||
$dbHOURS = ($login_sec[$i] / 3600);
|
||||
$dbHOURS = round($dbHOURS, 2);
|
||||
$dbHOURS = sprintf("%01.2f", $dbHOURS);
|
||||
}
|
||||
else
|
||||
{$dbHOURS='0.00';}
|
||||
|
||||
$hours[$i] = $dbHOURS;
|
||||
$hoursSORT[$i] = "$dbHOURS-----$i";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$j=0;
|
||||
while ($j < $rows_to_print)
|
||||
{
|
||||
|
||||
$hours_split = explode("-----",$hoursSORT[$j]);
|
||||
$i = $hours_split[1];
|
||||
|
||||
if (eregi("1$|3$|5$|7$|9$", $j))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$MAIN.="<TR $bgcolor>\n";
|
||||
$MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n";
|
||||
$MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n";
|
||||
$MAIN.="</TR>\n";
|
||||
$CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n";
|
||||
|
||||
$j++;
|
||||
}
|
||||
|
||||
|
||||
if ($TOTlogin_sec > 0)
|
||||
{
|
||||
$TOTdbHOURS = ($TOTlogin_sec / 3600);
|
||||
$TOTdbHOURS = round($TOTdbHOURS, 0);
|
||||
$TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS);
|
||||
}
|
||||
else
|
||||
{$dbHOURS='0.00';}
|
||||
{$TOTdbHOURS='0.00';}
|
||||
|
||||
$hours[$i] = $dbHOURS;
|
||||
$hoursSORT[$i] = "$dbHOURS-----$i";
|
||||
|
||||
$i++;
|
||||
}
|
||||
$TOThours = $TOTdbHOURS;
|
||||
|
||||
|
||||
$j=0;
|
||||
while ($j < $rows_to_print)
|
||||
{
|
||||
|
||||
$hours_split = explode("-----",$hoursSORT[$j]);
|
||||
$i = $hours_split[1];
|
||||
|
||||
if (eregi("1$|3$|5$|7$|9$", $j))
|
||||
{$bgcolor='bgcolor="#B9CBFD"';}
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
$MAIN.="<TR $bgcolor>\n";
|
||||
$MAIN.="<TD ALIGN=LEFT><FONT class=\"data_records_fix_small\">$j</TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\"><A HREF=\"user_status.php?user=$user_id[$i]\">$user_id[$i]</A> </TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\">$full_name[$i] </TD>\n";
|
||||
$MAIN.="<TD><FONT class=\"data_records\">$u_group[$i] </TD>\n";
|
||||
$MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $hours[$i]</TD>\n";
|
||||
$MAIN.="<TR BGCOLOR=#E6E6E6>\n";
|
||||
$MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n";
|
||||
$MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n";
|
||||
$MAIN.="</TR>\n";
|
||||
$CSV_text.="\"\",\"$j\",\"$user_id[$i]\",\"$full_name[$i]\",\"$u_group[$i]\",\"$hours[$i]\"\n";
|
||||
$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n";
|
||||
|
||||
$j++;
|
||||
$MAIN.="</TABLE>\n";
|
||||
}
|
||||
|
||||
|
||||
if ($TOTlogin_sec > 0)
|
||||
else
|
||||
{
|
||||
$TOTdbHOURS = ($TOTlogin_sec / 3600);
|
||||
$TOTdbHOURS = round($TOTdbHOURS, 0);
|
||||
$TOTdbHOURS = sprintf("%01.0f", $TOTdbHOURS);
|
||||
######## GRAPHING #########
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$high_ct=0; $i=0;
|
||||
while ($row=mysql_fetch_row($rslt)) {
|
||||
|
||||
if ($row[2] > 0)
|
||||
{
|
||||
$dbHOURS = ($row[2] / 3600);
|
||||
$dbHOURS = round($dbHOURS, 2);
|
||||
$dbHOURS = sprintf("%01.2f", $dbHOURS);
|
||||
}
|
||||
else
|
||||
{$dbHOURS='0.00';}
|
||||
|
||||
if ($dbHOURS>$high_ct) {$high_ct=$dbHOURS;}
|
||||
$ct_ary[$i][0]="$row[1] ($row[0]) - $row[3]";
|
||||
$ct_ary[$i][1]=$dbHOURS;
|
||||
$i++;
|
||||
}
|
||||
if ($high_ct<1) {$high_ct*=10;}
|
||||
$MAIN.="</PRE>\n";
|
||||
$MAIN.="<table cellspacing=\"0\" cellpadding=\"0\" summary=\"CALL HANGUP REASON STATS\" class=\"horizontalgraph\">\n";
|
||||
$MAIN.=" <caption align=\"top\">USER TIMECLOCK DETAILS<br /><font size='-1'>Time range: $query_date to $end_date<br/>These totals do NOT include any active sessions</font><br /></caption>\n";
|
||||
$MAIN.=" <tr>\n";
|
||||
$MAIN.=" <th class=\"thgraph\" scope=\"col\">USER </th>\n";
|
||||
$MAIN.=" <th class=\"thgraph\" scope=\"col\">HOURS </th>\n";
|
||||
$MAIN.=" </tr>\n";
|
||||
for ($i=0; $i<count($ct_ary); $i++) {
|
||||
if ($i==0) {$class=" first";} else if (($i+1)==count($ct_ary)) {$class=" last";} else {$class="";}
|
||||
$MAIN.=" <tr>\n";
|
||||
$MAIN.=" <td class=\"chart_td$class\">".$ct_ary[$i][0]."</td>\n";
|
||||
$MAIN.=" <td class=\"chart_td value$class\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$ct_ary[$i][1]/$high_ct)."\" height=\"16\" />".$ct_ary[$i][1]."</td>\n";
|
||||
$MAIN.=" </tr>\n";
|
||||
}
|
||||
$MAIN.=" <tr>\n";
|
||||
$MAIN.=" <th class=\"thgraph\" scope=\"col\">TOTAL HOURS:</th>\n";
|
||||
$MAIN.=" <th class=\"thgraph\" scope=\"col\">".trim($TOThours)."</th>\n";
|
||||
$MAIN.=" </tr>\n";
|
||||
$MAIN.="</table>\n";
|
||||
$MAIN.="<PRE>\n";
|
||||
###########################
|
||||
}
|
||||
else
|
||||
{$TOTdbHOURS='0.00';}
|
||||
|
||||
$TOThours = $TOTdbHOURS;
|
||||
|
||||
|
||||
$MAIN.="<TR BGCOLOR=#E6E6E6>\n";
|
||||
$MAIN.="<TD ALIGN=LEFT COLSPAN=4><FONT class=\"data_records\">TOTALS</TD>\n";
|
||||
$MAIN.="<TD ALIGN=RIGHT><FONT class=\"data_records_fix\"> $TOThours</TD>\n";
|
||||
$MAIN.="</TR>\n";
|
||||
$CSV_text.="\"\",\"TOTALS\",\"\",\"\",\"\",\"$TOThours\"\n";
|
||||
|
||||
$MAIN.="</TABLE>\n";
|
||||
$MAIN.="</CENTER>\n";
|
||||
$MAIN.="</BODY></HTML>\n";
|
||||
|
||||
|
||||
@@ -101,7 +101,6 @@ $rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$reports_only_user=$row[0];
|
||||
|
||||
$fp = fopen ("./project_auth_entries.txt", "a");
|
||||
$date = date("r");
|
||||
$ip = getenv("REMOTE_ADDR");
|
||||
$browser = getenv("HTTP_USER_AGENT");
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
# 90310-2144 - Added admin header
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120221-0025 - Added in User Group restrictions
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -91,7 +92,7 @@ else
|
||||
$LOGuser_group = $row[3];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -99,7 +100,7 @@ else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
exit;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# user_stats.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -33,6 +33,7 @@
|
||||
# 110718-1204 - Added skipped manual dial leads display
|
||||
# 111103-1050 - Added admin_hide_phone_data and admin_hide_lead_data options
|
||||
# 111106-1105 - Added user_group restrictions
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
|
||||
@@ -45,7 +46,7 @@ $db_source = 'M';
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active FROM system_settings;";
|
||||
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,user_territories_active,webroot_writable FROM system_settings;";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$qm_conf_ct = mysql_num_rows($rslt);
|
||||
@@ -57,6 +58,7 @@ if ($qm_conf_ct > 0)
|
||||
$slave_db_server = $row[2];
|
||||
$reports_use_slave_db = $row[3];
|
||||
$user_territories_active = $row[4];
|
||||
$webroot_writable = $row[5];
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
@@ -136,8 +138,11 @@ $LOGuser_group = $row[1];
|
||||
$LOGadmin_hide_lead_data = $row[2];
|
||||
$LOGadmin_hide_phone_data = $row[3];
|
||||
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB) {$MAIN.="|$stmt|\n";}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# user_status.php
|
||||
#
|
||||
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -19,6 +19,7 @@
|
||||
# 110124-1134 - Small query fix for large queue_log tables
|
||||
# 110224-2350 - Small QM logout fix
|
||||
# 110420-0344 - Added DEAD/PARK agent statuses
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
@@ -104,7 +105,7 @@ else
|
||||
$modify_timeclock_log = $row[2];
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
@@ -112,7 +113,7 @@ else
|
||||
{
|
||||
if ($webroot_writable > 0)
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n";
|
||||
exit;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# make sure you have added a user to the vicidial_users MySQL table with at
|
||||
# least user_level 4 to access this page the first time
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# Changes
|
||||
# 50307-1721 - First version
|
||||
@@ -13,10 +13,11 @@
|
||||
# 60619-1603 - Added variable filtering to eliminate SQL injection attack threat
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 91129-2249 - Replaced SELECT STAR in SQL queries, formatting fixes
|
||||
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
$version = '2.2.0';
|
||||
$build = '91129-2249';
|
||||
$version = '2.2.4-7';
|
||||
$build = '120223-2135';
|
||||
|
||||
require("dbconnect.php");
|
||||
|
||||
@@ -124,12 +125,12 @@ else
|
||||
$server_ip=$row[1];
|
||||
if (!$number_of_lines) {$number_of_lines=$row[2];}
|
||||
|
||||
fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VDremote|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
echo "This remote agent does not exist: |$PHP_AUTH_USER|\n";
|
||||
exit;
|
||||
@@ -137,7 +138,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VDremote|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
|
||||
.verticalBarGraph {
|
||||
border-bottom: 1px solid #FFF;
|
||||
height: 200px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.verticalBarGraph li {
|
||||
border: 1px solid #555;
|
||||
border-bottom: none;
|
||||
bottom: 0;
|
||||
list-style:none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
width: 39px;
|
||||
}
|
||||
|
||||
.barGraph {
|
||||
background: url(images/horizontal_grid_line_50_pixel.png) bottom left;
|
||||
border-bottom: 3px solid #333;
|
||||
font: 9px Helvetica, Geneva, sans-serif;
|
||||
height: 200px;
|
||||
margin: 1em 0;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.barGraph li {
|
||||
background: #666 url(images/bar_50_percent_highlight.png) repeat-y top right;
|
||||
border: 1px solid #555;
|
||||
border-bottom: none;
|
||||
bottom: 0;
|
||||
color: #FFF;
|
||||
margin: 0;
|
||||
padding: 0 0 0 0;
|
||||
position: absolute;
|
||||
list-style: none;
|
||||
text-align: center;
|
||||
width: 39px;
|
||||
}
|
||||
|
||||
.barGraph li.p1{
|
||||
background-color:#FFFFFF;
|
||||
color: #000;
|
||||
}
|
||||
/*
|
||||
.barGraph li.p2{ background-color:#AAAAAA }
|
||||
.barGraph li.p3{ background-color:#888888 }
|
||||
.barGraph li.p4{ background-color:#666666 }
|
||||
*/
|
||||
.barGraph li.p2{ background-color:#B66 }
|
||||
.barGraph li.p3{ background-color:#944 }
|
||||
.barGraph li.p4{ background-color:#722 }
|
||||
@@ -4,7 +4,7 @@
|
||||
# This script is designed to broadcast a recorded message or allow a person to
|
||||
# speak to all agents logged into a VICIDIAL campaign.
|
||||
#
|
||||
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES
|
||||
@@ -12,6 +12,7 @@
|
||||
# 61220-1050 - First Build
|
||||
# 70115-1246 - Added ability to define an exten to play
|
||||
# 90508-0644 - Changed to PHP long tags
|
||||
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
|
||||
#
|
||||
|
||||
require("dbconnect.php");
|
||||
@@ -70,21 +71,20 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if($auth>0)
|
||||
{
|
||||
$office_no=strtoupper($PHP_AUTH_USER);
|
||||
$password=strtoupper($PHP_AUTH_PW);
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|$LOGfullname|\n");
|
||||
$stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$LOGfullname=$row[0];
|
||||
fwrite ($fp, "VICIDIAL|GOOD|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|$LOGfullname|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|$PHP_AUTH_PW|$ip|$browser|\n");
|
||||
fwrite ($fp, "VICIDIAL|FAIL|$date|$PHP_AUTH_USER|XXXX|$ip|$browser|\n");
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ $browser = getenv("HTTP_USER_AGENT");
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$full_name = $row[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -140,91 +139,8 @@ echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"
|
||||
|
||||
<?php
|
||||
if ($NEW_VOICE_LAB > 0)
|
||||
{
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) )
|
||||
{
|
||||
echo "<br><br><br>TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW<br>\n";
|
||||
|
||||
echo "<br>or, you can enter an extension that you want played below<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=PLAY_MESSAGE value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "Message Extension<input type=text name=message>\n";
|
||||
echo "<input type=submit name=submit value='PLAY THIS MESSAGE'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id";
|
||||
|
||||
$thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y"));
|
||||
$past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old);
|
||||
|
||||
$stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$agents_to_loop = mysql_num_rows($rslt);
|
||||
$agents_sessions[0]='';
|
||||
$agents_servers[0]='';
|
||||
$agents_users[0]='';
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$agents_sessions[$o] = "$rowx[0]";
|
||||
$agents_servers[$o] = "$rowx[1]";
|
||||
$agents_users[$o] = "$rowx[2]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
if ($agents_servers[$o] == "$server_ip")
|
||||
{$dial_string = $session_id;}
|
||||
else
|
||||
{$dial_string = $remote_dialstring;}
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n";
|
||||
|
||||
$o++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "<input type=submit name=submit value='KILL THIS VOICE LAB'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($PLAY_MESSAGE > 0)
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) )
|
||||
{
|
||||
echo "<br><br><br>TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW<br>\n";
|
||||
|
||||
@@ -237,14 +153,56 @@ else
|
||||
echo "<input type=submit name=submit value='PLAY THIS MESSAGE'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
$nn='99';
|
||||
$n='9';
|
||||
$S='*';
|
||||
$D_s_ip = explode('.', $server_ip);
|
||||
if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";}
|
||||
if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";}
|
||||
if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";}
|
||||
if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";}
|
||||
$remote_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S$session_id";
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$thirty_minutes_old = mktime(date("H"), date("i"), date("s")-30, date("m"), date("d"), date("Y"));
|
||||
$past_thirty = date("Y-m-d H:i:s",$thirty_minutes_old);
|
||||
|
||||
$stmt="SELECT conf_exten,server_ip,user from vicidial_live_agents where last_update_time > '$past_thirty' and campaign_id='$campaign_id';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$agents_to_loop = mysql_num_rows($rslt);
|
||||
$agents_sessions[0]='';
|
||||
$agents_servers[0]='';
|
||||
$agents_users[0]='';
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
$rowx=mysql_fetch_row($rslt);
|
||||
$agents_sessions[$o] = "$rowx[0]";
|
||||
$agents_servers[$o] = "$rowx[1]";
|
||||
$agents_users[$o] = "$rowx[2]";
|
||||
$o++;
|
||||
}
|
||||
|
||||
$o=0;
|
||||
while ($agents_to_loop > $o)
|
||||
{
|
||||
if ($agents_servers[$o] == "$server_ip")
|
||||
{$dial_string = $session_id;}
|
||||
else
|
||||
{$dial_string = $remote_dialstring;}
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$agents_servers[$o]','','Originate','VL$FILE_datetime$o','Channel: $local_DEF$dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $agents_sessions[$o]','Priority: 1','Callerid: VL$FILE_datetime$o','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "LOGGED IN USER $agents_users[$o] at session $agents_sessions[$o] on server $agents_servers[$o]\n";
|
||||
|
||||
$o++;
|
||||
}
|
||||
|
||||
|
||||
echo "MESSAGE $message played at session $session_id on server $server_ip\n";
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
@@ -263,50 +221,91 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br>Start a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=NEW_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
if ($PLAY_MESSAGE > 0)
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) && (strlen($message) > 0) )
|
||||
{
|
||||
echo "<br><br><br>TO START YOUR VOICE LAB, DIAL 9$session_id ON YOUR PHONE NOW<br>\n";
|
||||
|
||||
echo "<br>or, you can enter an extension that you want played below<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=PLAY_MESSAGE value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "Message Extension<input type=text name=message>\n";
|
||||
echo "<input type=submit name=submit value='PLAY THIS MESSAGE'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
$nn='99';
|
||||
$n='9';
|
||||
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VL$FILE_datetime$nn','Channel: $local_DEF$n$session_id$local_AMP$ext_context','Context: $ext_context','Exten: $message','Priority: 1','Callerid: VL$FILE_datetime$nn','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "MESSAGE $message played at session $session_id on server $server_ip\n";
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "<input type=hidden name=server_ip value=$server_ip>\n";
|
||||
echo "<input type=hidden name=campaign_id value=$campaign_id>\n";
|
||||
echo "<input type=submit name=submit value='KILL THIS VOICE LAB'>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<br>Start a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=NEW_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
|
||||
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
echo "<br>Kill a Voice Lab Session: 8600900<form action=$PHP_SELF method=POST>\n";
|
||||
echo "<input type=hidden name=KILL_VOICE_LAB value=2>\n";
|
||||
echo "<input type=hidden name=session_id value=8600900>\n";
|
||||
echo "Your Server: <select size=1 name=server_ip>$servers_list</select>\n";
|
||||
echo "<BR>\n";
|
||||
echo "Campaign: <select size=1 name=campaign_id>$campaigns_list</select>";
|
||||
echo "<BR>\n";
|
||||
echo "<input type=submit name=submit value=submit>\n";
|
||||
echo "</form><BR><BR><BR>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($KILL_VOICE_LAB > 1)
|
||||
{
|
||||
{
|
||||
if ( (strlen($server_ip) > 6) && (strlen($session_id) > 6) && (strlen($campaign_id) > 2) )
|
||||
{
|
||||
$kill_dial_string = "5555$session_id";
|
||||
$hangup_exten='8300';
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
{
|
||||
$kill_dial_string = "5555$session_id";
|
||||
$hangup_exten='8300';
|
||||
$stmt="INSERT INTO vicidial_manager values('','','$MYSQL_datetime','NEW','N','$server_ip','','Originate','VLK$FILE_datetime','Channel: $local_DEF$kill_dial_string$local_AMP$ext_context','Context: $ext_context','Exten: $hangup_exten','Priority: 1','Callerid: VLK$FILE_datetime','','','','','')";
|
||||
echo "|$stmt|\n<BR><BR>\n";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
|
||||
echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n";
|
||||
}
|
||||
echo "VOICELAB SESSION KILLED: $session_id at $server_ip | $KILL_VOICE_LAB\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
{
|
||||
echo "ERROR!!!! Not all info entered properly\n<BR><BR>\n";
|
||||
echo "|$server_ip| |$session_id| |$campaign_id|\n<BR><BR>\n";
|
||||
echo "<a href=\"$PHP_SELF\">Back to main voicelab screen</a>\n<BR><BR>\n";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -0,0 +1,943 @@
|
||||
/* This notice must be untouched at all times.
|
||||
|
||||
wz_jsgraphics.js v. 2.33
|
||||
The latest version is available at
|
||||
http://www.walterzorn.com
|
||||
or http://www.devira.com
|
||||
or http://www.walterzorn.de
|
||||
|
||||
Copyright (c) 2002-2004 Walter Zorn. All rights reserved.
|
||||
Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com )
|
||||
Last modified: 24. 10. 2005
|
||||
|
||||
Performance optimizations for Internet Explorer
|
||||
by Thomas Frank and John Holdsworth.
|
||||
fillPolygon method implemented by Matthieu Haller.
|
||||
|
||||
High Performance JavaScript Graphics Library.
|
||||
Provides methods
|
||||
- to draw lines, rectangles, ellipses, polygons
|
||||
with specifiable line thickness,
|
||||
- to fill rectangles and ellipses
|
||||
- to draw text.
|
||||
NOTE: Operations, functions and branching have rather been optimized
|
||||
to efficiency and speed than to shortness of source code.
|
||||
|
||||
LICENSE: LGPL
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License (LGPL) as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with this library; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA,
|
||||
or see http://www.gnu.org/copyleft/lesser.html
|
||||
*/
|
||||
|
||||
|
||||
var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz,
|
||||
jg_n4 = (document.layers && typeof document.classes != "undefined");
|
||||
|
||||
|
||||
function chkDHTM(x, i)
|
||||
{
|
||||
x = document.body || null;
|
||||
jg_ie = x && typeof x.insertAdjacentHTML != "undefined";
|
||||
jg_dom = (x && !jg_ie &&
|
||||
typeof x.appendChild != "undefined" &&
|
||||
typeof document.createRange != "undefined" &&
|
||||
typeof (i = document.createRange()).setStartBefore != "undefined" &&
|
||||
typeof i.createContextualFragment != "undefined");
|
||||
jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined";
|
||||
jg_fast = jg_ie && document.all && !window.opera;
|
||||
jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined";
|
||||
}
|
||||
|
||||
|
||||
function pntDoc()
|
||||
{
|
||||
this.wnd.document.write(jg_fast? this.htmRpc() : this.htm);
|
||||
this.htm = '';
|
||||
}
|
||||
|
||||
|
||||
function pntCnvDom()
|
||||
{
|
||||
var x = document.createRange();
|
||||
x.setStartBefore(this.cnv);
|
||||
x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm);
|
||||
this.cnv.appendChild(x);
|
||||
this.htm = '';
|
||||
}
|
||||
|
||||
|
||||
function pntCnvIe()
|
||||
{
|
||||
this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm);
|
||||
this.htm = '';
|
||||
}
|
||||
|
||||
|
||||
function pntCnvIhtm()
|
||||
{
|
||||
this.cnv.innerHTML += this.htm;
|
||||
this.htm = '';
|
||||
}
|
||||
|
||||
|
||||
function pntCnv()
|
||||
{
|
||||
this.htm = '';
|
||||
}
|
||||
|
||||
|
||||
function mkDiv(x, y, w, h)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'width:' + w + 'px;'+
|
||||
'height:' + h + 'px;'+
|
||||
'clip:rect(0,'+w+'px,'+h+'px,0);'+
|
||||
'background-color:' + this.color +
|
||||
(!jg_moz? ';overflow:hidden' : '')+
|
||||
';"><\/div>';
|
||||
}
|
||||
|
||||
|
||||
function mkDivIe(x, y, w, h)
|
||||
{
|
||||
this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';';
|
||||
}
|
||||
|
||||
|
||||
function mkDivPrt(x, y, w, h)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;'+
|
||||
'border-left:' + w + 'px solid ' + this.color + ';'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'width:0px;'+
|
||||
'height:' + h + 'px;'+
|
||||
'clip:rect(0,'+w+'px,'+h+'px,0);'+
|
||||
'background-color:' + this.color +
|
||||
(!jg_moz? ';overflow:hidden' : '')+
|
||||
';"><\/div>';
|
||||
}
|
||||
|
||||
|
||||
function mkLyr(x, y, w, h)
|
||||
{
|
||||
this.htm += '<layer '+
|
||||
'left="' + x + '" '+
|
||||
'top="' + y + '" '+
|
||||
'width="' + w + '" '+
|
||||
'height="' + h + '" '+
|
||||
'bgcolor="' + this.color + '"><\/layer>\n';
|
||||
}
|
||||
|
||||
|
||||
var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g;
|
||||
function htmRpc()
|
||||
{
|
||||
return this.htm.replace(
|
||||
regex,
|
||||
'<div style="overflow:hidden;position:absolute;background-color:'+
|
||||
'$1;left:$2;top:$3;width:$4;height:$5"></div>\n');
|
||||
}
|
||||
|
||||
|
||||
function htmPrtRpc()
|
||||
{
|
||||
return this.htm.replace(
|
||||
regex,
|
||||
'<div style="overflow:hidden;position:absolute;background-color:'+
|
||||
'$1;left:$2;top:$3;width:$4;height:$5;border-left:$4px solid $1"></div>\n');
|
||||
}
|
||||
|
||||
|
||||
function mkLin(x1, y1, x2, y2)
|
||||
{
|
||||
if (x1 > x2)
|
||||
{
|
||||
var _x2 = x2;
|
||||
var _y2 = y2;
|
||||
x2 = x1;
|
||||
y2 = y1;
|
||||
x1 = _x2;
|
||||
y1 = _y2;
|
||||
}
|
||||
var dx = x2-x1, dy = Math.abs(y2-y1),
|
||||
x = x1, y = y1,
|
||||
yIncr = (y1 > y2)? -1 : 1;
|
||||
|
||||
if (dx >= dy)
|
||||
{
|
||||
var pr = dy<<1,
|
||||
pru = pr - (dx<<1),
|
||||
p = pr-dx,
|
||||
ox = x;
|
||||
while ((dx--) > 0)
|
||||
{
|
||||
++x;
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(ox, y, x-ox, 1);
|
||||
y += yIncr;
|
||||
p += pru;
|
||||
ox = x;
|
||||
}
|
||||
else p += pr;
|
||||
}
|
||||
this.mkDiv(ox, y, x2-ox+1, 1);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var pr = dx<<1,
|
||||
pru = pr - (dy<<1),
|
||||
p = pr-dy,
|
||||
oy = y;
|
||||
if (y2 <= y1)
|
||||
{
|
||||
while ((dy--) > 0)
|
||||
{
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(x++, y, 1, oy-y+1);
|
||||
y += yIncr;
|
||||
p += pru;
|
||||
oy = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += yIncr;
|
||||
p += pr;
|
||||
}
|
||||
}
|
||||
this.mkDiv(x2, y2, 1, oy-y2+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
while ((dy--) > 0)
|
||||
{
|
||||
y += yIncr;
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(x++, oy, 1, y-oy);
|
||||
p += pru;
|
||||
oy = y;
|
||||
}
|
||||
else p += pr;
|
||||
}
|
||||
this.mkDiv(x2, oy, 1, y2-oy+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mkLin2D(x1, y1, x2, y2)
|
||||
{
|
||||
if (x1 > x2)
|
||||
{
|
||||
var _x2 = x2;
|
||||
var _y2 = y2;
|
||||
x2 = x1;
|
||||
y2 = y1;
|
||||
x1 = _x2;
|
||||
y1 = _y2;
|
||||
}
|
||||
var dx = x2-x1, dy = Math.abs(y2-y1),
|
||||
x = x1, y = y1,
|
||||
yIncr = (y1 > y2)? -1 : 1;
|
||||
|
||||
var s = this.stroke;
|
||||
if (dx >= dy)
|
||||
{
|
||||
if (dx > 0 && s-3 > 0)
|
||||
{
|
||||
var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx;
|
||||
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
|
||||
}
|
||||
else var _s = s;
|
||||
var ad = Math.ceil(s/2);
|
||||
|
||||
var pr = dy<<1,
|
||||
pru = pr - (dx<<1),
|
||||
p = pr-dx,
|
||||
ox = x;
|
||||
while ((dx--) > 0)
|
||||
{
|
||||
++x;
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(ox, y, x-ox+ad, _s);
|
||||
y += yIncr;
|
||||
p += pru;
|
||||
ox = x;
|
||||
}
|
||||
else p += pr;
|
||||
}
|
||||
this.mkDiv(ox, y, x2-ox+ad+1, _s);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (s-3 > 0)
|
||||
{
|
||||
var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy;
|
||||
_s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1;
|
||||
}
|
||||
else var _s = s;
|
||||
var ad = Math.round(s/2);
|
||||
|
||||
var pr = dx<<1,
|
||||
pru = pr - (dy<<1),
|
||||
p = pr-dy,
|
||||
oy = y;
|
||||
if (y2 <= y1)
|
||||
{
|
||||
++ad;
|
||||
while ((dy--) > 0)
|
||||
{
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(x++, y, _s, oy-y+ad);
|
||||
y += yIncr;
|
||||
p += pru;
|
||||
oy = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
y += yIncr;
|
||||
p += pr;
|
||||
}
|
||||
}
|
||||
this.mkDiv(x2, y2, _s, oy-y2+ad);
|
||||
}
|
||||
else
|
||||
{
|
||||
while ((dy--) > 0)
|
||||
{
|
||||
y += yIncr;
|
||||
if (p > 0)
|
||||
{
|
||||
this.mkDiv(x++, oy, _s, y-oy+ad);
|
||||
p += pru;
|
||||
oy = y;
|
||||
}
|
||||
else p += pr;
|
||||
}
|
||||
this.mkDiv(x2, oy, _s, y2-oy+ad+1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mkLinDott(x1, y1, x2, y2)
|
||||
{
|
||||
if (x1 > x2)
|
||||
{
|
||||
var _x2 = x2;
|
||||
var _y2 = y2;
|
||||
x2 = x1;
|
||||
y2 = y1;
|
||||
x1 = _x2;
|
||||
y1 = _y2;
|
||||
}
|
||||
var dx = x2-x1, dy = Math.abs(y2-y1),
|
||||
x = x1, y = y1,
|
||||
yIncr = (y1 > y2)? -1 : 1,
|
||||
drw = true;
|
||||
if (dx >= dy)
|
||||
{
|
||||
var pr = dy<<1,
|
||||
pru = pr - (dx<<1),
|
||||
p = pr-dx;
|
||||
while ((dx--) > 0)
|
||||
{
|
||||
if (drw) this.mkDiv(x, y, 1, 1);
|
||||
drw = !drw;
|
||||
if (p > 0)
|
||||
{
|
||||
y += yIncr;
|
||||
p += pru;
|
||||
}
|
||||
else p += pr;
|
||||
++x;
|
||||
}
|
||||
if (drw) this.mkDiv(x, y, 1, 1);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var pr = dx<<1,
|
||||
pru = pr - (dy<<1),
|
||||
p = pr-dy;
|
||||
while ((dy--) > 0)
|
||||
{
|
||||
if (drw) this.mkDiv(x, y, 1, 1);
|
||||
drw = !drw;
|
||||
y += yIncr;
|
||||
if (p > 0)
|
||||
{
|
||||
++x;
|
||||
p += pru;
|
||||
}
|
||||
else p += pr;
|
||||
}
|
||||
if (drw) this.mkDiv(x, y, 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mkOv(left, top, width, height)
|
||||
{
|
||||
var a = width>>1, b = height>>1,
|
||||
wod = width&1, hod = (height&1)+1,
|
||||
cx = left+a, cy = top+b,
|
||||
x = 0, y = b,
|
||||
ox = 0, oy = b,
|
||||
aa = (a*a)<<1, bb = (b*b)<<1,
|
||||
st = (aa>>1)*(1-(b<<1)) + bb,
|
||||
tt = (bb>>1) - aa*((b<<1)-1),
|
||||
w, h;
|
||||
while (y > 0)
|
||||
{
|
||||
if (st < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3);
|
||||
tt += (bb<<1)*(++x);
|
||||
}
|
||||
else if (tt < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
|
||||
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
|
||||
w = x-ox;
|
||||
h = oy-y;
|
||||
if (w&2 && h&2)
|
||||
{
|
||||
this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1);
|
||||
this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1);
|
||||
}
|
||||
else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h);
|
||||
ox = x;
|
||||
oy = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
tt -= aa*((y<<1)-3);
|
||||
st -= (aa<<1)*(--y);
|
||||
}
|
||||
}
|
||||
this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod);
|
||||
this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod);
|
||||
}
|
||||
|
||||
|
||||
function mkOv2D(left, top, width, height)
|
||||
{
|
||||
var s = this.stroke;
|
||||
width += s-1;
|
||||
height += s-1;
|
||||
var a = width>>1, b = height>>1,
|
||||
wod = width&1, hod = (height&1)+1,
|
||||
cx = left+a, cy = top+b,
|
||||
x = 0, y = b,
|
||||
aa = (a*a)<<1, bb = (b*b)<<1,
|
||||
st = (aa>>1)*(1-(b<<1)) + bb,
|
||||
tt = (bb>>1) - aa*((b<<1)-1);
|
||||
|
||||
if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0))
|
||||
{
|
||||
var ox = 0, oy = b,
|
||||
w, h,
|
||||
pxl, pxr, pxt, pxb, pxw;
|
||||
while (y > 0)
|
||||
{
|
||||
if (st < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3);
|
||||
tt += (bb<<1)*(++x);
|
||||
}
|
||||
else if (tt < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
|
||||
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
|
||||
w = x-ox;
|
||||
h = oy-y;
|
||||
|
||||
if (w-1)
|
||||
{
|
||||
pxw = w+1+(s&1);
|
||||
h = s;
|
||||
}
|
||||
else if (h-1)
|
||||
{
|
||||
pxw = s;
|
||||
h += 1+(s&1);
|
||||
}
|
||||
else pxw = h = s;
|
||||
this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h);
|
||||
ox = x;
|
||||
oy = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
tt -= aa*((y<<1)-3);
|
||||
st -= (aa<<1)*(--y);
|
||||
}
|
||||
}
|
||||
this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod);
|
||||
this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
var _a = (width-((s-1)<<1))>>1,
|
||||
_b = (height-((s-1)<<1))>>1,
|
||||
_x = 0, _y = _b,
|
||||
_aa = (_a*_a)<<1, _bb = (_b*_b)<<1,
|
||||
_st = (_aa>>1)*(1-(_b<<1)) + _bb,
|
||||
_tt = (_bb>>1) - _aa*((_b<<1)-1),
|
||||
|
||||
pxl = new Array(),
|
||||
pxt = new Array(),
|
||||
_pxb = new Array();
|
||||
pxl[0] = 0;
|
||||
pxt[0] = b;
|
||||
_pxb[0] = _b-1;
|
||||
while (y > 0)
|
||||
{
|
||||
if (st < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3);
|
||||
tt += (bb<<1)*(++x);
|
||||
pxl[pxl.length] = x;
|
||||
pxt[pxt.length] = y;
|
||||
}
|
||||
else if (tt < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3) - (aa<<1)*(y-1);
|
||||
tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3);
|
||||
pxl[pxl.length] = x;
|
||||
pxt[pxt.length] = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
tt -= aa*((y<<1)-3);
|
||||
st -= (aa<<1)*(--y);
|
||||
}
|
||||
|
||||
if (_y > 0)
|
||||
{
|
||||
if (_st < 0)
|
||||
{
|
||||
_st += _bb*((_x<<1)+3);
|
||||
_tt += (_bb<<1)*(++_x);
|
||||
_pxb[_pxb.length] = _y-1;
|
||||
}
|
||||
else if (_tt < 0)
|
||||
{
|
||||
_st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1);
|
||||
_tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3);
|
||||
_pxb[_pxb.length] = _y-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
_tt -= _aa*((_y<<1)-3);
|
||||
_st -= (_aa<<1)*(--_y);
|
||||
_pxb[_pxb.length-1]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var ox = 0, oy = b,
|
||||
_oy = _pxb[0],
|
||||
l = pxl.length,
|
||||
w, h;
|
||||
for (var i = 0; i < l; i++)
|
||||
{
|
||||
if (typeof _pxb[i] != "undefined")
|
||||
{
|
||||
if (_pxb[i] < _oy || pxt[i] < oy)
|
||||
{
|
||||
x = pxl[i];
|
||||
this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy);
|
||||
ox = x;
|
||||
oy = pxt[i];
|
||||
_oy = _pxb[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
x = pxl[i];
|
||||
this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod);
|
||||
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
|
||||
ox = x;
|
||||
oy = pxt[i];
|
||||
}
|
||||
}
|
||||
this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod);
|
||||
this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mkOvDott(left, top, width, height)
|
||||
{
|
||||
var a = width>>1, b = height>>1,
|
||||
wod = width&1, hod = height&1,
|
||||
cx = left+a, cy = top+b,
|
||||
x = 0, y = b,
|
||||
aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
|
||||
st = (aa2>>1)*(1-(b<<1)) + bb,
|
||||
tt = (bb>>1) - aa2*((b<<1)-1),
|
||||
drw = true;
|
||||
while (y > 0)
|
||||
{
|
||||
if (st < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3);
|
||||
tt += (bb<<1)*(++x);
|
||||
}
|
||||
else if (tt < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3) - aa4*(y-1);
|
||||
tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
|
||||
}
|
||||
else
|
||||
{
|
||||
tt -= aa2*((y<<1)-3);
|
||||
st -= aa4*(--y);
|
||||
}
|
||||
if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1);
|
||||
drw = !drw;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mkRect(x, y, w, h)
|
||||
{
|
||||
var s = this.stroke;
|
||||
this.mkDiv(x, y, w, s);
|
||||
this.mkDiv(x+w, y, s, h);
|
||||
this.mkDiv(x, y+h, w+s, s);
|
||||
this.mkDiv(x, y+s, s, h-s);
|
||||
}
|
||||
|
||||
|
||||
function mkRectDott(x, y, w, h)
|
||||
{
|
||||
this.drawLine(x, y, x+w, y);
|
||||
this.drawLine(x+w, y, x+w, y+h);
|
||||
this.drawLine(x, y+h, x+w, y+h);
|
||||
this.drawLine(x, y, x, y+h);
|
||||
}
|
||||
|
||||
|
||||
function jsgFont()
|
||||
{
|
||||
this.PLAIN = 'font-weight:normal;';
|
||||
this.BOLD = 'font-weight:bold;';
|
||||
this.ITALIC = 'font-style:italic;';
|
||||
this.ITALIC_BOLD = this.ITALIC + this.BOLD;
|
||||
this.BOLD_ITALIC = this.ITALIC_BOLD;
|
||||
}
|
||||
var Font = new jsgFont();
|
||||
|
||||
|
||||
function jsgStroke()
|
||||
{
|
||||
this.DOTTED = -1;
|
||||
}
|
||||
var Stroke = new jsgStroke();
|
||||
|
||||
|
||||
function jsGraphics(id, wnd)
|
||||
{
|
||||
this.setColor = new Function('arg', 'this.color = arg.toLowerCase();');
|
||||
|
||||
this.setStroke = function(x)
|
||||
{
|
||||
this.stroke = x;
|
||||
if (!(x+1))
|
||||
{
|
||||
this.drawLine = mkLinDott;
|
||||
this.mkOv = mkOvDott;
|
||||
this.drawRect = mkRectDott;
|
||||
}
|
||||
else if (x-1 > 0)
|
||||
{
|
||||
this.drawLine = mkLin2D;
|
||||
this.mkOv = mkOv2D;
|
||||
this.drawRect = mkRect;
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drawLine = mkLin;
|
||||
this.mkOv = mkOv;
|
||||
this.drawRect = mkRect;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.setPrintable = function(arg)
|
||||
{
|
||||
this.printable = arg;
|
||||
if (jg_fast)
|
||||
{
|
||||
this.mkDiv = mkDivIe;
|
||||
this.htmRpc = arg? htmPrtRpc : htmRpc;
|
||||
}
|
||||
else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv;
|
||||
};
|
||||
|
||||
|
||||
this.setFont = function(fam, sz, sty)
|
||||
{
|
||||
this.ftFam = fam;
|
||||
this.ftSz = sz;
|
||||
this.ftSty = sty || Font.PLAIN;
|
||||
};
|
||||
|
||||
|
||||
this.drawPolyline = this.drawPolyLine = function(x, y, s)
|
||||
{
|
||||
for (var i=0 ; i<x.length-1 ; i++ )
|
||||
this.drawLine(x[i], y[i], x[i+1], y[i+1]);
|
||||
};
|
||||
|
||||
|
||||
this.fillRect = function(x, y, w, h)
|
||||
{
|
||||
this.mkDiv(x, y, w, h);
|
||||
};
|
||||
|
||||
|
||||
this.drawPolygon = function(x, y)
|
||||
{
|
||||
this.drawPolyline(x, y);
|
||||
this.drawLine(x[x.length-1], y[x.length-1], x[0], y[0]);
|
||||
};
|
||||
|
||||
|
||||
this.drawEllipse = this.drawOval = function(x, y, w, h)
|
||||
{
|
||||
this.mkOv(x, y, w, h);
|
||||
};
|
||||
|
||||
|
||||
this.fillEllipse = this.fillOval = function(left, top, w, h)
|
||||
{
|
||||
var a = (w -= 1)>>1, b = (h -= 1)>>1,
|
||||
wod = (w&1)+1, hod = (h&1)+1,
|
||||
cx = left+a, cy = top+b,
|
||||
x = 0, y = b,
|
||||
ox = 0, oy = b,
|
||||
aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1,
|
||||
st = (aa2>>1)*(1-(b<<1)) + bb,
|
||||
tt = (bb>>1) - aa2*((b<<1)-1),
|
||||
pxl, dw, dh;
|
||||
if (w+1) while (y > 0)
|
||||
{
|
||||
if (st < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3);
|
||||
tt += (bb<<1)*(++x);
|
||||
}
|
||||
else if (tt < 0)
|
||||
{
|
||||
st += bb*((x<<1)+3) - aa4*(y-1);
|
||||
pxl = cx-x;
|
||||
dw = (x<<1)+wod;
|
||||
tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3);
|
||||
dh = oy-y;
|
||||
this.mkDiv(pxl, cy-oy, dw, dh);
|
||||
this.mkDiv(pxl, cy+y+hod, dw, dh);
|
||||
ox = x;
|
||||
oy = y;
|
||||
}
|
||||
else
|
||||
{
|
||||
tt -= aa2*((y<<1)-3);
|
||||
st -= aa4*(--y);
|
||||
}
|
||||
}
|
||||
this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod);
|
||||
};
|
||||
|
||||
|
||||
/* fillPolygon method, implemented by Matthieu Haller.
|
||||
This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib.
|
||||
C source of GD 1.8.4 found at http://www.boutell.com/gd/
|
||||
|
||||
THANKS to Kirsten Schulz for the polygon fixes!
|
||||
|
||||
The intersection finding technique of this code could be improved
|
||||
by remembering the previous intertersection, and by using the slope.
|
||||
That could help to adjust intersections to produce a nice
|
||||
interior_extrema. */
|
||||
this.fillPolygon = function(array_x, array_y)
|
||||
{
|
||||
var i;
|
||||
var y;
|
||||
var miny, maxy;
|
||||
var x1, y1;
|
||||
var x2, y2;
|
||||
var ind1, ind2;
|
||||
var ints;
|
||||
|
||||
var n = array_x.length;
|
||||
|
||||
if (!n) return;
|
||||
|
||||
|
||||
miny = array_y[0];
|
||||
maxy = array_y[0];
|
||||
for (i = 1; i < n; i++)
|
||||
{
|
||||
if (array_y[i] < miny)
|
||||
miny = array_y[i];
|
||||
|
||||
if (array_y[i] > maxy)
|
||||
maxy = array_y[i];
|
||||
}
|
||||
for (y = miny; y <= maxy; y++)
|
||||
{
|
||||
var polyInts = new Array();
|
||||
ints = 0;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (!i)
|
||||
{
|
||||
ind1 = n-1;
|
||||
ind2 = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ind1 = i-1;
|
||||
ind2 = i;
|
||||
}
|
||||
y1 = array_y[ind1];
|
||||
y2 = array_y[ind2];
|
||||
if (y1 < y2)
|
||||
{
|
||||
x1 = array_x[ind1];
|
||||
x2 = array_x[ind2];
|
||||
}
|
||||
else if (y1 > y2)
|
||||
{
|
||||
y2 = array_y[ind1];
|
||||
y1 = array_y[ind2];
|
||||
x2 = array_x[ind1];
|
||||
x1 = array_x[ind2];
|
||||
}
|
||||
else continue;
|
||||
|
||||
// modified 11. 2. 2004 Walter Zorn
|
||||
if ((y >= y1) && (y < y2))
|
||||
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
|
||||
|
||||
else if ((y == maxy) && (y > y1) && (y <= y2))
|
||||
polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1);
|
||||
}
|
||||
polyInts.sort(integer_compare);
|
||||
for (i = 0; i < ints; i+=2)
|
||||
this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.drawString = function(txt, x, y)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;white-space:nowrap;'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'font-family:' + this.ftFam + ';'+
|
||||
'font-size:' + this.ftSz + ';'+
|
||||
'color:' + this.color + ';' + this.ftSty + '">'+
|
||||
txt +
|
||||
'<\/div>';
|
||||
};
|
||||
|
||||
|
||||
/* drawStringRect() added by Rick Blommers.
|
||||
Allows to specify the size of the text rectangle and to align the
|
||||
text both horizontally (e.g. right) and vertically within that rectangle */
|
||||
this.drawStringRect = function(txt, x, y, width, halign)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;overflow:hidden;'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'width:'+width +'px;'+
|
||||
'text-align:'+halign+';'+
|
||||
'font-family:' + this.ftFam + ';'+
|
||||
'font-size:' + this.ftSz + ';'+
|
||||
'color:' + this.color + ';' + this.ftSty + '">'+
|
||||
txt +
|
||||
'<\/div>';
|
||||
};
|
||||
|
||||
|
||||
this.drawImage = function(imgSrc, x, y, w, h, a)
|
||||
{
|
||||
this.htm += '<div style="position:absolute;'+
|
||||
'left:' + x + 'px;'+
|
||||
'top:' + y + 'px;'+
|
||||
'width:' + w + ';'+
|
||||
'height:' + h + ';">'+
|
||||
'<img src="' + imgSrc + '" width="' + w + '" height="' + h + '"' + (a? (' '+a) : '') + '>'+
|
||||
'<\/div>';
|
||||
};
|
||||
|
||||
|
||||
this.clear = function()
|
||||
{
|
||||
this.htm = "";
|
||||
if (this.cnv) this.cnv.innerHTML = this.defhtm;
|
||||
};
|
||||
|
||||
|
||||
this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h)
|
||||
{
|
||||
this.mkDiv(xr+cx, yt+cy, w, h);
|
||||
this.mkDiv(xr+cx, yb+cy, w, h);
|
||||
this.mkDiv(xl+cx, yb+cy, w, h);
|
||||
this.mkDiv(xl+cx, yt+cy, w, h);
|
||||
};
|
||||
|
||||
this.setStroke(1);
|
||||
this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN);
|
||||
this.color = '#000000';
|
||||
this.htm = '';
|
||||
this.wnd = wnd || window;
|
||||
|
||||
if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM();
|
||||
if (typeof id != 'string' || !id) this.paint = pntDoc;
|
||||
else
|
||||
{
|
||||
this.cnv = document.all? (this.wnd.document.all[id] || null)
|
||||
: document.getElementById? (this.wnd.document.getElementById(id) || null)
|
||||
: null;
|
||||
this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : '';
|
||||
this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv;
|
||||
}
|
||||
|
||||
this.setPrintable(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function integer_compare(x,y)
|
||||
{
|
||||
return (x < y) ? -1 : ((x > y)*1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user