Added CALLID as a recording filename variable
Added IMAP and POP3 debug flag option when --debugX used Added Called Counts List IDs Report git-svn-id: svn://192.168.202.10@2086 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -191,6 +191,8 @@ OTHER CHANGES:
|
|||||||
34. Added Agent API functions for preview_dial_action while previewing or
|
34. Added Agent API functions for preview_dial_action while previewing or
|
||||||
manual alt dialing a lead
|
manual alt dialing a lead
|
||||||
|
|
||||||
|
35. Added Called Counts List IDs Report
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
#
|
||||||
# VD_amd.agi version 2.6
|
# VD_amd.agi version 2.8
|
||||||
#
|
#
|
||||||
# runs after a call goes through AMD in extensions.conf to send the call on to
|
# runs after a call goes through AMD in extensions.conf to send the call on to
|
||||||
# it's proper destination, or when agent sends to VM message
|
# it's proper destination, or when agent sends to VM message
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
# exten => _8320*.,1,AGI(VD_amd.agi,${EXTEN}-----YES)
|
# exten => _8320*.,1,AGI(VD_amd.agi,${EXTEN}-----YES)
|
||||||
# exten => _8320*.,2,Hangup
|
# exten => _8320*.,2,Hangup
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# changes:
|
# changes:
|
||||||
# 60206-1434 - first build
|
# 60206-1434 - first build
|
||||||
@@ -45,6 +45,7 @@
|
|||||||
# 120430-2214 - Converted call to Monitor app to be asterisk 1.8 compatible
|
# 120430-2214 - Converted call to Monitor app to be asterisk 1.8 compatible
|
||||||
# 130108-1808 - Changes for Asterisk 1.8 compatibility
|
# 130108-1808 - Changes for Asterisk 1.8 compatibility
|
||||||
# 130210-1113 - Added options for CALLMENU|INGROUP cpd_amd_actions
|
# 130210-1113 - Added options for CALLMENU|INGROUP cpd_amd_actions
|
||||||
|
# 140312-2110 - Added CALLID as recording filename variable
|
||||||
#
|
#
|
||||||
|
|
||||||
$script = 'VD_amd.agi';
|
$script = 'VD_amd.agi';
|
||||||
@@ -507,6 +508,7 @@ else
|
|||||||
$campaign_rec_filename =~ s/AGENT/VDAD/gi;
|
$campaign_rec_filename =~ s/AGENT/VDAD/gi;
|
||||||
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
||||||
$campaign_rec_filename =~ s/LEADID/$VD_lead_id/gi;
|
$campaign_rec_filename =~ s/LEADID/$VD_lead_id/gi;
|
||||||
|
$campaign_rec_filename =~ s/CALLID/$callerid/gi;
|
||||||
$campaign_rec_filename =~ s/\"|\'//gi;
|
$campaign_rec_filename =~ s/\"|\'//gi;
|
||||||
$campaign_rec_filename =~ s/ //gi;
|
$campaign_rec_filename =~ s/ //gi;
|
||||||
|
|
||||||
|
|||||||
@@ -189,6 +189,7 @@
|
|||||||
# 131209-1539 - Added called_count logging
|
# 131209-1539 - Added called_count logging
|
||||||
# 140126-1129 - Added VMAIL_NO_INST options
|
# 140126-1129 - Added VMAIL_NO_INST options
|
||||||
# 140215-2133 - Added several variable options for QM socket URL
|
# 140215-2133 - Added several variable options for QM socket URL
|
||||||
|
# 140312-2111 - Added CALLID as recording filename variable
|
||||||
#
|
#
|
||||||
|
|
||||||
$script = 'agi-VDAD_ALL_inbound.agi';
|
$script = 'agi-VDAD_ALL_inbound.agi';
|
||||||
@@ -3299,6 +3300,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) && ($MCdrop_override
|
|||||||
$campaign_rec_filename =~ s/AGENT/$VDADuser/gi;
|
$campaign_rec_filename =~ s/AGENT/$VDADuser/gi;
|
||||||
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
||||||
$campaign_rec_filename =~ s/LEADID/$insert_lead_id/gi;
|
$campaign_rec_filename =~ s/LEADID/$insert_lead_id/gi;
|
||||||
|
$campaign_rec_filename =~ s/CALLID/$callerid/gi;
|
||||||
$campaign_rec_filename =~ s/\"|\'//gi;
|
$campaign_rec_filename =~ s/\"|\'//gi;
|
||||||
|
|
||||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
#
|
#
|
||||||
# agi-VDAD_RINGALL.agi version 2.6
|
# agi-VDAD_RINGALL.agi version 2.8
|
||||||
#
|
#
|
||||||
# NOTE: this script is used for on-hook agents to be connected to customer calls
|
# NOTE: this script is used for on-hook agents to be connected to customer calls
|
||||||
# when they answer their ringing phones
|
# when they answer their ringing phones
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
# exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
|
# exten => _8331*.,n,AGI(agi-VDAD_RINGALL.agi,${EXTEN})
|
||||||
# exten => _8331*.,n,Hangup
|
# exten => _8331*.,n,Hangup
|
||||||
#
|
#
|
||||||
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||||
#
|
#
|
||||||
# changes:
|
# changes:
|
||||||
# 110303-2325 - First build
|
# 110303-2325 - First build
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
# 110325-1411 - Added user recording override settings checking for remote agent recording
|
# 110325-1411 - Added user recording override settings checking for remote agent recording
|
||||||
# 121114-1935 - Added INGROUP recording option
|
# 121114-1935 - Added INGROUP recording option
|
||||||
# 130108-1808 - Changes for Asterisk 1.8 compatibility
|
# 130108-1808 - Changes for Asterisk 1.8 compatibility
|
||||||
|
# 140312-2112 - Added CALLID as recording filename variable
|
||||||
#
|
#
|
||||||
|
|
||||||
$script = 'agi-VDAD_RINGALL.agi';
|
$script = 'agi-VDAD_RINGALL.agi';
|
||||||
@@ -172,7 +173,7 @@ if ($channel =~ /^Local/)
|
|||||||
|
|
||||||
|
|
||||||
### Check that the call exists, if not then buzz and hangup ###
|
### Check that the call exists, if not then buzz and hangup ###
|
||||||
$stmtA = "SELECT campaign_id,call_type,extension,phone_number,lead_id FROM vicidial_auto_calls where auto_call_id='$auto_call_id';";
|
$stmtA = "SELECT campaign_id,call_type,extension,phone_number,lead_id,callerid FROM vicidial_auto_calls where auto_call_id='$auto_call_id';";
|
||||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||||
$VACcount=$sthA->rows;
|
$VACcount=$sthA->rows;
|
||||||
@@ -184,6 +185,7 @@ if ($VACcount > 0)
|
|||||||
$VAC_extension = $aryA[2];
|
$VAC_extension = $aryA[2];
|
||||||
$VAC_phone_number = $aryA[3];
|
$VAC_phone_number = $aryA[3];
|
||||||
$VAC_lead_id = $aryA[4];
|
$VAC_lead_id = $aryA[4];
|
||||||
|
$VAC_call_id = $aryA[5];
|
||||||
if ($AGILOG) {$agi_string = "-- VAC Call Found: |$callerid|$VAC_campaign_id|$VAC_call_type|$VAC_extension|$VAC_phone_number|$VAC_lead_id|$auto_call_id|"; &agi_output;}
|
if ($AGILOG) {$agi_string = "-- VAC Call Found: |$callerid|$VAC_campaign_id|$VAC_call_type|$VAC_extension|$VAC_phone_number|$VAC_lead_id|$auto_call_id|"; &agi_output;}
|
||||||
$sthA->finish();
|
$sthA->finish();
|
||||||
}
|
}
|
||||||
@@ -336,6 +338,7 @@ if ($NAGcount > 0)
|
|||||||
$campaign_rec_filename =~ s/AGENT/$dial_user/gi;
|
$campaign_rec_filename =~ s/AGENT/$dial_user/gi;
|
||||||
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
$campaign_rec_filename =~ s/VENDORLEADCODE/$vendor_lead_code/gi;
|
||||||
$campaign_rec_filename =~ s/LEADID/$VAC_lead_id/gi;
|
$campaign_rec_filename =~ s/LEADID/$VAC_lead_id/gi;
|
||||||
|
$campaign_rec_filename =~ s/CALLID/$VAC_call_id/gi;
|
||||||
$campaign_rec_filename =~ s/\"|\'//gi;
|
$campaign_rec_filename =~ s/\"|\'//gi;
|
||||||
|
|
||||||
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
%ast_ver_str = parse_asterisk_version($asterisk_version);
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ use MIME::QuotedPrint;
|
|||||||
# 130607-0155 - Encoding fix
|
# 130607-0155 - Encoding fix
|
||||||
# 140212-0719 - Added ignoresizeerrors option, changed debug and added --force-check option
|
# 140212-0719 - Added ignoresizeerrors option, changed debug and added --force-check option
|
||||||
# 140225-1241 - Added option for SSL no-cert-verify (--ssl-no-cert)
|
# 140225-1241 - Added option for SSL no-cert-verify (--ssl-no-cert)
|
||||||
|
# 140313-0905 - Added Debug options when --debugX for both IMAP and POP3
|
||||||
#
|
#
|
||||||
|
|
||||||
# default path to astguiclient configuration file:
|
# default path to astguiclient configuration file:
|
||||||
@@ -247,6 +248,7 @@ while (@row=$rslt->fetchrow_array) {
|
|||||||
User => "$VARemail_user",
|
User => "$VARemail_user",
|
||||||
Password => "$VARemail_pwd",
|
Password => "$VARemail_pwd",
|
||||||
Ignoresizeerrors => 1,
|
Ignoresizeerrors => 1,
|
||||||
|
Debug => "$DBX",
|
||||||
Socket => IO::Socket::SSL->new
|
Socket => IO::Socket::SSL->new
|
||||||
( Proto => 'tcp',
|
( Proto => 'tcp',
|
||||||
PeerAddr => "$VARemail_server",
|
PeerAddr => "$VARemail_server",
|
||||||
@@ -264,6 +266,7 @@ while (@row=$rslt->fetchrow_array) {
|
|||||||
Port => 993,
|
Port => 993,
|
||||||
Ssl => 1,
|
Ssl => 1,
|
||||||
Ignoresizeerrors => 1,
|
Ignoresizeerrors => 1,
|
||||||
|
Debug => "$DBX",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -617,6 +620,7 @@ while (@row=$rslt->fetchrow_array) {
|
|||||||
HOST => "$VARemail_server",
|
HOST => "$VARemail_server",
|
||||||
PORT => 995,
|
PORT => 995,
|
||||||
USESSL => true,
|
USESSL => true,
|
||||||
|
DEBUG => "$DBX",
|
||||||
)
|
)
|
||||||
or die "Cannot connect through POP3Client: $!";
|
or die "Cannot connect through POP3Client: $!";
|
||||||
|
|
||||||
@@ -947,7 +951,7 @@ while (@row=$rslt->fetchrow_array) {
|
|||||||
HOST => "$VARemail_server",
|
HOST => "$VARemail_server",
|
||||||
PORT => 995,
|
PORT => 995,
|
||||||
USESSL => true,
|
USESSL => true,
|
||||||
#DEBUG => true,
|
DEBUG => "$DBX",
|
||||||
)
|
)
|
||||||
or die "Cannot connect through POP3Client: $!";
|
or die "Cannot connect through POP3Client: $!";
|
||||||
$pop->Close();
|
$pop->Close();
|
||||||
|
|||||||
@@ -422,10 +422,11 @@
|
|||||||
# 140214-1851 - Added preview_dial_action API function
|
# 140214-1851 - Added preview_dial_action API function
|
||||||
# 140301-2059 - Added API functions options for SEARCH for phone within lead_id and Dial Next Number
|
# 140301-2059 - Added API functions options for SEARCH for phone within lead_id and Dial Next Number
|
||||||
# 140302-1018 - Changes to allow for & and + in standard fields
|
# 140302-1018 - Changes to allow for & and + in standard fields
|
||||||
|
# 140312-2109 - Added CALLID as recording filename variable
|
||||||
#
|
#
|
||||||
|
|
||||||
$version = '2.8-391c';
|
$version = '2.8-392c';
|
||||||
$build = '140302-1018';
|
$build = '140312-2109';
|
||||||
$mel=1; # Mysql Error Log enabled = 1
|
$mel=1; # Mysql Error Log enabled = 1
|
||||||
$mysql_log_count=79;
|
$mysql_log_count=79;
|
||||||
$one_mysql_log=0;
|
$one_mysql_log=0;
|
||||||
@@ -5250,6 +5251,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
|||||||
var REGrecAGENT = new RegExp("AGENT","g");
|
var REGrecAGENT = new RegExp("AGENT","g");
|
||||||
var REGrecVENDORLEADCODE = new RegExp("VENDORLEADCODE","g");
|
var REGrecVENDORLEADCODE = new RegExp("VENDORLEADCODE","g");
|
||||||
var REGrecLEADID = new RegExp("LEADID","g");
|
var REGrecLEADID = new RegExp("LEADID","g");
|
||||||
|
var REGrecCALLID = new RegExp("CALLID","g");
|
||||||
filename = LIVE_campaign_rec_filename;
|
filename = LIVE_campaign_rec_filename;
|
||||||
filename = filename.replace(REGrecCAMPAIGN, campaign);
|
filename = filename.replace(REGrecCAMPAIGN, campaign);
|
||||||
filename = filename.replace(REGrecINGROUP, VDCL_group_id);
|
filename = filename.replace(REGrecINGROUP, VDCL_group_id);
|
||||||
@@ -5260,6 +5262,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
|||||||
filename = filename.replace(REGrecAGENT, user);
|
filename = filename.replace(REGrecAGENT, user);
|
||||||
filename = filename.replace(REGrecVENDORLEADCODE, recVendorLeadCode);
|
filename = filename.replace(REGrecVENDORLEADCODE, recVendorLeadCode);
|
||||||
filename = filename.replace(REGrecLEADID, recLeadID);
|
filename = filename.replace(REGrecLEADID, recLeadID);
|
||||||
|
filename = filename.replace(REGrecCALLID, LasTCID);
|
||||||
// filename = filedate + "_" + user_abb;
|
// filename = filedate + "_" + user_abb;
|
||||||
var query_recording_exten = recording_exten;
|
var query_recording_exten = recording_exten;
|
||||||
var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context;
|
var channelrec = "Local/" + conf_silent_prefix + '' + taskconfrec + "@" + ext_context;
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
|||||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
$QUERY_STRING = getenv("QUERY_STRING");
|
$QUERY_STRING = getenv("QUERY_STRING");
|
||||||
|
|
||||||
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Hangup Cause Report, Lists Pass Report';
|
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report';
|
||||||
|
|
||||||
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report';
|
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary , Inbound Report, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound Email Report, Inbound IVR Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Fronter - Closer Report, Lists Campaign Statuses Report, Campaign Status List Report, Export Calls Report , Export Leads Report , Agent Time Detail, Agent Status Detail, Agent Performance Detail, Team Performance Detail, Single Agent Daily, User Group Login Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report , Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report';
|
||||||
|
|
||||||
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
|
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
|
||||||
|
|
||||||
@@ -3276,12 +3276,13 @@ else
|
|||||||
# 140214-1643 - Added system settings dialplan reload timestamp
|
# 140214-1643 - Added system settings dialplan reload timestamp
|
||||||
# 140302-0958 - Added Webserver-URL Report
|
# 140302-0958 - Added Webserver-URL Report
|
||||||
# 140305-0846 - Bug fix for list modify admin logging issue
|
# 140305-0846 - Bug fix for list modify admin logging issue
|
||||||
|
# 140313-0727 - Added links to Called Counts List IDs Report
|
||||||
#
|
#
|
||||||
|
|
||||||
# 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
|
# 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.8-428a';
|
$admin_version = '2.8-429a';
|
||||||
$build = '140305-0846';
|
$build = '140313-0727';
|
||||||
|
|
||||||
$STARTtime = date("U");
|
$STARTtime = date("U");
|
||||||
$SQLdate = date("Y-m-d H:i:s");
|
$SQLdate = date("Y-m-d H:i:s");
|
||||||
@@ -31413,7 +31414,10 @@ if ($ADD==999999)
|
|||||||
if ( (preg_match("/Lists Pass Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
if ( (preg_match("/Lists Pass Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||||
{echo "<LI><a href=\"AST_LISTS_pass_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Lists Pass Report</a></FONT>\n";}
|
{echo "<LI><a href=\"AST_LISTS_pass_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Lists Pass Report</a></FONT>\n";}
|
||||||
if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
if ( (preg_match("/Lists Campaign Statuses Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||||
{echo "<LI><a href=\"AST_LISTS_campaign_stats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Lists Campaign Statuses Report</a></FONT>\n";}
|
{echo "<LI><a href=\"AST_LISTS_campaign_stats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Lists Campaign Statuses Report</a></FONT>\n";}
|
||||||
|
if ( (preg_match("/Called Counts List IDs Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||||
|
{echo "<LI><a href=\"called_counts_multilist_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Called Counts List IDs Report</a></FONT>\n";}
|
||||||
|
|
||||||
if ( (preg_match("/Campaign Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
if ( (preg_match("/Campaign Status List Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||||
{echo "<LI><a href=\"AST_campaign_status_list_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Campaign Status List Report</a></FONT>\n";}
|
{echo "<LI><a href=\"AST_campaign_status_list_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>Campaign Status List Report</a></FONT>\n";}
|
||||||
# echo "<LI><a href=\"vicidial_sales_viewer.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>\n";
|
# echo "<LI><a href=\"vicidial_sales_viewer.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>AGENT SPREADSHEET PERFORMANCE</a></FONT>\n";
|
||||||
|
|||||||
@@ -0,0 +1,790 @@
|
|||||||
|
<?php
|
||||||
|
# called_counts_multilist_report.php
|
||||||
|
#
|
||||||
|
# Copyright (C) 2014 Joe Johnson <freewermadmin@gmail.com>, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
|
||||||
|
#
|
||||||
|
# This is a report designed for showing called counts similar to the results
|
||||||
|
# at the bottom of each list detail screen, but for multiple lists and using
|
||||||
|
# a date range, if necessary. The date range will restrict the results returned
|
||||||
|
# to leads called at least once within the given range (the count will still
|
||||||
|
# be cumulative for the entire existence of the leads, however).
|
||||||
|
#
|
||||||
|
# CHANGES
|
||||||
|
# 140311-1940 - First build based upon admin.php & AST_VDADstats.php
|
||||||
|
#
|
||||||
|
|
||||||
|
$startMS = microtime();
|
||||||
|
|
||||||
|
header ("Content-type: text/html; charset=utf-8");
|
||||||
|
|
||||||
|
require("dbconnect_mysqli.php");
|
||||||
|
require("functions.php");
|
||||||
|
|
||||||
|
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||||
|
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||||
|
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||||
|
$QUERY_STRING=$_SERVER['QUERY_STRING'];
|
||||||
|
|
||||||
|
if (isset($_GET["list_ids"])) {$list_ids=$_GET["list_ids"];}
|
||||||
|
elseif (isset($_POST["list_ids"])) {$list_ids=$_POST["list_ids"];}
|
||||||
|
if (isset($_GET["override_date"])) {$override_date=$_GET["override_date"];}
|
||||||
|
elseif (isset($_POST["override_date"])) {$override_date=$_POST["override_date"];}
|
||||||
|
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||||
|
elseif (isset($_POST["group"])) {$group=$_POST["group"];}
|
||||||
|
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||||
|
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||||
|
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||||
|
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||||
|
if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||||
|
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||||
|
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["file_download"])) {$file_download=$_GET["file_download"];}
|
||||||
|
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||||
|
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($bottom_graph)<2) {$bottom_graph='NO';}
|
||||||
|
if (strlen($carrier_stats)<2) {$carrier_stats='NO';}
|
||||||
|
if (strlen($include_rollover)<2) {$include_rollover='NO';}
|
||||||
|
|
||||||
|
$report_name = 'Called Counts List IDs Report';
|
||||||
|
$db_source = 'M';
|
||||||
|
$JS_text="<script language='Javascript'>\n";
|
||||||
|
$JS_onload="onload = function() {\n";
|
||||||
|
|
||||||
|
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||||
|
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db FROM system_settings;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$qm_conf_ct = mysqli_num_rows($rslt);
|
||||||
|
if ($qm_conf_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$non_latin = $row[0];
|
||||||
|
$outbound_autodial_active = $row[1];
|
||||||
|
$slave_db_server = $row[2];
|
||||||
|
$reports_use_slave_db = $row[3];
|
||||||
|
}
|
||||||
|
##### END SETTINGS LOOKUP #####
|
||||||
|
###########################################
|
||||||
|
|
||||||
|
##### SERVER CARRIER LOGGING LOOKUP #####
|
||||||
|
$stmt = "SELECT count(*) FROM servers where carrier_logging_active='Y' and max_vicidial_trunks > 0;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$srv_conf_ct = mysqli_num_rows($rslt);
|
||||||
|
if ($srv_conf_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$carrier_logging_active = $row[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($non_latin < 1)
|
||||||
|
{
|
||||||
|
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||||
|
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
|
||||||
|
$PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
|
||||||
|
}
|
||||||
|
$group = preg_replace("/'|\"|\\\\|;/","",$group);
|
||||||
|
|
||||||
|
$auth=0;
|
||||||
|
$reports_auth=0;
|
||||||
|
$admin_auth=0;
|
||||||
|
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'REPORTS',1);
|
||||||
|
if ($auth_message == 'GOOD')
|
||||||
|
{$auth=1;}
|
||||||
|
|
||||||
|
if ($auth > 0)
|
||||||
|
{
|
||||||
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports > 0;";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$admin_auth=$row[0];
|
||||||
|
|
||||||
|
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports > 0;";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$reports_auth=$row[0];
|
||||||
|
|
||||||
|
if ($reports_auth < 1)
|
||||||
|
{
|
||||||
|
$VDdisplayMESSAGE = "You are not allowed to view reports";
|
||||||
|
Header ("Content-type: text/html; charset=utf-8");
|
||||||
|
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
if ( ($reports_auth > 0) and ($admin_auth < 1) )
|
||||||
|
{
|
||||||
|
$ADD=999999;
|
||||||
|
$reports_only_user=1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$VDdisplayMESSAGE = "Login incorrect, please try again";
|
||||||
|
if ($auth_message == 'LOCK')
|
||||||
|
{
|
||||||
|
$VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes";
|
||||||
|
Header ("Content-type: text/html; charset=utf-8");
|
||||||
|
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||||
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
|
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
##### BEGIN log visit to the vicidial_report_log table #####
|
||||||
|
$LOGip = getenv("REMOTE_ADDR");
|
||||||
|
$LOGbrowser = getenv("HTTP_USER_AGENT");
|
||||||
|
$LOGscript_name = getenv("SCRIPT_NAME");
|
||||||
|
$LOGserver_name = getenv("SERVER_NAME");
|
||||||
|
$LOGserver_port = getenv("SERVER_PORT");
|
||||||
|
$LOGrequest_uri = getenv("REQUEST_URI");
|
||||||
|
$LOGhttp_referer = getenv("HTTP_REFERER");
|
||||||
|
if (preg_match("/443/i",$LOGserver_port)) {$HTTPprotocol = 'https://';}
|
||||||
|
else {$HTTPprotocol = 'http://';}
|
||||||
|
if (($LOGserver_port == '80') or ($LOGserver_port == '443') ) {$LOGserver_port='';}
|
||||||
|
else {$LOGserver_port = ":$LOGserver_port";}
|
||||||
|
$LOGfull_url = "$HTTPprotocol$LOGserver_name$LOGserver_port$LOGrequest_uri";
|
||||||
|
|
||||||
|
$LOGhostname = php_uname('n');
|
||||||
|
if (strlen($LOGhostname)<1) {$LOGhostname='X';}
|
||||||
|
if (strlen($LOGserver_name)<1) {$LOGserver_name='X';}
|
||||||
|
|
||||||
|
$stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$LOGserver_name' and hostname='$LOGhostname' LIMIT 1;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$webserver_id_ct = mysqli_num_rows($rslt);
|
||||||
|
if ($webserver_id_ct > 0)
|
||||||
|
{
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$webserver_id = $row[0];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
##### insert webserver entry
|
||||||
|
$stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$LOGserver_name','$LOGhostname');";
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$affected_rows = mysqli_affected_rows($link);
|
||||||
|
$webserver_id = mysqli_insert_id($link);
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$LOGip', report_name='$report_name', browser='$LOGbrowser', referer='$LOGhttp_referer', notes='$LOGserver_name:$LOGserver_port $LOGscript_name |$group[0], $query_date, $end_date, $shift, $file_download, $report_display_type|', url='$LOGfull_url', webserver='$webserver_id';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$report_log_id = mysqli_insert_id($link);
|
||||||
|
##### END log visit to the vicidial_report_log table #####
|
||||||
|
|
||||||
|
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
||||||
|
{
|
||||||
|
mysqli_close($link);
|
||||||
|
$use_slave_server=1;
|
||||||
|
$db_source = 'S';
|
||||||
|
require("dbconnect_mysqli.php");
|
||||||
|
echo "<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="SELECT user_group from vicidial_users where user='$PHP_AUTH_USER';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$LOGuser_group = $row[0];
|
||||||
|
|
||||||
|
$stmt="SELECT allowed_campaigns,allowed_reports from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$LOGallowed_campaigns = $row[0];
|
||||||
|
$LOGallowed_reports = $row[1];
|
||||||
|
|
||||||
|
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||||
|
{
|
||||||
|
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||||
|
Header("HTTP/1.0 401 Unauthorized");
|
||||||
|
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
$NOW_DATE = date("Y-m-d");
|
||||||
|
$NOW_TIME = date("Y-m-d H:i:s");
|
||||||
|
$STARTtime = date("U");
|
||||||
|
if (!isset($group)) {$group = '';}
|
||||||
|
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||||
|
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||||
|
|
||||||
|
$i=0;
|
||||||
|
$group_string='|';
|
||||||
|
$group_ct = count($group);
|
||||||
|
while($i < $group_ct)
|
||||||
|
{
|
||||||
|
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||||
|
{
|
||||||
|
$group_string .= "$group[$i]|";
|
||||||
|
$group_SQL .= "'$group[$i]',";
|
||||||
|
$groupQS .= "&group[]=$group[$i]";
|
||||||
|
}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$LOGallowed_campaignsSQL='';
|
||||||
|
$whereLOGallowed_campaignsSQL='';
|
||||||
|
if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
|
||||||
|
{
|
||||||
|
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||||
|
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||||
|
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||||
|
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||||
|
}
|
||||||
|
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||||
|
|
||||||
|
$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$campaigns_to_print = mysqli_num_rows($rslt);
|
||||||
|
$i=0;
|
||||||
|
while ($i < $campaigns_to_print)
|
||||||
|
{
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$groups[$i] = $row[0];
|
||||||
|
$group_names[$i] = $row[1];
|
||||||
|
if (preg_match('/\-ALL/',$group_string) )
|
||||||
|
{$group[$i] = $groups[$i];}
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
# grab names of global statuses and statuses in the selected campaign
|
||||||
|
$stmt="SELECT status,status_name from vicidial_statuses order by status;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$statuses_to_print = mysqli_num_rows($rslt);
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
while ($statuses_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysqli_fetch_row($rslt);
|
||||||
|
$statuses_list["$rowx[0]"] = "$rowx[1]";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="SELECT status,status_name from vicidial_campaign_statuses $whereLOGallowed_campaignsSQL order by status;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
$Cstatuses_to_print = mysqli_num_rows($rslt);
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
while ($Cstatuses_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysqli_fetch_row($rslt);
|
||||||
|
$statuses_list["$rowx[0]"] = "$rowx[1]";
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
# end grab status names
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$rollover_groups_count=0;
|
||||||
|
$i=0;
|
||||||
|
$group_string='|';
|
||||||
|
$group_ct = count($group);
|
||||||
|
while($i < $group_ct)
|
||||||
|
{
|
||||||
|
if ( (preg_match("/ $group[$i] /",$regexLOGallowed_campaigns)) or (preg_match("/-ALL/",$LOGallowed_campaigns)) )
|
||||||
|
{
|
||||||
|
$group_string .= "$group[$i]|";
|
||||||
|
$group_SQL .= "'$group[$i]',";
|
||||||
|
$groupQS .= "&group[]=$group[$i]";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match("/YES/i",$include_rollover))
|
||||||
|
{
|
||||||
|
$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_to_mysqli($stmt, $link);
|
||||||
|
if ($DB) {echo "$stmt\n";}
|
||||||
|
$in_groups_to_print = mysqli_num_rows($rslt);
|
||||||
|
if ($in_groups_to_print > 0)
|
||||||
|
{
|
||||||
|
$row=mysqli_fetch_row($rslt);
|
||||||
|
$group_drop_SQL .= "'$row[0]',";
|
||||||
|
|
||||||
|
$rollover_groups_count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
if (strlen($group_drop_SQL) < 2)
|
||||||
|
{$group_drop_SQL = "''";}
|
||||||
|
if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
|
||||||
|
{
|
||||||
|
$group_SQL = "$LOGallowed_campaignsSQL";
|
||||||
|
$group_drop_SQL = "";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$group_SQL = preg_replace('/,$/i', '',$group_SQL);
|
||||||
|
$group_drop_SQL = preg_replace('/,$/i', '',$group_drop_SQL);
|
||||||
|
$both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
|
||||||
|
$both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
|
||||||
|
$group_SQLand = "and campaign_id IN($group_SQL)";
|
||||||
|
$group_SQL = "where campaign_id IN($group_SQL)";
|
||||||
|
$group_drop_SQLand = "and campaign_id IN($group_drop_SQL)";
|
||||||
|
$group_drop_SQL = "where campaign_id IN($group_drop_SQL)";
|
||||||
|
}
|
||||||
|
|
||||||
|
$i=0;
|
||||||
|
$list_id_string='|';
|
||||||
|
$list_id_ct = count($list_ids);
|
||||||
|
while($i < $list_id_ct)
|
||||||
|
{
|
||||||
|
$list_id_string .= "$list_ids[$i]|";
|
||||||
|
$list_id_SQL .= "'$list_ids[$i]',";
|
||||||
|
$list_idQS .= "&list_ids[]=$list_ids[$i]";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
$list_id_title_str=$list_id_SQL;
|
||||||
|
$list_id_title_str=preg_replace('/\'/', '',$list_id_title_str);
|
||||||
|
$list_id_title_str = preg_replace('/,$/i', '',$list_id_title_str);
|
||||||
|
|
||||||
|
# If ALL lists are selected, filter it down to all lists within selected campaigns
|
||||||
|
if ( preg_match('/\-\-ALL\-\-/',$list_id_string) )
|
||||||
|
{
|
||||||
|
$list_id_string='|';
|
||||||
|
$list_id_SQL="";
|
||||||
|
$list_idQS="";
|
||||||
|
$list_stmt="select list_id from vicidial_lists $group_SQL";
|
||||||
|
if ($DB) {echo $list_stmt."\n";}
|
||||||
|
$list_rslt=mysql_to_mysqli($list_stmt, $link);
|
||||||
|
while ($list_row=mysqli_fetch_row($list_rslt))
|
||||||
|
{
|
||||||
|
$list_id_string .= "$list_row[0]|";
|
||||||
|
$list_id_SQL .= "'$list_row[0]',";
|
||||||
|
$list_idQS .= "&list_ids[]=$list_row[0]";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$list_id_SQL = preg_replace('/,$/i', '',$list_id_SQL);
|
||||||
|
$list_id_SQLandVLJOIN = "and vicidial_log.lead_id=vicidial_list.lead_id";
|
||||||
|
$list_id_SQLandVCLJOIN = "and vicidial_closer_log.lead_id=vicidial_list.lead_id";
|
||||||
|
$list_id_SQLandUCLJOIN = "and user_call_log.lead_id=vicidial_list.lead_id";
|
||||||
|
if (strlen($list_id_SQL)>0)
|
||||||
|
{
|
||||||
|
$list_id_SQLandVLJOIN .= " and vicidial_list.list_id IN($list_id_SQL)";
|
||||||
|
$list_id_SQLandVCLJOIN .= " and vicidial_list.list_id IN($list_id_SQL)";
|
||||||
|
$list_id_SQLandUCLJOIN .= " and vicidial_list.list_id IN($list_id_SQL)";
|
||||||
|
$list_id_SQL = "where list_id IN($list_id_SQL)";
|
||||||
|
$list_id_SQLand = "and list_id IN($list_id_SQL)";
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
if ( (preg_match('/\-\-ALL\-\-/',$list_id_string) ) or ($list_id_ct < 1) or (strlen($list_id_string) < 2) )
|
||||||
|
{
|
||||||
|
$list_id_SQL = "";
|
||||||
|
$list_id_drop_SQL = "";
|
||||||
|
$skip_productivity_calc=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$list_id_SQL = preg_replace('/,$/i', '',$list_id_SQL);
|
||||||
|
$skip_productivity_calc=1;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
$HEADER.="<!DOCTYPE HTML>\n";
|
||||||
|
$HEADER.="<HEAD>\n";
|
||||||
|
$HEADER.="<STYLE type=\"text/css\">\n";
|
||||||
|
$HEADER.="<!--\n";
|
||||||
|
$HEADER.=" .green {color: white; background-color: green}\n";
|
||||||
|
$HEADER.=" .red {color: white; background-color: red}\n";
|
||||||
|
$HEADER.=" .blue {color: white; background-color: blue}\n";
|
||||||
|
$HEADER.=" .purple {color: white; background-color: purple}\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.="<script language=\"JavaScript\">\n";
|
||||||
|
$list_stmt="select list_id, list_name, campaign_id from vicidial_lists $whereLOGallowed_campaignsSQL order by list_id asc";
|
||||||
|
$list_rslt=mysql_to_mysqli($list_stmt, $link);
|
||||||
|
$list_rows=mysqli_num_rows($list_rslt);
|
||||||
|
$list_options="<select name='list_ids[]' id='list_ids' multiple size=5>\n";
|
||||||
|
if (preg_match('/\-\-ALL\-\-/',$list_id_string))
|
||||||
|
{$list_options.="<option value=\"--ALL--\" selected>-- ALL LISTS --</option>\n";}
|
||||||
|
else
|
||||||
|
{$list_options.="<option value=\"--ALL--\">-- ALL LISTS --</option>\n";}
|
||||||
|
|
||||||
|
|
||||||
|
if ($list_rows>0) {
|
||||||
|
|
||||||
|
$list_id_ary_str.="var list_id_ary=[";
|
||||||
|
$list_name_ary_str.="var list_name_ary=[";
|
||||||
|
$campaign_id_ary_str.="var campaign_id_ary=[";
|
||||||
|
while ($list_row=mysqli_fetch_row($list_rslt)) {
|
||||||
|
$list_id_ary_str.="'$list_row[0]',";
|
||||||
|
$list_name_ary_str.="'$list_row[1]',";
|
||||||
|
$campaign_id_ary_str.="'$list_row[2]',";
|
||||||
|
|
||||||
|
if (preg_match("/\|$list_row[0]\|/i",$list_id_string)) {$list_options.="<option selected value=\"$list_row[0]\">$list_row[0] - $list_row[1]</option>\n";}
|
||||||
|
else {$list_options.="<option value=\"$list_row[0]\">$list_row[0] - $list_row[1]</option>\n";}
|
||||||
|
|
||||||
|
#$list_options.="\t<option value='$list_row[0]'>$list_row[0] - $list_row[1]</option>\n";
|
||||||
|
}
|
||||||
|
$list_id_ary_str=preg_replace('/,$/', '', $list_id_ary_str)."];\n";
|
||||||
|
$list_name_ary_str=preg_replace('/,$/', '', $list_name_ary_str)."];\n";
|
||||||
|
$campaign_id_ary_str=preg_replace('/,$/', '', $campaign_id_ary_str)."];\n";
|
||||||
|
|
||||||
|
$HEADER.=$list_id_ary_str;
|
||||||
|
$HEADER.=$list_name_ary_str;
|
||||||
|
$HEADER.=$campaign_id_ary_str;
|
||||||
|
}
|
||||||
|
|
||||||
|
$list_options.="</select>\n";
|
||||||
|
|
||||||
|
$HEADER.="function LoadLists(FromBox) {\n";
|
||||||
|
$HEADER.=" if (!FromBox) {alert(\"NO\"); return false;}\n";
|
||||||
|
$HEADER.=" var selectedCampaigns=\"|\";\n";
|
||||||
|
$HEADER.=" var selectedcamps = new Array();\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.=" for(i = 0; i < document.getElementById('group').options.length; i++) {\n";
|
||||||
|
$HEADER.=" if (document.getElementById('group').options[i].selected) {\n";
|
||||||
|
$HEADER.=" selectedCampaigns += document.getElementById('group').options[i].value+\"|\";\n";
|
||||||
|
$HEADER.=" } \n";
|
||||||
|
$HEADER.=" }\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.=" // Clear List menu\n";
|
||||||
|
$HEADER.=" document.getElementById('list_ids').options.length=0;\n";
|
||||||
|
$HEADER.=" var new_list = new Option();\n";
|
||||||
|
$HEADER.=" new_list.value = \"--ALL--\";\n";
|
||||||
|
$HEADER.=" new_list.text = \"--ALL LISTS--\";\n";
|
||||||
|
$HEADER.=" document.getElementById('list_ids')[0] = new_list;\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.=" list_id_index=1;\n";
|
||||||
|
$HEADER.=" for (j=0; j<campaign_id_ary.length; j++) {\n";
|
||||||
|
$HEADER.=" var campaignID=\"/\|\"+campaign_id_ary[j]+\"\|/g\";\n";
|
||||||
|
$HEADER.=" var campaign_matches = selectedCampaigns.match(campaignID);\n";
|
||||||
|
$HEADER.=" if (campaign_matches) {\n";
|
||||||
|
$HEADER.="\n";
|
||||||
|
$HEADER.=" var new_list = new Option();\n";
|
||||||
|
$HEADER.=" new_list.value = list_id_ary[j];\n";
|
||||||
|
$HEADER.=" new_list.text = list_id_ary[j]+\" - \"+list_name_ary[j];\n";
|
||||||
|
$HEADER.=" document.getElementById('list_ids')[list_id_index] = new_list;\n";
|
||||||
|
$HEADER.=" list_id_index++;\n";
|
||||||
|
$HEADER.=" }\n";
|
||||||
|
$HEADER.=" }\n";
|
||||||
|
$HEADER.="}\n";
|
||||||
|
|
||||||
|
$HEADER.="</script>\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";
|
||||||
|
|
||||||
|
$short_header=1;
|
||||||
|
$draw_graph=1;
|
||||||
|
|
||||||
|
#require("admin_header.php");
|
||||||
|
|
||||||
|
$MAIN.="<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||||
|
|
||||||
|
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name=vicidial_report id=vicidial_report>\n";
|
||||||
|
$MAIN.="<TABLE CELLSPACING=3><TR><TD VALIGN=TOP><input type='checkbox' name='override_date' value='1' checked>All dates<BR><BR>Dates:<BR>";
|
||||||
|
$MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
|
||||||
|
$MAIN.="<INPUT TYPE=HIDDEN NAME=outbound_rate VALUE=\"$outbound_rate\">\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";
|
||||||
|
$MAIN.=" 'formname': 'vicidial_report',\n";
|
||||||
|
$MAIN.=" // input name\n";
|
||||||
|
$MAIN.=" 'controlname': 'query_date'\n";
|
||||||
|
$MAIN.="});\n";
|
||||||
|
$MAIN.="o_cal.a_tpl.yearscroll = false;\n";
|
||||||
|
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
|
||||||
|
$MAIN.="</script>\n";
|
||||||
|
|
||||||
|
$MAIN.="<BR> to <BR><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";
|
||||||
|
$MAIN.=" 'formname': 'vicidial_report',\n";
|
||||||
|
$MAIN.=" // input name\n";
|
||||||
|
$MAIN.=" 'controlname': 'end_date'\n";
|
||||||
|
$MAIN.="});\n";
|
||||||
|
$MAIN.="o_cal.a_tpl.yearscroll = false;\n";
|
||||||
|
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
|
||||||
|
$MAIN.="</script>\n";
|
||||||
|
|
||||||
|
if (preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT'])) {
|
||||||
|
$JS_events="onBlur='LoadLists(this.form.group)' onKeyUp='LoadLists(this.form.group)'";
|
||||||
|
} else {
|
||||||
|
$JS_events="onMouseUp='LoadLists(this.form.group)' onBlur='LoadLists(this.form.group)' onKeyUp='LoadLists(this.form.group)'";
|
||||||
|
}
|
||||||
|
$MAIN.="</TD><TD VALIGN=TOP> Campaigns:<BR>";
|
||||||
|
$MAIN.="<SELECT multiple SIZE=5 NAME=group[] id='group' $JS_events>\n";
|
||||||
|
if (preg_match('/\-\-ALL\-\-/',$group_string))
|
||||||
|
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
|
||||||
|
else
|
||||||
|
{$MAIN.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
|
||||||
|
$o=0;
|
||||||
|
while ($campaigns_to_print > $o)
|
||||||
|
{
|
||||||
|
if (preg_match("/$groups[$o]\|/i",$group_string)) {$MAIN.="<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
|
||||||
|
else {$MAIN.="<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
$MAIN.="</SELECT>\n";
|
||||||
|
$MAIN.="</TD><TD VALIGN=TOP>";
|
||||||
|
$MAIN.="Lists: <font size=1>(optional, possibly slow)</font><BR>\n";
|
||||||
|
$MAIN.=$list_options;
|
||||||
|
$MAIN.="</TD><TD VALIGN=TOP ALIGN=CENTER>";
|
||||||
|
|
||||||
|
$MAIN.="<INPUT type=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||||
|
$MAIN.="<BR><BR><a href=\"$PHP_SELF\">reset</a>";
|
||||||
|
$MAIN.="</TD><TD VALIGN=TOP> ";
|
||||||
|
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||||
|
if (strlen($group[0]) > 1)
|
||||||
|
{
|
||||||
|
$MAIN.=" <a href=\"./admin.php?ADD=34&campaign_id=$group[0]\">MODIFY</a> | \n";
|
||||||
|
$MAIN.=" <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$MAIN.=" <a href=\"./admin.php?ADD=10\">CAMPAIGNS</a> | \n";
|
||||||
|
$MAIN.=" <a href=\"./admin.php?ADD=999999\">REPORTS</a> </FONT>\n";
|
||||||
|
}
|
||||||
|
$MAIN.="</TD></TR></TABLE>";
|
||||||
|
$MAIN.="</FORM>\n\n";
|
||||||
|
|
||||||
|
|
||||||
|
if (strlen($QUERY_STRING) > 5)
|
||||||
|
{
|
||||||
|
$leads_in_list = 0;
|
||||||
|
$leads_in_list_N = 0;
|
||||||
|
$leads_in_list_Y = 0;
|
||||||
|
|
||||||
|
if (!$override_date) {
|
||||||
|
$date_range_title=" FOR LEADS CALLED $query_date THROUGH $end_date";
|
||||||
|
$stmt="select distinct vicidial_list.lead_id from vicidial_list, vicidial_log where vicidial_log.call_date>='$query_date 00:00:00' and vicidial_log.call_date<='$end_date 23:59:59' $list_id_SQLandVLJOIN UNION select distinct vicidial_list.lead_id from vicidial_list, vicidial_closer_log where vicidial_closer_log.call_date>='$query_date 00:00:00' and vicidial_closer_log.call_date<='$end_date 23:59:59' $list_id_SQLandVCLJOIN;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if (!$rslt) {$MAIN.="<BR>**".mysqli_error($link)."<BR>$stmt";}
|
||||||
|
if ($DB) {$MAIN.="$stmt<BR><BR>";}
|
||||||
|
$lead_id_str="";
|
||||||
|
if (mysqli_num_rows($rslt)>200000) {
|
||||||
|
$MAIN.="WARNING: Query resulting from report parameters is too large. Running report by list ID selection only.";
|
||||||
|
} else if (mysqli_num_rows($rslt)>0) {
|
||||||
|
while ($rowx=mysqli_fetch_row($rslt)) {
|
||||||
|
$lead_id_str.="$rowx[0],";
|
||||||
|
}
|
||||||
|
$lead_id_str=preg_replace('/,$/', '', $lead_id_str);
|
||||||
|
if (!$list_id_SQL) {
|
||||||
|
$lead_id_str=" where lead_id in ($lead_id_str) ";
|
||||||
|
} else {
|
||||||
|
$lead_id_str=" and lead_id in ($lead_id_str) ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$stmt="select status, if(called_count >= 100, 100, called_count), count(*) from vicidial_list $list_id_SQL $lead_id_str group by status, if(called_count >= 100, 100, called_count) order by status,called_count;";
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
if (!$rslt) {$MAIN.="<BR>**".mysqli_error($link)."<BR>$stmt";}
|
||||||
|
if ($DB) {$MAIN.="$stmt<BR><BR>";}
|
||||||
|
|
||||||
|
$status_called_to_print = mysqli_num_rows($rslt);
|
||||||
|
|
||||||
|
$CSV_text="";
|
||||||
|
|
||||||
|
$o=0;
|
||||||
|
$sts=0;
|
||||||
|
$first_row=1;
|
||||||
|
$all_called_first=1000;
|
||||||
|
$all_called_last=0;
|
||||||
|
while ($status_called_to_print > $o)
|
||||||
|
{
|
||||||
|
$rowx=mysqli_fetch_row($rslt);
|
||||||
|
$leads_in_list = ($leads_in_list + $rowx[2]);
|
||||||
|
$count_statuses[$o] = $rowx[0];
|
||||||
|
$count_called[$o] = $rowx[1];
|
||||||
|
$count_count[$o] = $rowx[2];
|
||||||
|
$all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]);
|
||||||
|
|
||||||
|
if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") )
|
||||||
|
{
|
||||||
|
if ($first_row) {$first_row=0;}
|
||||||
|
else {$sts++;}
|
||||||
|
$status[$sts] = "$rowx[0]";
|
||||||
|
$status_called_first[$sts] = "$rowx[1]";
|
||||||
|
if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];}
|
||||||
|
}
|
||||||
|
$leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]);
|
||||||
|
$status_called_last[$sts] = "$rowx[1]";
|
||||||
|
if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];}
|
||||||
|
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$CSV_text="";
|
||||||
|
$MAIN.="<center>\n";
|
||||||
|
$MAIN.="<br><b>CALLED COUNTS WITHIN LIST(S) $list_id_title_str$date_range_title: <a href=\"$PHP_SELF?DB=$DB$groupQS$list_idQS&query_date=$query_date&end_date=$end_date&override_date=$override_date&SUBMIT=$SUBMIT&file_download=1\">[DOWNLOAD]</a></b><br>\n";
|
||||||
|
$CSV_text.="CALLED COUNTS WITHIN LIST(S) $list_id_title_str$date_range_title:\n";
|
||||||
|
$MAIN.="<TABLE width=700 cellspacing=1>\n";
|
||||||
|
$MAIN.="<tr><td align=left><font size=1>STATUS</td><td align=center><font size=1>STATUS NAME</td>";
|
||||||
|
$CSV_text.="\"STATUS\",\"STATUS NAME\",";
|
||||||
|
$first = $all_called_first;
|
||||||
|
while ($first <= $all_called_last)
|
||||||
|
{
|
||||||
|
if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#AFEEEE"';}
|
||||||
|
else{$AB='bgcolor="#E0FFFF"';}
|
||||||
|
if ($first >= 100) {$Fplus='+';}
|
||||||
|
else {$Fplus='';}
|
||||||
|
$MAIN.="<td align=center $AB><font size=1>$first$Fplus</td>";
|
||||||
|
$CSV_text.="\"$first$Fplus\",";
|
||||||
|
$first++;
|
||||||
|
}
|
||||||
|
$MAIN.="<td align=center><font size=1>SUBTOTAL</td></tr>\n";
|
||||||
|
$CSV_text.="\"SUBTOTAL\"\n";
|
||||||
|
|
||||||
|
$sts=0;
|
||||||
|
$statuses_called_to_print = count($status);
|
||||||
|
while ($statuses_called_to_print > $sts)
|
||||||
|
{
|
||||||
|
$Pstatus = $status[$sts];
|
||||||
|
if (preg_match("/1$|3$|5$|7$|9$/i", $sts))
|
||||||
|
{$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';}
|
||||||
|
else
|
||||||
|
{$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';}
|
||||||
|
# $MAIN.="$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n";
|
||||||
|
# $MAIN.="$status[$sts]|";
|
||||||
|
$MAIN.="<tr $bgcolor><td><font size=1>$Pstatus</td><td><font size=1>$statuses_list[$Pstatus]</td>";
|
||||||
|
$CSV_text.="\"$Pstatus\",\"$statuses_list[$Pstatus]\",";
|
||||||
|
|
||||||
|
$first = $all_called_first;
|
||||||
|
while ($first <= $all_called_last)
|
||||||
|
{
|
||||||
|
if (preg_match("/1$|3$|5$|7$|9$/i", $sts))
|
||||||
|
{
|
||||||
|
if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#9BB9FB"';}
|
||||||
|
else{$AB='bgcolor="#B9CBFD"';}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (preg_match("/0$|2$|4$|6$|8$/i", $first)) {$AB='bgcolor="#9BB9FB"';}
|
||||||
|
else{$AB='bgcolor="#B9CBFD"';}
|
||||||
|
}
|
||||||
|
|
||||||
|
$called_printed=0;
|
||||||
|
$o=0;
|
||||||
|
while ($status_called_to_print > $o)
|
||||||
|
{
|
||||||
|
if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") )
|
||||||
|
{
|
||||||
|
$called_printed++;
|
||||||
|
$MAIN.="<td $AB><font size=1> $count_count[$o]</td>";
|
||||||
|
$CSV_text.="\"$count_count[$o]\",";
|
||||||
|
}
|
||||||
|
|
||||||
|
$o++;
|
||||||
|
}
|
||||||
|
if (!$called_printed)
|
||||||
|
{
|
||||||
|
$MAIN.="<td $AB><font size=1> </td>";
|
||||||
|
$CSV_text.="\"\",";
|
||||||
|
}
|
||||||
|
$first++;
|
||||||
|
}
|
||||||
|
$MAIN.="<td><font size=1>$leads_in_sts[$sts]</td></tr>\n\n";
|
||||||
|
$CSV_text.="\"$leads_in_sts[$sts]\"\n";
|
||||||
|
|
||||||
|
$sts++;
|
||||||
|
}
|
||||||
|
|
||||||
|
$MAIN.="<tr><td align=center colspan=2><b><font size=1>TOTAL</td>";
|
||||||
|
$CSV_text.="\"\",\"TOTAL\",";
|
||||||
|
$first = $all_called_first;
|
||||||
|
while ($first <= $all_called_last)
|
||||||
|
{
|
||||||
|
if (preg_match('/1$|3$|5$|7$|9$/i', $first)) {$AB='bgcolor="#AFEEEE"';}
|
||||||
|
else{$AB='bgcolor="#E0FFFF"';}
|
||||||
|
$MAIN.="<td align=center $AB><b><font size=1>$all_called_count[$first]</td>";
|
||||||
|
$CSV_text.="\"$all_called_count[$first]\",";
|
||||||
|
$first++;
|
||||||
|
}
|
||||||
|
$MAIN.="<td align=center><b><font size=1>$leads_in_list</td></tr>\n";
|
||||||
|
$CSV_text.="\"$leads_in_list\",";
|
||||||
|
|
||||||
|
$MAIN.="</table></center><br>\n";
|
||||||
|
$MAIN.="</BODY></HTML>\n";
|
||||||
|
|
||||||
|
if ($file_download>0)
|
||||||
|
{
|
||||||
|
$FILE_TIME = date("Ymd-His");
|
||||||
|
$CSVfilename = "CALLED_COUNTS_MULTILIST_report_$US$FILE_TIME.csv";
|
||||||
|
$CSV_text=preg_replace('/\n +,/', ',', $CSV_text);
|
||||||
|
$CSV_text=preg_replace('/ +\"/', '"', $CSV_text);
|
||||||
|
$CSV_text=preg_replace('/\" +/', '"', $CSV_text);
|
||||||
|
// We'll be outputting a TXT file
|
||||||
|
header('Content-type: application/octet-stream');
|
||||||
|
|
||||||
|
// It will be called LIST_101_20090209-121212.txt
|
||||||
|
header("Content-Disposition: attachment; filename=\"$CSVfilename\"");
|
||||||
|
header('Expires: 0');
|
||||||
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||||
|
header('Pragma: public');
|
||||||
|
ob_clean();
|
||||||
|
flush();
|
||||||
|
|
||||||
|
echo "$CSV_text";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo $HEADER;
|
||||||
|
require("admin_header.php");
|
||||||
|
echo $MAIN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo $HEADER;
|
||||||
|
require("admin_header.php");
|
||||||
|
echo $MAIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($db_source == 'S')
|
||||||
|
{
|
||||||
|
mysqli_close($link);
|
||||||
|
$use_slave_server=0;
|
||||||
|
$db_source = 'M';
|
||||||
|
require("dbconnect_mysqli.php");
|
||||||
|
}
|
||||||
|
|
||||||
|
$endMS = microtime();
|
||||||
|
$startMSary = explode(" ",$startMS);
|
||||||
|
$endMSary = explode(" ",$endMS);
|
||||||
|
$runS = ($endMSary[0] - $startMSary[0]);
|
||||||
|
$runM = ($endMSary[1] - $startMSary[1]);
|
||||||
|
$TOTALrun = ($runS + $runM);
|
||||||
|
|
||||||
|
$stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';";
|
||||||
|
if ($DB) {echo "|$stmt|\n";}
|
||||||
|
$rslt=mysql_to_mysqli($stmt, $link);
|
||||||
|
|
||||||
|
exit;
|
||||||
|
?>
|
||||||
@@ -1170,7 +1170,7 @@ if ($SSoutbound_autodial_active > 0)
|
|||||||
<BR>
|
<BR>
|
||||||
<A NAME="campaigns-campaign_rec_filename">
|
<A NAME="campaigns-campaign_rec_filename">
|
||||||
<BR>
|
<BR>
|
||||||
<B>Campaign Rec Filename -</B> This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN INGROUP CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length.
|
<B>Campaign Rec Filename -</B> This field allows you to customize the name of the recording when Campaign recording is ONDEMAND or ALLCALLS. The allowed variables are CAMPAIGN INGROUP CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID CALLID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length.
|
||||||
|
|
||||||
<BR>
|
<BR>
|
||||||
<A NAME="campaigns-allcalls_delay">
|
<A NAME="campaigns-allcalls_delay">
|
||||||
@@ -2227,7 +2227,7 @@ if ($SSqc_features_active > 0)
|
|||||||
<BR>
|
<BR>
|
||||||
<A NAME="inbound_groups-ingroup_rec_filename">
|
<A NAME="inbound_groups-ingroup_rec_filename">
|
||||||
<BR>
|
<BR>
|
||||||
<B>In-Group Recording Filename -</B> This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN INGROUP CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length. Default is NONE.
|
<B>In-Group Recording Filename -</B> This field will override the Campaign Recording Filenaming Scheme unless it is set to NONE. The allowed variables are CAMPAIGN INGROUP CUSTPHONE FULLDATE TINYDATE EPOCH AGENT VENDORLEADCODE LEADID CALLID. The default is FULLDATE_AGENT and would look like this 20051020-103108_6666. Another example is CAMPAIGN_TINYDATE_CUSTPHONE which would look like this TESTCAMP_51020103108_3125551212. Te resulting filename must be less than 90 characters in length. Default is NONE.
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
if ($SSqc_features_active > 0)
|
if ($SSqc_features_active > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user