Added filtering by time (hours), and option for single user exports for Export Calls Report
Fixed download bug, added option to see unanswered transfers in Fronter Closer Detail Report git-svn-id: svn://192.168.202.10@3742 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
# 210911-1907 - Fix for --ALL-- selection user-group permission issue
|
||||
# 211119-1500 - Fix for status names
|
||||
# 220301-1603 - Added allow_web_debug system setting
|
||||
# 230622-1652 - Added filtering by time (hours), and option for single user exports.
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -76,10 +77,16 @@ $PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF);
|
||||
if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
|
||||
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
|
||||
if (isset($_GET["query_hour"])) {$query_hour=$_GET["query_hour"];}
|
||||
elseif (isset($_POST["query_hour"])) {$query_hour=$_POST["query_hour"];}
|
||||
if (isset($_GET["date_field"])) {$date_field=$_GET["date_field"];}
|
||||
elseif (isset($_POST["date_field"])) {$date_field=$_POST["date_field"];}
|
||||
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
|
||||
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
|
||||
if (isset($_GET["end_hour"])) {$end_hour=$_GET["end_hour"];}
|
||||
elseif (isset($_POST["end_hour"])) {$end_hour=$_POST["end_hour"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];}
|
||||
elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];}
|
||||
if (isset($_GET["group"])) {$group=$_GET["group"];}
|
||||
@@ -129,6 +136,8 @@ if (!isset($list_id)) {$list_id = array();}
|
||||
if (!isset($status)) {$status = array();}
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
if (!isset($end_date)) {$end_date = $NOW_DATE;}
|
||||
if (!isset($query_hour)) {$query_hour = "00";}
|
||||
if (!isset($end_hour)) {$end_hour = "23";}
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
$report_name = 'Export Calls Report';
|
||||
@@ -161,6 +170,8 @@ if ($SSallow_web_debug < 1) {$DB=0;}
|
||||
|
||||
$query_date = preg_replace('/[^- \:\_0-9a-zA-Z]/', '', $query_date);
|
||||
$end_date = preg_replace('/[^- \:\_0-9a-zA-Z]/', '', $end_date);
|
||||
$query_hour = preg_replace('/[^0-9]/', '', $query_hour);
|
||||
$end_hour = preg_replace('/[^0-9]/', '', $end_hour);
|
||||
$date_field = preg_replace('/[^-\.\_0-9a-zA-Z]/', '', $date_field);
|
||||
$submit = preg_replace('/[^-_0-9a-zA-Z]/', '', $submit);
|
||||
$SUBMIT = preg_replace('/[^-_0-9a-zA-Z]/', '', $SUBMIT);
|
||||
@@ -172,6 +183,9 @@ $custom_fields = preg_replace('/[^-_0-9a-zA-Z]/', '', $custom_fields);
|
||||
$call_notes = preg_replace('/[^-_0-9a-zA-Z]/', '', $call_notes);
|
||||
$export_fields = preg_replace('/[^-_0-9a-zA-Z]/', '', $export_fields);
|
||||
$search_archived_data = preg_replace('/[^-_0-9a-zA-Z]/', '', $search_archived_data);
|
||||
$query_time=$query_hour.":00:00";
|
||||
$end_time=$end_hour.":59:59";
|
||||
|
||||
|
||||
# Variables filtered further down in the code
|
||||
# $campaign
|
||||
@@ -184,11 +198,13 @@ 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);
|
||||
$user = preg_replace('/[^-_0-9a-zA-Z]/', '', $user);
|
||||
}
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW);
|
||||
$user = preg_replace('/[^-_0-9\p{L}]/u', '', $user);
|
||||
}
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
@@ -416,6 +432,16 @@ if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen(
|
||||
##### START RUN THE EXPORT AND OUTPUT FLAT DATA FILE #####
|
||||
if ($run_export > 0)
|
||||
{
|
||||
|
||||
if ($user)
|
||||
{
|
||||
$user_SQL=" and vl.user='$user' ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_SQL="";
|
||||
}
|
||||
|
||||
if ($date_field=="entry_date") {
|
||||
$date_field = "vi.entry_date";
|
||||
# Since entry_date only appears when the EXTENDED export option is selected, EXTENDED will automatically be used when entry_date is selected as the date field.
|
||||
@@ -721,11 +747,11 @@ if ($run_export > 0)
|
||||
{
|
||||
if ( ($export_fields == 'EXTENDED') or ($export_fields == 'EXTENDED_2') or ($export_fields == 'EXTENDED_3') or ($export_fields == 'EXTENDED_4') )
|
||||
{
|
||||
$stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id, ifnull(val.dispo_sec+val.dead_sec,0)$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
$stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id, ifnull(val.dispo_sec+val.dead_sec,0)$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date $query_time' and ".$date_field." <= '$end_date $end_time' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,".$vicidial_log_table." vl,vicidial_list vi where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
$stmt = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.alt_dial,vi.rank,vi.owner,vi.lead_id,vl.uniqueid,vi.entry_list_id$export_fields_SQL from vicidial_users vu,".$vicidial_log_table." vl,vicidial_list vi where ".$date_field." >= '$query_date $query_time' and ".$date_field." <= '$end_date $end_time' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $campaign_SQL $user_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$DBout .= "$stmt\n";}
|
||||
@@ -867,11 +893,11 @@ if ($run_export > 0)
|
||||
{
|
||||
if ( ($export_fields == 'EXTENDED') or ($export_fields == 'EXTENDED_2') or ($export_fields == 'EXTENDED_3') or ($export_fields == 'EXTENDED_4') )
|
||||
{
|
||||
$stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,val.campaign_id, ifnull(val.dispo_sec+val.dead_sec,0)$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_closer_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
$stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,val.campaign_id, ifnull(val.dispo_sec+val.dead_sec,0)$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_closer_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date $query_time' and ".$date_field." <= '$end_date $end_time' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,val.campaign_id$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_closer_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date 00:00:00' and ".$date_field." <= '$end_date 23:59:59' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
$stmtA = "SELECT vl.call_date,vl.phone_number,vl.status,vl.user,vu.full_name,vl.campaign_id,vi.vendor_lead_code,vi.source_id,vi.list_id,vi.gmt_offset_now,vi.phone_code,vi.phone_number,vi.title,vi.first_name,vi.middle_initial,vi.last_name,vi.address1,vi.address2,vi.address3,vi.city,vi.state,vi.province,vi.postal_code,vi.country_code,vi.gender,vi.date_of_birth,vi.alt_phone,vi.email,vi.security_phrase,vi.comments,vl.length_in_sec,vl.user_group,vl.queue_seconds,vi.rank,vi.owner,vi.lead_id,vl.closecallid,vi.entry_list_id,vl.uniqueid,val.campaign_id$export_fields_SQL from vicidial_users vu,vicidial_list vi,".$vicidial_closer_log_table." vl LEFT OUTER JOIN ".$vicidial_agent_log_table." val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where ".$date_field." >= '$query_date $query_time' and ".$date_field." <= '$end_date $end_time' and vu.user=vl.user and vi.lead_id=vl.lead_id $list_SQL $group_SQL $user_SQL $user_group_SQL $status_SQL order by ".$date_field." limit 1000000;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmtA, $link);
|
||||
if ($DB) {$DBout .= "$stmtA\n";}
|
||||
@@ -1351,7 +1377,7 @@ if ($run_export > 0)
|
||||
$IVRdelimiter='|';
|
||||
if ($export_fields=='ALTERNATE_1')
|
||||
{$IVRdelimiter='^';}
|
||||
$stmt="select menu_id,UNIX_TIMESTAMP(event_date) from ".$vicidial_outbound_ivr_log_table." where event_date >= '$query_date 00:00:00' and event_date <= '$end_date 23:59:59' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;";
|
||||
$stmt="select menu_id,UNIX_TIMESTAMP(event_date) from ".$vicidial_outbound_ivr_log_table." where event_date >= '$query_date $query_time' and event_date <= '$end_date $end_time' and uniqueid='$export_uniqueid[$i]' order by event_date,menu_action desc;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
# $ivr_path = "$stmt|$export_uniqueid[$i]|";
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -1645,7 +1671,16 @@ else
|
||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"vicidial_stylesheet.php\">\n";
|
||||
echo "<script language=\"JavaScript\" src=\"help.js\"></script>\n";
|
||||
echo "<link rel=\"stylesheet\" href=\"calendar.css\">\n";
|
||||
|
||||
echo "<style type='text/css'>\n";
|
||||
echo "label {\n";
|
||||
echo " display:flex;\n";
|
||||
echo " align-items: baseline;\n";
|
||||
echo "}\n";
|
||||
echo "\n";
|
||||
echo "input[type=checkbox] {\n";
|
||||
echo " margin-right: 8px;\n";
|
||||
echo "}\n";
|
||||
echo "</style>\n";
|
||||
echo "<div id='HelpDisplayDiv' class='help_info' style='display:none;'></div>";
|
||||
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
@@ -1688,8 +1723,8 @@ else
|
||||
echo "<INPUT TYPE=HIDDEN NAME=ivr_export VALUE=\"$ivr_export\">";
|
||||
echo "<TABLE BORDER=0 CELLSPACING=8><TR><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=3>\n";
|
||||
|
||||
echo "<font class=\"select_bold\"><B>"._QXZ("Date Range").":</B></font><BR><CENTER>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
|
||||
echo "<font class=\"select_bold\"><B>"._QXZ("Date Range").":</B></font><BR>\n"; #<CENTER>
|
||||
echo "<INPUT TYPE=TEXT NAME=query_date SIZE=8 MAXLENGTH=10 VALUE=\"$query_date\">";
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
@@ -1703,9 +1738,18 @@ else
|
||||
// o_cal.a_tpl.weekstart = 1; // Monday week start
|
||||
</script>
|
||||
<?php
|
||||
echo "<BR>\n";
|
||||
echo "<select name='query_hour' id='query_hour'>\n";
|
||||
for ($i=0; $i<24; $i++)
|
||||
{
|
||||
$hr=substr("0$i", -2);
|
||||
if($query_hour==$hr) {$s="selected";} else {$s="";}
|
||||
echo "<option value='$hr' $s>$hr</option>\n";
|
||||
}
|
||||
echo "</select><B>:00:00</B>\n";
|
||||
|
||||
echo "<BR>"._QXZ("to")."<BR>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
|
||||
echo "<BR><CENTER><B>"._QXZ("to")."</B></CENTER>\n";
|
||||
echo "<INPUT TYPE=TEXT NAME=end_date SIZE=8 MAXLENGTH=10 VALUE=\"$end_date\">";
|
||||
|
||||
?>
|
||||
<script language="JavaScript">
|
||||
@@ -1719,50 +1763,64 @@ else
|
||||
// o_cal.a_tpl.weekstart = 1; // Monday week start
|
||||
</script>
|
||||
<?php
|
||||
echo "<BR>\n";
|
||||
echo "<select name='end_hour' id='end_hour'>\n";
|
||||
for ($i=0; $i<24; $i++)
|
||||
{
|
||||
$hr=substr("0$i", -2);
|
||||
if($end_hour==$hr) {$s="selected";} else {$s="";}
|
||||
echo "<option value='$hr' $s>$hr</option>\n";
|
||||
}
|
||||
echo "</select><B>:59:59</B>\n";
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Date Field").":</B> $NWB#call_export_report-date_field$NWE<BR>\n";
|
||||
echo "<select size=1 name=date_field><option selected value=\"call_date\">"._QXZ("Call date")."</option><option value=\"entry_date\">"._QXZ("Entry date")."</option></select>\n";
|
||||
echo "<B>"._QXZ("User").":</B><BR>\n";
|
||||
echo "<input type='text' name='user' id='user' size='7' maxlength='20'> $NWB#call_export_report-user$NWE\n";
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Header Row").":</B> $NWB#call_export_report-header_row$NWE<BR>\n";
|
||||
echo "<select size=1 name=header_row><option selected value=\"YES\">"._QXZ("YES")."</option><option value=\"NO\">"._QXZ("NO")."</option></select>\n";
|
||||
echo "<B>"._QXZ("Date Field").":</B><BR>\n";
|
||||
echo "<select size=1 name=date_field><option selected value=\"call_date\">"._QXZ("Call date")."</option><option value=\"entry_date\">"._QXZ("Entry date")."</option></select> $NWB#call_export_report-date_field$NWE\n";
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Recording Fields").":</B> $NWB#call_export_report-rec_fields$NWE<BR>\n";
|
||||
echo "<B>"._QXZ("Header Row").":</B><BR>\n";
|
||||
echo "<select size=1 name=header_row><option selected value=\"YES\">"._QXZ("YES")."</option><option value=\"NO\">"._QXZ("NO")."</option></select> $NWB#call_export_report-header_row$NWE\n";
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Rec Fields").":</B><BR>\n";
|
||||
echo "<select size=1 name=rec_fields>";
|
||||
echo "<option value=\"ID\">"._QXZ("ID")."</option>";
|
||||
echo "<option value=\"FILENAME\">"._QXZ("FILENAME")."</option>";
|
||||
echo "<option value=\"LOCATION\">"._QXZ("LOCATION")."</option>";
|
||||
echo "<option value=\"ALL\">"._QXZ("ALL")."</option>";
|
||||
echo "<option selected value=\"NONE\">"._QXZ("NONE")."</option>";
|
||||
echo "</select>\n";
|
||||
echo "</select> $NWB#call_export_report-rec_fields$NWE\n";
|
||||
|
||||
if ($custom_fields_enabled > 0)
|
||||
{
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Custom Fields").":</B> $NWB#call_export_report-custom_fields$NWE<BR>\n";
|
||||
echo "<select size=1 name=custom_fields><option value=\"YES\">"._QXZ("YES")."</option><option selected value=\"NO\">"._QXZ("NO")."</option></select>\n";
|
||||
echo "<B>"._QXZ("Custom Fields").":</B><BR>\n";
|
||||
echo "<select size=1 name=custom_fields><option value=\"YES\">"._QXZ("YES")."</option><option selected value=\"NO\">"._QXZ("NO")."</option></select> $NWB#call_export_report-custom_fields$NWE\n";
|
||||
}
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Per Call Notes").":</B> $NWB#call_export_report-call_notes$NWE<BR>\n";
|
||||
echo "<select size=1 name=call_notes><option value=\"YES\">"._QXZ("YES")."</option><option selected value=\"NO\">"._QXZ("NO")."</option></select>\n";
|
||||
echo "<B>"._QXZ("Per Call Notes").":</B><BR>\n";
|
||||
echo "<select size=1 name=call_notes><option value=\"YES\">"._QXZ("YES")."</option><option selected value=\"NO\">"._QXZ("NO")."</option></select> $NWB#call_export_report-call_notes$NWE\n";
|
||||
|
||||
echo "<BR><BR>\n";
|
||||
|
||||
echo "<B>"._QXZ("Export Fields").":</B> $NWB#call_export_report-export_fields$NWE<BR>\n";
|
||||
echo "<B>"._QXZ("Export Type").":</B>$NWB#call_export_report-export_type$NWE<BR>\n";
|
||||
echo "<select size=1 name=export_fields><option selected value=\"STANDARD\">"._QXZ("STANDARD")."</option><option value=\"EXTENDED\">"._QXZ("EXTENDED")."</option><option value=\"EXTENDED_2\">"._QXZ("EXTENDED_2")."</option><option value=\"EXTENDED_3\">"._QXZ("EXTENDED_3")."</option><option value=\"EXTENDED_4\">"._QXZ("EXTENDED_4")."</option><option value=\"ALTERNATE_1\">ALTERNATE_1</option><option value=\"ALTERNATE_2\">ALTERNATE_2</option></select>\n";
|
||||
|
||||
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
echo "<BR><BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data><B>"._QXZ("Search archived data")."</B> $NWB#call_export_report-search_archived_data$NWE<BR>\n";
|
||||
echo "<BR><BR><label><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data><B>"._QXZ("Search archived data")."</B> $NWB#call_export_report-search_archived_data$NWE</label><BR>\n";
|
||||
}
|
||||
|
||||
### bottom of first column
|
||||
@@ -1816,7 +1874,7 @@ else
|
||||
$o=0;
|
||||
while ($statuses_to_print > $o)
|
||||
{
|
||||
if (preg_match("/\|$LISTstatus[$o]\|/",$list_string))
|
||||
if (preg_match("/\|$LISTstatus[$o]\|/",$status_string))
|
||||
{echo "<option selected value=\"$LISTstatus[$o]\">"._QXZ("$LISTstatus[$o]")."</option>\n";}
|
||||
else
|
||||
{echo "<option value=\"$LISTstatus[$o]\">"._QXZ("$LISTstatus[$o]")."</option>\n";}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
# 190216-0808 - Fix for user-group, in-group and campaign allowed/permissions matching issues
|
||||
# 191013-0851 - Fixes for PHP7
|
||||
# 220228-1955 - Added allow_web_debug system setting
|
||||
# 230621-1434 - Fixed download bug, added option to see unanswered transfers
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -73,6 +74,8 @@ if (isset($_GET["shift"])) {$shift=$_GET["shift"];}
|
||||
elseif (isset($_POST["shift"])) {$shift=$_POST["shift"];}
|
||||
if (isset($_GET["show_summary"])) {$show_summary=$_GET["show_summary"];}
|
||||
elseif (isset($_POST["show_summary"])) {$show_summary=$_POST["show_summary"];}
|
||||
if (isset($_GET["show_unanswered_xfers"])) {$show_unanswered_xfers=$_GET["show_unanswered_xfers"];}
|
||||
elseif (isset($_POST["show_unanswered_xfers"])) {$show_unanswered_xfers=$_POST["show_unanswered_xfers"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
@@ -140,6 +143,7 @@ $shift = preg_replace("/\<|\>|\'|\"|\\\\|;/","",$shift);
|
||||
$show_summary = preg_replace('/[^-_0-9a-zA-Z]/', '', $show_summary);
|
||||
$file_download = preg_replace('/[^-_0-9a-zA-Z]/', '', $file_download);
|
||||
$report_display_type = preg_replace('/[^-_0-9a-zA-Z]/', '', $report_display_type);
|
||||
$show_unanswered_xfers = preg_replace('/[^-_0-9a-zA-Z]/', '', $show_unanswered_xfers);
|
||||
|
||||
# Variables filtered further down in the code
|
||||
# $user_group
|
||||
@@ -671,8 +675,9 @@ if ($archives_available=="Y")
|
||||
$HTML_text.="<input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."<BR><BR>\n";
|
||||
}
|
||||
$HTML_text.="<input type='checkbox' name='show_summary' value='checked' $show_summary>"._QXZ("Show fronter/closer summary")."<BR><BR>\n";
|
||||
$HTML_text.="<input type='checkbox' name='show_unanswered_xfers' value='checked' $show_unanswered_xfers>"._QXZ("Show unanswered transfers")."<BR><BR>\n";
|
||||
$HTML_text.="<INPUT TYPE=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'><BR><BR>\n";
|
||||
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><a href=\"$PHP_SELF?query_date=$query_date&end_date=$end_date&group[]=" . implode("&group[]=", array_map(array($link, 'real_escape_string'), $group)) . "&shift=$shift&file_download=1&search_archived_data=$search_archived_data&show_summary=$show_summary$campaignQS$user_groupQS$userQS\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a><BR/></FONT>\n";
|
||||
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><a href=\"$PHP_SELF?query_date=$query_date&end_date=$end_date&group[]=" . implode("&group[]=", array_map(array($link, 'real_escape_string'), $group)) . "&shift=$shift&file_download=1&show_unanswered_xfers=$show_unanswered_xfers&search_archived_data=$search_archived_data&show_summary=$show_summary$campaignQS$user_groupQS$userQS\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a><BR/></FONT>\n";
|
||||
$HTML_text.="</TD>";
|
||||
|
||||
|
||||
@@ -761,6 +766,8 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
*/
|
||||
|
||||
$complete_xfer_log=array();
|
||||
$complete_fronter_stats=array();
|
||||
$complete_closer_stats=array();
|
||||
$xfer_log_stmt="select * from vicidial_xfer_log where campaign_id in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "') and call_date>='$query_date_BEGIN' and call_date<='$query_date_END' $user_SQL";
|
||||
if ($DB) {echo "<B>$xfer_log_stmt</B>\n";}
|
||||
$xfer_log_rslt=mysql_to_mysqli($xfer_log_stmt, $link);
|
||||
@@ -768,6 +775,7 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
$temp_array=array();
|
||||
$xfercallid=$xfer_row["xfercallid"];
|
||||
$closer=$xfer_row["closer"];
|
||||
if ($closer=="VDXL" && $show_unanswered_xfers) {$closer="VDCL";}
|
||||
$campaign_id="";
|
||||
|
||||
$lead_stmt="select * from vicidial_list where lead_id='$xfer_row[lead_id]'";
|
||||
@@ -788,6 +796,16 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
$campaign_id=$fronter_row["campaign_id"];
|
||||
$ingroup=$xfer_row["campaign_id"];
|
||||
|
||||
if($user_group=="") # sometimes NULL in closer_log
|
||||
{
|
||||
$val_stmt="select user_group, abs(timestampdiff(SECOND, '$xfer_row[call_date]', event_time)) as time_diff from vicidial_agent_log where user='$user' order by time_diff asc limit 1";
|
||||
$val_rslt=mysql_to_mysqli($val_stmt, $link);
|
||||
while ($val_row=mysqli_fetch_array($val_rslt))
|
||||
{
|
||||
$user_group=$val_row["user_group"];
|
||||
}
|
||||
}
|
||||
|
||||
#$uniqueid=$fronter_row["uniqueid"];
|
||||
#$agent_log_stmt="select * From vicidial_agent_log where uniqueid='$uniqueid' $campaignSQL";
|
||||
#$agent_log_rslt=mysql_to_mysqli($agent_log_stmt, $link);
|
||||
@@ -807,6 +825,16 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
$user_group=$closer_row["user_group"];
|
||||
$ingroup=$xfer_row["campaign_id"];
|
||||
|
||||
if($user_group=="") # sometimes NULL in closer_log
|
||||
{
|
||||
$val_stmt="select user_group, abs(timestampdiff(SECOND, '$xfer_row[call_date]', event_time)) as time_diff from vicidial_agent_log where user='$user' order by time_diff asc limit 1";
|
||||
$val_rslt=mysql_to_mysqli($val_stmt, $link);
|
||||
while ($val_row=mysqli_fetch_array($val_rslt))
|
||||
{
|
||||
$user_group=$val_row["user_group"];
|
||||
}
|
||||
}
|
||||
|
||||
$uniqueid=$closer_row["uniqueid"];
|
||||
$agent_log_stmt="select campaign_id From vicidial_agent_log where uniqueid='$uniqueid' and event_time>='$query_date_BEGIN' and event_time<='$query_date_END' $campaign_SQL $user_group_SQL";
|
||||
$agent_log_rslt=mysql_to_mysqli($agent_log_stmt, $link);
|
||||
@@ -823,7 +851,7 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
|
||||
$closer_xfer_log_stmt="select uniqueid, campaign_id, call_date, status from vicidial_closer_log where campaign_id in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "') and call_date>='$xfer_row[call_date]' and call_date<='$xfer_row[call_date]'+INTERVAL 1 HOUR and xfercallid='$xfercallid' and user='$closer' $user_SQL $user_group_SQL order by call_date asc limit 1";
|
||||
$closer_xfer_log_rslt=mysql_to_mysqli($closer_xfer_log_stmt, $link);
|
||||
if ($DB) {echo "<B>$closer_xfer_log_stmt</B>\n";}
|
||||
if ($DB) {echo "<B>$closer_xfer_log_stmt</B>|".mysqli_num_rows($closer_xfer_log_rslt)."\n";}
|
||||
if (mysqli_num_rows($closer_xfer_log_rslt)>0) {
|
||||
$closer_xfer_row=mysqli_fetch_array($closer_xfer_log_rslt);
|
||||
$closer_uid=$closer_xfer_row["uniqueid"];
|
||||
@@ -833,6 +861,7 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
|
||||
$closer_agent_log_stmt="select campaign_id, user_group from vicidial_agent_log where user='$closer' and uniqueid='$closer_uid' and event_time>='$query_date_BEGIN' and event_time<='$query_date_END' $user_SQL $user_group_SQL $campaign_SQL"; #$campaignSQL necessary?
|
||||
$closer_agent_log_rslt=mysql_to_mysqli($closer_agent_log_stmt, $link);
|
||||
if ($DB) {echo "<B>$closer_agent_log_stmt</B>|".mysqli_num_rows($closer_agent_log_rslt)."\n";}
|
||||
if (mysqli_num_rows($closer_agent_log_rslt)>0) {
|
||||
$closer_agent_log_row=mysqli_fetch_array($closer_agent_log_rslt);
|
||||
$closer_campaign=$closer_agent_log_row["campaign_id"];
|
||||
@@ -840,6 +869,15 @@ if ($campaign_ct>0 || $user_group_ct>0 || $user_ct>0) {
|
||||
|
||||
array_push($temp_array, "$closer_campaign", "$closer_ingroup", "$closer", "$closer_user_group", "$closer_call_date", "$status");
|
||||
array_push($complete_xfer_log, $temp_array);
|
||||
|
||||
$complete_fronter_stats["$user"]["$status"]++;
|
||||
$complete_closer_stats["$closer"]["$status"]++;
|
||||
} else if ($closer=="VDCL" && $show_unanswered_xfers) {
|
||||
array_push($temp_array, "$closer_ingroup", "$closer_ingroup", "$closer", "ADMIN", "$closer_call_date", "$status");
|
||||
array_push($complete_xfer_log, $temp_array);
|
||||
|
||||
$complete_fronter_stats["$user"]["$status"]++;
|
||||
$complete_closer_stats["$closer"]["$status"]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -862,6 +900,7 @@ if (count($complete_xfer_log)>0) {
|
||||
$HTML_text.="| "._QXZ("CALL DATE (INITIAL)", 19)." | "._QXZ("LEAD ID", 9)." | "._QXZ("PHONE NUMBER", 20)." | "._QXZ("PROVINCE", 20)." | "._QXZ("USER", 20)." | "._QXZ("USER GROUP - FRONTER", 20)." | "._QXZ("FRONT CAMP", 10)." | "._QXZ("INBOUND/XFER GROUP", 20)." | "._QXZ("RECVD CAMP", 10)." | "._QXZ("RCVD GROUP", 20)." | "._QXZ("USER", 20)." | "._QXZ("USER GROUP - CLOSER", 20)." | "._QXZ("RECEIPT DATE", 19)." | "._QXZ("STATUS", 6)." |\n";
|
||||
$CSV_text1="\""._QXZ("CALL DATE (INITIAL)")."\",\""._QXZ("LEAD ID")."\",\""._QXZ("PHONE NUMBER")."\",\""._QXZ("PROVINCE")."\",\""._QXZ("USER")."\",\""._QXZ("USER GROUP - FRONTER")."\",\""._QXZ("FRONT CAMP")."\",\""._QXZ("INBOUND/XFER GROUP")."\",\""._QXZ("RECVD CAMP")."\",\""._QXZ("RCVD GROUP")."\",\""._QXZ("USER")."\",\""._QXZ("USER GROUP - CLOSER")."\",\""._QXZ("RECEIPT DATE")."\",\""._QXZ("STATUS")."\"\n";
|
||||
$HTML_text.=$output_header;
|
||||
$total_transfers=0;
|
||||
for($i=0; $i<count($complete_xfer_log); $i++) {
|
||||
$HTML_text.="| ";
|
||||
$HTML_text.=sprintf("%-19s", $complete_xfer_log[$i][0])." | ";
|
||||
@@ -883,8 +922,11 @@ if (count($complete_xfer_log)>0) {
|
||||
}
|
||||
$CSV_text1=preg_replace("/,$/", "", $CSV_text1);
|
||||
$CSV_text1.="\n";
|
||||
$total_transfers++;
|
||||
}
|
||||
$HTML_text.=$output_header;
|
||||
$HTML_text.="| ".sprintf("%-31s", _QXZ("TOTAL TRANSFERS").": $total_transfers")." |\n";
|
||||
$HTML_text.="+---------------------------------+\n\n";
|
||||
} else {
|
||||
$CSV_text1=count($complete_xfer_log);
|
||||
}
|
||||
@@ -960,6 +1002,7 @@ $max_drops=1;
|
||||
$max_other=1;
|
||||
###########################
|
||||
|
||||
/*
|
||||
$stmt="select user,count(*) from ".$vicidial_xfer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "') and user is not null $summary_user_xfer_log_SQL group by user;";
|
||||
|
||||
|
||||
@@ -1011,7 +1054,7 @@ while ($i < $users_to_print)
|
||||
{$full_name[$i] = ' ';}
|
||||
|
||||
$DROP=0; $OTHER=0; $sales=0;
|
||||
$stmt="select vc.status,count(*) from ".$vicidial_xfer_log_table." vx, ".$vicidial_closer_log_table." 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 in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "') and vx.campaign_id in ('" . implode("','", array_map(array($link, '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;";
|
||||
$stmt="select vc.status,count(*) from ".$vicidial_xfer_log_table." vx, ".$vicidial_closer_log_table." vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vx.front_uniqueid in ('" . implode("','", $valid_UIDs)."') and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "') and vx.campaign_id in ('" . implode("','", array_map(array($link, '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_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1019,6 +1062,8 @@ while ($i < $users_to_print)
|
||||
$j=0;
|
||||
while ($j < $lead_ids_to_print)
|
||||
{
|
||||
# $TOTcalls++;
|
||||
# $USERcalls[$i]++;
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$recL=0;
|
||||
if ( (preg_match("/\|$row[0]\|/", $sale_dispo_str)) and ($recL < 1) ) {$A1=$row[1]; $recL++; $sales=($sales + $row[1]);}
|
||||
@@ -1069,7 +1114,84 @@ $TOTcalls = sprintf("%6s", $TOTcalls);
|
||||
$TOTsales = sprintf("%7s", $TOTsales);
|
||||
$totDROP = sprintf("%7s", $totDROP);
|
||||
$totOTHER = sprintf("%5s", $totOTHER);
|
||||
*/
|
||||
ksort($complete_fronter_stats); $i=0;
|
||||
foreach ($complete_fronter_stats as $fronter => $dispos)
|
||||
{
|
||||
|
||||
$stmt="select full_name from vicidial_users where user='$fronter' $LOGadmin_viewable_groupsSQL;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$names_to_print = mysqli_num_rows($rslt);
|
||||
if ($names_to_print > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$full_name = sprintf("%-15s", $row[0]); while(strlen($full_name)>15) {$full_name = substr("$full_name", 0, -1);}
|
||||
}
|
||||
else
|
||||
{
|
||||
$full_name = sprintf("%-45s", $row[0]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
|
||||
}
|
||||
}
|
||||
else
|
||||
{$full_name = ' ';}
|
||||
|
||||
$DROP=0; $OTHER=0; $sales=0; $USERcalls=0;
|
||||
foreach ($dispos as $dispo => $count)
|
||||
{
|
||||
$recL=0;
|
||||
if ( (preg_match("/\|$dispo\|/", $sale_dispo_str)) and ($recL < 1) ) {$A1=$count; $recL++; $sales=($sales + $count);}
|
||||
if ( ($dispo=='DROP' || $dispo=='TIMEOT') and ($recL < 1) ) {$DROP=($DROP+$count); $recL++;}
|
||||
if ($recL < 1) {$OTHER=($count + $OTHER); $recL++;}
|
||||
$USERcalls+=$count;
|
||||
$TOTcalls+=$count;
|
||||
}
|
||||
|
||||
$totDROP = ($totDROP + $DROP);
|
||||
$totOTHER = ($totOTHER + $OTHER);
|
||||
$TOTsales = ($TOTsales + $sales);
|
||||
|
||||
$Spct = MathZDC($sales, $USERcallsRAW[$i])*100;
|
||||
$Spct = round($Spct, 2);
|
||||
$Spct = sprintf("%01.2f", $Spct);
|
||||
|
||||
if ($sales>$max_success) {$max_success=$sales;}
|
||||
if ($USERcalls>$max_xfers) {$max_xfers=$USERcalls;}
|
||||
if ($Spct>$max_success_pct) {$max_success_pct=$Spct;}
|
||||
if ($DROP>$max_drops) {$max_drops=$DROP;}
|
||||
if ($OTHER>$max_other) {$max_other=$OTHER;}
|
||||
$graph_stats[$i][0]="$fronter - $full_name";
|
||||
$graph_stats[$i][1]=$USERcalls;
|
||||
$graph_stats[$i][2]=$Spct;
|
||||
$graph_stats[$i][3]=$sales;
|
||||
$graph_stats[$i][4]=$DROP;
|
||||
$graph_stats[$i][5]=$OTHER;
|
||||
|
||||
$USERcalls = sprintf("%6s", $USERcalls);
|
||||
$DROP = sprintf("%7s", $DROP);
|
||||
$OTHER = sprintf("%5s", $OTHER);
|
||||
$sales = sprintf("%7s", $sales);
|
||||
$Spct = sprintf("%7s", $Spct);
|
||||
|
||||
$ASCII_text.="| ".sprintf("%-24s", substr("$fronter - $full_name", 0, 24))." | $USERcalls | $Spct% | $sales | $DROP | $OTHER |\n";
|
||||
$CSV_fronter_lines.="\"$fronter - $full_name\",\"$USERcalls\",\"$Spct%\",\"$sales\",\"$DROP\",\"$OTHER\"\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
$totSpct = MathZDC($TOTsales, $TOTcalls)*100;
|
||||
$totSpct = round($totSpct, 2);
|
||||
$totSpct = sprintf("%01.2f", $totSpct);
|
||||
$totSpct = sprintf("%7s", $totSpct);
|
||||
|
||||
$TOTagents = sprintf("%6s", count($complete_fronter_stats));
|
||||
$TOTcalls = sprintf("%6s", $TOTcalls);
|
||||
$TOTsales = sprintf("%7s", $TOTsales);
|
||||
$totDROP = sprintf("%7s", $totDROP);
|
||||
$totOTHER = sprintf("%5s", $totOTHER);
|
||||
|
||||
$stmt="select avg(queue_seconds) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in ('" . implode("','", array_map(array($link, 'real_escape_string'), $group)) . "');";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -1436,7 +1558,7 @@ $CSV_closer_footer.="\""._QXZ("TOTAL CLOSERS").": $TOTagents\",\"$TOTcalls\",\"
|
||||
# $JS_text.="prepChart('$default_graph', $graph_id, $q, $dataset_name);\n";
|
||||
$JS_text.="var main_ctx = document.getElementById(\"CanvasID".$graph_id."_".$q."\");\n";
|
||||
$JS_text.="var GraphID".$graph_id."_".$q." = new Chart(main_ctx, {type: '$default_graph', $chart_options data: $dataset_name});\n";
|
||||
echo "<!-- $JS_text //-->\n";
|
||||
# echo "<!-- $JS_text //-->\n";
|
||||
}
|
||||
|
||||
$graph_count=count($graph_array);
|
||||
|
||||
@@ -1494,6 +1494,7 @@ USERDELETE User Bulk Delete <QXZ>This will delete the selected users from your s
|
||||
ACCIDADD AC-CID Bulk Add <QXZ>This allows you to paste in a listing of CIDs to insert into a campaign AC-CID list or CID Group list. There are three methods to choose from: <ul> <li><b>STATE LOOKUP</b> - This will take a list of CIDs and insert them as Area Code Caller IDs into the selected campaign. The area code lookup is designed to work only with numbers in the North American Numbering Plan as it uses the first three digits of each CID. The description will automatically be filled with the appropriate US state abbreviation corresponding to the given CIDs 3-digit area code. <li><b>CSV</b> - This will take a comma separated list in the format of NPA,CID,DESCRIPTION,ACTIVE and insert each line into the specified campaigns AC-CID list using the supplied values. For example, given a listing of 813,7271234567,Florida,Y will result in an AC-CID entry for area code 813 using the CID 7271234567 and a description of -Florida- with the status being active. Descriptions are limited to 50 characters. For CID Groups of a STATE type, use this format for CSV- STATE,CID,DESCRIPTION,ACTIVE. The -ACTIVE- column will only be used if the Active select list above is set to -Input-.<li><b>STATE FILL</b> - Similar to the STATE LOOKUP method above, this will take a list of CIDs and insert them as AC-CIDs in the specified campaign but will also make an entry for each area code in a state based off the state the CID is in. For example, if given the CID 7271234567, 19 CID entries will be created with the same CID, one each for every area code in Florida. If you are inserting into a CID Group that is a STATE type, then you will not want to use the STATE FILL method.</ul> CIDs must be between 6 and 20 digits in length and only digits 0-9 are allowed. Optionally, you can have the AC-CIDs set to active upon insertion.</QXZ>
|
||||
ACCIDDELETE AC-CID Bulk Delete <QXZ>This will delete the Areacode Caller ID entries you select from the next screen based on the campaign or CID group you select here. Setting Clear All CIDs to YES will bypass the AC-CID selection and wipe all AC-CIDs for the selected campaign or CID group.</QXZ>
|
||||
call_export_report Call Export Report <QXZ>This report is for the downloading of leads and their vicidial_log and/or vicidial_closer_log information by status, list_id and date range. Report downloads to a flat text file that is tab delimited.</QXZ>
|
||||
call_export_report-user User <QXZ>This option will filter all calls to a specific user - user group permissions for the report user still apply, however.</QXZ>
|
||||
call_export_report-date_field Date Field <QXZ>This option will determine if the data exported will be by call log date or the entry date of when the lead was added to the system.</QXZ>
|
||||
call_export_report-header_row Header Row <QXZ>If enabled, the first line in the exported data file will be a list of the headers for the data in the file.</QXZ>
|
||||
call_export_report-rec_fields Recording Fields <QXZ>If enabled, the recordings for the latest phone call for the selected leads will be included in the export. If there is more than one recording, they will be pipe-delimited.</QXZ>
|
||||
@@ -1502,6 +1503,7 @@ call_export_report-call_notes Per Call Notes <QXZ>If enabled at the campaign lev
|
||||
call_export_report-did_filter Use DID Filter <QXZ>If enabled, this will only affect selection of leads from inbound calls, and will allow you to have only the leads that have inbound calls that arrived through the selected Inbound DIDs.</QXZ>
|
||||
call_export_report-vlc_filter VLC Filter <QXZ>If enabled, you will be able to have only the leads with the vendor_lead_code values you have selected be exported. We do not recommend using this option if you have unique VLC values for most of your leads.</QXZ>
|
||||
call_export_report-export_fields Export Fields <QXZ>STANDARD will include all of the lead fields that agents normally have access to, EXTENDED will include the following extra lead fields: entry_date, called_count, last_local_call_time, modify_date, called_since_last_reset. NOTE: If you have selected to use Entry Date or DID Filtering, EXTENDED will be automaticaly used.</QXZ>
|
||||
call_export_report-export_type Export Type <QXZ>STANDARD will include all of the lead fields that agents normally have access to, EXTENDED will include the following extra lead fields: entry_date, called_count, last_local_call_time, modify_date, called_since_last_reset. NOTE: If you have selected to use Entry Date or DID Filtering, EXTENDED will be automaticaly used.</QXZ>
|
||||
call_export_report-exclude_call_log_data Exclude Call Log Data <QXZ>If you only want to export lead data, and no log or user information associated with the leads, then set this option to YES, change the -Date Field- to Entry Date and select -Lists-, -Statuses- and a -Campaign-, even though the Campaign will be ignored.</QXZ>
|
||||
call_export_report-search_archived_data Search Archived Data <QXZ>If you want to pull data from older leads and-or call logs that have been archived on your system, then you can select either or both of those options here.</QXZ>
|
||||
lead_export_report Lead Export Report <QXZ>This report allows downloading of leads and their latest vicidial_log and/or vicidial_closer_log information by status, list_id and date range. It downloads to a flat text file that is tab delimited.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user