diff --git a/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php b/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php
index 456fa583..b78af1be 100644
--- a/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php
+++ b/agc_2-X/trunk/www/vicidial/AST_LISTS_campaign_stats.php
@@ -23,6 +23,7 @@
# 141114-0828 - Finalized adding QXZ translation to all admin files
# 141230-1444 - Added code for on-the-fly language translations display
# 150516-1302 - Fixed Javascript element problem, Issue #857
+# 151229-2009 - Added archive search option
#
$startMS = microtime();
@@ -47,6 +48,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"];}
$report_name = 'Lists Campaign Statuses Report';
$db_source = 'M';
@@ -72,6 +75,22 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP #####
###########################################
+### ARCHIVED DATA CHECK CONFIGURATION
+$archives_available="N";
+$table_name="vicidial_list";
+$archive_table_name=use_archive_table($table_name);
+if ($archive_table_name!=$table_name) {$archives_available="Y";}
+
+if ($search_archived_data)
+ {
+ $vicidial_list_table=use_archive_table("vicidial_list");
+ }
+else
+ {
+ $vicidial_list_table="vicidial_list";
+ }
+#############
+
if ($non_latin < 1)
{
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
@@ -318,7 +337,7 @@ while ($i < $statcats_to_print)
}
$category_statuses=substr($category_statuses, 0, -1);
- $category_stmt="select count(*) from vicidial_list where status in ($category_statuses) and list_id IN($lists_id_str)";
+ $category_stmt="select count(*) from ".$vicidial_list_table." where status in ($category_statuses) and list_id IN($lists_id_str)";
if ($DB) {echo "$category_stmt\n";}
$category_rslt=mysql_to_mysqli($category_stmt, $link);
$category_row=mysqli_fetch_row($category_rslt);
@@ -434,8 +453,13 @@ $MAIN.=_QXZ("Display as").":
";
$MAIN.=" ";
-$MAIN.="
\n";
-$MAIN.="\n";
+
+if ($archives_available=="Y")
+ {
+ $MAIN.="
"._QXZ("Search archived data")."\n";
+ }
+
+$MAIN.="
\n";
$MAIN.="
\n";
-
if (!$group)
{
$HTML_text.="\n";
@@ -628,20 +631,36 @@ $HTML_text.="---------- "._QXZ("AGENTS Details")." -------------\n\n";
-
-
$statuses='-';
$statusesTXT='';
$statusesHEAD='';
+## Breakdown by date text
+if ($breakdown_by_date)
+ {
+ $BBD_header="------------+";
+ $BBD_text=" | "._QXZ("CALL DATE",10);
+ $BBD_filler=" | ".sprintf("%-10s", " ");
+ $BBD_csv=_QXZ("CALL DATE",10)."\",\"";
+ $BBD_csv_filler="\",\"";
+ }
+else
+ {
+ $BBD_header="";
+ $BBD_text="";
+ $BBD_filler="";
+ $BBD_csv="";
+ $BBD_csv_filler="";
+ }
+
+
$CSV_header="\""._QXZ("Agent Performance Detail",47)." $NOW_TIME\"\n";
$CSV_header.="\""._QXZ("Time range").": $query_date_BEGIN "._QXZ("to")." $query_date_END\"\n\n";
$CSV_header.="\"---------- "._QXZ("AGENTS Details")." -------------\"\n";
-
if ($show_percentages) {
- $CSV_header.='"'._QXZ("USER NAME").'","'._QXZ("ID").'","'._QXZ("CURRENT USER GROUP").'","'._QXZ("MOST RECENT USER GROUP").'","'._QXZ("CALLS").'","'._QXZ("TIME").'","'._QXZ("PAUSE").'","'._QXZ("PAUSE").' %","'._QXZ("PAUSAVG").'","'._QXZ("WAIT").'","'._QXZ("WAIT").' %","'._QXZ("WAITAVG").'","'._QXZ("TALK").'","'._QXZ("TALK").' %","'._QXZ("TALKAVG").'","'._QXZ("DISPO").'","'._QXZ("DISPO").' %","'._QXZ("DISPAVG").'","'._QXZ("DEAD").'","'._QXZ("DEAD").' %","'._QXZ("DEADAVG").'","'._QXZ("CUSTOMER").'","'._QXZ("CUSTOMER").' %","'._QXZ("CUSTAVG").'"';
+ $CSV_header.='"'._QXZ("USER NAME").'","'._QXZ("ID").'","'._QXZ("CURRENT USER GROUP").'","'._QXZ("MOST RECENT USER GROUP").'","'.$BBD_csv._QXZ("CALLS").'","'._QXZ("TIME").'","'._QXZ("PAUSE").'","'._QXZ("PAUSE").' %","'._QXZ("PAUSAVG").'","'._QXZ("WAIT").'","'._QXZ("WAIT").' %","'._QXZ("WAITAVG").'","'._QXZ("TALK").'","'._QXZ("TALK").' %","'._QXZ("TALKAVG").'","'._QXZ("DISPO").'","'._QXZ("DISPO").' %","'._QXZ("DISPAVG").'","'._QXZ("DEAD").'","'._QXZ("DEAD").' %","'._QXZ("DEADAVG").'","'._QXZ("CUSTOMER").'","'._QXZ("CUSTOMER").' %","'._QXZ("CUSTAVG").'"';
} else {
- $CSV_header.='"'._QXZ("USER NAME").'","'._QXZ("ID").'","'._QXZ("CURRENT USER GROUP").'","'._QXZ("MOST RECENT USER GROUP").'","'._QXZ("CALLS").'","'._QXZ("TIME").'","'._QXZ("PAUSE").'","'._QXZ("PAUSAVG").'","'._QXZ("WAIT").'","'._QXZ("WAITAVG").'","'._QXZ("TALK").'","'._QXZ("TALKAVG").'","'._QXZ("DISPO").'","'._QXZ("DISPAVG").'","'._QXZ("DEAD").'","'._QXZ("DEADAVG").'","'._QXZ("CUSTOMER").'","'._QXZ("CUSTAVG").'"';
+ $CSV_header.='"'._QXZ("USER NAME").'","'._QXZ("ID").'","'._QXZ("CURRENT USER GROUP").'","'._QXZ("MOST RECENT USER GROUP").'","'.$BBD_csv._QXZ("CALLS").'","'._QXZ("TIME").'","'._QXZ("PAUSE").'","'._QXZ("PAUSAVG").'","'._QXZ("WAIT").'","'._QXZ("WAITAVG").'","'._QXZ("TALK").'","'._QXZ("TALKAVG").'","'._QXZ("DISPO").'","'._QXZ("DISPAVG").'","'._QXZ("DEAD").'","'._QXZ("DEADAVG").'","'._QXZ("CUSTOMER").'","'._QXZ("CUSTAVG").'"';
}
@@ -769,14 +788,14 @@ while ($stat_row=mysqli_fetch_row($stat_rslt)) {
if ($show_defunct_users=="checked")
{
- $stmt="SELECT count(*) as calls,sum(talk_sec) as talk,'' as full_name,user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), '' as user_group from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 and status='$current_status' $group_SQL $user_agent_log_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
+ $stmt="SELECT count(*) as calls,sum(talk_sec) as talk,'' as full_name,user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), '' as user_group from ".$agent_log_table.",date(event_time) as call_date where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 and status='$current_status' $group_SQL $user_agent_log_SQL $user_SQL group by user,full_name,user_group,status,call_date order by full_name,user,status desc limit 500000;";
}
else
{
- $stmt="SELECT count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 and status='$current_status' $group_SQL $user_group_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
+ $stmt="SELECT count(*) as calls,sum(talk_sec) as talk,full_name,vicidial_users.user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), vicidial_users.user_group,date(event_time) as call_date from vicidial_users,".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and vicidial_users.user=".$agent_log_table.".user and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 and status='$current_status' $group_SQL $user_group_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
}
$rslt=mysql_to_mysqli($stmt, $link);
- if ($DB) {$HTML_text.="$stmt\n";}
+ if ($DB) {$HTML_text.="$stmt\n";}
$rows_to_print+=mysqli_num_rows($rslt);
$stat_rows_to_print = mysqli_num_rows($rslt);
@@ -821,6 +840,7 @@ while ($stat_row=mysqli_fetch_row($stat_rslt)) {
$status[$q] = strtoupper($row[7]);
$dead_sec[$q] = $row[8];
$user_group[$q] = $user_group_val;
+ $call_date[$q] = $row[10];
$customer_sec[$q] = ($talk_sec[$q] - $dead_sec[$q]);
if (strlen($status[$q])>0) {$userTOTcalls[$row[3]]+=$row[0];}
@@ -867,15 +887,14 @@ $CSV_header.="\n";
$CSV_lines='';
$ASCII_text.=_QXZ("CALL STATS BREAKDOWN").": ("._QXZ("Statistics related to handling of calls only").") ["._QXZ("DOWNLOAD")."]\n";
-
if ($show_percentages) {
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
- $ASCII_text.="| "._QXZ("USER NAME",15)." | "._QXZ("ID",8)." | "._QXZ("CURRENT USER GROUP",20)." | "._QXZ("MOST RECENT USER GRP",20)." | "._QXZ("CALLS",6)." | "._QXZ("TIME",9)." | "._QXZ("PAUSE",8)." | "._QXZ("PAUSE",8)." % |"._QXZ("PAUSAVG",7)." | "._QXZ("WAIT",8)." | "._QXZ("WAIT",8)." % |"._QXZ("WAITAVG",7)." | "._QXZ("TALK",8)." | "._QXZ("TALK",8)." % |"._QXZ("TALKAVG",7)." | "._QXZ("DISPO",8)." | "._QXZ("DISPO",8)." % |"._QXZ("DISPAVG",7)." | "._QXZ("DEAD",7)." | "._QXZ("DEAD",8)." % |"._QXZ("DEADAVG",7)." | "._QXZ("CUSTOMER",8)." | "._QXZ("CUSTOMER",8)." % |"._QXZ("CUSTAVG",7)." |$statusesHTML\n";
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
+ $ASCII_text.="| "._QXZ("USER NAME",15)." | "._QXZ("ID",8)." | "._QXZ("CURRENT USER GROUP",20)." | "._QXZ("MOST RECENT USER GRP",20).$BBD_text." | "._QXZ("CALLS",6)." | "._QXZ("TIME",9)." | "._QXZ("PAUSE",8)." | "._QXZ("PAUSE",8)." % |"._QXZ("PAUSAVG",7)." | "._QXZ("WAIT",8)." | "._QXZ("WAIT",8)." % |"._QXZ("WAITAVG",7)." | "._QXZ("TALK",8)." | "._QXZ("TALK",8)." % |"._QXZ("TALKAVG",7)." | "._QXZ("DISPO",8)." | "._QXZ("DISPO",8)." % |"._QXZ("DISPAVG",7)." | "._QXZ("DEAD",7)." | "._QXZ("DEAD",8)." % |"._QXZ("DEADAVG",7)." | "._QXZ("CUSTOMER",8)." | "._QXZ("CUSTOMER",8)." % |"._QXZ("CUSTAVG",7)." |$statusesHTML\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
} else {
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
- $ASCII_text.="| "._QXZ("USER NAME",15)." | "._QXZ("ID",8)." | "._QXZ("CURRENT USER GROUP",20)." | "._QXZ("MOST RECENT USER GRP",20)." | "._QXZ("CALLS",6)." | "._QXZ("TIME",9)." | "._QXZ("PAUSE",8)." |"._QXZ("PAUSAVG",7)." | "._QXZ("WAIT",8)." |"._QXZ("WAITAVG",7)." | "._QXZ("TALK",8)." |"._QXZ("TALKAVG",7)." | "._QXZ("DISPO",8)." |"._QXZ("DISPAVG",7)." | "._QXZ("DEAD",8)." |"._QXZ("DEADAVG",7)." | "._QXZ("CUSTOMER",8)." |"._QXZ("CUSTAVG",7)." |$statusesHTML\n";
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+ $ASCII_text.="| "._QXZ("USER NAME",15)." | "._QXZ("ID",8)." | "._QXZ("CURRENT USER GROUP",20)." | "._QXZ("MOST RECENT USER GRP",20).$BBD_text." | "._QXZ("CALLS",6)." | "._QXZ("TIME",9)." | "._QXZ("PAUSE",8)." |"._QXZ("PAUSAVG",7)." | "._QXZ("WAIT",8)." |"._QXZ("WAITAVG",7)." | "._QXZ("TALK",8)." |"._QXZ("TALKAVG",7)." | "._QXZ("DISPO",8)." |"._QXZ("DISPAVG",7)." | "._QXZ("DEAD",8)." |"._QXZ("DEADAVG",7)." | "._QXZ("CUSTOMER",8)." |"._QXZ("CUSTAVG",7)." |$statusesHTML\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
}
@@ -885,14 +904,206 @@ while ($m < $k)
{
$Suser=$usersARY[$m];
+ if ($breakdown_by_date)
+ {
+ $Toutput_sub="";
+ $CSV_lines_sub="";
+
+ $SstatusesHTML='';
+ $CSVstatuses='';
+
+ $Stalk_sec_pct=0;
+ $Spause_sec_pct=0;
+ $Swait_sec_pct=0;
+ $Sdispo_sec_pct=0;
+ $Sdead_sec_pct=0;
+
+ $date_stmt="select distinct date(event_time) as call_date from ".$agent_log_table." where event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and user='$Suser' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL $user_agent_log_SQL order by call_date asc limit 500000;";
+ if ($DB) {$ASCII_text.=$date_stmt."\n";}
+ $date_rslt=mysql_to_mysqli($date_stmt, $link);
+ while($date_row=mysqli_fetch_row($date_rslt))
+ {
+ $call_dateX=$date_row[0];
+
+ $cd_stmt="SELECT count(*) as calls,sum(talk_sec) as talk,'' as full_name,user,sum(pause_sec),sum(wait_sec),sum(dispo_sec),status,sum(dead_sec), '' as user_group from ".$agent_log_table." where date(event_time)='$call_dateX' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 and user='$Suser' $group_SQL $user_agent_log_SQL $user_SQL group by user,full_name,user_group,status order by full_name,user,status desc limit 500000;";
+ $cd_rslt=mysql_to_mysqli($cd_stmt, $link);
+ if ($DB) {$ASCII_text.=$cd_stmt."\n";}
+
+ $x=0;
+ while ($cd_row=mysqli_fetch_row($cd_rslt))
+ {
+ $calls_sub[$x] = $cd_row[0];
+ $talk_sec_sub[$x] = $cd_row[1];
+ $user_sub[$x] = $cd_row[3];
+ $pause_sec_sub[$x] = $cd_row[4];
+ $wait_sec_sub[$x] = $cd_row[5];
+ $dispo_sec_sub[$x] = $cd_row[6];
+ $status_sub[$x] = strtoupper($cd_row[7]);
+ $dead_sec_sub[$x] = $cd_row[8];
+ $customer_sec_sub[$x] = ($talk_sec_sub[$x] - $dead_sec_sub[$x]);
+ $x++;
+ }
+
+
+ $Stime=0;
+ $Scalls=0;
+ $Stalk_sec=0;
+ $Spause_sec=0;
+ $Swait_sec=0;
+ $Sdispo_sec=0;
+ $Sdead_sec=0;
+ $Scustomer_sec=0;
+ $o=0;
+ $SstatusesHTML='';
+ $CSVstatuses='';
+ while ($o < $j)
+ {
+ $Sstatus=$statusesARY[$o];
+ $Scall_date=$call_date[$o];
+ $SstatusTXT='';
+
+ $i=0; $status_found=0;
+ while ($i < $x)
+ {
+ if ($Sstatus=="$status_sub[$i]")
+ {
+ $Scalls = ($Scalls + $calls_sub[$i]);
+ $Stalk_sec = ($Stalk_sec + $talk_sec_sub[$i]);
+ $Spause_sec = ($Spause_sec + $pause_sec_sub[$i]);
+ $Swait_sec = ($Swait_sec + $wait_sec_sub[$i]);
+ $Sdispo_sec = ($Sdispo_sec + $dispo_sec_sub[$i]);
+ $Sdead_sec = ($Sdead_sec + $dead_sec_sub[$i]);
+ $Scustomer_sec = ($Scustomer_sec + $customer_sec_sub[$i]);
+ $SstatusTXT = sprintf("%8s", $calls_sub[$i]);
+ $SstatusesHTML .= " $SstatusTXT |";
+
+ $CSVstatuses.=",\"$calls_sub[$i]\"";
+
+ if ($show_percentages)
+ {
+ $SstatusTXT_pct=sprintf("%8s", sprintf("%0.2f", MathZDC(100*$calls[$i], $userTOTcalls[$Suser])));
+ $SstatusesHTML .= " $SstatusTXT_pct % |";
+ $CSVstatuses.=",\"$SstatusTXT_pct %\"";
+ }
+
+ $status_found++;
+ }
+ $i++;
+ }
+ if ($status_found < 1)
+ {
+ $SstatusesHTML .= " 0 |";
+ $CSVstatuses.=",\"0\"";
+ if ($show_percentages)
+ {
+ $SstatusesHTML .= " 0.00 % |";
+ $CSVstatuses.=",\"0.00 %\"";
+ }
+ }
+ ### END loop through each stat line ###
+ $o++;
+ }
+
+ $Stime = ($Stalk_sec + $Spause_sec + $Swait_sec + $Sdispo_sec);
+
+ $Stalk_avg = MathZDC($Stalk_sec, $Scalls);
+ $Spause_avg = MathZDC($Spause_sec, $Scalls);
+ $Swait_avg = MathZDC($Swait_sec, $Scalls);
+ $Sdispo_avg = MathZDC($Sdispo_sec, $Scalls);
+ $Sdead_avg = MathZDC($Sdead_sec, $Scalls);
+ $Scustomer_avg = MathZDC($Scustomer_sec, $Scalls);
+
+ $RAWuser = $Suser;
+ $RAWcalls = $Scalls;
+ $Scalls = sprintf("%6s", $Scalls);
+ $Sfull_nameRAW = $Sfull_name;
+ $SuserRAW = $Suser;
+
+ $pfUSERtime_MS = sec_convert($Stime,$TIME_H_agentperfdetail);
+ $pfUSERtotTALK_MS = sec_convert($Stalk_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotTALK_MS_pct = sprintf("%0.2f", MathZDC(100*$Stalk_sec, $Stime));
+ $pfUSERavgTALK_MS = sec_convert($Stalk_avg,$TIME_M_agentperfdetail);
+ $USERtotPAUSE_MS = sec_convert($Spause_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotPAUSE_MS_pct = sprintf("%0.2f", MathZDC(100*$Spause_sec, $Stime));
+ $USERavgPAUSE_MS = sec_convert($Spause_avg,$TIME_M_agentperfdetail);
+ $USERtotWAIT_MS = sec_convert($Swait_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotWAIT_MS_pct = sprintf("%0.2f", MathZDC(100*$Swait_sec, $Stime));
+ $USERavgWAIT_MS = sec_convert($Swait_avg,$TIME_M_agentperfdetail);
+ $USERtotDISPO_MS = sec_convert($Sdispo_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotDISPO_MS_pct = sprintf("%0.2f", MathZDC(100*$Sdispo_sec, $Stime));
+ $USERavgDISPO_MS = sec_convert($Sdispo_avg,$TIME_M_agentperfdetail);
+ $USERtotDEAD_MS = sec_convert($Sdead_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotDEAD_MS_pct = sprintf("%0.2f", MathZDC(100*$Sdead_sec, $Stime));
+ $USERavgDEAD_MS = sec_convert($Sdead_avg,$TIME_M_agentperfdetail);
+ $USERtotCUSTOMER_MS = sec_convert($Scustomer_sec,$TIME_H_agentperfdetail);
+ $pfUSERtotCUSTOMER_MS_pct = sprintf("%0.2f", MathZDC(100*$Scustomer_sec, $Stime));
+ $USERavgCUSTOMER_MS = sec_convert($Scustomer_avg,$TIME_M_agentperfdetail);
+
+ $pfUSERtime_MS = sprintf("%9s", $pfUSERtime_MS);
+ $pfUSERtotTALK_MS = sprintf("%8s", $pfUSERtotTALK_MS);
+ $pfUSERtotTALK_MS_pct = sprintf("%8s", $pfUSERtotTALK_MS_pct);
+ $pfUSERavgTALK_MS = sprintf("%6s", $pfUSERavgTALK_MS);
+ $pfUSERtotPAUSE_MS = sprintf("%8s", $USERtotPAUSE_MS);
+ $pfUSERtotPAUSE_MS_pct = sprintf("%8s", $pfUSERtotPAUSE_MS_pct);
+ $pfUSERavgPAUSE_MS = sprintf("%6s", $USERavgPAUSE_MS);
+ $pfUSERtotWAIT_MS = sprintf("%8s", $USERtotWAIT_MS);
+ $pfUSERtotWAIT_MS_pct = sprintf("%8s", $pfUSERtotWAIT_MS_pct);
+ $pfUSERavgWAIT_MS = sprintf("%6s", $USERavgWAIT_MS);
+ $pfUSERtotDISPO_MS = sprintf("%8s", $USERtotDISPO_MS);
+ $pfUSERtotDISPO_MS_pct = sprintf("%8s", $pfUSERtotDISPO_MS_pct);
+ $pfUSERavgDISPO_MS = sprintf("%6s", $USERavgDISPO_MS);
+ $pfUSERtotDEAD_MS = sprintf("%8s", $USERtotDEAD_MS);
+ $pfUSERtotDEAD_MS_pct = sprintf("%8s", $pfUSERtotDEAD_MS_pct);
+ $pfUSERavgDEAD_MS = sprintf("%6s", $USERavgDEAD_MS);
+ $pfUSERtotCUSTOMER_MS = sprintf("%8s", $USERtotCUSTOMER_MS);
+ $pfUSERtotCUSTOMER_MS_pct = sprintf("%8s", $pfUSERtotCUSTOMER_MS_pct);
+ $pfUSERavgCUSTOMER_MS = sprintf("%6s", $USERavgCUSTOMER_MS);
+ $PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
+
+ if ($non_latin < 1)
+ {
+ $Scall_date= sprintf("%-10s", $call_dateX);
+ $Sfull_name= sprintf("%-15s", " ");
+ $Suser_group= sprintf("%-20s", " ");
+ $Slast_user_group= sprintf("%-20s", " ");
+ $Suser_sub = sprintf("%-8s", " ");
+ }
+ else
+ {
+ $Scall_date= sprintf("%-10s", $call_dateX);
+ $Sfull_name= sprintf("%-45s", " ");
+ $Suser_group= sprintf("%-60s", " ");
+ $Slast_user_group= sprintf("%-60s", " ");
+ $Suser_sub = sprintf("%-24s", " ");
+ }
+
+ if ($show_percentages) {
+ $Toutput_sub .= "| $Sfull_name | $Suser_sub | $Suser_group | $Slast_user_group | $Scall_date | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERtotPAUSE_MS_pct % | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERtotWAIT_MS_pct % | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERtotTALK_MS_pct % | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERtotDISPO_MS_pct % | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERtotDEAD_MS_pct % | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERtotCUSTOMER_MS_pct % | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
+ } else {
+ $Toutput_sub .= "| $Sfull_name | $Suser_sub | $Suser_group | $Slast_user_group | $Scall_date | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
+ }
+
+
+ $CSV_lines_sub.="\"\",";
+ if ($show_percentages) {
+ $CSV_lines_sub.=preg_replace('/\s/', '', "\"\",\"\",\"\",\"$Scall_date\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERtotPAUSE_MS_pct\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERtotWAIT_MS_pct\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERtotTALK_MS_pct\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERtotDISPO_MS_pct\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERtotDEAD_MS_pct\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERtotCUSTOMER_MS_pct\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
+ } else {
+ $CSV_lines_sub.=preg_replace('/\s/', '', "\"\",\"\",\"\",\"$Scall_date\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
+ }
+ $CSV_lines_sub.="\n";
+
+ }
+ if ($show_percentages)
+ {
+ $Toutput_sub.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
+ }
+ else
+ {
+ $Toutput_sub.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+ }
+ }
+
$Slast_user_group=$recent_user_groups[$Suser];
-# $recent_UG_stmt="SELECT max(event_time) as most_recent_event, user_group from vicidial_agent_log where user='$Suser' and event_time <= '$query_date_END' and event_time >= '$query_date_BEGIN' and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000 $group_SQL $user_group_agent_log_SQL group by user_group order by most_recent_event desc limit 1";
-# if ($DB) {$HTML_text.="$recent_UG_stmt\n";}
-# $recent_UG_rslt=mysql_to_mysqli($recent_UG_stmt, $link);
-# while ($UG_row=mysqli_fetch_row($recent_UG_rslt)) {
-# $Slast_user_group=$UG_row[1];
-# $recent_user_groups[$Suser]=$UG_row[1];
-# }
$Sfull_name=$user_namesARY[$m];
$Suser_group=$user_groupsARY[$m];
@@ -994,6 +1205,7 @@ while ($m < $k)
if ($non_latin < 1)
{
+ $Scall_date= sprintf("%-10s", " ");
$Sfull_name= sprintf("%-15s", $Sfull_name);
while(strlen($Sfull_name)>15) {$Sfull_name = substr("$Sfull_name", 0, -1);}
$Suser_group= sprintf("%-20s", $Suser_group);
@@ -1005,6 +1217,7 @@ while ($m < $k)
}
else
{
+ $Scall_date= sprintf("%-10s", " ");
$Sfull_name= sprintf("%-45s", $Sfull_name);
while(mb_strlen($Sfull_name,'utf-8')>15) {$Sfull_name = mb_substr("$Sfull_name", 0, -1,'utf-8');}
$Suser_group= sprintf("%-60s", $Suser_group);
@@ -1088,19 +1301,22 @@ while ($m < $k)
$PAUSEtotal[$m] = $pfUSERtotPAUSE_MS;
if ($show_percentages) {
- $Toutput = "| $Sfull_name | $Suser | $Suser_group | $Slast_user_group | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERtotPAUSE_MS_pct % | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERtotWAIT_MS_pct % | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERtotTALK_MS_pct % | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERtotDISPO_MS_pct % | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERtotDEAD_MS_pct % | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERtotCUSTOMER_MS_pct % | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
+ $Toutput = "| $Sfull_name | $Suser | $Suser_group | $Slast_user_group$BBD_filler | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERtotPAUSE_MS_pct % | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERtotWAIT_MS_pct % | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERtotTALK_MS_pct % | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERtotDISPO_MS_pct % | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERtotDEAD_MS_pct % | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERtotCUSTOMER_MS_pct % | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
} else {
- $Toutput = "| $Sfull_name | $Suser | $Suser_group | $Slast_user_group | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
+ $Toutput = "| $Sfull_name | $Suser | $Suser_group | $Slast_user_group$BBD_filler | $Scalls | $pfUSERtime_MS | $pfUSERtotPAUSE_MS | $pfUSERavgPAUSE_MS | $pfUSERtotWAIT_MS | $pfUSERavgWAIT_MS | $pfUSERtotTALK_MS | $pfUSERavgTALK_MS | $pfUSERtotDISPO_MS | $pfUSERavgDISPO_MS | $pfUSERtotDEAD_MS | $pfUSERavgDEAD_MS | $pfUSERtotCUSTOMER_MS | $pfUSERavgCUSTOMER_MS |$SstatusesHTML\n";
}
+ $Toutput.=$Toutput_sub;
$CSV_lines.="\"$Sfull_nameRAW\",";
if ($show_percentages) {
- $CSV_lines.=preg_replace('/\s/', '', "\"$SuserRAW\",\"$Suser_group\",\"$Slast_user_group\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERtotPAUSE_MS_pct\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERtotWAIT_MS_pct\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERtotTALK_MS_pct\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERtotDISPO_MS_pct\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERtotDEAD_MS_pct\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERtotCUSTOMER_MS_pct\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
+ $CSV_lines.=preg_replace('/\s/', '', "\"$SuserRAW\",\"$Suser_group\",\"$Slast_user_group$BBD_csv_filler\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERtotPAUSE_MS_pct\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERtotWAIT_MS_pct\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERtotTALK_MS_pct\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERtotDISPO_MS_pct\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERtotDEAD_MS_pct\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERtotCUSTOMER_MS_pct\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
} else {
- $CSV_lines.=preg_replace('/\s/', '', "\"$SuserRAW\",\"$Suser_group\",\"$Slast_user_group\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
+ $CSV_lines.=preg_replace('/\s/', '', "\"$SuserRAW\",\"$Suser_group\",\"$Slast_user_group$BBD_csv_filler\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses");
}
$CSV_lines.="\n";
+ $CSV_lines.=$CSV_lines_sub;
+
$TOPsorted_output[$m] = $Toutput;
@@ -1257,13 +1473,19 @@ if ($file_download == 0 || !$file_download)
}
if ($show_percentages) {
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
- $ASCII_text.="| "._QXZ("TOTALS",33)." "._QXZ("AGENTS",32,"r").":$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTtotPAUSE_MS_pct % | $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTtotWAIT_MS_pct % | $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTtotTALK_MS_pct % | $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTtotDISPO_MS_pct % | $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTtotDEAD_MS_pct % | $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTtotCUSTOMER_MS_pct % | $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
+ if (!$breakdown_by_date) # Prevent additional line from being printed - has to be here, won't work above in if-breakdown-by-date loop when results are sorted
+ {
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
+ }
+ $ASCII_text.="| "._QXZ("TOTALS",33)." "._QXZ("AGENTS",32,"r").":$TOT_AGENTS$BBD_filler | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTtotPAUSE_MS_pct % | $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTtotWAIT_MS_pct % | $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTtotTALK_MS_pct % | $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTtotDISPO_MS_pct % | $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTtotDEAD_MS_pct % | $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTtotCUSTOMER_MS_pct % | $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+----------+------------+--------+$statusesHEAD\n";
} else {
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
- $ASCII_text.="| "._QXZ("TOTALS",33)." "._QXZ("AGENTS",32,"r").":$TOT_AGENTS | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
- $ASCII_text.="+-----------------+----------+----------------------+----------------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+ if (!$breakdown_by_date) # Prevent additional line from being printed - has to be here, won't work above in if-breakdown-by-date loop when results are sorted
+ {
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
+ }
+ $ASCII_text.="| "._QXZ("TOTALS",33)." "._QXZ("AGENTS",32,"r").":$TOT_AGENTS$BBD_filler | $TOTcalls| $TOTtime_MS|$TOTtotPAUSE_MS| $TOTavgPAUSE_MS |$TOTtotWAIT_MS| $TOTavgWAIT_MS |$TOTtotTALK_MS| $TOTavgTALK_MS |$TOTtotDISPO_MS| $TOTavgDISPO_MS |$TOTtotDEAD_MS| $TOTavgDEAD_MS |$TOTtotCUSTOMER_MS| $TOTavgCUSTOMER_MS |$SUMstatusesHTML\n";
+ $ASCII_text.="+-----------------+----------+----------------------+----------------------+".$BBD_header."--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
}
for ($e=0; $e 0)
##### END SETTINGS LOOKUP #####
###########################################
+### ARCHIVED DATA CHECK CONFIGURATION
+$archives_available="N";
+$log_tables_array=array("vicidial_timeclock_log", "vicidial_agent_log");
+for ($t=0; $t\n";
$MAIN.="\n\n";
@@ -330,7 +361,7 @@ $CSV_text_header.="\""._QXZ("AGENT TIME SHEET").": $agent - $full_name\"\n\n";
if ($calls_summary)
{
- $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from vicidial_agent_log where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
+ $stmt="select count(*) as calls,sum(talk_sec) as talk,avg(talk_sec),sum(pause_sec),avg(pause_sec),sum(wait_sec),avg(wait_sec),sum(dispo_sec),avg(dispo_sec) from ".$vicidial_agent_log_table." where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' and pause_sec<48800 and wait_sec<48800 and talk_sec<48800 and dispo_sec<48800 limit 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
@@ -357,7 +388,7 @@ if ($calls_summary)
$pfWAIT_AVG_MS = sprintf("%6s", $WAIT_AVG_MS);
$pfWRAPUP_AVG_MS = sprintf("%6s", $WRAPUP_AVG_MS);
- $MAIN.=_QXZ("TOTAL CALLS TAKEN",17).": $row[0] ["._QXZ("DOWNLOAD")."]\n";
+ $MAIN.=_QXZ("TOTAL CALLS TAKEN",17).": $row[0] ["._QXZ("DOWNLOAD")."]\n";
$MAIN.=_QXZ("TALK TIME:",24)." $pfTALK_TIME_HMS "._QXZ("AVERAGE",11,"r").": $pfTALK_AVG_MS\n";
$MAIN.=_QXZ("PAUSE TIME:",24)." $pfPAUSE_TIME_HMS "._QXZ("AVERAGE",11,"r").": $pfPAUSE_AVG_MS\n";
$MAIN.=_QXZ("WAIT TIME:",24)." $pfWAIT_TIME_HMS "._QXZ("AVERAGE",11,"r").": $pfWAIT_AVG_MS\n";
@@ -378,7 +409,7 @@ else
}
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' order by event_time limit 1;";
+$stmt="select event_time,UNIX_TIMESTAMP(event_time) from ".$vicidial_agent_log_table." where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' order by event_time limit 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
@@ -388,7 +419,7 @@ $start = $row[1];
$CSV_login.="\"\",\""._QXZ("FIRST LOGIN").":\",\"$row[0]\"\n";
-$stmt="select event_time,UNIX_TIMESTAMP(event_time) from vicidial_agent_log where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' order by event_time desc limit 1;";
+$stmt="select event_time,UNIX_TIMESTAMP(event_time) from ".$vicidial_agent_log_table." where event_time <= '" . mysqli_real_escape_string($link, $query_date_END) . "' and event_time >= '" . mysqli_real_escape_string($link, $query_date_BEGIN) . "' and user='" . mysqli_real_escape_string($link, $agent) . "' order by event_time desc limit 1;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$row=mysqli_fetch_row($rslt);
@@ -421,7 +452,7 @@ $EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
$MAIN.="\n";
-$MAIN.=""._QXZ("TIMECLOCK LOGIN/LOGOUT TIME").": ["._QXZ("DOWNLOAD")."]\n";
+$MAIN.=""._QXZ("TIMECLOCK LOGIN/LOGOUT TIME").": ["._QXZ("DOWNLOAD")."]\n";
$MAIN.="\n";
$MAIN.=""._QXZ("ID")." "._QXZ("EDIT")." "._QXZ("EVENT")." "._QXZ("DATE")." "._QXZ("IP ADDRESS")." "._QXZ("GROUP")." "._QXZ("HOURS:MINUTES")." \n";
@@ -430,7 +461,7 @@ $CSV_text2.=$CSV_login;
$CSV_text2.="\""._QXZ("TIMECLOCK LOGIN/LOGOUT TIME").":\"\n";
$CSV_text2.="\"\",\""._QXZ("ID")."\",\""._QXZ("EDIT")."\",\""._QXZ("EVENT")."\",\""._QXZ("DATE")."\",\""._QXZ("IP ADDRESS")."\",\""._QXZ("GROUP")."\",\""._QXZ("HOURS:MINUTES")."\"\n";
- $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from vicidial_timeclock_log where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
+ $stmt="SELECT event,event_epoch,user_group,login_sec,ip_address,timeclock_id,manager_user from ".$vicidial_timeclock_log_table." where user='$agent' and event_epoch >= '$SQepoch' and event_epoch <= '$EQepoch';";
if ($DB>0) {$MAIN.="|$stmt|";}
$rslt=mysql_to_mysqli($stmt, $link);
$events_to_print = mysqli_num_rows($rslt);
diff --git a/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php b/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php
index 0528d9fa..cf79c702 100644
--- a/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php
+++ b/agc_2-X/trunk/www/vicidial/AST_campaign_status_list_report.php
@@ -20,6 +20,7 @@
# 141114-0848 - Finalized adding QXZ translation to all admin files
# 141230-1516 - Added code for on-the-fly language translations display
# 150516-1312 - Fixed Javascript element problem, Issue #857
+# 151219-0107 - Added option for searching archived data
#
$startMS = microtime();
@@ -50,6 +51,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"];}
$report_name="Campaign Status List Report";
$NOW_DATE = date("Y-m-d");
@@ -63,7 +66,6 @@ if (!isset($end_date_T)) {$end_date_T="23:59:59";}
$stmt = "SELECT use_non_latin,outbound_autodial_active,slave_db_server,reports_use_slave_db,enable_languages,language_method FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
if ($DB) {$HTML_text.="$stmt\n";}
-if ($archive_tbl) {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";}
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
{
@@ -78,6 +80,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";
$HTML_text.="\n
";
+
+if ($archives_available=="Y")
+ {
+ $HTML_text.=""._QXZ("Search archived data")."
\n";
+ }
+
$HTML_text.="\n";
$HTML_text.=" ";
$HTML_text.=" \n";
-$HTML_text.=""._QXZ("DOWNLOAD")." |";
+$HTML_text.=""._QXZ("DOWNLOAD")." |";
$HTML_text.=" "._QXZ("REPORTS")." \n";
$HTML_text.="\n";
$HTML_text.="
";
@@ -407,7 +439,7 @@ while($i < $group_ct)
if (strlen($inbound_groups)>0)
{
$inbound_groups=preg_replace("/\s/", "', '", $inbound_groups);
- $inbound_SQL="and vicidial_closer_log.campaign_id in ('$inbound_groups')";
+ $inbound_SQL="and ".$vicidial_closer_log_table.".campaign_id in ('$inbound_groups')";
}
else
{
@@ -435,7 +467,7 @@ while($i < $group_ct)
$CSV_text.="\""._QXZ("List ID")." #$list_id: $list_name\"\n";
- $stat_stmt="SELECT vicidial_log.status, vicidial_log.uniqueid, vicidial_log.length_in_sec as duration, cast(vicidial_agent_log.talk_sec as signed)-cast(vicidial_agent_log.dead_sec as signed) as handle_time from vicidial_log LEFT OUTER JOIN vicidial_agent_log on vicidial_log.lead_id=vicidial_agent_log.lead_id and vicidial_log.uniqueid=vicidial_agent_log.uniqueid where vicidial_log.call_date>='$query_date' and vicidial_log.call_date<='$end_date' and vicidial_log.list_id='$list_id' UNION SELECT vicidial_closer_log.status, vicidial_closer_log.uniqueid, vicidial_closer_log.length_in_sec as duration, cast(vicidial_agent_log.talk_sec as signed)-cast(vicidial_agent_log.dead_sec as signed) as handle_time from vicidial_closer_log LEFT OUTER JOIN vicidial_agent_log on vicidial_closer_log.lead_id=vicidial_agent_log.lead_id and vicidial_closer_log.uniqueid=vicidial_agent_log.uniqueid where call_date>='$query_date' and call_date<='$end_date' and list_id='$list_id' order by status";
+ $stat_stmt="SELECT ".$vicidial_log_table.".status, ".$vicidial_log_table.".uniqueid, ".$vicidial_log_table.".length_in_sec as duration, cast(".$vicidial_agent_log_table.".talk_sec as signed)-cast(".$vicidial_agent_log_table.".dead_sec as signed) as handle_time from ".$vicidial_log_table." LEFT OUTER JOIN ".$vicidial_agent_log_table." on ".$vicidial_log_table.".lead_id=".$vicidial_agent_log_table.".lead_id and ".$vicidial_log_table.".uniqueid=".$vicidial_agent_log_table.".uniqueid where ".$vicidial_log_table.".call_date>='$query_date' and ".$vicidial_log_table.".call_date<='$end_date' and ".$vicidial_log_table.".list_id='$list_id' UNION SELECT ".$vicidial_closer_log_table.".status, ".$vicidial_closer_log_table.".uniqueid, ".$vicidial_closer_log_table.".length_in_sec as duration, cast(".$vicidial_agent_log_table.".talk_sec as signed)-cast(".$vicidial_agent_log_table.".dead_sec as signed) as handle_time from ".$vicidial_closer_log_table." LEFT OUTER JOIN ".$vicidial_agent_log_table." on ".$vicidial_closer_log_table.".lead_id=".$vicidial_agent_log_table.".lead_id and ".$vicidial_closer_log_table.".uniqueid=".$vicidial_agent_log_table.".uniqueid where call_date>='$query_date' and call_date<='$end_date' and list_id='$list_id' order by status";
if ($DB) {$HTML_text.="|$stat_stmt|\n";}
# $ASCII_text.=$stat_stmt."\n";
$stat_rslt=mysql_to_mysqli($stat_stmt, $link);
diff --git a/agc_2-X/trunk/www/vicidial/AST_email_log_report.php b/agc_2-X/trunk/www/vicidial/AST_email_log_report.php
index a41ec5ed..520ea553 100644
--- a/agc_2-X/trunk/www/vicidial/AST_email_log_report.php
+++ b/agc_2-X/trunk/www/vicidial/AST_email_log_report.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2015 Matt Florell LICENSE: AGPLv2
#
# report of emails handled by the system
#
@@ -16,6 +16,7 @@
# 140918-0615 - Fixed bug #789
# 141113-2048 - Finalized adding QXZ translation to all admin files
# 141230-1504 - Added code for on-the-fly language translations display
+# 151219-0117 - Added option for searching archived data
#
$startMS = microtime();
@@ -61,6 +62,8 @@ if (isset($_GET["query_date"])) {$query_date=$_GET["query_date"];}
elseif (isset($_POST["query_date"])) {$query_date=$_POST["query_date"];}
if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];}
+if (isset($_GET["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 = 'Email Log Report';
@@ -86,6 +89,30 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP #####
###########################################
+### ARCHIVED DATA CHECK CONFIGURATION
+$archives_available="N";
+$log_tables_array=array("vicidial_email_list", "vicidial_closer_log", "vicidial_email_log");
+for ($t=0; $t"._QXZ("IVR REPORT")." | \n";
}
$MAIN.=""._QXZ("REPORTS")." | ";
-$MAIN.="
\n";
+$MAIN.="
";
+
+
+if ($archives_available=="Y")
+ {
+ $MAIN.=""._QXZ("Search archived data")."
\n";
+ }
+
+
+$MAIN.=" \n";
$MAIN.=" \n";
@@ -470,7 +506,7 @@ $query_date_END = "$end_date 23:59:59";
$rpt_title=_QXZ("Showing emails")." $email_title "._QXZ("that were")." $date_title "._QXZ("from")." $query_date_BEGIN "._QXZ("to")." $query_date_END\n\n";
$MAIN.=$rpt_title;
-$MAIN.=_QXZ("Email log results").": $group_string $NOW_TIME "._QXZ("DOWNLOAD")."\n";
+$MAIN.=_QXZ("Email log results").": $group_string $NOW_TIME "._QXZ("DOWNLOAD")."\n";
$CSV_text1.="\""._QXZ("Showing emails")." $email_title "._QXZ("that were")." $date_title "._QXZ("from")." $query_date_BEGIN "._QXZ("to")." $query_date_END\"\n\n";
if ($email_type=="received")
@@ -481,16 +517,16 @@ if ($email_type=="received")
if ($date_type=="email_date")
{
# $stmt="select vel.* from vicidial_email_list vel where $date_type>='$query_date_BEGIN' and $date_type<='$query_date_END' and group_id in ($group_SQL) order by $date_type asc";
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status from vicidial_email_list vel where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vel.group_id in ($group_SQL) order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status from ".$vicidial_email_list_table." vel where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
# $stmt="select vel.*, vcl.call_date, from vicidial_email_list vel, vicidial_closer_log vcl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vcl.$date_type asc";
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status from vicidial_email_list vel where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status from ".$vicidial_email_list_table." vel where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.user as sending_user, vl.message as sent_message from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl, ".$vicidial_email_log_table." vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
}
else if ($email_type=="viewed")
@@ -500,15 +536,15 @@ else if ($email_type=="viewed")
$CSV_text1.="\""._QXZ("DATE EMAIL RECEIVED")."\",\""._QXZ("ADDRESS FROM")."\",\""._QXZ("SENDER NAME")."\",\""._QXZ("MESSAGE")."\",\""._QXZ("DATE EMAIL VIEWED")."\",\""._QXZ("STATUS")."\"\n";
if ($date_type=="email_date")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vcl.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from vicidial_email_list vel, vicidial_closer_log vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) order by vel.$date_type asc";
}
}
else if ($email_type=="answered")
@@ -518,15 +554,15 @@ else if ($email_type=="answered")
$CSV_text1.="\""._QXZ("DATE EMAIL RECEIVED")."\",\""._QXZ("ADDRESS FROM")."\",\""._QXZ("SENDER NAME")."\",\""._QXZ("MESSAGE")."\",\""._QXZ("DATE EMAIL VIEWED")."\",\""._QXZ("DATE EMAIL ANSWERED")."\",\""._QXZ("USER")."\",\""._QXZ("RESPONSE")."\",\""._QXZ("STATUS")."\"\n";
if ($date_type=="email_date")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl, ".$vicidial_email_log_table." vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
else if ($date_type=="call_date")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl, ".$vicidial_email_log_table." vl where vcl.$date_type>='$query_date_BEGIN' and vcl.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vcl.$date_type asc";
}
else if ($date_type=="date_answered")
{
- $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from vicidial_email_list vel, vicidial_closer_log vcl, vicidial_email_log vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
+ $stmt="select vel.email_row_id, vel.lead_id, vel.email_date, vel.email_from, vel.email_from_name, convert(vel.message using 'UTF8') as message, vel.status, vcl.call_date, vl.email_date as date_response_sent, vl.email_log_id, vl.user as sending_user, vl.message as sent_message from ".$vicidial_email_list_table." vel, ".$vicidial_closer_log_table." vcl, ".$vicidial_email_log_table." vl where vel.$date_type>='$query_date_BEGIN' and vel.$date_type<='$query_date_END' and vcl.uniqueid=vel.uniqueid and vel.group_id in ($group_SQL) and vel.email_row_id=vl.email_row_id order by vel.$date_type asc";
}
}
#echo $stmt."\n";
diff --git a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php
index d55dabb1..bc74c030 100644
--- a/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php
+++ b/agc_2-X/trunk/www/vicidial/AST_performance_comparison_report.php
@@ -12,6 +12,7 @@
# 141128-0905 - Code cleanup for QXZ functions
# 141230-0939 - Added code for on-the-fly language translations display
# 150516-1314 - Fixed Javascript element problem, Issue #857
+# 151227-1746 - Added option for searching archived data
#
$startMS = microtime();
@@ -48,6 +49,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["show_percentages"])) {$show_percentages=$_GET["show_percentages"];}
elseif (isset($_POST["show_percentages"])) {$show_percentages=$_POST["show_percentages"];}
+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';}
@@ -75,6 +78,26 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP #####
###########################################
+### ARCHIVED DATA CHECK CONFIGURATION
+$archives_available="N";
+$log_tables_array=array("vicidial_agent_log");
+for ($t=0; $t";}
-$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB&show_percentages=$show_percentages";
+$LINKbase = "$PHP_SELF?query_date=$query_date&end_date=$end_date$groupQS$user_groupQS&shift=$shift&DB=$DB&show_percentages=$show_percentages&search_archived_data=$search_archived_data";
$NWB = "
";
@@ -522,8 +545,14 @@ $HTML_text.="