diff --git a/www/vicidial/AST_agent_performance_detail.php b/www/vicidial/AST_agent_performance_detail.php index 21bfb9b4..cc7364c7 100644 --- a/www/vicidial/AST_agent_performance_detail.php +++ b/www/vicidial/AST_agent_performance_detail.php @@ -51,6 +51,7 @@ # 150603-1533 - Statuses are now sorted in alphabetical order # 150728-1230 - Fix for non-latin display issue #858 # 150909-0728 - Fix for time display issue for downloads, issue #886 +# 151112-1338 - Added ability to search archive logs and show defunct users # $startMS = microtime(); @@ -89,8 +90,13 @@ if (isset($_GET["show_percentages"])) {$show_percentages=$_GET["show_percentag elseif (isset($_POST["show_percentages"])) {$show_percentages=$_POST["show_percentages"];} if (isset($_GET["time_in_sec"])) {$time_in_sec=$_GET["time_in_sec"];} elseif (isset($_POST["time_in_sec"])) {$time_in_sec=$_POST["time_in_sec"];} +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 (isset($_GET["show_defunct_users"])) {$show_defunct_users=$_GET["show_defunct_users"];} + elseif (isset($_POST["show_defunct_users"])) {$show_defunct_users=$_POST["show_defunct_users"];} if (strlen($shift)<2) {$shift='ALL';} +if ($search_archived_data=="checked") {$agent_log_table="vicidial_agent_log_archive";} else {$agent_log_table="vicidial_agent_log";} $TIME_HF_agentperfdetail = 'HF'; $TIME_H_agentperfdetail = 'H'; @@ -338,7 +344,7 @@ while($i < $users_ct) $i++; } -$stmt="select campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; +$stmt="SELECT campaign_id from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {$HTML_text.="$stmt\n";} $campaigns_to_print = mysqli_num_rows($rslt); @@ -356,7 +362,7 @@ for ($i=0; $i\"HELP\""; @@ -562,7 +568,9 @@ $HTML_text.="\n"; $HTML_text.="\n"; $HTML_text.="

\n"; $HTML_text.=""._QXZ("Show %s")."
\n"; -$HTML_text.=""._QXZ("Time in seconds")."\n"; +$HTML_text.=""._QXZ("Time in seconds")."
\n"; +$HTML_text.=""._QXZ("Search archived data")."
\n"; +$HTML_text.=""._QXZ("Show defunct users")."\n"; $HTML_text.=""; $HTML_text.=_QXZ("Display as").":
"; $HTML_text.=""; if ($report_display_type) {echo "";} echo "\n

"; echo "$NWB#agent_status_detail$NWE\n"; +echo "
"; +echo ""._QXZ("Search archived data")."

\n"; +echo ""._QXZ("Show defunct users")."
\n"; echo "         "; echo "          \n"; diff --git a/www/vicidial/AST_agent_time_detail.php b/www/vicidial/AST_agent_time_detail.php index 3cbcd586..409859d3 100644 --- a/www/vicidial/AST_agent_time_detail.php +++ b/www/vicidial/AST_agent_time_detail.php @@ -44,6 +44,7 @@ # 150516-1311 - Fixed Javascript element problem, Issue #857 # 150529-1921 - Sub statuses are now sorted in alphabetical order # 151110-1612 - Changed download function to always export time with hours +# 151112-1335 - Added option to search archived tables # $startMS = microtime(); @@ -86,10 +87,32 @@ if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_d elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} if (isset($_GET["time_in_sec"])) {$time_in_sec=$_GET["time_in_sec"];} elseif (isset($_POST["time_in_sec"])) {$time_in_sec=$_POST["time_in_sec"];} +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($stage)<2) {$stage='NAME';} +if ($search_archived_data=="checked") + { + $agent_log_table="vicidial_agent_log_archive"; + $table_check_stmt="show tables like 'vicidial_timeclock_log_archive'"; + $table_check_rslt=mysql_to_mysqli($table_check_stmt, $link); + if (mysqli_num_rows($table_check_rslt)>0) + { + $timeclock_log_table="vicidial_timeclock_log_archive"; + } + else + { + $timeclock_log_table="vicidial_timeclock_log"; + } + } +else + { + $agent_log_table="vicidial_agent_log"; + $timeclock_log_table="vicidial_timeclock_log"; + } + $report_name = 'Agent Time Detail'; $db_source = 'M'; $JS_text="