Added option to several reports to search the archived logs
git-svn-id: svn://192.168.202.10@2418 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -193,6 +193,8 @@ OTHER CHANGES:
|
||||
Carrier Log Stats generated once per minute system-wide instead of every
|
||||
time the realtime report refreshes on every screen.
|
||||
|
||||
47. Added option to several reports to search the archived logs.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# 141128-0856 - Code cleanup for QXZ functions
|
||||
# 141230-0923 - Added code for on-the-fly language translations display
|
||||
# 150516-1258 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1627 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -56,6 +57,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
@@ -81,6 +84,24 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$table_name="vicidial_closer_log";
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
}
|
||||
#############
|
||||
|
||||
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -352,13 +373,17 @@ $MAIN.="<option value=\"845-1745\">845-1745</option>\n";
|
||||
$MAIN.="<option value=\"1745-100\">1745-100</option>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a>";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date&group=$group&shift=$shift&SUBMIT=$SUBMIT&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a>";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
$MAIN.="</FONT>\n";
|
||||
|
||||
$MAIN.="</FORM>\n\n";
|
||||
|
||||
$MAIN.="<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$group)
|
||||
{
|
||||
$MAIN.="\n\n";
|
||||
@@ -560,7 +585,7 @@ $TOTintervals = $j;
|
||||
|
||||
|
||||
### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "';";
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$records_to_grab = mysqli_num_rows($rslt);
|
||||
|
||||
+172
-129
@@ -49,6 +49,8 @@
|
||||
# 150516-1259 - Fixed Javascript element problem, Issue #857
|
||||
# 150522-1304 - Fixed issue with missing calls from user stats section
|
||||
# 150928-1234 - Separated User Group permissions for this report by in-group and by DID
|
||||
# 151124-1236 - Changed bottom chart to pull all time segments
|
||||
# 151125-1633 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -81,6 +83,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
$MT[0]='0';
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
@@ -111,6 +115,30 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_did_log", "vicidial_closer_log", "live_inbound_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_did_log_table=use_archive_table("vicidial_did_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
$live_inbound_log_table=use_archive_table("live_inbound_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_did_log_table="vicidial_did_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
$live_inbound_log_table="live_inbound_log";
|
||||
}
|
||||
#############
|
||||
|
||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -434,6 +462,7 @@ $MAIN.="o_cal.a_tpl.yearscroll = false;\n";
|
||||
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
|
||||
$MAIN.="</script>\n";
|
||||
|
||||
|
||||
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
if ($EMAIL=='Y')
|
||||
{$MAIN.=_QXZ("Email Accts").": \n";}
|
||||
@@ -486,6 +515,11 @@ $MAIN.="<BR>"._QXZ("Display as").": ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>"._QXZ("TEXT")."</option><option value='HTML'>"._QXZ("HTML")."</option></select>\n<BR>";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."<BR><BR>\n";
|
||||
}
|
||||
|
||||
$MAIN.=" <INPUT TYPE=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
|
||||
$MAIN.="</TD></TR></TABLE>\n";
|
||||
$MAIN.="</FORM>\n\n";
|
||||
@@ -527,14 +561,20 @@ if ($shift == 'ALL')
|
||||
$query_date_BEGIN = "$query_date $time_BEGIN";
|
||||
$query_date_END = "$end_date $time_END";
|
||||
|
||||
# Calculate first record in interval and last
|
||||
$time_BEGIN_array=explode(":", $time_BEGIN);
|
||||
$first_shift_record=(4*$time_BEGIN_array[0])+(ceil($time_BEGIN_array[1]/15));
|
||||
$time_END_array=explode(":", $time_END);
|
||||
$last_shift_record=(4*$time_END_array[0])+(ceil($time_END_array[1]/15));
|
||||
|
||||
if ($EMAIL=='Y')
|
||||
{
|
||||
$MAIN.=_QXZ("Inbound Email Stats").": $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$MAIN.=_QXZ("Inbound Email Stats").": $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$CSV_text1.="\""._QXZ("Inbound Call Stats").":\",\"$group_string\",\"$NOW_TIME\"\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$MAIN.=_QXZ("Inbound Call Stats").": $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$MAIN.=_QXZ("Inbound Call Stats").": $group_string $NOW_TIME <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$CSV_text1.="\""._QXZ("Inbound Call Stats").":\",\"$group_string\",\"$NOW_TIME\"\n";
|
||||
}
|
||||
|
||||
@@ -557,7 +597,7 @@ if ($DID=='Y')
|
||||
$did_SQL = preg_replace('/,$/i', '',$did_SQL);
|
||||
if (strlen($did_SQL)<3) {$did_SQL="''";}
|
||||
|
||||
$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
|
||||
$stmt="select uniqueid from ".$vicidial_did_log_table." where did_id IN($did_SQL);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$unids_to_print = mysqli_num_rows($rslt);
|
||||
@@ -620,7 +660,7 @@ if ($group_ct > 1)
|
||||
$did_id[$i] = $row[0];
|
||||
}
|
||||
|
||||
$stmt="select uniqueid from vicidial_did_log where did_id='$did_id[$i]';";
|
||||
$stmt="select uniqueid from ".$vicidial_did_log_table." where did_id='$did_id[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$DIDunids_to_print = mysqli_num_rows($rslt);
|
||||
@@ -634,28 +674,28 @@ if ($group_ct > 1)
|
||||
$DIDunid_SQL = preg_replace('/,$/i', '',$DIDunid_SQL);
|
||||
if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
|
||||
$stmt="select count(*) from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a='$group[$i]' and comment_b='START';";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
|
||||
$stmt="select count(*) from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($DIDunid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$rowx=mysqli_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($DIDunid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -733,28 +773,28 @@ $MAIN.="---------- "._QXZ("TOTALS")."\n";
|
||||
|
||||
$CSV_text1.="\n\""._QXZ("Time range").":\",\"$query_date_BEGIN\",\""._QXZ("to")."\",\"$query_date_END\"\n\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
$stmt="select count(*),sum(queue_seconds) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);";
|
||||
$stmt="select count(*),sum(queue_seconds) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$rowy=mysqli_fetch_row($rslt);
|
||||
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
$stmt="select count(*) from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) and comment_b='START';";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*) from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
$stmt="select count(*) from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -811,10 +851,10 @@ $MAIN.="---------- "._QXZ("DROPS")."\n";
|
||||
|
||||
$CSV_text1.="\n\""._QXZ("DROPS")."\"\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null);";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN('DROP','XDROP') and (length_in_sec <= 49999 or length_in_sec is null) and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -859,13 +899,13 @@ if (strlen($group_SQL)>3)
|
||||
$Sanswer_sec_pct_rt_stat_one = $row[0];
|
||||
$Sanswer_sec_pct_rt_stat_two = $row[1];
|
||||
|
||||
$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
$stmt = "SELECT count(*) from ".$vicidial_closer_log_table." where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_one and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$answer_sec_pct_rt_stat_one = $row[0];
|
||||
|
||||
$stmt = "SELECT count(*) from vicidial_closer_log where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
$stmt = "SELECT count(*) from ".$vicidial_closer_log_table." where campaign_id IN($group_SQL) and call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and queue_seconds <= $Sanswer_sec_pct_rt_stat_two and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL');";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -956,10 +996,10 @@ $MAIN.="---------- "._QXZ("QUEUE STATS")."\n";
|
||||
|
||||
$CSV_text1.="\n\""._QXZ("QUEUE STATS")."\"\n";
|
||||
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
|
||||
$stmt="select count(*),sum(queue_seconds) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and (queue_seconds > 0);";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),sum(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);";
|
||||
$stmt="select count(*),sum(queue_seconds) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and (queue_seconds > 0) and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -1012,7 +1052,7 @@ if ($EMAIL=='Y') {
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("HOLD TIME BREAKDOWN IN SECONDS",36)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=2\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("HOLD TIME BREAKDOWN IN SECONDS",36)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=2&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
$ASCII_text.="| 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | TOTAL |\n";
|
||||
$ASCII_text.="+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
@@ -1021,10 +1061,10 @@ $CSV_text2.="\n\"$rpt_type_verbiage "._QXZ("HOLD TIME BREAKDOWN IN SECONDS")."\"
|
||||
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\"TOTAL\"\n";
|
||||
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1081,14 +1121,14 @@ $CSV_text2.="\"\",\"$hd_0\",\"$hd_5\",\"$hd10\",\"$hd15\",\"$hd20\",\"$hd25\",\"
|
||||
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_seconds order by ct desc limit 1;";
|
||||
}
|
||||
if ($DB) {$GRAPH_text.=$stmt."\n";}
|
||||
$ms_rslt=mysql_to_mysqli($ms_stmt, $link);
|
||||
@@ -1165,10 +1205,10 @@ $ASCII_text.="+-----------------------------------------------------------------
|
||||
$CSV_text2.="\n\"$rpt_type_verbiage "._QXZ("DROP TIME BREAKDOWN IN SECONDS")."\"\n";
|
||||
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\""._QXZ("TOTAL")."\"\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1225,14 +1265,14 @@ $ASCII_text.="+-----------------------------------------------------------------
|
||||
$CSV_text2.="\"\",\"$dd_0\",\"$dd_5\",\"$dd10\",\"$dd15\",\"$dd20\",\"$dd25\",\"$dd30\",\"$dd35\",\"$dd40\",\"$dd45\",\"$dd50\",\"$dd55\",\"$dd60\",\"$dd90\",\"$dd99\",\"$BDdropCALLS\"\n";
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status IN('DROP','XDROP') group by queue_seconds order by ct desc limit 1;";
|
||||
}
|
||||
if ($DB) {$GRAPH_text.=$stmt."\n";}
|
||||
$ms_rslt=mysql_to_mysqli($ms_stmt, $link);
|
||||
@@ -1310,10 +1350,10 @@ $ASCII_text.="----------+-------------------------------------------------------
|
||||
$CSV_text2.="\n\"$rpt_type_verbiage "._QXZ("ANSWERED TIME AND PERCENT BREAKDOWN IN SECONDS")."\"\n";
|
||||
$CSV_text2.="\"\",\"0\",\"5\",\"10\",\"15\",\"20\",\"25\",\"30\",\"35\",\"40\",\"45\",\"50\",\"55\",\"60\",\"90\",\"+90\",\""._QXZ("TOTAL")."\"\n";
|
||||
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;";
|
||||
$stmt="select count(*),queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1515,14 +1555,14 @@ $CSV_text2.="\""._QXZ("CUM")." %\",\"$pCad_0\",\"$pCad_5\",\"$pCad10\",\"$pCad15
|
||||
$CSV_text2.="\""._QXZ("CUM ANS")." %\",\"$ApCad_0\",\"$ApCad_5\",\"$ApCad10\",\"$ApCad15\",\"$ApCad20\",\"$ApCad25\",\"$ApCad30\",\"$ApCad35\",\"$ApCad40\",\"$ApCad45\",\"$ApCad50\",\"$ApCad55\",\"$ApCad60\",\"$ApCad90\",\"$ApCad99\"\n";
|
||||
|
||||
if ($report_display_type=="HTML") {
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec order by rd_sec asc;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;";
|
||||
$stmt="select count(*),round(queue_seconds) as rd_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by rd_sec;";
|
||||
$ms_stmt="select queue_seconds from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') order by queue_seconds desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE','TIMEOT','AFTHRS','NANQUE','INBND','MAXCAL') group by queue_seconds order by ct desc limit 1;";
|
||||
}
|
||||
if ($DB) {$GRAPH_text.=$stmt."\n";}
|
||||
$ms_rslt=mysql_to_mysqli($ms_stmt, $link);
|
||||
@@ -1590,7 +1630,7 @@ else
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("HANGUP REASON STATS",25)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=3\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("HANGUP REASON STATS",25)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=3&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+----------------------+------------+\n";
|
||||
$ASCII_text.="| "._QXZ("HANGUP REASON",20)." | $rpt_type_verbiages |\n";
|
||||
$ASCII_text.="+----------------------+------------+\n";
|
||||
@@ -1598,10 +1638,10 @@ $ASCII_text.="+----------------------+------------+\n";
|
||||
$CSV_text3.="\n\"$rpt_type_verbiage "._QXZ("HANGUP REASON STATS")."\"\n";
|
||||
$CSV_text3.="\""._QXZ("HANGUP REASON")."\",\"$rpt_type_verbiages\"\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;";
|
||||
$stmt="select count(*),term_reason from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by term_reason order by term_reason;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),term_reason from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;";
|
||||
$stmt="select count(*),term_reason from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by term_reason order by term_reason;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1676,7 +1716,7 @@ else
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("STATUS STATS",18)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=4\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("STATUS STATS",18)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=4&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+-----------+\n";
|
||||
$ASCII_text.="| "._QXZ("STATUS",6)." | "._QXZ("DESCRIPTION",20)." | "._QXZ("CATEGORY",20)." | $rpt_type_verbiages | "._QXZ("TOTAL TIME",10)." | "._QXZ("AVG TIME",8)." |$rpt_type_verbiages/"._QXZ("HOUR",4)."|\n";
|
||||
$ASCII_text.="+--------+----------------------+----------------------+------------+------------+----------+-----------+\n";
|
||||
@@ -1691,10 +1731,10 @@ $CSV_text4.="\""._QXZ("STATUS")."\",\""._QXZ("DESCRIPTION")."\",\""._QXZ("CATEGO
|
||||
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;";
|
||||
$stmt="select count(*),status,sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by status;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;";
|
||||
$stmt="select count(*),status,sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by status;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -1851,7 +1891,7 @@ else
|
||||
######### STATUS CATEGORY STATS
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- "._QXZ("CUSTOM STATUS CATEGORY STATS",34)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=5\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- "._QXZ("CUSTOM STATUS CATEGORY STATS",34)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=5&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+----------------------+------------+--------------------------------+\n";
|
||||
$ASCII_text.="| "._QXZ("CATEGORY",20)." | $rpt_type_verbiages | "._QXZ("DESCRIPTION",30)." |\n";
|
||||
$ASCII_text.="+----------------------+------------+--------------------------------+\n";
|
||||
@@ -1937,7 +1977,7 @@ else
|
||||
$TOTALcalls = 0;
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("INITIAL QUEUE POSITION BREAKDOWN",38)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=6\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- $rpt_type_verbiage "._QXZ("INITIAL QUEUE POSITION BREAKDOWN",38)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=6&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
|
||||
$ASCII_text.="| 1 2 3 4 5 6 7 8 9 10 15 20 25 +25 | "._QXZ("TOTAL",10)." |\n";
|
||||
$ASCII_text.="+-------------------------------------------------------------------------------------+------------+\n";
|
||||
@@ -1946,10 +1986,10 @@ $CSV_text6.="\n\"$rpt_type_verbiage "._QXZ("INITIAL QUEUE POSITION BREAKDOWN")."
|
||||
$CSV_text6.="\"\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"15\",\"20\",\"25\",\"+25\",\""._QXZ("TOTAL")."\"\n";
|
||||
|
||||
|
||||
$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position;";
|
||||
$stmt="select count(*),queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
|
||||
$stmt="select count(*),queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -2002,14 +2042,14 @@ $CSV_text6.="\"\",\"$qp_1\",\"$qp_2\",\"$qp_3\",\"$qp_4\",\"$qp_5\",\"$qp_6\",\"
|
||||
|
||||
if ($report_display_type=="HTML")
|
||||
{
|
||||
$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
|
||||
$stmt="select count(*),queue_position as qp from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) group by queue_position order by ct desc limit 1;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select count(*),queue_position as qp from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
|
||||
$stmt="select count(*),queue_position as qp from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by qp order by qp asc;";
|
||||
$ms_stmt="select queue_position from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) order by queue_position desc limit 1;";
|
||||
$mc_stmt="select count(*) as ct from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) group by queue_position order by ct desc limit 1;";
|
||||
}
|
||||
if ($DB) {$GRAPH_text.=$stmt."\n";}
|
||||
$ms_rslt=mysql_to_mysqli($ms_stmt, $link);
|
||||
@@ -2079,7 +2119,7 @@ $TOTtime=0;
|
||||
$TOTavg=0;
|
||||
|
||||
$ASCII_text="\n";
|
||||
$ASCII_text.="---------- "._QXZ("AGENT STATS",17)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=7\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="---------- "._QXZ("AGENT STATS",17)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=7&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$ASCII_text.="+--------------------------+------------+------------+--------+\n";
|
||||
$ASCII_text.="| "._QXZ("AGENT",24)." | $rpt_type_verbiages | "._QXZ("TIME H:M:S",10)." |"._QXZ("AVERAGE",8)."|\n";
|
||||
$ASCII_text.="+--------------------------+------------+------------+--------+\n";
|
||||
@@ -2100,10 +2140,10 @@ $CALLS_graph=$graph_header."<th class='thgraph' scope='col'>$rpt_type_verbiages
|
||||
$TIMEHMS_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("TIME H:M:S")."</th></tr>";
|
||||
$AVERAGE_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("AVERAGE")."</th></tr>";
|
||||
|
||||
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
|
||||
$stmt="select ".$vicidial_closer_log_table.".user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from ".$vicidial_closer_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and ".$vicidial_closer_log_table.".user is not null and length_in_sec is not null and ".$vicidial_closer_log_table.".user=vicidial_users.user group by ".$vicidial_closer_log_table.".user;";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="select vicidial_closer_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_closer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and vicidial_closer_log.user is not null and length_in_sec is not null and vicidial_closer_log.user=vicidial_users.user group by vicidial_closer_log.user;";
|
||||
$stmt="select ".$vicidial_closer_log_table.".user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from ".$vicidial_closer_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL) and ".$vicidial_closer_log_table.".user is not null and length_in_sec is not null and ".$vicidial_closer_log_table.".user=vicidial_users.user group by ".$vicidial_closer_log_table.".user;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -2211,7 +2251,7 @@ $CSV_text7.="\""._QXZ("TOTAL Agents").": $TOTagents\",\"$TOTcalls\",\"$TOTtime\"
|
||||
######### TIME STATS
|
||||
|
||||
$MAIN.="\n";
|
||||
$MAIN.="---------- "._QXZ("TIME STATS",16)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=9\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$MAIN.="---------- "._QXZ("TIME STATS",16)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=9&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
|
||||
$CSV_text9.="\""._QXZ("TIME STATS")."\"\n\n";
|
||||
|
||||
@@ -2221,10 +2261,10 @@ $MAIN.="<FONT SIZE=0>\n";
|
||||
##############################
|
||||
######### 15-minute increment breakdowns of total calls and drops, then answered table
|
||||
$BDansweredCALLS = 0;
|
||||
$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
|
||||
$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL);";
|
||||
if ($DID=='Y')
|
||||
{
|
||||
$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
$stmt="SELECT status,queue_seconds,UNIX_TIMESTAMP(call_date),call_date from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and uniqueid IN($unid_SQL);";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -2365,72 +2405,75 @@ while ($i <= 96)
|
||||
if ($h == 2) {$time = " 30 ";}
|
||||
if ($h == 3) {$time = " 45 ";}
|
||||
$Ghour_count = $hour_count[$i];
|
||||
if ($Ghour_count < 1)
|
||||
if ($i >= $first_shift_record && $i<=$last_shift_record) # May need to use lower. Ask Matt.
|
||||
# if ($i >= $first_shift_record && $i<$last_shift_record)
|
||||
{
|
||||
if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
if ($Ghour_count < 1)
|
||||
{
|
||||
$do_nothing=1;
|
||||
# if ( ($no_lines_yet) or ($i > $last_full_record) )
|
||||
# {
|
||||
# $do_nothing=1;
|
||||
# }
|
||||
# else
|
||||
# {
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$ASCII_text.="|$time|";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;}
|
||||
$ASCII_text.="| $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"0\",\"0\"\n";
|
||||
|
||||
# }
|
||||
}
|
||||
else
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$ASCII_text.="|$time|";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= 102) {$ASCII_text.=" "; $k++;}
|
||||
$ASCII_text.="| $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"0\",\"0\"\n";
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
$ASCII_text.="|$time|<SPAN class=\"green\">";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| 0 | $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"0\",\"$hour_count[$i]\"\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i]+=0;
|
||||
$drop_count[$i]+=0;
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
|
||||
|
||||
$ASCII_text.="|$time|<SPAN class=\"red\">";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;}
|
||||
$ASCII_text.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_lines_yet=0;
|
||||
$Xhour_count = ($Ghour_count * $hour_multiplier);
|
||||
$Yhour_count = (99 - $Xhour_count);
|
||||
|
||||
$Gdrop_count = $drop_count[$i];
|
||||
if ($Gdrop_count < 1)
|
||||
{
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
|
||||
$ASCII_text.="|$time|<SPAN class=\"green\">";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= $Xhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="*X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 101) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| 0 | $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"0\",\"$hour_count[$i]\"\n";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$Xdrop_count = ($Gdrop_count * $hour_multiplier);
|
||||
|
||||
# if ($Xdrop_count >= $Xhour_count) {$Xdrop_count = ($Xdrop_count - 1);}
|
||||
|
||||
$XXhour_count = ( ($Xhour_count - $Xdrop_count) - 1 );
|
||||
|
||||
$hour_count[$i]+=0;
|
||||
$drop_count[$i]+=0;
|
||||
|
||||
$hour_count[$i] = sprintf("%-5s", $hour_count[$i]);
|
||||
$drop_count[$i] = sprintf("%-5s", $drop_count[$i]);
|
||||
|
||||
$ASCII_text.="|$time|<SPAN class=\"red\">";
|
||||
$CSV_text9.="\"$time\",";
|
||||
$k=0; while ($k <= $Xdrop_count) {$ASCII_text.=">"; $k++; $char_counter++;}
|
||||
$ASCII_text.="D</SPAN><SPAN class=\"green\">"; $char_counter++;
|
||||
$k=0; while ($k <= $XXhour_count) {$ASCII_text.="*"; $k++; $char_counter++;}
|
||||
$ASCII_text.="X</SPAN>"; $char_counter++;
|
||||
$k=0; while ($k <= $Yhour_count) {$ASCII_text.=" "; $k++; $char_counter++;}
|
||||
while ($char_counter <= 102) {$ASCII_text.=" "; $char_counter++;}
|
||||
$ASCII_text.="| $drop_count[$i] | $hour_count[$i] |\n";
|
||||
$CSV_text9.="\"$drop_count[$i]\",\"$hour_count[$i]\"\n";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$graph_stats[$i][0]="$time";
|
||||
$graph_stats[$i][1]=trim($hour_count[$i]);
|
||||
$graph_stats[$i][2]=trim($drop_count[$i]);
|
||||
@@ -2475,7 +2518,7 @@ else
|
||||
|
||||
##### Answered wait time breakdown
|
||||
$MAIN.="\n";
|
||||
$MAIN.="---------- $rpt_type_verbiage "._QXZ("ANSWERED TIME BREAKDOWN IN SECONDS", 40)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=8\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$MAIN.="---------- $rpt_type_verbiage "._QXZ("ANSWERED TIME BREAKDOWN IN SECONDS", 40)." <a href=\"$PHP_SELF?DB=$DB&DID=$DID&query_date=$query_date&end_date=$end_date$groupQS&shift=$shift&SUBMIT=$SUBMIT&file_download=8&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
$MAIN.="| "._QXZ("HOUR",4)." | 0 5 10 15 20 25 30 35 40 45 50 55 60 90 +90 | "._QXZ("TOTAL",10)." |\n";
|
||||
$MAIN.="+------+-------------------------------------------------------------------------------------------+------------+\n";
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# 141114-0012 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-1511 - Added code for on-the-fly language translations display
|
||||
# 150516-1300 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1609 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -65,6 +66,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
$MT[0]='0';
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
@@ -92,6 +95,22 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$table_name="vicidial_closer_log";
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
}
|
||||
#############
|
||||
|
||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -438,7 +457,7 @@ if ($bareformat < 1)
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&inbound_rate=$inbound_rate&outbound_rate=$outbound_rate$groupQS&costformat=$costformat&print_calls=$print_calls&query_date=$query_date&end_date=$end_date&exclude_rollover=$exclude_rollover&SUBMIT=$SUBMIT&shift=$shift&file_download=1\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&inbound_rate=$inbound_rate&outbound_rate=$outbound_rate$groupQS&costformat=$costformat&print_calls=$print_calls&query_date=$query_date&end_date=$end_date&exclude_rollover=$exclude_rollover&SUBMIT=$SUBMIT&shift=$shift&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">"._QXZ("MODIFY")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a>";
|
||||
$MAIN.="</FONT>\n";
|
||||
@@ -452,6 +471,11 @@ if ($bareformat < 1)
|
||||
$MAIN.="<option value=\"YES\">"._QXZ("YES")."</option>\n";
|
||||
$MAIN.="<option value=\"NO\">"._QXZ("NO")."</option>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
|
||||
$MAIN.="<BR> ";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
|
||||
@@ -631,7 +655,7 @@ else
|
||||
$hTOTmax_queue_seconds = 0;
|
||||
$hTOTdrop_count = 0;
|
||||
|
||||
$stmt = "SELECT status,length_in_sec,queue_seconds,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$stmt = "SELECT status,length_in_sec,queue_seconds,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$calls_to_parse = mysqli_num_rows($rslt);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# AST_DIDstats.php
|
||||
#
|
||||
# Copyright (C) 2014 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
#
|
||||
@@ -26,6 +26,7 @@
|
||||
# 141020-0848 - Added 9am-10pm and 10am-6pm options
|
||||
# 141113-2040 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-1508 - Added code for on-the-fly language translations display
|
||||
# 151125-1614 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -54,6 +55,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
@@ -79,6 +82,22 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$table_name="vicidial_did_log";
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_did_log_table=use_archive_table("vicidial_did_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_did_log_table="vicidial_did_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -381,7 +400,7 @@ while ($groups_to_print > $o)
|
||||
$o++;
|
||||
}
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD align=center valign=top>\n";
|
||||
$MAIN.="</TD><TD align=left valign=top><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>\n";
|
||||
$MAIN.="<SELECT SIZE=1 NAME=shift>\n";
|
||||
$MAIN.="<option selected value=\"$shift\">$shift</option>\n";
|
||||
$MAIN.="<option value=\"\">--</option>\n";
|
||||
@@ -397,7 +416,13 @@ $MAIN.="<option value=\"9AM-1AM\">"._QXZ("9AM-1AM")."</option>\n";
|
||||
$MAIN.="<option value=\"845-1745\">845-1745</option>\n";
|
||||
$MAIN.="<option value=\"1745-100\">1745-100</option>\n";
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD align=left valign=top>\n";
|
||||
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><BR><BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
|
||||
$MAIN.="</FONT></TD><TD align=left valign=top>\n";
|
||||
$MAIN.="<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
$MAIN.=" ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
@@ -624,7 +649,7 @@ else
|
||||
|
||||
|
||||
### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
|
||||
$stmt="select UNIX_TIMESTAMP(call_date),extension,server_ip from vicidial_did_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and did_id IN($group_SQL);";
|
||||
$stmt="select UNIX_TIMESTAMP(call_date),extension,server_ip from ".$vicidial_did_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and did_id IN($group_SQL);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$records_to_grab = mysqli_num_rows($rslt);
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
# 141113-2319 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-1448 - Added code for on-the-fly language translations display
|
||||
# 150516-1301 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1643 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -61,6 +62,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
if (strlen($type)<2) {$type='inbound';}
|
||||
@@ -92,6 +95,30 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_outbound_ivr_log", "vicidial_closer_log", "live_inbound_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_outbound_ivr_log_table=use_archive_table("vicidial_outbound_ivr_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
$live_inbound_log_table=use_archive_table("live_inbound_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_outbound_ivr_log_table="vicidial_outbound_ivr_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
$live_inbound_log_table="live_inbound_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -475,7 +502,7 @@ if ($type == 'inbound')
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&type=$type&query_date=$query_date&end_date=$end_date&query_date_D=$query_date_D&query_date_T=$query_date_T&end_date_D=$end_date_D&end_date_T=$end_date_T$groupQS&shift=$shift&file_download=1\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&type=$type&query_date=$query_date&end_date=$end_date&query_date_D=$query_date_D&query_date_T=$query_date_T&end_date_D=$end_date_D&end_date_T=$end_date_T$groupQS&shift=$shift&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=3111&group_id=$group[0]\">"._QXZ("MODIFY")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a> | ";
|
||||
$MAIN.="<a href=\"./AST_CLOSERstats.php?query_date=$query_date&end_date=$end_date&shift=$shift$groupQS\">"._QXZ("CLOSER REPORT")."</a> \n";
|
||||
@@ -498,7 +525,7 @@ else
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&type=$type&query_date=$query_date&end_date=$end_date&query_date_D=$query_date_D&query_date_T=$query_date_T&end_date_D=$end_date_D&end_date_T=$end_date_T$groupQS&shift=$shift&file_download=1\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&type=$type&query_date=$query_date&end_date=$end_date&query_date_D=$query_date_D&query_date_T=$query_date_T&end_date_D=$end_date_D&end_date_T=$end_date_T$groupQS&shift=$shift&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=31&campaign_id=$group[0]\">"._QXZ("MODIFY")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a> | ";
|
||||
$MAIN.="<a href=\"./AST_VDADstats.php?query_date=$query_date&end_date=$end_date&shift=$shift$groupQS\">"._QXZ("OUTBOUND REPORT")."</a> \n";
|
||||
@@ -541,6 +568,10 @@ $MAIN.="<BR>"._QXZ("Display as").": ";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>"._QXZ("TEXT")."</option><option value='HTML'>"._QXZ("HTML")."</option></select>\n<BR>";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."<BR>\n";
|
||||
}
|
||||
$MAIN.=" <input type=button value=\""._QXZ("SUBMIT")."\" name=smt id=smt onClick=\"submit_form()\">\n";
|
||||
|
||||
$MAIN.="</TD></TR></TABLE>\n";
|
||||
@@ -571,11 +602,11 @@ else
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
if ($type == 'inbound')
|
||||
{
|
||||
$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
|
||||
$stmt="select uniqueid,extension,start_time,comment_a,comment_b,comment_d,UNIX_TIMESTAMP(start_time),phone_ext from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) order by uniqueid,start_time;";
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
|
||||
$stmt="select uniqueid,caller_code,event_date,campaign_id,menu_id,menu_action,UNIX_TIMESTAMP(event_date),caller_code from ".$vicidial_outbound_ivr_log_table." where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) order by uniqueid,event_date,menu_action desc;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -759,7 +790,7 @@ else
|
||||
if ($type == 'inbound')
|
||||
{
|
||||
##### Grab all records for the IVR for the specified time period
|
||||
$stmt="select status,length_in_sec from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$stmt="select status,length_in_sec from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($group_SQL) and uniqueid IN($FLOWunique_calls_list[$s]);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$vcl_statuses_to_print = mysqli_num_rows($rslt);
|
||||
@@ -893,7 +924,7 @@ else
|
||||
if ($type == 'inbound')
|
||||
{
|
||||
$inb_15min_array=array();
|
||||
$stmt="select uniqueid, SEC_TO_TIME((TIME_TO_SEC(min(start_time)) DIV 900) * 900) as stime from live_inbound_log where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) group by uniqueid";
|
||||
$stmt="select uniqueid, SEC_TO_TIME((TIME_TO_SEC(min(start_time)) DIV 900) * 900) as stime from ".$live_inbound_log_table." where start_time >= '$query_date_BEGIN' and start_time <= '$query_date_END' and comment_a IN($group_SQL) group by uniqueid";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
while ($row=mysqli_fetch_row($rslt))
|
||||
{
|
||||
@@ -905,7 +936,7 @@ else
|
||||
else
|
||||
{
|
||||
$inb_15min_array=array();
|
||||
$stmt="select uniqueid, SEC_TO_TIME((TIME_TO_SEC(min(event_date)) DIV 900) * 900) as stime from vicidial_outbound_ivr_log where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) and menu_action='' group by uniqueid";
|
||||
$stmt="select uniqueid, SEC_TO_TIME((TIME_TO_SEC(min(event_date)) DIV 900) * 900) as stime from ".$vicidial_outbound_ivr_log_table." where event_date >= '$query_date_BEGIN' and event_date <= '$query_date_END' and campaign_id IN($group_SQL) and menu_action='' group by uniqueid";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
while ($row=mysqli_fetch_row($rslt))
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# 141114-0827 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-0919 - Added code for on-the-fly language translations display
|
||||
# 150516-1303 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1640 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -39,6 +40,8 @@ if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["use_lists"])) {$use_lists=$_GET["use_lists"];}
|
||||
elseif (isset($_POST["use_lists"])) {$use_lists=$_POST["use_lists"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
|
||||
$report_name = 'Lists Pass Report';
|
||||
@@ -65,6 +68,22 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$table_name="vicidial_log";
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_log_table=use_archive_table("vicidial_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_log_table="vicidial_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -458,6 +477,10 @@ $MAIN.=_QXZ("Display as").":<BR/>";
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>"._QXZ("TEXT")."</option><option value='HTML'>"._QXZ("HTML")."</option></select> ";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
$MAIN.="<BR><BR>\n";
|
||||
$MAIN.="<INPUT type=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
|
||||
$MAIN.="</TD><TD VALIGN=TOP> ";
|
||||
@@ -513,7 +536,7 @@ else
|
||||
$TOTALleads = 0;
|
||||
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- "._QXZ("LIST ID SUMMARY",19)." <a href=\"$PHP_SELF?DB=$DB$groupQS&SUBMIT=$SUBMIT&file_download=1\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
$OUToutput .= "---------- "._QXZ("LIST ID SUMMARY",19)." <a href=\"$PHP_SELF?DB=$DB$groupQS&SUBMIT=$SUBMIT&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a>\n";
|
||||
|
||||
$OUToutput .= "+------------+------------------------------------------+----------+------------+----------+";
|
||||
$OUToutput .= "---------+---------+---------+---------+---------+---------+";
|
||||
@@ -866,37 +889,37 @@ else
|
||||
$HA_results = mysqli_num_rows($rslt);
|
||||
if ($HA_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_one_results = mysqli_num_rows($rslt);
|
||||
if ($HA_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_two_results = mysqli_num_rows($rslt);
|
||||
if ($HA_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_three_results = mysqli_num_rows($rslt);
|
||||
if ($HA_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_four_results = mysqli_num_rows($rslt);
|
||||
if ($HA_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_five_results = mysqli_num_rows($rslt);
|
||||
if ($HA_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $HA_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($human_answered_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$HA_all_results = mysqli_num_rows($rslt);
|
||||
@@ -975,37 +998,37 @@ else
|
||||
$SA_results = mysqli_num_rows($rslt);
|
||||
if ($SA_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_one_results = mysqli_num_rows($rslt);
|
||||
if ($SA_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_two_results = mysqli_num_rows($rslt);
|
||||
if ($SA_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_three_results = mysqli_num_rows($rslt);
|
||||
if ($SA_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_four_results = mysqli_num_rows($rslt);
|
||||
if ($SA_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_five_results = mysqli_num_rows($rslt);
|
||||
if ($SA_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $SA_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($sale_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$SA_all_results = mysqli_num_rows($rslt);
|
||||
@@ -1084,37 +1107,37 @@ else
|
||||
$DN_results = mysqli_num_rows($rslt);
|
||||
if ($DN_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_one_results = mysqli_num_rows($rslt);
|
||||
if ($DN_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_two_results = mysqli_num_rows($rslt);
|
||||
if ($DN_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_three_results = mysqli_num_rows($rslt);
|
||||
if ($DN_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_four_results = mysqli_num_rows($rslt);
|
||||
if ($DN_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_five_results = mysqli_num_rows($rslt);
|
||||
if ($DN_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $DN_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($dnc_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$DN_all_results = mysqli_num_rows($rslt);
|
||||
@@ -1193,37 +1216,37 @@ else
|
||||
$CC_results = mysqli_num_rows($rslt);
|
||||
if ($CC_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_one_results = mysqli_num_rows($rslt);
|
||||
if ($CC_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_two_results = mysqli_num_rows($rslt);
|
||||
if ($CC_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_three_results = mysqli_num_rows($rslt);
|
||||
if ($CC_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_four_results = mysqli_num_rows($rslt);
|
||||
if ($CC_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_five_results = mysqli_num_rows($rslt);
|
||||
if ($CC_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $CC_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($customer_contact_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$CC_all_results = mysqli_num_rows($rslt);
|
||||
@@ -1302,37 +1325,37 @@ else
|
||||
$UW_results = mysqli_num_rows($rslt);
|
||||
if ($UW_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_one_results = mysqli_num_rows($rslt);
|
||||
if ($UW_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_two_results = mysqli_num_rows($rslt);
|
||||
if ($UW_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_three_results = mysqli_num_rows($rslt);
|
||||
if ($UW_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_four_results = mysqli_num_rows($rslt);
|
||||
if ($UW_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_five_results = mysqli_num_rows($rslt);
|
||||
if ($UW_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $UW_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($unworkable_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$UW_all_results = mysqli_num_rows($rslt);
|
||||
@@ -1411,37 +1434,37 @@ else
|
||||
$BA_results = mysqli_num_rows($rslt);
|
||||
if ($BA_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_one_results = mysqli_num_rows($rslt);
|
||||
if ($BA_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_two_results = mysqli_num_rows($rslt);
|
||||
if ($BA_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_three_results = mysqli_num_rows($rslt);
|
||||
if ($BA_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_four_results = mysqli_num_rows($rslt);
|
||||
if ($BA_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_five_results = mysqli_num_rows($rslt);
|
||||
if ($BA_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $BA_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($scheduled_callback_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$BA_all_results = mysqli_num_rows($rslt);
|
||||
@@ -1520,37 +1543,37 @@ else
|
||||
$MP_results = mysqli_num_rows($rslt);
|
||||
if ($MP_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=1 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=1 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_one_results = mysqli_num_rows($rslt);
|
||||
if ($MP_one_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_one_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=2 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=2 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_two_results = mysqli_num_rows($rslt);
|
||||
if ($MP_two_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_two_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count=3 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count=3 and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_three_results = mysqli_num_rows($rslt);
|
||||
if ($MP_three_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_three_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='4' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='4' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_four_results = mysqli_num_rows($rslt);
|
||||
if ($MP_four_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_four_count = $row[0];}
|
||||
$stmt="select count(*) from vicidial_log where called_count='5' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where called_count='5' and status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_five_results = mysqli_num_rows($rslt);
|
||||
if ($MP_five_results > 0)
|
||||
{$row=mysqli_fetch_row($rslt); $MP_five_count = $row[0];}
|
||||
$stmt="select count(distinct lead_id) from vicidial_log where status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$stmt="select count(distinct lead_id) from ".$vicidial_log_table." where status IN($completed_statuses) and list_id='$LISTIDlists[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
$MP_all_results = mysqli_num_rows($rslt);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# 141114-0822 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-0912 - Added code for on-the-fly language translations display
|
||||
# 150516-1305 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1632 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -63,6 +64,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
$MT[0]='0';
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
@@ -92,6 +95,30 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_log", "vicidial_closer_log", "vicidial_agent_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_log_table=use_archive_table("vicidial_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
$vicidial_agent_log_table=use_archive_table("vicidial_agent_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_log_table="vicidial_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
$vicidial_agent_log_table="vicidial_agent_log";
|
||||
}
|
||||
#############
|
||||
|
||||
$stmt = "SELECT local_gmt FROM servers where active='Y' limit 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$MAIN.="$stmt\n";}
|
||||
@@ -586,7 +613,7 @@ if ($bareformat < 1)
|
||||
$MAIN.="</SELECT>\n";
|
||||
$MAIN.="</TD><TD VALIGN=TOP ALIGN=LEFT ROWSPAN=2>\n";
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&costformat=$costformat&print_calls=$print_calls&query_date=$query_date&end_date=$end_date$groupQS&include_rollover=$include_rollover&time_interval=$time_interval&SUBMIT=$SUBMIT&shift=$shift&file_download=1\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"$PHP_SELF?DB=$DB&costformat=$costformat&print_calls=$print_calls&query_date=$query_date&end_date=$end_date$groupQS&include_rollover=$include_rollover&time_interval=$time_interval&SUBMIT=$SUBMIT&shift=$shift&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=34&campaign_id=$group[0]\">"._QXZ("MODIFY")."</a> | ";
|
||||
$MAIN.="<a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a>";
|
||||
$MAIN.="</FONT><BR><BR>\n";
|
||||
@@ -594,6 +621,10 @@ if ($bareformat < 1)
|
||||
$MAIN.="<select name='report_display_type'>";
|
||||
if ($report_display_type) {$MAIN.="<option value='$report_display_type' selected>$report_display_type</option>";}
|
||||
$MAIN.="<option value='TEXT'>"._QXZ("TEXT")."</option><option value='HTML'>"._QXZ("HTML")."</option></select>\n<BR>";
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
$MAIN.="<BR> ";
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
|
||||
|
||||
@@ -775,7 +806,7 @@ else
|
||||
$u=0;
|
||||
|
||||
##### Gather Agent time records
|
||||
$stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');";
|
||||
$stmt="select event_time,UNIX_TIMESTAMP(event_time),campaign_id,pause_sec,wait_sec,talk_sec,dispo_sec from ".$vicidial_agent_log_table." where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and campaign_id IN('$group_drop[$i]','$group[$i]');";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$AGENTtime_to_print = mysqli_num_rows($rslt);
|
||||
@@ -793,7 +824,7 @@ else
|
||||
}
|
||||
|
||||
##### Gather outbound calls
|
||||
$stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$stmt = "SELECT status,length_in_sec,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,uniqueid,lead_id from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$calls_to_parse = mysqli_num_rows($rslt);
|
||||
@@ -834,7 +865,7 @@ else
|
||||
$length_in_secZ=0;
|
||||
$queue_secondsZ=0;
|
||||
$agent_alert_delayZ=0;
|
||||
$stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';";
|
||||
$stmt="select status,length_in_sec,queue_seconds,agent_alert_delay,call_date,UNIX_TIMESTAMP(call_date),phone_number,campaign_id,closecallid,lead_id,uniqueid from ".$vicidial_closer_log_table.",vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and campaign_id='$group_drop[$i]';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$INallcalls_to_printZ = mysqli_num_rows($rslt);
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
# 141230-1353 - Added code for on-the-fly language translations display
|
||||
# 150516-1306 - Fixed Javascript element problem, Issue #857
|
||||
# 150619-0137 - Added option to calculate 'Percent of DROP Calls taken out of Answers' differently
|
||||
# 151125-1615 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -89,6 +90,8 @@ 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 (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
if (strlen($bottom_graph)<2) {$bottom_graph='NO';}
|
||||
@@ -125,6 +128,34 @@ if (file_exists('options.php'))
|
||||
require('options.php');
|
||||
}
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_log", "user_call_log", "vicidial_carrier_log", "vicidial_closer_log", "vicidial_agent_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_log_table=use_archive_table("vicidial_log");
|
||||
$user_call_log_table=use_archive_table("user_call_log");
|
||||
$vicidial_carrier_log_table=use_archive_table("vicidial_carrier_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
$vicidial_agent_log_table=use_archive_table("vicidial_agent_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_log_table="vicidial_log";
|
||||
$user_call_log_table="user_call_log";
|
||||
$vicidial_carrier_log_table="vicidial_carrier_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
$vicidial_agent_log_table="vicidial_agent_log";
|
||||
}
|
||||
#############
|
||||
|
||||
##### 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);
|
||||
@@ -396,8 +427,8 @@ else
|
||||
{
|
||||
$list_id_SQL = preg_replace('/,$/i', '',$list_id_SQL);
|
||||
$list_id_SQLand = "and list_id IN($list_id_SQL)";
|
||||
$list_id_SQLandVALJOIN = "and vicidial_agent_log.lead_id=vicidial_list.lead_id and vicidial_list.list_id IN($list_id_SQL)";
|
||||
$list_id_SQLandUCLJOIN = "and user_call_log.lead_id=vicidial_list.lead_id and vicidial_list.list_id IN($list_id_SQL)";
|
||||
$list_id_SQLandVALJOIN = "and ".$vicidial_agent_log_table.".lead_id=vicidial_list.lead_id and vicidial_list.list_id IN($list_id_SQL)";
|
||||
$list_id_SQLandUCLJOIN = "and ".$user_call_log_table.".lead_id=vicidial_list.lead_id and vicidial_list.list_id IN($list_id_SQL)";
|
||||
$list_id_SQL = "where list_id IN($list_id_SQL)";
|
||||
$skip_productivity_calc=1;
|
||||
}
|
||||
@@ -591,6 +622,12 @@ if (preg_match('/MSIE/i', $_SERVER['HTTP_USER_AGENT'])) {
|
||||
} else {
|
||||
$JS_events="onMouseUp='LoadLists(this.form.group)' onBlur='LoadLists(this.form.group)' onKeyUp='LoadLists(this.form.group)'";
|
||||
}
|
||||
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
echo "<BR><BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
|
||||
echo "</TD><TD VALIGN=TOP> "._QXZ("Campaigns").":<BR>";
|
||||
echo "<SELECT multiple SIZE=5 NAME=group[] id='group' $JS_events>\n";
|
||||
if (preg_match('/\-\-ALL\-\-/',$group_string))
|
||||
@@ -699,7 +736,7 @@ else
|
||||
$OUToutput .= _QXZ("Time range").": $query_date_BEGIN "._QXZ("to")." $query_date_END\n\n";
|
||||
$OUToutput .= "---------- "._QXZ("TOTALS")."\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -712,7 +749,7 @@ else
|
||||
$length_in_secZ=0;
|
||||
$queue_secondsZ=0;
|
||||
$agent_alert_delayZ=0;
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from ".$vicidial_closer_log_table.",vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$INallcalls_to_printZ = mysqli_num_rows($rslt);
|
||||
@@ -753,7 +790,7 @@ else
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- "._QXZ("HUMAN ANSWERS")."\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN($customer_interactive_statuses) $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status IN($customer_interactive_statuses) $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -765,7 +802,7 @@ else
|
||||
$length_in_secZ=0;
|
||||
$queue_secondsZ=0;
|
||||
$agent_alert_delayZ=0;
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and vicidial_closer_log.status IN($customer_interactive_statuses) $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from ".$vicidial_closer_log_table.",vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and ".$vicidial_closer_log_table.".status IN($customer_interactive_statuses) $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$INallcalls_to_printZ = mysqli_num_rows($rslt);
|
||||
@@ -806,7 +843,7 @@ else
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- "._QXZ("DROPS")."\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status='DROP' and (length_in_sec <= 6000 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status='DROP' and (length_in_sec <= 6000 or length_in_sec is null);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -859,7 +896,7 @@ else
|
||||
$camp_ANS_STAT_SQL = preg_replace('/,$/i', '',$camp_ANS_STAT_SQL);
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN($camp_ANS_STAT_SQL);";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN($camp_ANS_STAT_SQL);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -904,14 +941,14 @@ else
|
||||
}
|
||||
$closer_campaignsSQL = preg_replace('/,$/i', '',$closer_campaignsSQL);
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($closer_campaignsSQL) $list_id_SQLand and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE');";
|
||||
$stmt="select count(*) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($closer_campaignsSQL) $list_id_SQLand and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE');";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$TOTALanswers = ($row[0] + $ANSWERcalls);
|
||||
|
||||
|
||||
$stmt = "SELECT sum(wait_sec + talk_sec + dispo_sec) from vicidial_agent_log$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQLand $list_id_SQLandVALJOIN;";
|
||||
$stmt = "SELECT sum(wait_sec + talk_sec + dispo_sec) from ".$vicidial_agent_log_table."$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQLand $list_id_SQLandVALJOIN;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -933,13 +970,13 @@ else
|
||||
$OUToutput .= "\n";
|
||||
$OUToutput .= "---------- "._QXZ("NO ANSWERS")."\n";
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN('NA','ADC','AB','CPDB','CPDUK','CPDATB','CPDNA','CPDREJ','CPDINV','CPDSUA','CPDSI','CPDSNC','CPDSR','CPDSUK','CPDSV','CPDERR') and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN('NA','ADC','AB','CPDB','CPDUK','CPDATB','CPDNA','CPDREJ','CPDINV','CPDSUA','CPDSI','CPDSNC','CPDSR','CPDSUK','CPDSV','CPDERR') and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$autoNAcalls = sprintf("%10s", $row[0]);
|
||||
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN('B','DC','N') and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and status IN('B','DC','N') and (length_in_sec <= 60 or length_in_sec is null);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$OUToutput .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -980,7 +1017,7 @@ else
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">"._QXZ("CALLS")."</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*),term_reason from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand group by term_reason;";
|
||||
$stmt="select count(*),term_reason from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand group by term_reason;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
@@ -1063,7 +1100,7 @@ else
|
||||
if (preg_match("/YES/i",$include_rollover))
|
||||
{$campaignSQL = "$both_group_SQLand";}
|
||||
## Pull the count of agent seconds for the total tally
|
||||
$stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from vicidial_agent_log$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $campaignSQL $list_id_SQLandVALJOIN and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000;";
|
||||
$stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from ".$vicidial_agent_log_table."$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $campaignSQL $list_id_SQLandVALJOIN and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$Ctally_to_print = mysqli_num_rows($rslt);
|
||||
if ($Ctally_to_print > 0)
|
||||
@@ -1078,7 +1115,7 @@ else
|
||||
$rollover_exclude_dropSQL='';
|
||||
if (preg_match("/YES/i",$include_rollover))
|
||||
{$rollover_exclude_dropSQL = "and status NOT IN('DROP')";}
|
||||
$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $rollover_exclude_dropSQL $group_SQLand $list_id_SQLand group by status;";
|
||||
$stmt="select count(*),status,sum(length_in_sec) from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $rollover_exclude_dropSQL $group_SQLand $list_id_SQLand group by status;";
|
||||
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -1102,7 +1139,7 @@ else
|
||||
{
|
||||
$statusSQL = preg_replace('/,$/i', '',$statusSQL);
|
||||
}
|
||||
$stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN($statusSQL) $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select distinct status from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN($statusSQL) $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$inS_statuses_to_print = mysqli_num_rows($rslt);
|
||||
$n=0;
|
||||
@@ -1128,7 +1165,7 @@ else
|
||||
|
||||
if (preg_match("/YES/i",$include_rollover))
|
||||
{
|
||||
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status='$RAWstatus' $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*),sum(length_in_sec) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status='$RAWstatus' $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$in_statuses_to_print = mysqli_num_rows($rslt);
|
||||
if ($in_statuses_to_print > 0)
|
||||
@@ -1277,7 +1314,7 @@ else
|
||||
$GRAPH.="<th class=\"thgraph\" scope=\"col\">"._QXZ("CALLS")."</th>\n";
|
||||
$GRAPH.="</tr>\n";
|
||||
|
||||
$stmt="select count(*),list_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand group by list_id;";
|
||||
$stmt="select count(*),list_id from ".$vicidial_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand group by list_id;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
@@ -1352,7 +1389,7 @@ else
|
||||
$ASCII_text .= "+----------------------+------------+\n";
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select dialstatus,count(*) from vicidial_carrier_log vcl,vicidial_log vl where vcl.uniqueid=vl.uniqueid and vcl.call_date > \"$query_date_BEGIN\" and vcl.call_date < \"$query_date_END\" and vl.call_date > \"$query_date_BEGIN\" and vl.call_date < \"$query_date_END\" $group_SQLand $list_id_SQLand group by dialstatus order by dialstatus;";
|
||||
$stmt="select dialstatus,count(*) from ".$vicidial_carrier_log_table." vcl,".$vicidial_log_table." vl where vcl.uniqueid=vl.uniqueid and vcl.call_date > \"$query_date_BEGIN\" and vcl.call_date < \"$query_date_END\" and vl.call_date > \"$query_date_BEGIN\" and vl.call_date < \"$query_date_END\" $group_SQLand $list_id_SQLand group by dialstatus order by dialstatus;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
@@ -1410,7 +1447,7 @@ else
|
||||
$max_calls=1; $graph_stats=array();
|
||||
|
||||
## get counts and time totals for all statuses in this campaign
|
||||
$stmt="select preset_name,count(*) from user_call_log$VL_INC where call_date > \"$query_date_BEGIN\" and call_date < \"$query_date_END\" and preset_name!='' and preset_name is not NULL $group_SQLand $list_id_SQLandUCLJOIN group by preset_name order by preset_name;";
|
||||
$stmt="select preset_name,count(*) from ".$user_call_log_table."$VL_INC where call_date > \"$query_date_BEGIN\" and call_date < \"$query_date_END\" and preset_name!='' and preset_name is not NULL $group_SQLand $list_id_SQLandUCLJOIN group by preset_name order by preset_name;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$carrierstatuses_to_print = mysqli_num_rows($rslt);
|
||||
@@ -1541,7 +1578,7 @@ else
|
||||
$AVGTIME_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("AVG TIME")."</th></tr>";
|
||||
###########################
|
||||
|
||||
$stmt="select vicidial_log.user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and vicidial_log.user is not null and length_in_sec is not null and length_in_sec >= 0 and vicidial_log.user=vicidial_users.user group by vicidial_log.user;";
|
||||
$stmt="select ".$vicidial_log_table.".user,full_name,count(*),sum(length_in_sec),avg(length_in_sec) from ".$vicidial_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and ".$vicidial_log_table.".user is not null and length_in_sec is not null and length_in_sec >= 0 and ".$vicidial_log_table.".user=vicidial_users.user group by ".$vicidial_log_table.".user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
@@ -1580,7 +1617,7 @@ else
|
||||
$length_in_secZ=0;
|
||||
$queue_secondsZ=0;
|
||||
$agent_alert_delayZ=0;
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and user='$RAWuser[$i]' $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select length_in_sec,queue_seconds,agent_alert_delay from ".$vicidial_closer_log_table.",vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id and user='$RAWuser[$i]' $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$INallcalls_to_printZ = mysqli_num_rows($rslt);
|
||||
@@ -1652,7 +1689,7 @@ else
|
||||
$TOTtime = sprintf("%8s", $TOTtime);
|
||||
$TOTavg = sprintf("%6s", $TOTavg);
|
||||
|
||||
$stmt="select avg(wait_sec) from vicidial_agent_log$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQLand $list_id_SQLandVALJOIN;";
|
||||
$stmt="select avg(wait_sec) from ".$vicidial_agent_log_table."$VL_INC where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQLand $list_id_SQLandVALJOIN;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text .= "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -1696,7 +1733,7 @@ else
|
||||
|
||||
if ($costformat > 0)
|
||||
{
|
||||
$stmt="select campaign_id,phone_number,length_in_sec from vicidial_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and vicidial_log.user=vicidial_users.user;";
|
||||
$stmt="select campaign_id,phone_number,length_in_sec from ".$vicidial_log_table.",vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand $list_id_SQLand and ".$vicidial_log_table.".user=vicidial_users.user;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$allcalls_to_print = mysqli_num_rows($rslt);
|
||||
@@ -1712,7 +1749,7 @@ else
|
||||
}
|
||||
if (preg_match("/YES/i",$include_rollover))
|
||||
{
|
||||
$stmt="select campaign_id,phone_number,length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand $list_id_SQLand;";
|
||||
$stmt="select campaign_id,phone_number,length_in_sec,queue_seconds,agent_alert_delay from ".$vicidial_closer_log_table.",vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$INallcalls_to_print = mysqli_num_rows($rslt);
|
||||
@@ -1792,14 +1829,14 @@ else
|
||||
$h=0;
|
||||
while ($i <= 96)
|
||||
{
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:00:00' and call_date <= '$query_date $h:14:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -1807,42 +1844,42 @@ else
|
||||
$i++;
|
||||
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:15:00' and call_date <= '$query_date $h:29:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:30:00' and call_date <= '$query_date $h:44:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$drop_count[$i] = $row[0];
|
||||
$i++;
|
||||
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand $list_id_SQLand;";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand $list_id_SQLand;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$hour_count[$i] = $row[0];
|
||||
if ($hour_count[$i] > $hi_hour_count) {$hi_hour_count = $hour_count[$i];}
|
||||
if ($hour_count[$i] > 0) {$last_full_record = $i;}
|
||||
$stmt="select count(*) from vicidial_log where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$stmt="select count(*) from ".$vicidial_log_table." where call_date >= '$query_date $h:45:00' and call_date <= '$query_date $h:59:59' $group_SQLand $list_id_SQLand and status='DROP';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
# 141230-0921 - Added code for on-the-fly language translations display
|
||||
# 150218-1142 - Fix for download issue
|
||||
# 150516-1313 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1629 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -63,6 +64,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
@@ -90,6 +93,22 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$table_name="vicidial_closer_log";
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -431,7 +450,12 @@ if ($IDR_calltime_available==1)
|
||||
}
|
||||
|
||||
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'></TD></TR>\n";
|
||||
$MAIN.="<TR><TD align='left'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><INPUT TYPE=checkbox NAME=hourly_breakdown VALUE='checked' $hourly_breakdown>"._QXZ("Show hourly results")."<BR><INPUT TYPE=checkbox NAME=show_disposition_statuses VALUE='checked' $show_disposition_statuses>"._QXZ("Show disposition statuses")."<BR><INPUT TYPE=checkbox NAME=ignore_afterhours VALUE='checked' $ignore_afterhours>"._QXZ("Ignore after-hours calls")."</FONT></TD><TD align='right'><a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date$selected_group_URLstr&shift=$shift&hourly_breakdown=$hourly_breakdown&show_disposition_statuses=$show_disposition_statuses&SUBMIT=$SUBMIT&file_download=1\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group[0]\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a></TD></TR>\n";
|
||||
$MAIN.="<TR><TD align='left'><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2><INPUT TYPE=checkbox NAME=hourly_breakdown VALUE='checked' $hourly_breakdown>"._QXZ("Show hourly results")."<BR><INPUT TYPE=checkbox NAME=show_disposition_statuses VALUE='checked' $show_disposition_statuses>"._QXZ("Show disposition statuses")."<BR><INPUT TYPE=checkbox NAME=ignore_afterhours VALUE='checked' $ignore_afterhours>"._QXZ("Ignore after-hours calls");
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$MAIN.="<BR><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
$MAIN.="</FONT></TD><TD align='right'><a href=\"$PHP_SELF?DB=$DB&query_date=$query_date&end_date=$end_date$selected_group_URLstr&shift=$shift&hourly_breakdown=$hourly_breakdown&show_disposition_statuses=$show_disposition_statuses&SUBMIT=$SUBMIT&file_download=1&search_archived_data=$search_archived_data\">"._QXZ("DOWNLOAD")."</a> | <a href=\"./admin.php?ADD=3111&group_id=$group[0]\">"._QXZ("MODIFY")."</a> | <a href=\"./admin.php?ADD=999999\">"._QXZ("REPORTS")."</a></TD></TR>\n";
|
||||
$MAIN.="<TR><TD colspan=2>";
|
||||
$MAIN.="<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
@@ -645,7 +669,7 @@ else
|
||||
$CSV_text.="\n\n";
|
||||
|
||||
if ($show_disposition_statuses) {
|
||||
$dispo_stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in (" . $groups_selected_str . ") $big_shift_time_SQL_clause order by status;";
|
||||
$dispo_stmt="select distinct status from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in (" . $groups_selected_str . ") $big_shift_time_SQL_clause order by status;";
|
||||
#echo $dispo_stmt."<BR>";
|
||||
$dispo_rslt=mysql_to_mysqli($dispo_stmt, $link);
|
||||
$dispo_str="";
|
||||
@@ -813,7 +837,7 @@ else
|
||||
|
||||
|
||||
### GRAB ALL RECORDS WITHIN RANGE FROM THE DATABASE ###
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date,user from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in (" . $groups_selected_str . ");";
|
||||
$stmt="select queue_seconds,UNIX_TIMESTAMP(call_date),length_in_sec,status,term_reason,call_date,user from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id in (" . $groups_selected_str . ");";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$records_to_grab = mysqli_num_rows($rslt);
|
||||
|
||||
@@ -33468,15 +33468,15 @@ if ($ADD==1300)
|
||||
else
|
||||
{$bgcolor='bgcolor="#9BB9FB"';}
|
||||
|
||||
# truncate description and carrier if they are more than 30 characters
|
||||
if (strlen($row[2])>30)
|
||||
# truncate description and carrier if they are more than 60 characters
|
||||
if (strlen($row[2])>60)
|
||||
{
|
||||
while (strlen($row[2])>30) {$row[2] = preg_replace("/.$/",'',$row[2]);}
|
||||
while (strlen($row[2])>60) {$row[2] = preg_replace("/.$/",'',$row[2]);}
|
||||
$row[2] .= '...';
|
||||
}
|
||||
if (strlen($row[3])>30)
|
||||
if (strlen($row[3])>40)
|
||||
{
|
||||
while (strlen($row[3])>30) {$row[3] = preg_replace("/.$/",'',$row[3]);}
|
||||
while (strlen($row[3])>40) {$row[3] = preg_replace("/.$/",'',$row[3]);}
|
||||
$row[3] .= '...';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
# 150727-2143 - Enabled user features for hiding phone numbers and lead data
|
||||
# 150903-1536 - Added compatibility for custom fields data options
|
||||
# 150909-0747 - Fixed issues with translated select list values, issue #885
|
||||
# 151125-1621 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -89,6 +90,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
@@ -116,6 +119,43 @@ if ($qm_conf_ct > 0)
|
||||
}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_log", "vicidial_closer_log", "vicidial_agent_log", "vicidial_log_extended", "recording_log", "vicidial_carrier_log", "vicidial_cpd_log", "vicidial_did_log", "vicidial_outbound_ivr_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_log_table=use_archive_table("vicidial_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
$vicidial_agent_log_table=use_archive_table("vicidial_agent_log");
|
||||
$vicidial_log_extended_table=use_archive_table("vicidial_log_extended");
|
||||
$recording_log_table=use_archive_table("recording_log");
|
||||
$vicidial_carrier_log_table=use_archive_table("vicidial_carrier_log");
|
||||
$vicidial_cpd_log_table=use_archive_table("vicidial_cpd_log");
|
||||
$vicidial_did_log_table=use_archive_table("vicidial_did_log");
|
||||
$vicidial_outbound_ivr_log_table=use_archive_table("vicidial_outbound_ivr_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_log_table="vicidial_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
$vicidial_agent_log_table="vicidial_agent_log";
|
||||
$vicidial_log_extended_table="vicidial_log_extended";
|
||||
$recording_log_table="recording_log";
|
||||
$vicidial_carrier_log_table="vicidial_carrier_log";
|
||||
$vicidial_cpd_log_table="vicidial_cpd_log";
|
||||
$vicidial_did_log_table="vicidial_did_log";
|
||||
$vicidial_outbound_ivr_log_table="vicidial_outbound_ivr_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -456,11 +496,11 @@ if ($run_export > 0)
|
||||
{
|
||||
if ($export_fields == 'EXTENDED')
|
||||
{
|
||||
$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 vl LEFT OUTER JOIN vicidial_agent_log val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
$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 vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
}
|
||||
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 vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
$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 vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -568,11 +608,11 @@ if ($run_export > 0)
|
||||
{
|
||||
if ($export_fields == 'EXTENDED')
|
||||
{
|
||||
$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, ifnull(val.dispo_sec+val.dead_sec,0)$export_fields_SQL from vicidial_users vu,vicidial_list vi,vicidial_closer_log vl LEFT OUTER JOIN vicidial_agent_log val ON vl.uniqueid=val.uniqueid and vl.lead_id=val.lead_id and vl.user=val.user where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
$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, 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 vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
}
|
||||
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$export_fields_SQL from vicidial_users vu,vicidial_closer_log vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
$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$export_fields_SQL from vicidial_users vu,".$vicidial_closer_log_table." vl,vicidial_list vi where vl.call_date >= '$query_date 00:00:00' and vl.call_date <= '$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 vl.call_date limit 100000;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmtA, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
@@ -777,7 +817,7 @@ if ($run_export > 0)
|
||||
$rec_id='';
|
||||
$rec_filename='';
|
||||
$rec_location='';
|
||||
$stmt = "SELECT recording_id,filename,location from recording_log where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;";
|
||||
$stmt = "SELECT recording_id,filename,location from ".$recording_log_table." where vicidial_id='$export_vicidial_id[$i]' order by recording_id desc LIMIT 10;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$recordings_ct = mysqli_num_rows($rslt);
|
||||
@@ -816,7 +856,7 @@ if ($run_export > 0)
|
||||
{
|
||||
$uniqueidTEST = $export_uniqueid[$i];
|
||||
$uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST);
|
||||
$stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$stmt = "SELECT caller_code,server_ip from ".$vicidial_log_extended_table." where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vle_ct = mysqli_num_rows($rslt);
|
||||
@@ -838,7 +878,7 @@ if ($run_export > 0)
|
||||
{
|
||||
$uniqueidTEST = $export_uniqueid[$i];
|
||||
$uniqueidTEST = preg_replace('/\..*$/','',$uniqueidTEST);
|
||||
$stmt = "SELECT caller_code,server_ip from vicidial_log_extended where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$stmt = "SELECT caller_code,server_ip from ".$vicidial_log_extended_table." where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vle_ct = mysqli_num_rows($rslt);
|
||||
@@ -849,7 +889,7 @@ if ($run_export > 0)
|
||||
$export_call_id[$i] = $row[0];
|
||||
}
|
||||
|
||||
$stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from vicidial_carrier_log where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$stmt = "SELECT hangup_cause,dialstatus,channel,dial_time,answered_time from ".$vicidial_carrier_log_table." where uniqueid LIKE \"$uniqueidTEST%\" and lead_id='$export_lead_id[$i]' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcarl_ct = mysqli_num_rows($rslt);
|
||||
@@ -859,7 +899,7 @@ if ($run_export > 0)
|
||||
$extended_data_b = "\t$row[0]\t$row[1]\t$row[2]\t$row[3]\t$row[4]";
|
||||
}
|
||||
|
||||
$stmt = "SELECT result from vicidial_cpd_log where callerid='$export_call_id[$i]' LIMIT 1;";
|
||||
$stmt = "SELECT result from ".$vicidial_cpd_log_table." where callerid='$export_call_id[$i]' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcpdl_ct = mysqli_num_rows($rslt);
|
||||
@@ -869,7 +909,7 @@ if ($run_export > 0)
|
||||
$extended_data_c = "\t$row[0]";
|
||||
}
|
||||
|
||||
$stmt = "SELECT extension,did_id from vicidial_did_log where uniqueid='$export_uniqueid[$i]' LIMIT 1;";
|
||||
$stmt = "SELECT extension,did_id from ".$vicidial_did_log_table." where uniqueid='$export_uniqueid[$i]' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$vcdid_ct = mysqli_num_rows($rslt);
|
||||
@@ -932,7 +972,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 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 00:00:00' and event_date <= '$end_date 23:59:59' 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";}
|
||||
@@ -1309,6 +1349,12 @@ else
|
||||
echo "<B>"._QXZ("Export Fields").":</B><BR>\n";
|
||||
echo "<select size=1 name=export_fields><option selected value=\"STANDARD\">"._QXZ("STANDARD")."</option><option value=\"EXTENDED\">"._QXZ("EXTENDED")."</option><option value=\"ALTERNATE_1\">ALTERNATE_1</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><BR>\n";
|
||||
}
|
||||
|
||||
### bottom of first column
|
||||
|
||||
echo "</TD><TD ALIGN=LEFT VALIGN=TOP ROWSPAN=2>\n";
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# 141114-0017 - Finalized adding QXZ translation to all admin files
|
||||
# 141230-1345 - Added code for on-the-fly language translations display
|
||||
# 150516-1317 - Fixed Javascript element problem, Issue #857
|
||||
# 151125-1642 - Added search archive option
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -56,6 +57,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
|
||||
elseif (isset($_POST["file_download"])) {$file_download=$_POST["file_download"];}
|
||||
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
|
||||
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
|
||||
if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search_archived_data"];}
|
||||
elseif (isset($_POST["search_archived_data"])) {$search_archived_data=$_POST["search_archived_data"];}
|
||||
|
||||
if (strlen($shift)<2) {$shift='ALL';}
|
||||
|
||||
@@ -84,6 +87,28 @@ if ($qm_conf_ct > 0)
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
### ARCHIVED DATA CHECK CONFIGURATION
|
||||
$archives_available="N";
|
||||
$log_tables_array=array("vicidial_xfer_log", "vicidial_closer_log");
|
||||
for ($t=0; $t<count($log_tables_array); $t++)
|
||||
{
|
||||
$table_name=$log_tables_array[$t];
|
||||
$archive_table_name=use_archive_table($table_name);
|
||||
if ($archive_table_name!=$table_name) {$archives_available="Y";}
|
||||
}
|
||||
|
||||
if ($search_archived_data)
|
||||
{
|
||||
$vicidial_xfer_log_table=use_archive_table("vicidial_xfer_log");
|
||||
$vicidial_closer_log_table=use_archive_table("vicidial_closer_log");
|
||||
}
|
||||
else
|
||||
{
|
||||
$vicidial_xfer_log_table="vicidial_xfer_log";
|
||||
$vicidial_closer_log_table="vicidial_closer_log";
|
||||
}
|
||||
#############
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
@@ -342,9 +367,16 @@ $HTML_text.="<option value=\"AM\">"._QXZ("AM")."</option>\n";
|
||||
$HTML_text.="<option value=\"PM\">"._QXZ("PM")."</option>\n";
|
||||
$HTML_text.="<option value=\"ALL\">"._QXZ("ALL")."</option>\n";
|
||||
$HTML_text.="</SELECT>\n";
|
||||
|
||||
if ($archives_available=="Y")
|
||||
{
|
||||
$HTML_text.="<input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."\n";
|
||||
}
|
||||
|
||||
|
||||
$HTML_text.="<INPUT TYPE=hidden NAME=DB VALUE=\"$DB\">\n";
|
||||
$HTML_text.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT>\n";
|
||||
$HTML_text.="<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <a href=\"$PHP_SELF?query_date=$query_date&group=$group&shift=$shift&file_download=1\">"._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&group=$group&shift=$shift&file_download=1&search_archived_data=$search_archived_data\">"._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.="</FORM>\n\n";
|
||||
|
||||
$HTML_text.="<PRE><FONT SIZE=2>\n\n";
|
||||
@@ -397,7 +429,7 @@ while ($ssrow=mysqli_fetch_row($sale_dispo_rslt)) {
|
||||
$sale_dispo_str.="|";
|
||||
if ($DB) {$HTML_text.=_QXZ("Sale dispo string").": $sale_dispo_str\n";}
|
||||
|
||||
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and status in ($sale_dispos);";
|
||||
$stmt="select count(*) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and status in ($sale_dispos);";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$HTML_text.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -476,7 +508,7 @@ $OTHER_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("OTHER")."</t
|
||||
###########################
|
||||
|
||||
#$stmt="select vicidial_xfer_log.user,full_name,count(*) from vicidial_xfer_log,vicidial_users where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and vicidial_xfer_log.user is not null and vicidial_xfer_log.user=vicidial_users.user group by vicidial_xfer_log.user;";
|
||||
$stmt="select user,count(distinct lead_id) from vicidial_xfer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user is not null group by user;";
|
||||
$stmt="select user,count(distinct lead_id) from ".$vicidial_xfer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user is not null group by user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -520,7 +552,7 @@ while ($i < $users_to_print)
|
||||
{$full_name[$i] = ' ';}
|
||||
|
||||
$A1=0; $A2=0; $A3=0; $A4=0; $A5=0; $A6=0; $A7=0; $A8=0; $A9=0; $DROP=0; $OTHER=0; $sales=0;
|
||||
$stmt="select vc.status,count(distinct vc.lead_id) from vicidial_xfer_log vx, vicidial_closer_log vc where vx.call_date >= '$query_date_BEGIN' and vx.call_date <= '$query_date_END' and vc.call_date >= '$query_date_BEGIN' and vc.call_date <= '$query_date_END' and vc.campaign_id='" . mysqli_real_escape_string($link, $group) . "' and vx.campaign_id='" . mysqli_real_escape_string($link, $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(distinct vc.lead_id) 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='" . mysqli_real_escape_string($link, $group) . "' and vx.campaign_id='" . mysqli_real_escape_string($link, $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";}
|
||||
@@ -617,7 +649,7 @@ $totDROP = sprintf("%5s", $totDROP);
|
||||
$totOTHER = sprintf("%5s", $totOTHER);
|
||||
|
||||
|
||||
$stmt="select avg(queue_seconds) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "';";
|
||||
$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='" . mysqli_real_escape_string($link, $group) . "';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -728,7 +760,7 @@ $SALES2_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("SALES")."</
|
||||
$CONVPCT_graph=$graph_header."<th class='thgraph' scope='col'>"._QXZ("CONV")." %</th></tr>";
|
||||
###########################
|
||||
|
||||
$stmt="select user,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user is not null group by user;";
|
||||
$stmt="select user,count(*) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user is not null group by user;";
|
||||
if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {$ASCII_text.="$stmt\n";}
|
||||
@@ -771,7 +803,7 @@ while ($i < $users_to_print)
|
||||
{$full_name[$i] = ' ';}
|
||||
|
||||
$A1=0; $A2=0; $A3=0; $A4=0; $A5=0; $A6=0; $A7=0; $A8=0; $A9=0; $DROP=0; $OTHER=0; $sales=0; $uTOP=0; $uBOT=0; $points=0;
|
||||
$stmt="select status,count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user='$userRAW[$i]' group by status;";
|
||||
$stmt="select status,count(*) from ".$vicidial_closer_log_table." where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='" . mysqli_real_escape_string($link, $group) . "' and user='$userRAW[$i]' group by 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";}
|
||||
|
||||
Reference in New Issue
Block a user