Code updates for PHP8 compatibility in all PHP scripts

Added PHP_error_reporting_OVERRIDE options for each web directory

git-svn-id: svn://192.168.202.10@3863 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2024-08-06 15:02:09 +00:00
parent 97ba6fde4b
commit 3be624eb17
121 changed files with 1421 additions and 967 deletions
@@ -1,4 +1,4 @@
ALTERNATE NUMBER DIALING Redesign Started: 2008-08-20 Updated: 2022-01-19
ALTERNATE NUMBER DIALING Redesign Started: 2008-08-20 Updated: 2024-08-05
*** THIS SECTION OUTLINES PROPOSED CHANGES TO ALT-NUMBER-DIALING in the 2.0.5 version ***
*** FOR INFORMATION ON THE 2.0.3 AND 2.0.4 VERSION OF ALT NUMBER DIALING LOOK BELOW THIS SECTION ***
@@ -53,7 +53,11 @@ Using MULTI_LEAD is different from the other standard Auto-Alt-Dial functions, i
The Auto-Alt-Statuses are still in used for MULTI_LEAD so you may want to make sure that statuses like DROP, PDROP and others to your campaign's auto-alt-dial statuses so that the other leads tied by vendor_lead_code in the campaign's lists are not deactivated.
There is a feature in the hopper section of the modify campaign page that it is recommended you activate if you are using MULTI_LEAD auto-alt dialing: Hopper VLC Dup Check. This feature will prevent multiple numbers from the same account from getting inserted into the hopper at the same time.
There is a feature in the hopper section of the modify campaign page that it is recommended you activate if you are using MULTI_LEAD auto-alt dialing: "Hopper VLC Dup Check". This feature will prevent multiple numbers from the same account from getting inserted into the hopper at the same time.
Also, you can have the system automatically disable the rest of the leads for an account by adding a "Dispo Call URL" entry for the campaign using the "agc/deactivate_lead.php" script. For example: VARhttp://192.168.1.1/agc/deactivate_lead.php?search_field=vendor_lead_code&new_status=INACTIV&dispo=--A--dispo--B--&lead_id=--A--lead_id--B--&campaign_check=TESTCAMP&user=--A--user--B--&pass=--A--pass--B--&sale_status=SALE---XSALE&log_to_file=1
The above dispo call url example will set the other leads tied to the account linked by the vendor_lead_code to a status of 'INACTIV' when one of them is set as a SALE or XSALE.
@@ -132,6 +136,7 @@ A new Campaign and List-Override feature was added in January of 2022(svn/trunk
Technical explanation:
!!! DO NOT MAKE THESE DATABASE CHANGES, FOR DOCUMENTATION PURPOSES ONLY !!!!
+1 -1
View File
@@ -2665,7 +2665,7 @@ ERROR: copy_did NOT AN ALLOWED DID - 98762
ERROR: copy_did DID DESCRIPTION MUST BE EITHER BLANK OR FROM 6 TO 50 CHARACTERS, THIS IS AN OPTIONAL FIELD - 6666|012
NOTICE: copy_did DID ALREADY EXISTS - 6666|1000
NOTICE: copy_did DID HAS BEEN ADDED - 6666|1000|1001|12|1
ERROR: copy_did NO DIDS ADDED - 6666|1000|0|12|1
ERROR: copy_did NO DIDS ADDED - 6666|1000|0|1
SUCCESS: copy_did DIDS HAVE BEEN ADDED - 6666|1000|1|0
NOTE: If DIDs are attempted to be copied, there will be output for each attempted DID as well as a SUCCESS message if any were successfully copied or an ERROR if none were
+22 -20
View File
@@ -1,11 +1,12 @@
<?php
# VERM_AGENTS_rpt.inc - Vicidial Enhanced Reporting agent report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1631 - First build
# 230106-1304 - Added data flushing for large page outputs
# 240801-1130 - Code updates for PHP8 compatibility
#
# NANQUE, not an unanswered call?
@@ -748,11 +749,11 @@ foreach ($agent_sessions_array as $user => $sessions)
$total_dispo_time=array_sum(array_column($sessions,'dispo_sec'));
$total_ALL_billable_time=($total_talk_time+$total_wait_time+$total_billable_time+$total_dispo_time);
$average_pause_time=sprintf('%02d', floor(($total_pause_time/$total_pauses)/3600)).gmdate(":i:s", round($total_pause_time/$total_pauses));
$average_pause_time=sprintf('%02d', floor(MathZDC($total_pause_time, $total_pauses)/3600)).gmdate(":i:s", round(MathZDC($total_pause_time, $total_pauses)));
$total_sessions=count($sessions);
$avg_session=sprintf('%02d', floor(($total_duration/$total_sessions)/3600)).gmdate(":i:s", round($total_duration/$total_sessions));
$pauses_pct=sprintf("%.1f", 100*($total_pause_time/$total_duration));
$pauses_per_session=sprintf("%.1f", ($total_pauses/$total_sessions));
$avg_session=sprintf('%02d', floor(MathZDC($total_duration, $total_sessions)/3600)).gmdate(":i:s", round(MathZDC($total_duration, $total_sessions)));
$pauses_pct=sprintf("%.1f", 100*MathZDC($total_pause_time, $total_duration));
$pauses_per_session=sprintf("%.1f", MathZDC($total_pauses, $total_sessions));
$total_pause_His=sprintf('%02d', floor($total_pause_time/3600)).gmdate(":i:s", $total_pause_time);
$total_available_His=sprintf('%02d', floor($total_available_time/3600)).gmdate(":i:s", $total_available_time);
@@ -836,7 +837,7 @@ foreach ($agent_sessions_array as $user => $sessions)
$total_nonbillable_His=sprintf('%02d', floor($total_nonbillable_time/3600)).gmdate(":i:s", $total_nonbillable_time);
$total_ALL_billable_His=sprintf('%02d', floor($total_ALL_billable_time/3600)).gmdate(":i:s", $total_ALL_billable_time);
$available_pct=sprintf("%.1f", 100*($total_duration/$grand_total_duration));
$available_pct=sprintf("%.1f", 100*MathZDC($total_duration, $grand_total_duration));
$overlapping="0:00";
@@ -851,7 +852,7 @@ foreach ($agent_sessions_array as $user => $sessions)
$HTML_output.="<td>".$total_nonbillable_His."</td>";
### $HTML_output.="<td>".$overlapping."</td>";
$HTML_output.="<td>".$available_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_duration)/$max_agent_duration)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_duration), $max_agent_duration))."%'></td>";
$HTML_output.="</tr>\n";
$CSV_output["agent_availability"].="\"".$agentName."\",\"".$total_available_His."\",\"".$total_pause_His."\",\"".$total_billable_His."\",\"".$total_nonbillable_His."\",\"".$available_pct." %\"\n";
@@ -901,7 +902,7 @@ foreach ($agent_sessions_array as $user => $sessions)
$total_billable_His=sprintf('%02d', floor($total_billable_time/3600)).gmdate(":i:s", $total_billable_time);
$total_ALL_billable_His=sprintf('%02d', floor($total_ALL_billable_time/3600)).gmdate(":i:s", $total_ALL_billable_time);
$queue_pct=sprintf("%.1f", 100*($total_calls/$grand_total_calls));
$queue_pct=sprintf("%.1f", 100*MathZDC($total_calls, $grand_total_calls));
$agentName=($show_full_agent_info ? "$user - ".$fullname_info["$user"] : $fullname_info["$user"]);
@@ -944,9 +945,9 @@ $CSV_output["answered_calls_by_user_group"]="\""._QXZ("Agent group")."\",\""._QX
foreach ($user_groups_array as $user_group => $data)
{
$total_talk_His=sprintf('%02d', floor($data["talk_sec"]/3600)).gmdate(":i:s", $data["talk_sec"]);
$avg_talk_His=gmdate("H:i:s", round($data["talk_sec"]/$data["calls"]));
$avg_talk_His=gmdate("H:i:s", MathZDC(round($data["talk_sec"]), $data["calls"]));
$queue_pct=sprintf("%.1f", 100*($data["calls"]/$grand_total_calls));
$queue_pct=sprintf("%.1f", 100*MathZDC($data["calls"], $grand_total_calls));
$HTML_output.="<tr>\n";
$HTML_output.="<td>$user_group"."-".$usergroup_info["$user_group"]."</td>";
@@ -985,10 +986,10 @@ $CSV_output["answered_calls_by_location"]="\""._QXZ("Location")."\",\""._QXZ("N.
foreach ($locations_array as $location => $data)
{
$total_talk_His=sprintf('%02d', floor($data["talk_sec"]/3600)).gmdate(":i:s", $data["talk_sec"]);
$avg_talk_His=gmdate("H:i:s", round($data["talk_sec"]/$data["calls"]));
$avg_wait_His=gmdate("H:i:s", round($data["wait_sec"]/$data["calls"]));
$avg_talk_His=gmdate("H:i:s", round(MathZDC($data["talk_sec"], $data["calls"])));
$avg_wait_His=gmdate("H:i:s", round(MathZDC($data["wait_sec"], $data["calls"])));
$queue_pct=sprintf("%.1f", 100*($data["calls"]/$grand_total_calls));
$queue_pct=sprintf("%.1f", 100*MathZDC($data["calls"], $grand_total_calls));
$HTML_output.="<tr>\n";
@@ -1038,7 +1039,7 @@ $grand_total_pause_His=sprintf('%02d', floor($grand_total_pause_time/3600)).gmda
$grand_total_duration_His=sprintf('%02d', floor($grand_total_duration/3600)).gmdate(":i:s", $grand_total_duration);
$grand_total_billable_His=sprintf('%02d', floor($grand_total_billable_time/3600)).gmdate(":i:s", $grand_total_billable_time);
$grand_total_nonbillable_His=sprintf('%02d', floor($grand_total_nonbillable_time/3600)).gmdate(":i:s", $grand_total_nonbillable_time);
$grand_total_occupancy=sprintf("%.1f", 100*($grand_total_talk_time/($grand_total_duration-$grand_total_pause_time)));
$grand_total_occupancy=sprintf("%.1f", 100*(MathZDC($grand_total_talk_time, ($grand_total_duration-$grand_total_pause_time))));
$HTML_output.="<tr>\n";
### $HTML_output.="<td>&nbsp;</td>";
@@ -1220,6 +1221,7 @@ $HTML_output.="</tr>\n";
$CSV_output["agents_by_hour"].="\""._QXZ("Total")."\"\n";
ksort($agent_date_hour_array);
foreach ($agent_date_hour_array as $array_date => $hour)
{
$total_distinct_agents=array();
@@ -1291,12 +1293,12 @@ $HTML_output.="</tr>\n";
$CSV_output["agent_sessions_view"]="\""._QXZ("Agent")."\",\""._QXZ("Login")."\",\""._QXZ("Talk")."\",\""._QXZ("Pause + Wait")."\",\""._QXZ("Pause")."\",\""._QXZ("Billable (pause)")."\",\""._QXZ("Not Billable (pause)")."\",\""._QXZ("Tot. Wait")."\",\""._QXZ("Sales")."\",\""._QXZ("S PH")."\",\""._QXZ("Cust Cont")."\",\""._QXZ("CC PH")."\",\""._QXZ("Human Ans")."\",\""._QXZ("HA PH")."\",\""._QXZ("Answered")."\",\""._QXZ("HA Conv.")."\",\""._QXZ("CC Conv.")."\",\""._QXZ("Goal Ftrs")."\",\""._QXZ("Ftrs")."\",\""._QXZ("Avg")."\"\n";
$grand_total_idle_time=$grand_total_pause_time+$grand_total_wait_time;
$grand_sph=sprintf("%.1f", $grand_total_sales/($grand_total_duration/3600));
$grand_haph=sprintf("%.1f", $grand_total_human_answered/($grand_total_duration/3600));
$grand_ccph=sprintf("%.1f", $grand_total_contacts/($grand_total_duration/3600));
$grand_ha_conv=sprintf("%.1f", 100*($grand_total_sales/$grand_total_human_answered));
$grand_cc_conv=sprintf("%.1f", 100*($grand_total_sales/$grand_total_contacts));
$grand_avg_talk_time=round($grand_total_talk_time/$grand_total_calls);
$grand_sph=sprintf("%.1f", MathZDC($grand_total_sales, ($grand_total_duration/3600)));
$grand_haph=sprintf("%.1f", MathZDC($grand_total_human_answered, ($grand_total_duration/3600)));
$grand_ccph=sprintf("%.1f", MathZDC($grand_total_contacts, ($grand_total_duration/3600)));
$grand_ha_conv=sprintf("%.1f", 100*MathZDC($grand_total_sales, $grand_total_human_answered));
$grand_cc_conv=sprintf("%.1f", 100*MathZDC($grand_total_sales, $grand_total_contacts));
$grand_avg_talk_time=round(MathZDC($grand_total_talk_time, $grand_total_calls));
$grand_total_talk_His=sprintf('%02d', floor($grand_total_talk_time/3600)).gmdate(":i:s", $grand_total_talk_time);
$grand_total_wait_His=sprintf('%02d', floor($grand_total_wait_time/3600)).gmdate(":i:s", $grand_total_wait_time);
@@ -6,6 +6,7 @@
# CHANGELOG:
# 220825-1608 - First build
# 240709-2151 - Added input variable filtering
# 240801-1130 - Code updates for PHP8 compatibility
#
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
@@ -57,16 +58,16 @@ if ($non_latin < 1)
$function = preg_replace('/[^\-_0-9a-zA-Z]/','',$function);
$custom_report_vars = preg_replace('/[^-\/\|\_\#\*\,\.\_\[\]0-9a-zA-Z]/','',$custom_report_vars);
$custom_report_name = preg_replace('/[^\-_0-9a-zA-Z]/','',$custom_report_name);
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
}
else
{
$function = preg_replace('/[^-_0-9\p{L}/u','',$function);
$custom_report_vars = preg_replace('/[^-\/\|\_\#\*\,\.\_\[\]0-9\p{L}]/u','',$custom_report_vars);
$custom_report_name = preg_replace('/[^-_0-9\p{L}/u','',$custom_report_name);
$PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW);
$PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW);
}
@@ -96,7 +97,7 @@ if ($function=="log_custom_report")
{
$rpt_log_stmt="insert ignore into verm_custom_report_holder(user, report_name, report_parameters) values('$PHP_AUTH_USER', '$custom_report_name', '$LOGhttp_referer') ON DUPLICATE KEY UPDATE report_name='$custom_report_name', report_parameters='$custom_report_vars'";
$rpt_log_rslt=mysql_to_mysqli($rpt_log_stmt, $link);
return mysqli_affected_rows($rpt_log_rslt);
return mysqli_affected_rows($link);
}
+10 -9
View File
@@ -1,11 +1,12 @@
<?php
# VERM_ANSWERED_rpt.inc - Vicidial Enhanced Reporting answered call report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1629 - First build
# 230106-1310 - Added auto download and page flushing for large data output, modification to uniqueid handling to speed up page load
# 240801-1130 - Code updates for PHP8 compatibility
#
# DROP, WAITTO, TIMEOT are unanswered statuses, not NANQUE
@@ -465,7 +466,7 @@ $HTML_output.="</tr>\n";
$CSV_output["agents_on_queue"]="\""._QXZ("Agents on queue")."\"\n";
$CSV_output["agents_on_queue"].="\""._QXZ("Agent")."\",\""._QXZ("N. Calls")."\",\"\",\"...\",\""._QXZ("Total call time")."\",\""._QXZ("Average call time")."\"\n";
$highest_agent_call_count=max($agent_call_counts);
$highest_agent_call_count=(count($agent_call_counts)>0 ? max($agent_call_counts) : 0);
$agents_on_queue_graph_labels="[";
$agents_on_queue_graph_data="[";
@@ -624,7 +625,7 @@ $disconnection_causes_graph_data="[";
$disconnection_causes_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$disconnection_causes_graph_hovborder="[";
$max_term_reason=max($term_reasons);
$max_term_reason=(count($term_reasons)>0 ? max($term_reasons) : 0);
$x=0;
foreach ($term_reasons as $reason => $value)
{
@@ -689,7 +690,7 @@ while ($xfer_row=mysqli_fetch_row($xfer_rslt))
}
# print_r($transferred_counts);
$max_xfer_count=max($transferred_counts);
$max_xfer_count=(count($transferred_counts)>0 ? max($transferred_counts) : 0);
$x=0;
foreach ($transferred_counts as $reason => $value)
{
@@ -737,7 +738,7 @@ $answered_calls_by_queue_graph_data="[";
$answered_calls_by_queue_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$answered_calls_by_queue_graph_hovborder="[";
$max_queue_count=max($queue_stats);
$max_queue_count=(count($queue_stats)>0 ? max($queue_stats) : 0);
ksort($queue_stats);
$x=0;
foreach ($queue_stats as $queue => $value)
@@ -799,7 +800,7 @@ $answered_calls_by_direction_graph_data="[";
$answered_calls_by_direction_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$answered_calls_by_direction_graph_hovborder="[";
$max_call_direction=max($call_directions);
$max_call_direction=(count($call_directions)>0 ? max($call_directions) : 0);
ksort($call_directions);
$call_directions["Any calls"]=0;
$x=0;
@@ -900,7 +901,7 @@ $queue_position_graph_data="[";
$queue_position_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$queue_position_graph_hovborder="[";
$max_queue_count=max($queue_positions);
$max_queue_count=(count($queue_positions)>0 ? max($queue_positions) : 0);
$x=0;
foreach ($queue_positions as $position => $value)
{
@@ -1015,7 +1016,7 @@ if ($ivr_path!="")
if ($ivr_paths["$ivr_path"][3]<$ivr_call_time) {$ivr_paths["$ivr_path"][3]=$ivr_call_time;}
}
$max_ivr_count=max($ivr_counts);
$max_ivr_count=(count($ivr_counts)>0 ? max($ivr_counts) : 0);
if ($max_ivr_count<$untracked_calls) {$max_ivr_count=$untracked_calls;}
$untracked_ivr_pct=sprintf("%.1f", MathZDC((100*$untracked_calls), $total_answered_calls));
@@ -1122,7 +1123,7 @@ while ($did_row=mysqli_fetch_array($did_rslt))
$untracked_did_calls--;
}
}
$max_did=max($did_counts);
$max_did=(count($did_counts)>0 ? max($did_counts) : 0);
if ($max_did<$untracked_did_calls) {$max_did=$untracked_did_calls;}
$untracked_did_pct=sprintf("%.1f", MathZDC((100*$untracked_did_calls), $total_answered_calls));
+42 -39
View File
@@ -1,11 +1,12 @@
<?php
# VERM_DAY_rpt.inc - Vicidial Enhanced Reporting per-day report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1624 - First build
# 230106-1311 - Added page flushing to show page load progress
# 240801-1130 - Code updates for PHP8 compatibility
#
$vicidial_user_log_table="vicidial_user_log";
@@ -193,17 +194,18 @@ while ($row=mysqli_fetch_array($rslt))
### These counts are in here because by definition these SHOULD be answers, but you never know with some morons.
### "Real" campaign_id should have been gotten under the direction clause above
if (in_array($status, $sale_array["$campaign_id"]) || in_array($status, $sale_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $sale_array) && in_array($status, $sale_array["$campaign_id"])) || in_array($status, $sale_array["SYSTEM"]))
{
$calls_array["$call_date"]["sales"]++;
$total_sales++;
}
if (in_array($status, $human_ans_array["$campaign_id"]) || in_array($status, $human_ans_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $human_ans_array) && in_array($status, $human_ans_array["$campaign_id"])) || in_array($status, $human_ans_array["SYSTEM"]))
{
$calls_array["$call_date"]["human_answered"]++;
$total_human_answered++;
}
if (in_array($status, $contact_array["$campaign_id"]) || in_array($status, $contact_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $contact_array) && in_array($status, $contact_array["$campaign_id"])) || in_array($status, $contact_array["SYSTEM"]))
{
$calls_array["$call_date"]["customer_contacts"]++;
$total_customer_contacts++;
@@ -234,7 +236,7 @@ while ($row=mysqli_fetch_array($rslt))
# Queue array
$queue_array["$call_date"]["total_calls"]++;
$queue_array["$call_date"]["total_queue"]+=$queue_position;
$queue_array["$call_date"]["avg_position"]=($queue_array["$call_date"]["total_queue"]/$queue_array["$call_date"]["total_calls"]);
$queue_array["$call_date"]["avg_position"]=MathZDC($queue_array["$call_date"]["total_queue"], $queue_array["$call_date"]["total_calls"]);
# Min/max queue
if (!$queue_array["$call_date"]["min_queue_position"] || $queue_position<$queue_array["$call_date"]["min_queue_position"])
{
@@ -281,7 +283,7 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$total_date_calls_answered=($answered_calls_array["$call_date_key"]["inbound"]+$answered_calls_array["$call_date_key"]["outbound"]);
$total_date_calls_unanswered=($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"]);
$avg_call_length=round($answered_calls_array["$call_date_key"]["total_length"]/$total_date_calls_answered);
$avg_call_length=round(MathZDC($answered_calls_array["$call_date_key"]["total_length"], $total_date_calls_answered));
$avg_call_length_fmt=($avg_call_length>=3600 ? floor($avg_call_length/3600).":" : "").gmdate("i:s", $avg_call_length);
$min_call_length_fmt=($answered_calls_array["$call_date_key"]["min_call_length"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_call_length"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_call_length"]);
@@ -290,15 +292,15 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_answered), $total_answered_calls))."%'></td>";
$HTML_output.="<td>".$avg_call_length_fmt."</td>";
$HTML_output.="<td>".$min_call_length_fmt."</td>";
$HTML_output.="<td>".$max_call_length_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_call_length)/$max_avg_call_length)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_call_length), $max_avg_call_length))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
}
$HTML_output.="<tr class='export_row'>";
# $HTML_output.="<td colspan='8' class='export_row_cell'>"._QXZ("Export as")."...<a href=\"".$PHP_SELF."?download_rpt=answered_call_distribution\" title=\"Export as a CSV file\" class=\"uk-icon\">CSV</a></td>";
@@ -344,7 +346,7 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$total_date_calls_answered=($answered_calls_array["$call_date_key"]["inbound"]+$answered_calls_array["$call_date_key"]["outbound"]);
$total_date_calls_unanswered=($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"]);
$avg_wait_time=round($answered_calls_array["$call_date_key"]["total_wait"]/$total_date_calls_answered);
$avg_wait_time=round(MathZDC($answered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_answered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", $avg_wait_time);
$min_wait_time_fmt=($answered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_wait_time"]);
@@ -353,15 +355,15 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_answered), $total_answered_calls))."%'></td>";
$HTML_output.="<td>".$avg_wait_time_fmt."</td>";
$HTML_output.="<td>".$min_wait_time_fmt."</td>";
$HTML_output.="<td>".$max_wait_time_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_wait_time)/$max_avg_wait_time)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_wait_time), $max_avg_wait_time))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
}
$HTML_output.="<tr class='export_row'>";
# $HTML_output.="<td colspan='8' class='export_row_cell'>"._QXZ("Export as")."...<a href=\"".$PHP_SELF."?download_rpt=answered_call_wait_time\" title=\"Export as a CSV file\" class=\"uk-icon\">CSV</a></td>";
@@ -397,7 +399,7 @@ $CSV_output["unanswered_call_wait_time"]="\""._QXZ("Day")."\",\""._QXZ("Num")."\
$max_avg_wait_time=0;
foreach ($calls_array as $call_date_key => $call_date_data)
{
$avg_wait_time=round($unanswered_calls_array["$call_date_key"]["total_wait"]/($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"]));
$avg_wait_time=round(MathZDC($unanswered_calls_array["$call_date_key"]["total_wait"], ($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"])));
# print $unanswered_calls_array["$call_date_key"]["total_wait"]."/".($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"])."\n";
$unanswered_calls_array["$call_date_key"]["avg_wait_time"]=$avg_wait_time+0;
if ($max_avg_wait_time<$avg_wait_time) {$max_avg_wait_time=$avg_wait_time;}
@@ -409,7 +411,7 @@ foreach ($unanswered_calls_array as $call_date_key => $call_date_data)
$total_date_calls_answered=($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"]);
$total_date_calls_unanswered=($unanswered_calls_array["$call_date_key"]["inbound"]+$unanswered_calls_array["$call_date_key"]["outbound"]);
$avg_wait_time=round($unanswered_calls_array["$call_date_key"]["total_wait"]/$total_date_calls_unanswered);
$avg_wait_time=round(MathZDC($unanswered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_unanswered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", $avg_wait_time);
$min_wait_time_fmt=($unanswered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($unanswered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $unanswered_calls_array["$call_date_key"]["min_wait_time"]);
@@ -418,15 +420,15 @@ foreach ($unanswered_calls_array as $call_date_key => $call_date_data)
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_unanswered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_unanswered)/$total_unanswered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_unanswered)/$total_unanswered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls))."%'></td>";
$HTML_output.="<td>".$avg_wait_time_fmt."</td>";
$HTML_output.="<td>".$min_wait_time_fmt."</td>";
$HTML_output.="<td>".$max_wait_time_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_wait_time)/$max_avg_wait_time)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_wait_time), $max_avg_wait_time))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["unanswered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_unanswered."\",\"".sprintf("%.1f", ((100*$total_date_calls_unanswered)/$total_unanswered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$CSV_output["unanswered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_unanswered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls)))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
}
$HTML_output.="<tr class='export_row'>";
@@ -461,25 +463,25 @@ $HTML_output.="</tr>\n";
$CSV_output["sales_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Human ans. conv")."\",\""._QXZ("Customer cont. conv")."\",\""._QXZ("Sales")."\",\"\",\"\",\""._QXZ("Human answers")."\",\""._QXZ("Customer contacts")."\",\"\",\"\"\n";
#print_r($calls_array);
$max_day_sales=max(array_column($calls_array, 'sales'));
$max_day_customer_contacts=max(array_column($calls_array, 'customer_contacts'));
$max_day_sales=(count(array_column($calls_array, 'sales'))>0 ? max(array_column($calls_array, 'sales')) : 0);
$max_day_customer_contacts=(count(array_column($calls_array, 'customer_contacts'))>0 ? max(array_column($calls_array, 'customer_contacts')) : 0);
#print "<BR>$max_day_sales<BR>\n";
foreach ($calls_array as $call_date_key => $data)
{
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["sales"])/$data["human_answered"]))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["sales"])/$data["customer_contacts"]))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["sales"]), $data["human_answered"])))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["sales"]), $data["customer_contacts"])))." %</td>";
$HTML_output.="<td>".($data["sales"]+0)."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["sales"])/$total_sales))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["sales"])/$max_day_sales)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["sales"]), $total_sales)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["sales"]), $max_day_sales))."%'></td>";
$HTML_output.="<td>".$data["human_answered"]."</td>";
$HTML_output.="<td>".$data["customer_contacts"]."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["customer_contacts"])/$total_customer_contacts))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["customer_contacts"])/$max_day_customer_contacts)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["customer_contacts"]), $total_customer_contacts)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["customer_contacts"]), $max_day_customer_contacts))."%'></td>";
$HTML_output.="</tr>\n";
$CSV_output["sales_per_day"].="\"$call_date_key\",\"".sprintf("%.1f", ((100*$data["sales"])/$data["human_answered"]))." %\",\"".sprintf("%.1f", ((100*$data["sales"])/$data["customer_contacts"]))." %\",\"".($data["sales"]+0)."\",\"".sprintf("%.1f", ((100*$data["sales"])/$total_sales))." %\",\"\",\"".$data["human_answered"]."\",\"".$data["customer_contacts"]."\",\"".sprintf("%.1f", ((100*$data["customer_contacts"])/$total_customer_contacts))." %\",\"\"\n";
$CSV_output["sales_per_day"].="\"$call_date_key\",\"".sprintf("%.1f", (MathZDC((100*$data["sales"]), $data["human_answered"])))." %\",\"".sprintf("%.1f", (MathZDC((100*$data["sales"]), $data["customer_contacts"])))." %\",\"".($data["sales"]+0)."\",\"".sprintf("%.1f", (MathZDC((100*$data["sales"]), $total_sales)))." %\",\"\",\"".$data["human_answered"]."\",\"".$data["customer_contacts"]."\",\"".sprintf("%.1f", (MathZDC((100*$data["customer_contacts"]), $total_customer_contacts)))." %\",\"\"\n";
}
$HTML_output.="<tr class='export_row'>";
# $HTML_output.="<td colspan='10' class='export_row_cell'>"._QXZ("Export as")."...<a href=\"".$PHP_SELF."?download_rpt=sales_per_day\" title=\"Export as a CSV file\" class=\"uk-icon\">CSV</a></td>";
@@ -509,17 +511,17 @@ $HTML_output.="</tr>\n";
### Removed Coverage column before Steps 5/19/22 - not needed
$CSV_output["queue_length_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Avg")."\",\"...\",\""._QXZ("Min")."\",\""._QXZ("Max")."\",\"...\",\""._QXZ("Average Sum of Queue Positions Per Hour")."\"\n";
$max_call_position=max(array_column($queue_array, 'max_queue_position'));
$max_avg_position=max(array_column($queue_array, 'avg_position'));
$max_call_position=(count(array_column($queue_array, 'max_queue_position'))>0 ? max(array_column($queue_array, 'max_queue_position')) : 0);
$max_avg_position=(count(array_column($queue_array, 'avg_position'))>0 ? max(array_column($queue_array, 'avg_position')) : 0);
foreach ($queue_array as $call_date_key => $data)
{
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date"]["avg_position"])."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["avg_position"])/$max_avg_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$queue_array["$call_date_key"]["avg_position"]), $max_avg_position))."%'></td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["min_queue_position"]."</td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["max_queue_position"]."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["max_queue_position"])/$max_call_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$queue_array["$call_date_key"]["max_queue_position"]), $max_call_position))."%'></td>";
### $HTML_output.="<td>100% **</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date_key"]["total_queue"]/24)."</td>"; # Always seems to be 24 hours for the date - even when I ran starting at 8am.
$HTML_output.="</tr>\n";
@@ -554,13 +556,13 @@ foreach ($user_array as $call_date_key => $users_that_day)
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".count($users_that_day)."</td>";
$HTML_output.="<td>".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))."%'></td>";
$HTML_output.="</tr>\n";
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %\",\"\"\n";
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))." %\",\"\"\n";
# print "agents for $call_date_key: ".count($users_that_day)."\n";
@@ -618,6 +620,7 @@ $HTML_output.="</tr>\n";
$CSV_output["inclusive_sla_per_day"].="\n";
$svc_lvl_row=array();
foreach ($calls_array as $call_date_key => $data)
{
$svc_lvl_stmt="select $SLA_query from vicidial_closer_log where call_date>='".$call_date_key." $start_time' and call_date<='".$call_date_key." $end_time' $and_vicidial_closer_log_SQL and (user!='VDCL')"; # and campaign_id in ($ingroup_str) and user in ('VDCL', $user_str)
@@ -640,8 +643,8 @@ foreach ($calls_array as $call_date_key => $data)
for ($f=0; $f<count($svc_lvl_row); $f++)
{
$svc_lvl_row[$f]+=$answered_calls_array["$call_date_key"]["outbound"];
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$svc_lvl_row[$f])/$answered_calls))." %</td>";
$CSV_output["inclusive_sla_per_day"].=",\"".sprintf("%.1f", ((100*$svc_lvl_row[$f])/$answered_calls))." %\"";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$svc_lvl_row[$f]), $answered_calls)))." %</td>";
$CSV_output["inclusive_sla_per_day"].=",\"".sprintf("%.1f", (MathZDC((100*$svc_lvl_row[$f]), $answered_calls)))." %\"";
}
$HTML_output.="</tr>\n";
+40 -32
View File
@@ -1,10 +1,11 @@
<?php
# VERM_DOW_rpt.inc - Vicidial Enhanced Reporting per-day-of-week report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1623 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
# NANQUE, not an unanswered call?
@@ -114,7 +115,7 @@ for ($q=0; $q<=6; $q++)
$user_array["$key"]=array();
}
$stmt="select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as call_length, uniqueid, queue_seconds as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by day_no";
$stmt="select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, length_in_sec as call_length, uniqueid, '0' as wait_sec, 'O' as direction, '1' as queue_position, lead_id from vicidial_log $vicidial_log_SQL $and_NANQUE_clause $exc_addtl_statuses UNION ALL select dayname(call_date) as cdate, dayofweek(call_date) as day_no, campaign_id, status, user, if(comments='EMAIL', length_in_sec, length_in_sec-queue_seconds) as call_length, uniqueid, if(comments='EMAIL', '0', queue_seconds) as wait_sec, 'I' as direction, queue_position, lead_id from vicidial_closer_log $vicidial_closer_log_SQL $and_NANQUE_clause $exc_addtl_statuses order by day_no";
if ($DB) {$HTML_output.="<B>$stmt</B>";}
# print $stmt."\n";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -233,17 +234,17 @@ while ($row=mysqli_fetch_array($rslt))
### These counts are in here because by definition these SHOULD be answers, but you never know with some morons.
### "Real" campaign_id should have been gotten under the direction clause above
if (in_array($status, $sale_array["$campaign_id"]) || in_array($status, $sale_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $sale_array) && in_array($status, $sale_array["$campaign_id"])) || in_array($status, $sale_array["SYSTEM"]))
{
$calls_array["$call_date"]["sales"]++;
$total_sales++;
}
if (in_array($status, $human_ans_array["$campaign_id"]) || in_array($status, $human_ans_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $human_ans_array) && in_array($status, $human_ans_array["$campaign_id"])) || in_array($status, $human_ans_array["SYSTEM"]))
{
$calls_array["$call_date"]["human_answered"]++;
$total_human_answered++;
}
if (in_array($status, $contact_array["$campaign_id"]) || in_array($status, $contact_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $contact_array) && in_array($status, $contact_array["$campaign_id"])) || in_array($status, $contact_array["SYSTEM"]))
{
$calls_array["$call_date"]["customer_contacts"]++;
$total_customer_contacts++;
@@ -274,7 +275,7 @@ while ($row=mysqli_fetch_array($rslt))
# Queue array
$queue_array["$call_date"]["total_calls"]++;
$queue_array["$call_date"]["total_queue"]+=$queue_position;
$queue_array["$call_date"]["avg_position"]=($queue_array["$call_date"]["total_queue"]/$queue_array["$call_date"]["total_calls"]);
$queue_array["$call_date"]["avg_position"]=(MathZDC($queue_array["$call_date"]["total_queue"], $queue_array["$call_date"]["total_calls"]));
# Min/max queue
if (!$queue_array["$call_date"]["min_queue_position"] || $queue_position<$queue_array["$call_date"]["min_queue_position"])
{
@@ -332,21 +333,23 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$avg_call_length=round(MathZDC($answered_calls_array["$call_date_key"]["total_length"], $total_date_calls_answered));
$avg_call_length_fmt=($avg_call_length>=3600 ? floor($avg_call_length/3600).":" : "").gmdate("i:s", $avg_call_length);
$answered_calls_array["$call_date_key"]["min_call_length"]+=0;
$answered_calls_array["$call_date_key"]["max_call_length"]+=0;
$min_call_length_fmt=($answered_calls_array["$call_date_key"]["min_call_length"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_call_length"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_call_length"]);
$max_call_length_fmt=($answered_calls_array["$call_date_key"]["max_call_length"]>=3600 ? floor($answered_calls_array["$call_date_key"]["max_call_length"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["max_call_length"]);
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_answered), $total_answered_calls))."%'></td>";
$HTML_output.="<td>".$avg_call_length_fmt."</td>";
$HTML_output.="<td>".$min_call_length_fmt."</td>";
$HTML_output.="<td>".$max_call_length_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_call_length)/$max_avg_call_length)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_call_length), $max_avg_call_length))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
$answered_call_distribution_graph_labels.="\"$call_date_key\",";
$answered_call_distribution_graph_data1.="\"$total_date_calls_answered\",";
@@ -420,21 +423,23 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$avg_wait_time=round(MathZDC($answered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_answered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", $avg_wait_time);
$answered_calls_array["$call_date_key"]["min_wait_time"]+=0;
$answered_calls_array["$call_date_key"]["max_wait_time"]+=0;
$min_wait_time_fmt=($answered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_wait_time"]);
$max_wait_time_fmt=($answered_calls_array["$call_date_key"]["max_wait_time"]>=3600 ? floor($answered_calls_array["$call_date_key"]["max_wait_time"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["max_wait_time"]);
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_answered), $total_answered_calls))."%'></td>";
$HTML_output.="<td>".$avg_wait_time_fmt."</td>";
$HTML_output.="<td>".$min_wait_time_fmt."</td>";
$HTML_output.="<td>".$max_wait_time_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_wait_time)/$max_avg_wait_time)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_wait_time), $max_avg_wait_time))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$answered_call_wait_time_graph_labels.="\"$call_date_key\",";
$answered_call_wait_time_graph_data1.="\"$total_date_calls_answered\",";
@@ -509,21 +514,23 @@ foreach ($unanswered_calls_array as $call_date_key => $call_date_data)
$avg_wait_time=round(MathZDC($unanswered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_unanswered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", $avg_wait_time);
$unanswered_calls_array["$call_date_key"]["min_wait_time"]+=0;
$unanswered_calls_array["$call_date_key"]["max_wait_time"]+=0;
$min_wait_time_fmt=($unanswered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($unanswered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $unanswered_calls_array["$call_date_key"]["min_wait_time"]);
$max_wait_time_fmt=($unanswered_calls_array["$call_date_key"]["max_wait_time"]>=3600 ? floor($unanswered_calls_array["$call_date_key"]["max_wait_time"]/3600).":" : "").gmdate("i:s", $unanswered_calls_array["$call_date_key"]["max_wait_time"]);
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_unanswered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_unanswered)/$total_unanswered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_unanswered)/$total_unanswered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls))."%'></td>";
$HTML_output.="<td>".$avg_wait_time_fmt."</td>";
$HTML_output.="<td>".$min_wait_time_fmt."</td>";
$HTML_output.="<td>".$max_wait_time_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_wait_time)/$max_avg_wait_time)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$avg_wait_time), $max_avg_wait_time))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["unanswered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_unanswered."\",\"".sprintf("%.1f", ((100*$total_date_calls_unanswered)/$total_unanswered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$CSV_output["unanswered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_unanswered."\",\"".sprintf("%.1f", (MathZDC((100*$total_date_calls_unanswered), $total_unanswered_calls)))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$unanswered_call_wait_time_graph_labels.="\"$call_date_key\",";
$unanswered_call_wait_time_graph_data1.="\"$total_date_calls_unanswered\",";
@@ -573,8 +580,8 @@ $HTML_output.="</tr>\n";
$CSV_output["sales_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Human ans. conv")."\",\""._QXZ("Customer cont. conv")."\",\""._QXZ("Sales")."\",\"\",\"\",\""._QXZ("Human answers")."\",\""._QXZ("Customer contacts")."\",\"\",\"\"\n";
#print_r($calls_array);
$max_day_sales=max(array_column($calls_array, 'sales'));
$max_day_customer_contacts=max(array_column($calls_array, 'customer_contacts'));
$max_day_sales=(count(array_column($calls_array, 'sales'))>0 ? max(array_column($calls_array, 'sales')) : 0);
$max_day_customer_contacts=(count(array_column($calls_array, 'customer_contacts'))>0 ? max(array_column($calls_array, 'customer_contacts')) : 0);
#print "<BR>$max_day_sales<BR>\n";
foreach ($calls_array as $call_date_key => $data)
{
@@ -583,15 +590,15 @@ foreach ($calls_array as $call_date_key => $data)
$HTML_output.="<td>".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["human_answered"]))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["customer_contacts"]))." %</td>";
$HTML_output.="<td>".($data["sales"]+0)."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["sales"])/$total_sales))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["sales"])/$max_day_sales)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["sales"]), $total_sales)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["sales"]), $max_day_sales))."%'></td>";
$HTML_output.="<td>".$data["human_answered"]."</td>";
$HTML_output.="<td>".$data["customer_contacts"]."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$data["customer_contacts"])/$total_customer_contacts))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["customer_contacts"])/$max_day_customer_contacts)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$data["customer_contacts"]), $total_customer_contacts)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["customer_contacts"]), $max_day_customer_contacts))."%'></td>";
$HTML_output.="</tr>\n";
$CSV_output["sales_per_day"].="\"$call_date_key\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["human_answered"]))." %\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["customer_contacts"]))." %\",\"".($data["sales"]+0)."\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $total_sales))." %\",\"\",\"".$data["human_answered"]."\",\"".$data["customer_contacts"]."\",\"".sprintf("%.1f", ((100*$data["customer_contacts"])/$total_customer_contacts))." %\",\"\"\n";
$CSV_output["sales_per_day"].="\"$call_date_key\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["human_answered"]))." %\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $data["customer_contacts"]))." %\",\"".($data["sales"]+0)."\",\"".sprintf("%.1f", MathZDC((100*$data["sales"]), $total_sales))." %\",\"\",\"".$data["human_answered"]."\",\"".$data["customer_contacts"]."\",\"".sprintf("%.1f", (MathZDC((100*$data["customer_contacts"]), $total_customer_contacts)))." %\",\"\"\n";
}
$HTML_output.="<tr class='export_row'>";
# $HTML_output.="<td colspan='10' class='export_row_cell'>"._QXZ("Export as")."...<a href=\"".$PHP_SELF."?download_rpt=sales_per_day\" title=\"Export as a CSV file\" class=\"uk-icon\">CSV</a></td>";
@@ -621,17 +628,17 @@ $HTML_output.="</tr>\n";
### Removed Coverage column before Steps 5/19/22 - not needed
$CSV_output["queue_length_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Avg")."\",\"...\",\""._QXZ("Min")."\",\""._QXZ("Max")."\",\"...\",\""._QXZ("Average Sum of Queue Positions Per Hour")."\"\n";
$max_call_position=max(array_column($queue_array, 'max_queue_position'));
$max_avg_position=max(array_column($queue_array, 'avg_position'));
$max_call_position=(count(array_column($queue_array, 'max_queue_position'))>0 ? max(array_column($queue_array, 'max_queue_position')) : 0);
$max_avg_position=(count(array_column($queue_array, 'avg_position'))>0 ? max(array_column($queue_array, 'avg_position')) : 0);
foreach ($queue_array as $call_date_key => $data)
{
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date_key"]["avg_position"])."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["avg_position"])/$max_avg_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$queue_array["$call_date_key"]["avg_position"]), $max_avg_position))."%'></td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["min_queue_position"]."</td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["max_queue_position"]."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["max_queue_position"])/$max_call_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$queue_array["$call_date_key"]["max_queue_position"]), $max_call_position))."%'></td>";
### $HTML_output.="<td>100% **</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date_key"]["total_queue"]/24)."</td>"; # Always seems to be 24 hours for the date - even when I ran starting at 8am.
$HTML_output.="</tr>\n";
@@ -666,13 +673,13 @@ foreach ($user_array as $call_date_key => $users_that_day)
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".count($users_that_day)."</td>";
$HTML_output.="<td>".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))."%'></td>";
$HTML_output.="</tr>\n";
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %\",\"\"\n";
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))." %\",\"\"\n";
# print "agents for $call_date_key: ".count($users_that_day)."\n";
@@ -730,6 +737,7 @@ $HTML_output.="</tr>\n";
$CSV_output["inclusive_sla_per_day"].="\n";
$svc_lvl_row=array();
foreach ($calls_array as $call_date_key => $data)
{
$svc_lvl_stmt="select $SLA_query from vicidial_closer_log where call_date>='$start_date $start_time' and call_date<='$end_date $end_time' and dayname(call_date)='$call_date_key' $and_vicidial_closer_log_SQL and (user!='VDCL')"; # and campaign_id in ($ingroup_str) and user in ('VDCL', $user_str)
+30 -23
View File
@@ -1,11 +1,12 @@
<?php
# VERM_HOUR_rpt.inc - Vicidial Enhanced Reporting per-hour report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1620 - First build
# 230106-1311 - Added page flushing to show page load progress
# 240801-1130 - Code updates for PHP8 compatibility
#
# NANQUE, not an unanswered call?
@@ -250,17 +251,17 @@ while ($row=mysqli_fetch_array($rslt))
### These counts are in here because by definition these SHOULD be answers, but you never know with some morons.
### "Real" campaign_id should have been gotten under the direction clause above
if (in_array($status, $sale_array["$campaign_id"]) || in_array($status, $sale_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $sale_array) && in_array($status, $sale_array["$campaign_id"])) || in_array($status, $sale_array["SYSTEM"]))
{
$calls_array["$call_date"]["sales"]++;
$total_sales++;
}
if (in_array($status, $human_ans_array["$campaign_id"]) || in_array($status, $human_ans_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $human_ans_array) && in_array($status, $human_ans_array["$campaign_id"])) || in_array($status, $human_ans_array["SYSTEM"]))
{
$calls_array["$call_date"]["human_answered"]++;
$total_human_answered++;
}
if (in_array($status, $contact_array["$campaign_id"]) || in_array($status, $contact_array["SYSTEM"]))
if ((array_key_exists("$campaign_id", $contact_array) && in_array($status, $contact_array["$campaign_id"])) || in_array($status, $contact_array["SYSTEM"]))
{
$calls_array["$call_date"]["customer_contacts"]++;
$total_customer_contacts++;
@@ -291,7 +292,7 @@ while ($row=mysqli_fetch_array($rslt))
# Queue array
$queue_array["$call_date"]["total_calls"]++;
$queue_array["$call_date"]["total_queue"]+=$queue_position;
$queue_array["$call_date"]["avg_position"]=($queue_array["$call_date"]["total_queue"]/$queue_array["$call_date"]["total_calls"]);
$queue_array["$call_date"]["avg_position"]=MathZDC($queue_array["$call_date"]["total_queue"], $queue_array["$call_date"]["total_calls"]);
# Min/max queue
if (!$queue_array["$call_date"]["min_queue_position"] || $queue_position<$queue_array["$call_date"]["min_queue_position"])
{
@@ -349,21 +350,23 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$avg_call_length=round(MathZDC($answered_calls_array["$call_date_key"]["total_length"], $total_date_calls_answered));
$avg_call_length_fmt=($avg_call_length>=3600 ? floor($avg_call_length/3600).":" : "").gmdate("i:s", floor($avg_call_length));
$answered_calls_array["$call_date_key"]["min_call_length"]+=0;
$answered_calls_array["$call_date_key"]["max_call_length"]+=0;
$min_call_length_fmt=($answered_calls_array["$call_date_key"]["min_call_length"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_call_length"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_call_length"]);
$max_call_length_fmt=($answered_calls_array["$call_date_key"]["max_call_length"]>=3600 ? floor($answered_calls_array["$call_date_key"]["max_call_length"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["max_call_length"]);
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC((100*$total_date_calls_answered), $total_answered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$total_date_calls_answered), $total_answered_calls)."%'></td>";
$HTML_output.="<td>".$avg_call_length_fmt."</td>";
$HTML_output.="<td>".$min_call_length_fmt."</td>";
$HTML_output.="<td>".$max_call_length_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_call_length)/$max_avg_call_length)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$avg_call_length), $max_avg_call_length)."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
$CSV_output["answered_call_distribution"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", MathZDC((100*$total_date_calls_answered), $total_answered_calls))." %\",\"\",\"".$avg_call_length_fmt."\",\"".$min_call_length_fmt."\",\"".$max_call_length_fmt."\",\"\"\n";
$answered_call_distribution_graph_labels.="\"$call_date_key\",";
$answered_call_distribution_graph_data1.="\"$total_date_calls_answered\",";
@@ -436,21 +439,23 @@ foreach ($answered_calls_array as $call_date_key => $call_date_data)
$avg_wait_time=round(MathZDC($answered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_answered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", floor($avg_wait_time));
$answered_calls_array["$call_date_key"]["min_wait_time"]+=0;
$answered_calls_array["$call_date_key"]["max_wait_time"]+=0;
$min_wait_time_fmt=($answered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($answered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["min_wait_time"]);
$max_wait_time_fmt=($answered_calls_array["$call_date_key"]["max_wait_time"]>=3600 ? floor($answered_calls_array["$call_date_key"]["max_wait_time"]/3600).":" : "").gmdate("i:s", $answered_calls_array["$call_date_key"]["max_wait_time"]);
$HTML_output.="<tr>";
$HTML_output.="<td>".$call_date_key."</td>";
$HTML_output.="<td>".$total_date_calls_answered."</td>";
$HTML_output.="<td>".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$total_date_calls_answered)/$total_answered_calls)."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", MathZDC((100*$total_date_calls_answered), $total_answered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$total_date_calls_answered), $total_answered_calls)."%'></td>";
$HTML_output.="<td>".$avg_wait_time_fmt."</td>";
$HTML_output.="<td>".$min_wait_time_fmt."</td>";
$HTML_output.="<td>".$max_wait_time_fmt."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$avg_wait_time)/$max_avg_wait_time)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$avg_wait_time), $max_avg_wait_time)."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", ((100*$total_date_calls_answered)/$total_answered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$CSV_output["answered_call_wait_time"].="\"".$call_date_key."\",\"".$total_date_calls_answered."\",\"".sprintf("%.1f", MathZDC((100*$total_date_calls_answered), $total_answered_calls))." %\",\"\",\"".$avg_wait_time_fmt."\",\"".$min_wait_time_fmt."\",\"".$max_wait_time_fmt."\",\"\"\n";
$answered_call_wait_time_graph_labels.="\"$call_date_key\",";
$answered_call_wait_time_graph_data1.="\"$total_date_calls_answered\",";
@@ -525,6 +530,8 @@ foreach ($unanswered_calls_array as $call_date_key => $call_date_data)
$avg_wait_time=round(MathZDC($unanswered_calls_array["$call_date_key"]["total_wait"], $total_date_calls_unanswered));
$avg_wait_time_fmt=($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", floor($avg_wait_time));
$unanswered_calls_array["$call_date_key"]["min_wait_time"]+=0;
$unanswered_calls_array["$call_date_key"]["max_wait_time"]+=0;
$min_wait_time_fmt=($unanswered_calls_array["$call_date_key"]["min_wait_time"]>=3600 ? floor($unanswered_calls_array["$call_date_key"]["min_wait_time"]/3600).":" : "").gmdate("i:s", $unanswered_calls_array["$call_date_key"]["min_wait_time"]);
$max_wait_time_fmt=($unanswered_calls_array["$call_date_key"]["max_wait_time"]>=3600 ? floor($unanswered_calls_array["$call_date_key"]["max_wait_time"]/3600).":" : "").gmdate("i:s", $unanswered_calls_array["$call_date_key"]["max_wait_time"]);
@@ -589,8 +596,8 @@ $HTML_output.="</tr>\n";
$CSV_output["sales_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Human ans. conv")."\",\""._QXZ("Customer cont. conv")."\",\""._QXZ("Sales")."\",\"\",\"\",\""._QXZ("Human answers")."\",\""._QXZ("Customer contacts")."\",\"\",\"\"\n";
#print_r($calls_array);
$max_day_sales=max(array_column($calls_array, 'sales'));
$max_day_customer_contacts=max(array_column($calls_array, 'customer_contacts'));
$max_day_sales=(count(array_column($calls_array, 'sales'))>0 ? max(array_column($calls_array, 'sales')) : 0);
$max_day_customer_contacts=(count(array_column($calls_array, 'customer_contacts'))>0 ? max(array_column($calls_array, 'customer_contacts')) : 0);
#print "<BR>$max_day_sales<BR>\n";
foreach ($calls_array as $call_date_key => $data)
{
@@ -637,17 +644,17 @@ $HTML_output.="</tr>\n";
### Removed Coverage column before Steps 5/19/22 - not needed
$CSV_output["queue_length_per_day"]="\""._QXZ("Day")."\",\""._QXZ("Avg")."\",\"...\",\""._QXZ("Min")."\",\""._QXZ("Max")."\",\"...\",\""._QXZ("Average Sum of Queue Positions Per Hour")."\"\n";
$max_call_position=max(array_column($queue_array, 'max_queue_position'));
$max_avg_position=max(array_column($queue_array, 'avg_position'));
$max_call_position=(count(array_column($queue_array, 'max_queue_position'))>0 ? max(array_column($queue_array, 'max_queue_position')) : 0);
$max_avg_position=(count(array_column($queue_array, 'avg_position'))>0 ? max(array_column($queue_array, 'avg_position')) : 0);
foreach ($queue_array as $call_date_key => $data)
{
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date_key"]["avg_position"])."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["avg_position"])/$max_avg_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$queue_array["$call_date_key"]["avg_position"]), $max_avg_position)."%'></td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["min_queue_position"]."</td>";
$HTML_output.="<td>".$queue_array["$call_date_key"]["max_queue_position"]."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$queue_array["$call_date_key"]["max_queue_position"])/$max_call_position)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".MathZDC((100*$queue_array["$call_date_key"]["max_queue_position"]), $max_call_position)."%'></td>";
### $HTML_output.="<td>100% **</td>";
$HTML_output.="<td>".sprintf("%.1f", $queue_array["$call_date_key"]["total_queue"]/24)."</td>"; # Always seems to be 24 hours for the date - even when I ran starting at 8am.
$HTML_output.="</tr>\n";
@@ -682,13 +689,13 @@ foreach ($user_array as $call_date_key => $users_that_day)
$HTML_output.="<tr>";
$HTML_output.="<td>$call_date_key</td>";
$HTML_output.="<td>".count($users_that_day)."</td>";
$HTML_output.="<td>".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))."%'></td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC(100*count($users_that_day), $total_distinct_users_per_date)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".sprintf("%.1f", MathZDC(100*count($users_that_day), $total_distinct_users_per_date))."%'></td>";
$HTML_output.="</tr>\n";
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", (100*count($users_that_day)/$total_distinct_users_per_date))." %\",\"\"\n";
$CSV_output["schedule_adherence_per_day"].="\"$call_date_key\",\"".count($users_that_day)."\",\"".sprintf("%.1f", MathZDC(100*count($users_that_day), $total_distinct_users_per_date))." %\",\"\"\n";
# print "agents for $call_date_key: ".count($users_that_day)."\n";
@@ -781,7 +788,7 @@ foreach ($calls_array as $call_date_key => $data)
}
$HTML_output.="<tr class='export_row'>";
# $HTML_output.="<td colspan='".(4+count($svc_lvl_row))."' class='export_row_cell'>"._QXZ("Export as")."...<a href=\"".$PHP_SELF."?download_rpt=inclusive_sla_per_day\" title=\"Export as a CSV file\" class=\"uk-icon\">CSV</a></td>";
$HTML_output.="<td class='export_row_cell' colspan='".(4+count($svc_lvl_row))."'>"._QXZ("Export as")."...<input type='button' class='download_button' onClick=\"DownloadReport('HOUR', 'inclusive_sla_per_day')\" title=\"Export as a CSV file\" value='CSV'></td>";
$HTML_output.="<td class='export_row_cell' colspan='".(4+(is_array($svc_lvl_row) ? count($svc_lvl_row) : 0))."'>"._QXZ("Export as")."...<input type='button' class='download_button' onClick=\"DownloadReport('HOUR', 'inclusive_sla_per_day')\" title=\"Export as a CSV file\" value='CSV'></td>";
$HTML_output.="</tr>";
$HTML_output.="</table>";
+14 -13
View File
@@ -1,11 +1,12 @@
<?php
# VERM_IVR_rpt.inc - Vicidial Enhanced Reporting IVR report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1619 - First build
# 230106-1328 - Added page flushing to show page load progress
# 240801-1130 - Code updates for PHP8 compatibility
#
if (isset($_GET["page_no"])) {$page_no=$_GET["page_no"];}
@@ -262,14 +263,14 @@ foreach ($ivr_data as $ivr_path => $data)
$HTML_output.="<td>".$ivr_value."</td>";
$HTML_output.="<td>".$data["calls"]."</td>";
$HTML_output.="<td>".$data["goals"]."</td>";
$HTML_output.="<td>".sprintf("%.1f", (100*($data["calls"]-$data["hangups"])/$data["calls"]))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC(100*($data["calls"]-$data["hangups"]), $data["calls"])))." %</td>";
$HTML_output.="<td>".$data["hangups"]."</td>";
$HTML_output.="<td>".sprintf("%.1f", (100*$data["hangups"]/$data["calls"]))." %</td>";
$HTML_output.="<td>".sprintf("%.1f", (MathZDC(100*$data["hangups"], $data["calls"])))." %</td>";
$HTML_output.="</tr>\n";
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
$CSV_output["ivr_traversal"].="\"".$CSV_ivr_value."\",\"".$data["calls"]."\",\"".($data["calls"]-$data["hangups"])."\",\"".sprintf("%.1f", (100*($data["calls"]-$data["hangups"])/$data["calls"]))." %\",\"".$data["hangups"]."\",\"".sprintf("%.1f", (100*$data["hangups"]/$data["calls"]))." %\"\n";
$CSV_output["ivr_traversal"].="\"".$CSV_ivr_value."\",\"".$data["calls"]."\",\"".($data["calls"]-$data["hangups"])."\",\"".sprintf("%.1f", (MathZDC(100*($data["calls"]-$data["hangups"]), $data["calls"])))." %\",\"".$data["hangups"]."\",\"".sprintf("%.1f", (MathZDC(100*$data["hangups"], $data["calls"])))." %\"\n";
if(preg_match('/\-TOTAL$/', $ivr_path)) {unset($ivr_data["$ivr_path"]);} # Remove total, don't need anymore
}
@@ -317,9 +318,9 @@ foreach ($ivr_data as $comment_d => $data)
if ($prev_base_path!=$base_path)
{
# Calculate totals for base path
$total_success_rate=sprintf("%.1f", (100*(($total_prompt_calls-$total_prompt_hangups)/$total_prompt_calls)));
$total_hangup_rate=sprintf("%.1f", (100*($total_prompt_hangups/$total_prompt_calls)));
$total_average_sec=round($total_prompt_time/$total_prompt_calls);
$total_success_rate=sprintf("%.1f", (100*MathZDC(($total_prompt_calls-$total_prompt_hangups), $total_prompt_calls)));
$total_hangup_rate=sprintf("%.1f", (100*MathZDC($total_prompt_hangups, $total_prompt_calls)));
$total_average_sec=round(MathZDC($total_prompt_time, $total_prompt_calls));
$base_average_time=($total_average_sec>=3600 ? intval(floor($total_average_sec/3600)).date(":i:s", $total_average_sec) : intval(date("i", $total_average_sec)).":".date("s", $total_average_sec));
$base_total_time=($total_prompt_time>=3600 ? intval(floor($total_prompt_time/3600)).date(":i:s", $total_prompt_time) : intval(date("i", $total_prompt_time)).":".date("s", $total_prompt_time));
$base_minimum_time=($total_minimum_time>=3600 ? intval(floor($total_minimum_time/3600)).date(":i:s", $total_minimum_time) : intval(date("i", $total_minimum_time)).":".date("s", $total_minimum_time));
@@ -359,14 +360,14 @@ foreach ($ivr_data as $comment_d => $data)
$total_maximum_time=0;
}
$average_sec=round($data["time"]/$data["calls"]);
$average_sec=round(MathZDC($data["time"], $data["calls"]));
$average_time=($average_sec>=3600 ? intval(floor($average_sec/3600)).date(":i:s", $average_sec) : intval(date("i", $average_sec)).":".date("s", $average_sec));
$total_time=($data["time"]>=3600 ? intval(floor($data["time"]/3600)).date(":i:s", $data["time"]) : intval(date("i", $data["time"])).":".date("s", $data["time"]));
$minimum_time=($data["minimum_time"]>=3600 ? intval(floor($data["minimum_time"]/3600)).date(":i:s", $data["minimum_time"]) : intval(date("i", $data["minimum_time"])).":".date("s", $data["minimum_time"]));
$maximum_time=($data["maximum_time"]>=3600 ? intval(floor($data["maximum_time"]/3600)).date(":i:s", $data["maximum_time"]) : intval(date("i", $data["maximum_time"])).":".date("s", $data["maximum_time"]));
$success_rate=sprintf("%.1f", (100*(($data["calls"]-$data["hangups"])/$data["calls"])));
$hangup_rate=sprintf("%.1f", (100*($data["hangups"]/$data["calls"])));
$success_rate=sprintf("%.1f", (100*(MathZDC(($data["calls"]-$data["hangups"]), $data["calls"]))));
$hangup_rate=sprintf("%.1f", (100*(MathZDC($data["hangups"], $data["calls"]))));
#$traversal_outputs.=" - $selection -> ".$data["calls"].", ".($data["calls"]-$data["hangups"]).", $success_rate %, ".$data["hangups"].", $hangup_rate % \n";
#$CSV_time_outputs.=" - $selection -> ".$data["calls"].", $average_time, $total_time, $minimum_time, $maximum_time\n";
$HTML_datarows.="<tr class='standard_font_small'><td>&nbsp;#&nbsp; $selection</td><td>".$data["calls"]."</td><td>$average_time</td><td>$total_time</td><td>$minimum_time</td><td>$maximum_time</td></tr>\n";
@@ -382,7 +383,7 @@ foreach ($ivr_data as $comment_d => $data)
}
}
$total_average_sec=round($total_prompt_time/$total_prompt_calls);
$total_average_sec=round(MathZDC($total_prompt_time, $total_prompt_calls));
$base_average_time=($total_average_sec>=3600 ? intval(floor($total_average_sec/3600)).date(":i:s", $total_average_sec) : intval(date("i", $total_average_sec)).":".date("s", $total_average_sec));
$base_total_time=($total_prompt_time>=3600 ? intval(floor($total_prompt_time/3600)).date(":i:s", $total_prompt_time) : intval(date("i", $total_prompt_time)).":".date("s", $total_prompt_time));
$base_minimum_time=($total_minimum_time>=3600 ? intval(floor($total_minimum_time/3600)).date(":i:s", $total_minimum_time) : intval(date("i", $total_minimum_time)).":".date("s", $total_minimum_time));
@@ -449,7 +450,7 @@ foreach ($path_data as $goal => $path)
$final_key_path=preg_replace('/ \=\> $/', "", $final_key_path);
$CSV_final_key_path=$final_key_path;
$average_sec=round($data["time"]/$data["calls"]);
$average_sec=round(MathZDC($data["time"], $data["calls"]));
$average_time=($average_sec>=3600 ? intval(floor($average_sec/3600)).date(":i:s", $average_sec) : intval(date("i", $average_sec)).":".date("s", $average_sec));
$minimum_time=($data["minimum_time"]>=3600 ? intval(floor($data["minimum_time"]/3600)).date(":i:s", $data["minimum_time"]) : intval(date("i", $data["minimum_time"])).":".date("s", $data["minimum_time"]));
$maximum_time=($data["maximum_time"]>=3600 ? intval(floor($data["maximum_time"]/3600)).date(":i:s", $data["maximum_time"]) : intval(date("i", $data["maximum_time"])).":".date("s", $data["maximum_time"]));
@@ -621,7 +622,7 @@ $HTML_output.="<input type='hidden' name='sort_ivr_details' id='sort_ivr_details
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
if ($ivr_survey_ingroups_detail && count($ivr_survey_ingroups_detail)>0)
if (is_array($ivr_survey_ingroups_detail) && count($ivr_survey_ingroups_detail)>0)
{
require("VERM_IVR_survey_details.inc");
}
+226 -221
View File
@@ -1,12 +1,13 @@
<?php
# VERM_OUTCOEMS_rpt.inc - Vicidial Enhanced Reporting call outcomes report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1617 - First build
# 230106-1500 - Added page flushing
# 230124-1218 - Updated LookupCall function, added unknown statuses option, outcome status/lagged status overrides
# 240801-1130 - Code updates for PHP8 compatibility
#
# NANQUE, not an unanswered call?
@@ -120,7 +121,6 @@ if (count($val_uniqueid_array)>0 && $atomic_queue_campaigns_str=="") // No OUTB
if ($DB) {$HTML_output.="Statuses:<B>$outcomes_stmt</B><BR>";}
$outcomes_rslt=mysql_to_mysqli($outcomes_stmt, $link);
$outcomes_array=array();
$call_results_array=array();
$call_types_array=array();
@@ -129,229 +129,234 @@ $nonbillable_activities_array=array();
$agent_details_array=array();
$outcomes_per_agent_array=array();
$call_results_total_calls=0;
while ($outcomes_row=mysqli_fetch_array($outcomes_rslt))
if ($outcomes_stmt)
{
$lead_id=$outcomes_row["lead_id"];
$campaign_id=$outcomes_row["campaign_id"];
$status=$outcomes_row["status"];
$user=$outcomes_row["user"];
$pause_code=$outcomes_row["pause_code"];
$pause_sec=$outcomes_row["pause_sec"];
$talk_sec=$outcomes_row["talk_sec"];
$wait_sec=$outcomes_row["wait_sec"];
$dispo_sec=$outcomes_row["dispo_sec"];
$uniqueid=$outcomes_row["uniqueid"];
$comments=$outcomes_row["comments"];
$call_type="Unknown";
$pause_name_key=$campaign_id."-".$pause_code;
$pause_code_name=$pause_code;
$full_name=$fullname_info["$user"];
if (!$agent_details_array["$full_name"])
$outcomes_rslt=mysql_to_mysqli($outcomes_stmt, $link);
while ($outcomes_row=mysqli_fetch_array($outcomes_rslt))
{
$agent_details_array["$full_name"]["available"]=0;
$agent_details_array["$full_name"]["billable"]=0;
$agent_details_array["$full_name"]["nonbillable"]=0;
$agent_details_array["$full_name"]["sales"]=0;
$agent_details_array["$full_name"]["human_answered"]=0;
$agent_details_array["$full_name"]["customer_contacts"]=0;
}
$lead_id=$outcomes_row["lead_id"];
$campaign_id=$outcomes_row["campaign_id"];
$status=$outcomes_row["status"];
$user=$outcomes_row["user"];
$pause_code=$outcomes_row["pause_code"];
$pause_sec=$outcomes_row["pause_sec"];
$talk_sec=$outcomes_row["talk_sec"];
$wait_sec=$outcomes_row["wait_sec"];
$dispo_sec=$outcomes_row["dispo_sec"];
$uniqueid=$outcomes_row["uniqueid"];
$comments=$outcomes_row["comments"];
$call_type="Unknown";
$pause_name_key=$campaign_id."-".$pause_code;
$pause_code_name=$pause_code;
$outcomes_array["total_billable_time"]+=($talk_sec+$wait_sec+$dispo_sec);
$outcomes_array["total_agent_available_time"]+=($talk_sec+$wait_sec+$dispo_sec);
$agent_details_array["$full_name"]["available"]+=($talk_sec+$wait_sec+$dispo_sec);
# Billable/nonbillable activity
if (in_array($pause_code, $billable_pause_codes["$campaign_id"]) || in_array($pause_code, $billable_pause_codes["SYSTEM"]))
{
if ($pause_code_names["$pause_name_key"])
$full_name=$fullname_info["$user"];
if (!$agent_details_array["$full_name"])
{
$pause_code_name=$pause_code_names["$pause_name_key"];
}
$outcomes_array["total_billable_time"]+=$pause_sec;
$outcomes_array["total_agent_billable_activities"]+=$pause_sec;
if (!$billable_activities_array["$pause_code_name"])
{
$billable_activities_array["$pause_code_name"]["n_times"]=0;
$billable_activities_array["$pause_code_name"]["total_time"]=0;
$billable_activities_array["$pause_code_name"]["max"]=0;
$billable_activities_array["$pause_code_name"]["min"]=100000;
}
$billable_activities_array["$pause_code_name"]["n_times"]++;
$billable_activities_array["$pause_code_name"]["total_time"]+=$pause_sec;
if ($billable_activities_array["$pause_code_name"]["max"]<$pause_sec) {$billable_activities_array["$pause_code_name"]["max"]=$pause_sec;}
if ($billable_activities_array["$pause_code_name"]["min"]>$pause_sec) {$billable_activities_array["$pause_code_name"]["min"]=$pause_sec;}
$agent_details_array["$full_name"]["billable"]+=$pause_sec;
}
else
{
if ($pause_code_names["$pause_name_key"])
{
$pause_code_name=$pause_code_names["$pause_name_key"];
}
$outcomes_array["total_nonbillable_time"]+=$pause_sec;
if (!$nonbillable_activities_array["$pause_code_name"])
{
$nonbillable_activities_array["$pause_code_name"]["n_times"]=0;
$nonbillable_activities_array["$pause_code_name"]["total_time"]=0;
$nonbillable_activities_array["$pause_code_name"]["max"]=0;
$nonbillable_activities_array["$pause_code_name"]["min"]=100000;
$agent_details_array["$full_name"]["available"]=0;
$agent_details_array["$full_name"]["billable"]=0;
$agent_details_array["$full_name"]["nonbillable"]=0;
$agent_details_array["$full_name"]["sales"]=0;
$agent_details_array["$full_name"]["human_answered"]=0;
$agent_details_array["$full_name"]["customer_contacts"]=0;
}
$nonbillable_activities_array["$pause_code_name"]["n_times"]++;
$nonbillable_activities_array["$pause_code_name"]["total_time"]+=$pause_sec;
if ($nonbillable_activities_array["$pause_code_name"]["max"]<$pause_sec) {$nonbillable_activities_array["$pause_code_name"]["max"]=$pause_sec;}
if ($nonbillable_activities_array["$pause_code_name"]["min"]>$pause_sec) {$nonbillable_activities_array["$pause_code_name"]["min"]=$pause_sec;}
$agent_details_array["$full_name"]["nonbillable"]+=$pause_sec;
}
$outcomes_array["total_billable_time"]+=($talk_sec+$wait_sec+$dispo_sec);
$outcomes_array["total_agent_available_time"]+=($talk_sec+$wait_sec+$dispo_sec);
$call_outcome=$status;
$agent_details_array["$full_name"]["available"]+=($talk_sec+$wait_sec+$dispo_sec);
# Billable/nonbillable activity
if (in_array($pause_code, $billable_pause_codes["$campaign_id"]) || in_array($pause_code, $billable_pause_codes["SYSTEM"]))
{
if ($pause_code_names["$pause_name_key"])
{
$pause_code_name=$pause_code_names["$pause_name_key"];
}
$outcomes_array["total_billable_time"]+=$pause_sec;
$outcomes_array["total_agent_billable_activities"]+=$pause_sec;
if (!$billable_activities_array["$pause_code_name"])
{
$billable_activities_array["$pause_code_name"]["n_times"]=0;
$billable_activities_array["$pause_code_name"]["total_time"]=0;
$billable_activities_array["$pause_code_name"]["max"]=0;
$billable_activities_array["$pause_code_name"]["min"]=100000;
}
$billable_activities_array["$pause_code_name"]["n_times"]++;
$billable_activities_array["$pause_code_name"]["total_time"]+=$pause_sec;
if ($billable_activities_array["$pause_code_name"]["max"]<$pause_sec) {$billable_activities_array["$pause_code_name"]["max"]=$pause_sec;}
if ($billable_activities_array["$pause_code_name"]["min"]>$pause_sec) {$billable_activities_array["$pause_code_name"]["min"]=$pause_sec;}
$agent_details_array["$full_name"]["billable"]+=$pause_sec;
}
else
{
if ($pause_code_names["$pause_name_key"])
{
$pause_code_name=$pause_code_names["$pause_name_key"];
}
$outcomes_array["total_nonbillable_time"]+=$pause_sec;
if (!$nonbillable_activities_array["$pause_code_name"])
{
$nonbillable_activities_array["$pause_code_name"]["n_times"]=0;
$nonbillable_activities_array["$pause_code_name"]["total_time"]=0;
$nonbillable_activities_array["$pause_code_name"]["max"]=0;
$nonbillable_activities_array["$pause_code_name"]["min"]=100000;
}
$nonbillable_activities_array["$pause_code_name"]["n_times"]++;
$nonbillable_activities_array["$pause_code_name"]["total_time"]+=$pause_sec;
if ($nonbillable_activities_array["$pause_code_name"]["max"]<$pause_sec) {$nonbillable_activities_array["$pause_code_name"]["max"]=$pause_sec;}
if ($nonbillable_activities_array["$pause_code_name"]["min"]>$pause_sec) {$nonbillable_activities_array["$pause_code_name"]["min"]=$pause_sec;}
$agent_details_array["$full_name"]["nonbillable"]+=$pause_sec;
}
if (strlen($call_outcome)<=1)
{
$call_type="None";
$status=LookUpCall($uniqueid, $comments, $user);
# print "$status=LookUpCall($uniqueid, $comments);<BR>\n";
$call_outcome=$status;
}
# JCJ 12/6/22 - added for overriding certain statuses
if (array_key_exists($status, $outcome_status_overrides))
{
$call_outcome=$outcome_status_overrides["$status"];
$status=$call_outcome;
}
# JCJ 12/6/22 - added for removing certain statuses that should basically be lagged in certain conditions
# 1/27/23 - changed $outcome_lagged_status_overrides to normal array instead of associative
else if (in_array($status, $outcome_lagged_status_overrides) && strlen($uniqueid)<1)
{
$status="LAGGED";
$call_outcome="";
}
/* JCJ 12/6/22 - commented out, may be useful later
# 1/27/23 - changed $outcome_lagged_status_overrides to normal array instead of associative, below section won't work now
else if (array_key_exists($status, $outcome_lagged_status_overrides))
{
# print_r($outcome_lagged_status_overrides);
# $HTML_output.="<!-- \n*** $uniqueid, $call_outcome, $status\n";
$status=LookUpCall($uniqueid, $comments, $user);
if (in_array($status, $outcome_lagged_status_overrides["$call_outcome"]))
if (strlen($call_outcome)<=1)
{
$call_type="None";
$status=LookUpCall($uniqueid, $comments, $user);
# print "$status=LookUpCall($uniqueid, $comments);<BR>\n";
$call_outcome=$status;
}
# JCJ 12/6/22 - added for overriding certain statuses
if (array_key_exists($status, $outcome_status_overrides))
{
$call_outcome=$outcome_status_overrides["$status"];
$status=$call_outcome;
}
# JCJ 12/6/22 - added for removing certain statuses that should basically be lagged in certain conditions
# 1/27/23 - changed $outcome_lagged_status_overrides to normal array instead of associative
else if (in_array($status, $outcome_lagged_status_overrides) && strlen($uniqueid)<1)
{
$status="LAGGED";
$call_outcome="";
}
else
/* JCJ 12/6/22 - commented out, may be useful later
# 1/27/23 - changed $outcome_lagged_status_overrides to normal array instead of associative, below section won't work now
else if (array_key_exists($status, $outcome_lagged_status_overrides))
{
$status=$call_outcome;
# print_r($outcome_lagged_status_overrides);
# $HTML_output.="<!-- \n*** $uniqueid, $call_outcome, $status\n";
$status=LookUpCall($uniqueid, $comments, $user);
if (in_array($status, $outcome_lagged_status_overrides["$call_outcome"]))
{
$status="LAGGED";
$call_outcome="";
}
else
{
$status=$call_outcome;
}
# $HTML_output.="*** $uniqueid, $call_outcome, $status //-->\n";
}
# $HTML_output.="*** $uniqueid, $call_outcome, $status //-->\n";
}
*/
*/
if ($status_names["$status"] && !in_array($status, $unknown_network_statuses))
{
$call_outcome=$status_names["$status"];
$call_type="Known";
}
else if (in_array($status, $unknown_network_statuses) || strlen($call_outcome)<=1)
{
# $call_outcome.=" (unknown)";
$call_outcome="Network/LAGGED";
}
else
{
$call_outcome.=" (unknown)"; # commented out 10/13, uncommented 11/2 (known_outcome_stauses not working as they expect)
}
if (strlen($call_outcome)<=1)
{
$call_type="None";
}
/* Added 10/13, removed 11/2 - known_outcome_statuses not having desired effect
if (in_array($status, $selectable_array["$campaign_id"]) || in_array($status, $selectable_array["SYSTEM"]) || in_array($status, $known_outcome_statuses))
{
$outcomes_array["selected"]++;
$agent_details_array["$full_name"]["selected"]++;
$call_type="Known";
}
else
{
$status="---";
$call_type="System/Auto";
$call_outcome="(unknown)";
}
*/
# Human answered (contact)
if (in_array($status, $human_ans_array["$campaign_id"]) || in_array($status, $human_ans_array["SYSTEM"]))
{
$outcomes_array["human_answered"]++;
$agent_details_array["$full_name"]["human_answered"]++;
$call_type="Human answered";
}
# Customer contact (qualified contact)
if (in_array($status, $contact_array["$campaign_id"]) || in_array($status, $contact_array["SYSTEM"]))
{
$outcomes_array["customer_contacts"]++;
$agent_details_array["$full_name"]["customer_contacts"]++;
$call_type="Customer contact";
}
# Sales
if (in_array($status, $sale_array["$campaign_id"]) || in_array($status, $sale_array["SYSTEM"]))
{
$outcomes_array["sales"]++;
$agent_details_array["$full_name"]["sales"]++;
$call_type="Sale";
}
if (!$call_types_array["$call_outcome"]) {$call_types_array["$call_outcome"]=$call_type;}
# Only count results if this is an agent log record with a lead id, i.e. an actual call
if (strlen($lead_id)>0)
{
$call_results_array["$call_outcome"]["total"]++;
$call_results_total_calls++;
if (in_array($status, $lost_statuses_array))
if ($status_names["$status"] && !in_array($status, $unknown_network_statuses))
{
$call_results_array["$call_outcome"]["lost"]++;
$call_results_array["$call_outcome"]["taken"]+=0;
$call_outcome=$status_names["$status"];
$call_type="Known";
}
else if (in_array($status, $unknown_network_statuses) || strlen($call_outcome)<=1)
{
# $call_outcome.=" (unknown)";
$call_outcome="Network/LAGGED";
}
else
{
$call_results_array["$call_outcome"]["lost"]+=0;
$call_results_array["$call_outcome"]["taken"]++;
$call_outcome.=" (unknown)"; # commented out 10/13, uncommented 11/2 (known_outcome_stauses not working as they expect)
}
$call_results_array["$call_outcome"]["call_type"]=$call_type;
# $outcomes_per_agent_array["$full_name"]["$call_type"]["$call_outcome"]["$status"]++; #
if (strlen($call_outcome)<=1)
{
$call_type="None";
}
$opa_key="$full_name|$call_type|$call_outcome|$status";
$outcomes_per_agent_array["$opa_key"]++;
/* Added 10/13, removed 11/2 - known_outcome_statuses not having desired effect
if (in_array($status, $selectable_array["$campaign_id"]) || in_array($status, $selectable_array["SYSTEM"]) || in_array($status, $known_outcome_statuses))
{
$outcomes_array["selected"]++;
# $outcomes_per_agent_array_agents["$full_name"]++; #
# $outcomes_per_agent_array_types["$call_type"]++; #
# $outcomes_per_agent_array_outcomes["$call_outcome"]++; #
# $outcomes_per_agent_array_statuses["$full_name"]++; #
$agent_details_array["$full_name"]["selected"]++;
$call_type="Known";
}
else
{
$status="---";
$call_type="System/Auto";
$call_outcome="(unknown)";
}
*/
# Human answered (contact)
if (in_array($status, $human_ans_array["$campaign_id"]) || in_array($status, $human_ans_array["SYSTEM"]))
{
$outcomes_array["human_answered"]++;
$agent_details_array["$full_name"]["human_answered"]++;
$call_type="Human answered";
}
# Customer contact (qualified contact)
if (in_array($status, $contact_array["$campaign_id"]) || in_array($status, $contact_array["SYSTEM"]))
{
$outcomes_array["customer_contacts"]++;
$agent_details_array["$full_name"]["customer_contacts"]++;
$call_type="Customer contact";
}
# Sales
if (in_array($status, $sale_array["$campaign_id"]) || in_array($status, $sale_array["SYSTEM"]))
{
$outcomes_array["sales"]++;
$agent_details_array["$full_name"]["sales"]++;
$call_type="Sale";
}
if (!$call_types_array["$call_outcome"]) {$call_types_array["$call_outcome"]=$call_type;}
# Only count results if this is an agent log record with a lead id, i.e. an actual call
if (strlen($lead_id)>0)
{
$call_results_array["$call_outcome"]["total"]++;
$call_results_total_calls++;
if (in_array($status, $lost_statuses_array))
{
$call_results_array["$call_outcome"]["lost"]++;
$call_results_array["$call_outcome"]["taken"]+=0;
}
else
{
$call_results_array["$call_outcome"]["lost"]+=0;
$call_results_array["$call_outcome"]["taken"]++;
}
$call_results_array["$call_outcome"]["call_type"]=$call_type;
# $outcomes_per_agent_array["$full_name"]["$call_type"]["$call_outcome"]["$status"]++; #
$opa_key="$full_name|$call_type|$call_outcome|$status";
$outcomes_per_agent_array["$opa_key"]++;
# $outcomes_per_agent_array_agents["$full_name"]++; #
# $outcomes_per_agent_array_types["$call_type"]++; #
# $outcomes_per_agent_array_outcomes["$call_outcome"]++; #
# $outcomes_per_agent_array_statuses["$full_name"]++; #
}
}
}
@@ -415,8 +420,8 @@ $max_call_results_total_pct=0;
$max_call_results_taken_pct=0;
foreach ($call_results_array as $outcome => $data)
{
$call_results_array["$outcome"]["total_pct"]=sprintf("%.1f", 100*($data["total"]/$call_results_total_calls));
$call_results_array["$outcome"]["taken_pct"]=sprintf("%.1f", 100*($data["taken"]/$call_results_total_calls));
$call_results_array["$outcome"]["total_pct"]=sprintf("%.1f", 100*(MathZDC($data["total"], $call_results_total_calls)));
$call_results_array["$outcome"]["taken_pct"]=sprintf("%.1f", 100*(MathZDC($data["taken"], $call_results_total_calls)));
if ($max_call_results_total_pct<$call_results_array["$outcome"]["total_pct"]) {$max_call_results_total_pct=$call_results_array["$outcome"]["total_pct"];}
if ($max_call_results_taken_pct<$call_results_array["$outcome"]["taken_pct"]) {$max_call_results_taken_pct=$call_results_array["$outcome"]["taken_pct"];}
}
@@ -425,7 +430,7 @@ $max_billable_activities_total_time=0;
$billable_activities_grand_total_time=0;
foreach ($billable_activities_array as $pause_code => $data)
{
$billable_activities_array["$pause_code"]["avg"]=round($data["total_time"]/$data["n_times"]);
$billable_activities_array["$pause_code"]["avg"]=round(MathZDC($data["total_time"], $data["n_times"]));
if ($max_billable_activities_total_time<$data["total_time"]) {$max_billable_activities_total_time=$data["total_time"];}
$billable_activities_grand_total_time+=$data["total_time"];
}
@@ -434,7 +439,7 @@ $max_nonbillable_activities_total_time=0;
$nonbillable_activities_grand_total_time=0;
foreach ($nonbillable_activities_array as $pause_code => $data)
{
$nonbillable_activities_array["$pause_code"]["avg"]=round($data["total_time"]/$data["n_times"]);
$nonbillable_activities_array["$pause_code"]["avg"]=round(MathZDC($data["total_time"], $data["n_times"]));
if ($max_nonbillable_activities_total_time<$data["total_time"]) {$max_nonbillable_activities_total_time=$data["total_time"];}
$nonbillable_activities_grand_total_time+=$data["total_time"];
}
@@ -443,8 +448,8 @@ foreach ($nonbillable_activities_array as $pause_code => $data)
$sph=sprintf("%.1f", MathZDC($outcomes_array["sales"], ($outcomes_array["total_billable_time"] / 3600)));
$ccph=sprintf("%.1f", MathZDC($outcomes_array["customer_contacts"], ($outcomes_array["total_billable_time"] / 3600)));
$haph=sprintf("%.1f", MathZDC($outcomes_array["human_answered"], ($outcomes_array["total_billable_time"] / 3600)));
$ha_conv_index=sprintf("%.1f", 100*($outcomes_array["sales"]/$outcomes_array["customer_contacts"]));
$cc_conv_index=sprintf("%.1f", 100*($outcomes_array["sales"]/$outcomes_array["human_answered"]));
$ha_conv_index=sprintf("%.1f", 100*(MathZDC($outcomes_array["sales"], $outcomes_array["customer_contacts"])));
$cc_conv_index=sprintf("%.1f", 100*(MathZDC($outcomes_array["sales"], $outcomes_array["human_answered"])));
$HTML_output.="<BR><h2 class='rpt_header'>"._QXZ("Statuses").":$NWB#VERM_OUTCOMES-outcomes$NWE</h2>";
$HTML_output.="<hr style='height:2px;border-width:0;color:#ddd;background-color:#ddd;margin-bottom: 2em;'>";
@@ -509,7 +514,7 @@ if ($sort_call_results=="outcomes desc")
{
krsort($call_results_array);
}
else
else if(!preg_match('/^outcomes/', $sort_call_results))
{
if ($sort_cr_index)
{
@@ -566,9 +571,9 @@ foreach ($call_results_array as $outcome => $data)
$HTML_output.="<td>".$data["taken"]."</td>";
$HTML_output.="<td>".$data["lost"]."</td>";
$HTML_output.="<td>".$data["total_pct"]." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["total_pct"])/$max_call_results_total_pct)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["total_pct"]), $max_call_results_total_pct))."%'></td>";
$HTML_output.="<td>".$data["taken_pct"]." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$data["taken_pct"])/$max_call_results_taken_pct)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$data["taken_pct"]), $max_call_results_taken_pct))."%'></td>";
$HTML_output.="<td><a onClick=\"ShowOutcomesDetails('', '$start_date $start_time', '$end_date $end_time', '', '', '".trim(preg_replace("/\(unknown\)/", "", $outcome))."')\"><svg width='20' height='20' viewBox='0 0 20 20' data-svg='search'><circle fill='none' stroke='#000' stroke-width='1.1' cx='9' cy='9' r='7'></circle><path fill='none' stroke='#000' stroke-width='1.1' d='M14,14 L18,18 L14,14 Z'></path></svg></a></td>";
$HTML_output.="</tr>\n";
@@ -605,7 +610,7 @@ if ($sort_billable_activities=="activity desc")
{
krsort($billable_activities_array);
}
else
else if (!preg_match('/^activity/', $sort_billable_activities))
{
if ($sort_ba_index)
{
@@ -649,7 +654,7 @@ $CSV_output["billable_activities"]="\""._QXZ("Activity")."\",\""._QXZ("N. Times"
foreach ($billable_activities_array as $pause_code => $data)
{
$pct=sprintf("%.1f", ((100*$data["total_time"])/$billable_activities_grand_total_time));
$pct=sprintf("%.1f", (MathZDC((100*$data["total_time"]), $billable_activities_grand_total_time)));
$HTML_output.="<tr class='standard_font bold'>";
$HTML_output.="<td>".$pause_code."</td>";
@@ -695,7 +700,7 @@ if ($sort_nonbillable_activities=="activity desc")
{
krsort($nonbillable_activities_array);
}
else
else if (!preg_match('/^activity/', $sort_nonbillable_activities))
{
if ($sort_nba_index)
{
@@ -738,7 +743,7 @@ $CSV_output["nonbillable_activities"]="\""._QXZ("Activity")."\",\""._QXZ("N. Tim
foreach ($nonbillable_activities_array as $pause_code => $data)
{
$pct=sprintf("%.1f", ((100*$data["total_time"])/$nonbillable_activities_grand_total_time));
$pct=sprintf("%.1f", (MathZDC((100*$data["total_time"]), $nonbillable_activities_grand_total_time)));
$HTML_output.="<tr class='standard_font bold'>";
$HTML_output.="<td>".$pause_code."</td>";
@@ -759,7 +764,7 @@ $HTML_output.="<tr class='export_row'>";
$HTML_output.="<td class='export_row_cell' colspan='10'>"._QXZ("Export as")."...<input type='button' class='download_button' onClick=\"DownloadReport('OUTCOMES', 'nonbillable_activities')\" title=\"Export as a CSV file\" value='CSV'></td>";
$HTML_output.="</tr>";
$HTML_output.="</table>";
$HTML_output.="<input type='hidden' name='sort_nonbillable_activities' id='sort_nonbillable_activities' value='$sort_billable_activities'>";
$HTML_output.="<input type='hidden' name='sort_nonbillable_activities' id='sort_nonbillable_activities' value='$sort_nonbillable_activities'>";
if (!$download_rpt) {echo $HTML_output; ob_flush(); flush(); $HTML_output="";}
###############################
@@ -794,16 +799,16 @@ foreach($agent_details_array as $agent_name => $data)
$billable_seconds=($data["available"]+$data["billable"]);
$billable_hours=$billable_seconds/3600;
$av_pct=sprintf("%.1f", (100*($data["available"]/$billable_seconds)));
$b_pct=sprintf("%.1f", (100*($data["billable"]/$billable_seconds)));
$av_pct=sprintf("%.1f", (100*(MathZDC($data["available"], $billable_seconds))));
$b_pct=sprintf("%.1f", (100*(MathZDC($data["billable"], $billable_seconds))));
# ??? - Not sure of the logic below, but whatever.
$ha_conv_pct=sprintf("%.1f", (100*MathZDC($data["sales"], $data["human_answered"], 0)));
$cc_conv_pct=sprintf("%.1f", (100*MathZDC($data["sales"], $data["customer_contacts"], 0)));
$nb_pct=sprintf("%.1f", (100*($data["nonbillable"]/$billable_seconds)));
$sph=sprintf("%.1f", ($data["sales"]/$billable_hours));
$ccph=sprintf("%.1f", ($data["customer_contacts"]/$billable_hours));
$haph=sprintf("%.1f", ($data["human_answered"]/$billable_hours));
$nb_pct=sprintf("%.1f", (100*(MathZDC($data["nonbillable"], $billable_seconds))));
$sph=sprintf("%.1f", (MathZDC($data["sales"], $billable_hours)));
$ccph=sprintf("%.1f", (MathZDC($data["customer_contacts"], $billable_hours)));
$haph=sprintf("%.1f", (MathZDC($data["human_answered"], $billable_hours)));
$HTML_output.="<tr class='standard_font bold'>";
$HTML_output.="<td>".$agent_name."</td>";
@@ -928,7 +933,7 @@ foreach($final_opa_array as $key => $row)
$HTML_output.="<td>".$row["outcome"]."</td>";
$HTML_output.="<td>".$row["type"]."</td>";
$HTML_output.="<td>".$row["total"]."</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$row["total"])/$max_total_value)."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$row["total"]), $max_total_value))."%'></td>";
$HTML_output.="</tr>\n";
$CSV_output["agent_outcomes"].="\"$row[agent]\",\"$row[status]\",\"$row[outcome]\",\"$row[type]\",\"$row[total]\"\n";
+4 -3
View File
@@ -1,10 +1,11 @@
<?php
# VERM_STATS_rpt.inc - Vicidial Enhanced Reporting stats report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1616 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
# DROP, WAITTO, TIMEOT are unanswered statuses, not NANQUE
@@ -367,7 +368,7 @@ $HTML_output.="</tr>\n";
$CSV_output["agents_on_queue"]="\""._QXZ("Agents on queue")."\"\n";
$CSV_output["agents_on_queue"].="\""._QXZ("Agent")."\",\""._QXZ("N. Calls")."\",\"\",\"...\",\""._QXZ("Total call time")."\",\""._QXZ("Average call time")."\"\n";
$highest_agent_call_count=max($agent_call_counts);
$highest_agent_call_count=(count($agent_call_counts)>0 ? max($agent_call_counts) : 0);
$agents_on_queue_graph_labels="[";
$agents_on_queue_graph_data="[";
@@ -524,7 +525,7 @@ $disconnection_causes_graph_data="[";
$disconnection_causes_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$disconnection_causes_graph_hovborder="[";
$max_term_reason=max($term_reasons);
$max_term_reason=(count($term_reasons)>0 ? max($term_reasons) : 0);
$x=0;
foreach ($term_reasons as $reason => $value)
{
+42 -39
View File
@@ -1,11 +1,12 @@
<?php
# VERM_UNANSWERED_rpt.inc - Vicidial Enhanced Reporting unanswered call report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1614 - First build
# 230106-1506 - Uniqueid array modification to speed up page loading, added page flushing
# 240801-1130 - Code updates for PHP8 compatibility
#
if (isset($_GET["sort_agents_on_queue"])) {$sort_agents_on_queue=$_GET["sort_agents_on_queue"];}
@@ -62,6 +63,7 @@ $max_unanswered_position=0;
$min_unanswered_position=1000000;
$unanswered_queue_stats=array(); # campaign id breakdown BY UNANSWERED CALLS
$unanswered_term_reasons=array(); # UNANSWERED CALLS ONLY
$unanswered_calls_by_agent=array();
$unanswered_call_directions=array(); # UNANSWERED CALLS
$unanswered_call_stints=array(); # UNANSWERED CALLS
$unanswered_agent_events=array(); # UNANSWERED CALLS
@@ -687,7 +689,7 @@ $disconnection_causes_graph_data="[";
$disconnection_causes_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$disconnection_causes_graph_hovborder="[";
$max_term_reason=max($unanswered_term_reasons);
$max_term_reason=(count($unanswered_term_reasons)>0 ? max($unanswered_term_reasons) : 0);
$x=0;
foreach ($unanswered_term_reasons as $reason => $value)
{
@@ -787,7 +789,7 @@ $unanswered_calls_by_queue_graph_data="[";
$unanswered_calls_by_queue_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$unanswered_calls_by_queue_graph_hovborder="[";
$max_queue_count=max($unanswered_queue_stats);
$max_queue_count=(count($unanswered_queue_stats)>0 ? max($unanswered_queue_stats) : 0);
ksort($unanswered_queue_stats);
$x=0;
foreach ($unanswered_queue_stats as $queue => $value)
@@ -842,7 +844,7 @@ $HTML_output.="</tr>";
$CSV_output["unanswered_calls_by_agent"]="\""._QXZ("Unanswered calls, by agent").":\"\n";
$CSV_output["unanswered_calls_by_agent"].="\"\",\""._QXZ("Campaign/ingroup")."\",\""._QXZ("N. Calls")."\",\"\",\"...\"\n";
$max_queue_count=max($unanswered_calls_by_agent);
$max_queue_count=(count($unanswered_calls_by_agent)>0 ? max($unanswered_calls_by_agent) : 0);
ksort($unanswered_calls_by_agent);
$x=0;
foreach ($unanswered_calls_by_agent as $user => $value)
@@ -916,18 +918,18 @@ foreach($svc_lvl_row as $interval => $sum)
$HTML_output.="<td>$int_name "._QXZ("seconds").":</td>";
$HTML_output.="<td>".$sum."</td>";
$HTML_output.="<td align='right'><i>$delta</i>&nbsp;&nbsp;</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$sum)/$unanswered_inbound_calls))." %</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$sum)/$total_unanswered_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$sum)/$unanswered_inbound_calls)."%'></td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$sum), $unanswered_inbound_calls)))." %</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$sum), $total_unanswered_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$sum), $unanswered_inbound_calls))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["unanswered_calls_by_distribution"].="\"$int_name seconds:\",\"$sum\",\"$delta\",\"".sprintf("%.1f", ((100*$sum)/$unanswered_inbound_calls))." %\",\"".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))." %\"\n";
$CSV_output["unanswered_calls_by_distribution"].="\"$int_name seconds:\",\"$sum\",\"$delta\",\"".sprintf("%.1f", (MathZDC((100*$sum), $unanswered_inbound_calls)))." %\",\"".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))." %\"\n";
$unanswered_calls_by_distribution_graph_labels.="\"$int_name\",";
$unanswered_calls_by_distribution_graph_delta_data.="\"".($prev_int || $x>0 ? ($sum-$prev_int) : "0")."\",";
$unanswered_calls_by_distribution_graph_delta_bgcolor.="\"#33CCCC\",";
$unanswered_calls_by_distribution_graph_delta_hovborder.="\"#66FFFF\",";
$unanswered_calls_by_distribution_graph_percent_data.="\"".sprintf("%.1f", ((100*$sum)/$unanswered_inbound_calls))."\",";
$unanswered_calls_by_distribution_graph_percent_data.="\"".sprintf("%.1f", (MathZDC((100*$sum), $unanswered_inbound_calls)))."\",";
$unanswered_calls_by_distribution_graph_percent_bgcolor.="\"#FFCC66\",";
$unanswered_calls_by_distribution_graph_percent_hovborder.="\"#FFFF99\",";
@@ -998,17 +1000,17 @@ foreach($svc_lvl_row as $interval => $sum)
$HTML_output.="<td>$int_name "._QXZ("seconds").":</td>";
$HTML_output.="<td>".$sum."</td>";
$HTML_output.="<td align='right'><i>$delta</i>&nbsp;&nbsp;</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$sum)/$total_inbound_calls)."%'></td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$sum), $total_inbound_calls))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["service_level_agreement"].="\"$int_name seconds:\",\"$sum\",\"$delta\",\"".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))." %\"\n";
$CSV_output["service_level_agreement"].="\"$int_name seconds:\",\"$sum\",\"$delta\",\"".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))." %\"\n";
$service_level_agreement_graph_labels.="\"$int_name\",";
$service_level_agreement_graph_delta_data.="\"".($prev_int ? ($sum-$prev_int) : "0")."\",";
$service_level_agreement_graph_delta_bgcolor.="\"#33CCCC\",";
$service_level_agreement_graph_delta_hovborder.="\"#66FFFF\",";
$service_level_agreement_graph_percent_data.="\"".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))."\",";
$service_level_agreement_graph_percent_data.="\"".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))."\",";
$service_level_agreement_graph_percent_bgcolor.="\"#FFCC66\",";
$service_level_agreement_graph_percent_hovborder.="\"#FFFF99\",";
@@ -1053,6 +1055,7 @@ $CSV_output["unanswered_calls_by_keypress"].="\""._QXZ("Key")."\",\""._QXZ("N. C
$keypress_stmt="select extension, count(*) as ct From live_inbound_log where uniqueid in ('".implode("', '", $unans_uniqueid_array)."') and extension not in ('s', 'i', 't') and comment_a='CALLMENU' group by extension order by extension";
if ($DB) {$HTML_output.="<B>$keypress_stmt</B>";}
$keypress_rslt=mysql_to_mysqli($keypress_stmt, $link);
$kp_array=array();
while ($kp_row=mysqli_fetch_array($keypress_rslt))
{
$kp_array["$kp_row[extension]"]+=$kp_row["ct"];
@@ -1206,16 +1209,16 @@ $queue_position_graph_data="[";
$queue_position_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$queue_position_graph_hovborder="[";
$max_queue_count=max($unanswered_queue_positions);
$max_queue_count=(count($unanswered_queue_positions)>0 ? max($unanswered_queue_positions) : 0);
$x=0;
foreach ($unanswered_queue_positions as $position => $value)
{
$position_pct=sprintf("%.1f", (100*$value)/$total_unanswered_calls);
$position_pct=sprintf("%.1f", MathZDC((100*$value), $total_unanswered_calls));
$HTML_output.="<tr>";
$HTML_output.="<td>".$position."</td>";
$HTML_output.="<td>".$value."</td>";
$HTML_output.="<td>".$position_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($value/$max_queue_count))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($value, $max_queue_count))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["queue_position"].="\"".$position."\",\"".$value."\",\"".$position_pct." %\",\"\"\n";
@@ -1270,16 +1273,16 @@ $queue_position_all_calls_graph_bgcolor="["; # SAME FOR hoverBackgroundColor
$queue_position_all_calls_graph_hovborder="[";
ksort($queue_positions);
$max_queue_count=max($queue_positions);
$max_queue_count=(count($queue_positions)>0 ? max($queue_positions) : 0);
$x=0;
foreach ($queue_positions as $position => $value)
{
$position_pct=sprintf("%.1f", (100*$value)/$total_calls);
$position_pct=sprintf("%.1f", MathZDC((100*$value), $total_calls));
$HTML_output.="<tr>";
$HTML_output.="<td>".$position."</td>";
$HTML_output.="<td>".$value."</td>";
$HTML_output.="<td>".$position_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($value/$max_queue_count))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($value, $max_queue_count))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["queue_position_all_calls_all_calls"].="\"".$position."\",\"".$value."\",\"".$position_pct." %\",\"\"\n";
@@ -1384,9 +1387,9 @@ if ($ivr_path!="")
if ($ivr_paths["$ivr_path"][3]<$ivr_call_time) {$ivr_paths["$ivr_path"][3]=$ivr_call_time;}
}
$max_ivr_count=max($ivr_counts);
$max_ivr_count=(count($ivr_counts)>0 ? max($ivr_counts) : 0);
if ($max_ivr_count<$untracked_calls) {$max_ivr_count=$untracked_calls;}
$untracked_ivr_pct=sprintf("%.1f", (100*$untracked_calls)/$total_unanswered_calls);
$untracked_ivr_pct=sprintf("%.1f", MathZDC((100*$untracked_calls), $total_unanswered_calls));
$HTML_output.="<BR><h2 class='rpt_header'>"._QXZ("IVR selection").": $NWB#VERM_UNANSWERED-ivr_selection$NWE</h2>";
$HTML_output.="<hr style='height:2px;border-width:0;color:#ddd;background-color:#ddd;margin-bottom: 2em;'>";
@@ -1408,7 +1411,7 @@ $HTML_output.="<tr>";
$HTML_output.="<td>"._QXZ("Untracked")."</td>";
$HTML_output.="<td>$untracked_calls</td>";
$HTML_output.="<td>".$untracked_ivr_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($untracked_calls/$total_unanswered_calls))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($untracked_calls, $total_unanswered_calls))."%'></td>";
$HTML_output.="<td>&nbsp;</td>";
$HTML_output.="<td>&nbsp;</td>";
$HTML_output.="<td>&nbsp;</td>";
@@ -1440,7 +1443,7 @@ foreach ($ivr_paths as $pathname => $value)
$HTML_output.="<td>".$pathname."</td>";
$HTML_output.="<td>".$value[0]."</td>";
$HTML_output.="<td>".$ivr_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($value[0]/$total_unanswered_calls))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($value[0], $total_unanswered_calls))."%'></td>";
$HTML_output.="<td>".$total_duration."</td>";
$HTML_output.="<td>".$average_duration."</td>";
$HTML_output.="<td>".$min_duration."</td>";
@@ -1550,9 +1553,9 @@ if ($ivr_path!="")
if ($ivr_paths["$ivr_path"][3]<$ivr_call_time) {$ivr_paths["$ivr_path"][3]=$ivr_call_time;}
}
$max_ivr_count=max($ivr_counts);
$max_ivr_count=(count($ivr_counts)>0 ? max($ivr_counts) : 0);
if ($max_ivr_count<$untracked_calls) {$max_ivr_count=$untracked_calls;}
$untracked_ivr_pct=sprintf("%.1f", (100*$untracked_calls)/$total_calls);
$untracked_ivr_pct=sprintf("%.1f", MathZDC((100*$untracked_calls), $total_calls));
$HTML_output.="<BR><h2 class='rpt_header'>"._QXZ("IVR selection, all calls").": $NWB#VERM_UNANSWERED-IVR_selection_all_calls$NWE</h2>";
$HTML_output.="<hr style='height:2px;border-width:0;color:#ddd;background-color:#ddd;margin-bottom: 2em;'>";
@@ -1575,7 +1578,7 @@ $HTML_output.="<tr>";
$HTML_output.="<td>"._QXZ("Untracked")."</td>";
$HTML_output.="<td>$untracked_calls</td>";
$HTML_output.="<td>".$untracked_ivr_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($untracked_calls/$total_calls))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($untracked_calls, $total_calls))."%'></td>";
$HTML_output.="<td>&nbsp;</td>";
$HTML_output.="<td>&nbsp;</td>";
$HTML_output.="<td>&nbsp;</td>";
@@ -1606,7 +1609,7 @@ foreach ($ivr_paths as $pathname => $value)
$HTML_output.="<td>".$pathname."</td>";
$HTML_output.="<td>".$value[0]."</td>";
$HTML_output.="<td>".$ivr_pct." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*($value[0]/$total_calls))."%'></td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(100*MathZDC($value[0], $total_calls))."%'></td>";
$HTML_output.="<td>".$total_duration."</td>";
$HTML_output.="<td>".$average_duration."</td>";
$HTML_output.="<td>".$min_duration."</td>";
@@ -1656,10 +1659,10 @@ while ($did_row=mysqli_fetch_array($did_rslt))
$untracked_did_calls--;
}
}
$max_did=max($did_counts);
$max_did=(count($did_counts)>0 ? max($did_counts) : 0);
if ($max_did<$untracked_did_calls) {$max_did=$untracked_did_calls;}
$untracked_did_pct=sprintf("%.1f", ((100*$untracked_did_calls)/$total_unanswered_calls));
$untracked_did_pct=sprintf("%.1f", (MathZDC((100*$untracked_did_calls), $total_unanswered_calls)));
$HTML_output.="<BR><h2 class='rpt_header'>"._QXZ("Inbound DID used").": $NWB#VERM_UNANSWERED-did_used$NWE</h2>";
$HTML_output.="<hr style='height:2px;border-width:0;color:#ddd;background-color:#ddd;margin-bottom: 2em;'>";
$HTML_output.="<table border='0' cellpadding='0' cellspacing='5'>";
@@ -1743,10 +1746,10 @@ while ($did_row=mysqli_fetch_array($did_rslt))
$untracked_did_calls--;
}
}
$max_did=max($did_counts);
$max_did=(count($did_counts)>0 ? max($did_counts) : 0);
if ($max_did<$untracked_did_calls) {$max_did=$untracked_did_calls;}
$untracked_did_pct=sprintf("%.1f", ((100*$untracked_did_calls)/$total_calls));
$untracked_did_pct=sprintf("%.1f", (MathZDC((100*$untracked_did_calls), $total_calls)));
$HTML_output.="<BR><h2 class='rpt_header'>"._QXZ("Inbound DID used, for all calls").": $NWB#VERM_UNANSWERED-did_used_all_calls$NWE</h2>";
$HTML_output.="<hr style='height:2px;border-width:0;color:#ddd;background-color:#ddd;margin-bottom: 2em;'>";
$HTML_output.="<table border='0' cellpadding='0' cellspacing='5'>";
@@ -1779,7 +1782,7 @@ ksort($did_counts);
$x=1;
foreach ($did_counts as $did => $value)
{
$did_pct=sprintf("%.1f", (100*$value)/$total_answered_calls);
$did_pct=sprintf("%.1f", MathZDC((100*$value), $total_answered_calls));
$HTML_output.="<tr>";
$HTML_output.="<td>".$did." - ".$did_pattern_info["$did"]."</td>";
$HTML_output.="<td>$value</td>";
@@ -1881,8 +1884,8 @@ foreach($total_queue_stats as $campaign_name => $data)
$CSV_output["call_overview"].="\"".$campaign_name."\",\"".$data["calls"]."\",\"".$data["answered"]."\",\"".$data["unanswered"]."\",\"".($avg_call_time>=3600 ? floor($avg_call_time/3600).":" : "").gmdate("i:s", $avg_call_time)."\",\"".($data["call_time"]>=3600 ? floor($data["call_time"]/3600).":" : "").gmdate("i:s", $data["call_time"])."\",\"".($avg_wait_time>=3600 ? floor($avg_wait_time/3600).":" : "").gmdate("i:s", $avg_wait_time)."\",\"".($data["wait_time"]>=3600 ? floor($data["wait_time"]/3600).":" : "").gmdate("i:s", $data["wait_time"])."\"\n";
}
$avg_call_time=round($total_queue_call_time/$total_queue_answered);
$avg_wait_time=round($total_queue_wait_time/$total_queue_calls);
$avg_call_time=round(MathZDC($total_queue_call_time, $total_queue_answered));
$avg_wait_time=round(MathZDC($total_queue_wait_time, $total_queue_calls));
$HTML_output.="<tr>";
$HTML_output.="<td>"._QXZ("TOTAL")."</td>";
@@ -1948,18 +1951,18 @@ foreach($svc_lvl_row as $interval => $sum)
$HTML_output.="<td>$int_name "._QXZ("seconds").":</td>";
$HTML_output.="<td>".$sum."</td>";
$HTML_output.="<td align='right'><i>$delta</i>&nbsp;&nbsp;</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$sum)/$answered_inbound_calls))." %</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".((100*$sum)/$answered_inbound_calls)."%'></td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$sum), $answered_inbound_calls)))." %</td>";
$HTML_output.="<td align='right'>".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))." %</td>";
$HTML_output.="<td width='200'><img src='images/shade-histo.gif' height='10' width='".(MathZDC((100*$sum), $answered_inbound_calls))."%'></td>";
$HTML_output.="</tr>";
$CSV_output["answered_service_level_agreement"].="\"$int_name "._QXZ("seconds").":\",\"$sum\",\"$delta\",\"".sprintf("%.1f", ((100*$sum)/$answered_inbound_calls))." %\",\"".sprintf("%.1f", ((100*$sum)/$total_inbound_calls))." %\"\n";
$CSV_output["answered_service_level_agreement"].="\"$int_name "._QXZ("seconds").":\",\"$sum\",\"$delta\",\"".sprintf("%.1f", (MathZDC((100*$sum), $answered_inbound_calls)))." %\",\"".sprintf("%.1f", (MathZDC((100*$sum), $total_inbound_calls)))." %\"\n";
$answered_service_level_agreement_graph_labels.="\"$int_name\",";
$answered_service_level_agreement_graph_delta_data.="\"".($prev_int ? ($sum-$prev_int) : "0")."\",";
$answered_service_level_agreement_graph_delta_bgcolor.="\"#33CCCC\",";
$answered_service_level_agreement_graph_delta_hovborder.="\"#66FFFF\",";
$answered_service_level_agreement_graph_percent_data.="\"".sprintf("%.1f", ((100*$sum)/$answered_inbound_calls))."\",";
$answered_service_level_agreement_graph_percent_data.="\"".sprintf("%.1f", (MathZDC((100*$sum), $answered_inbound_calls)))."\",";
$answered_service_level_agreement_graph_percent_bgcolor.="\"#FFCC66\",";
$answered_service_level_agreement_graph_percent_hovborder.="\"#FFFF99\",";
+5 -4
View File
@@ -1,10 +1,11 @@
<?php
# VERM_admin.php - Vicidial Enhanced Reporting administration page
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1609 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
@@ -75,8 +76,9 @@ if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];}
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group;}
else {$group = $groups[0];}
if (!isset($user_group_filter)) {$user_group_filter=array();}
if (!isset($ingroup_filter)) {$ingroup_filter=array();}
if (!is_array($groups)) {$groups=array();}
if (!is_array($user_group_filter)) {$user_group_filter=array();}
if (!is_array($ingroup_filter)) {$ingroup_filter=array();}
$NOW_TIME = date("Y-m-d H:i:s");
$NOW_DAY = date("Y-m-d");
@@ -394,7 +396,6 @@ $allactivecampaigns .= "''";
$i=0;
$group_string='|';
if (!$groups) {$groups=array();}
$group_ct = count($groups);
while($i < $group_ct)
{
@@ -1,10 +1,11 @@
<?php
# VERM_custom_report.php - Vicidial Enhanced Reporting custom report form page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1606 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -150,8 +151,8 @@ if (file_exists('options.php'))
if ( (strlen($group)>1) and (strlen($groups[0])<1) ) {$groups[0] = $group;}
else {$group = $groups[0];}
if (!isset($user_group_filter) || $user_group_filter=='') {$user_group_filter=array();}
if (!isset($ingroup_filter) || $ingroup_filter=='') {$ingroup_filter=array();}
if (!is_array($user_group_filter) || $user_group_filter=='') {$user_group_filter=array();}
if (!is_array($ingroup_filter) || $ingroup_filter=='') {$ingroup_filter=array();}
$NOW_TIME = date("Y-m-d H:i:s");
$NOW_DAY = date("Y-m-d");
@@ -476,7 +477,7 @@ $allactivecampaigns .= "''";
$i=0;
$group_string='|';
if (!$groups) {$groups=array();}
if (!is_array($groups)) {$groups=array();}
$group_ct = count($groups);
while($i < $group_ct)
{
+22 -7
View File
@@ -1,11 +1,12 @@
<?php
# VERM_global_vars.inc - Vicidial Enhanced Reporting global variables
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1622 - First build
# 230106-1317 - Added missing QXZ, added pull of selectable statuses, human answered statues now include DISPO and SYSTEM
# 240801-1130 - Code updates for PHP8 compatibility
#
if (isset($_GET["start_date"])) {$start_date=$_GET["start_date"];}
@@ -278,11 +279,25 @@ while ($callmenu_row=mysqli_fetch_row($callmenu_rslt))
# Compile closer campaigns for waiting calls
$campaign_closer_names=array();
# 7/31/24 - below arrays moved here to be declared as they need to exist for every campaign in the queue, not just ones where there are pause codes.
# Null campaign entries for the pause code arrays will cause an error;
$billable_pause_codes=array();
$payable_pause_codes=array();
$sale_array=array("SYSTEM" => array());
$selectable_array=array("SYSTEM" => array());
$human_ans_array=array("SYSTEM" => array());
$contact_array=array("SYSTEM" => array());
$campaign_closer_stmt="select campaign_id, closer_campaigns from vicidial_campaigns $queueSQL_where";
$campaign_closer_rslt=mysql_to_mysqli($campaign_closer_stmt, $link);
while ($campaign_closer_row=mysqli_fetch_row($campaign_closer_rslt))
{
$campaign_closer_names["$campaign_closer_row[0]"]="$campaign_closer_row[1]";
$billable_pause_codes["$campaign_closer_row[0]"]=array();
$payable_pause_codes["$campaign_closer_row[0]"]=array();
$sale_array["$campaign_closer_row[0]"]=array();
$selectable_array["$campaign_closer_row[0]"]=array();
$human_ans_array["$campaign_closer_row[0]"]=array();
$contact_array["$campaign_closer_row[0]"]=array();
}
# Compile closer campaigns for waiting calls
@@ -303,7 +318,7 @@ while ($terminal_row=mysqli_fetch_row($terminal_rslt))
$terminal_names["$terminal_row[0]"]="$terminal_row[1]";
}
$sale_array=array("SYSTEM" => array());
# $sale_array=array("SYSTEM" => array());
$sale_stmt="select distinct status, 'SYSTEM' as campaign_id from vicidial_statuses where sale='Y' UNION select distinct status, campaign_id from vicidial_campaign_statuses where sale='Y'";
$sale_rslt=mysql_to_mysqli($sale_stmt, $link);
while ($sale_row=mysqli_fetch_array($sale_rslt))
@@ -312,7 +327,7 @@ while ($sale_row=mysqli_fetch_array($sale_rslt))
array_push($sale_array["$sale_row[campaign_id]"], $sale_row["status"]);
}
$selectable_array=array("SYSTEM" => array());
# $selectable_array=array("SYSTEM" => array());
$selectable_stmt="select distinct status, 'SYSTEM' as campaign_id from vicidial_statuses where selectable='Y' UNION select distinct status, campaign_id from vicidial_campaign_statuses where selectable='Y'";
$selectable_rslt=mysql_to_mysqli($selectable_stmt, $link);
while ($selectable_row=mysqli_fetch_array($selectable_rslt))
@@ -321,7 +336,7 @@ while ($selectable_row=mysqli_fetch_array($selectable_rslt))
array_push($selectable_array["$selectable_row[campaign_id]"], $selectable_row["status"]);
}
$human_ans_array=array("SYSTEM" => array());
# $human_ans_array=array("SYSTEM" => array());
$human_ans_stmt="select distinct status, 'SYSTEM' as campaign_id from vicidial_statuses where human_answered='Y' UNION select distinct status, campaign_id from vicidial_campaign_statuses where human_answered='Y' UNION select 'DISPO', 'SYSTEM'";
$human_ans_rslt=mysql_to_mysqli($human_ans_stmt, $link);
while ($human_ans_row=mysqli_fetch_array($human_ans_rslt))
@@ -330,7 +345,7 @@ while ($human_ans_row=mysqli_fetch_array($human_ans_rslt))
array_push($human_ans_array["$human_ans_row[campaign_id]"], $human_ans_row["status"]);
}
$contact_array=array("SYSTEM" => array());
# $contact_array=array("SYSTEM" => array());
$contact_stmt="select distinct status, 'SYSTEM' as campaign_id from vicidial_statuses where customer_contact='Y' UNION select distinct status, campaign_id from vicidial_campaign_statuses where customer_contact='Y'";
$contact_rslt=mysql_to_mysqli($contact_stmt, $link);
while ($contact_row=mysqli_fetch_array($contact_rslt))
@@ -365,8 +380,8 @@ if (mysqli_num_rows($container_rslt)>0)
$pause_code_stmt="select * from vicidial_pause_codes";
$pause_code_rslt=mysql_to_mysqli($pause_code_stmt, $link);
$billable_pause_codes=array();
$payable_pause_codes=array();
# $billable_pause_codes=array();
# $payable_pause_codes=array();
$pause_code_names=array();
while ($pause_code_row=mysqli_fetch_array($pause_code_rslt))
{
@@ -2,14 +2,17 @@
# VERM_inbound_comparison_report.php
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# changes
# 230225-1531 - First build of script
# 240801-1139 - Code updates for PHP8 compatibility
#
$startMS = microtime();
$version = '2.14-41';
$build = '230225-1531';
$version = '2.14-42';
$build = '240801-1139';
header ("Content-type: text/html; charset=utf-8");
@@ -86,6 +89,9 @@ if ($SSallow_web_debug < 1) {$DB=0;}
# $PHP_SELF=$_SERVER['PHP_SELF'];
# $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF);
if(!is_array($comparison_years)) {$comparison_years=array();}
if(!is_array($comparison_months)) {$comparison_months=array();}
$start_date=preg_replace('/[^-0-9]/', '', $start_date);
$end_date=preg_replace('/[^-0-9]/', '', $end_date);
$comparison_years=preg_replace('/[^0-9]/', '', $comparison_years);
@@ -393,6 +399,11 @@ if ($vicidial_queue_groups && $submit_report)
$included_inbound_groups_clause="and group_id in ('".preg_replace('/\s/', "', '", $included_inbound_groups)."')";
$where_included_inbound_groups_clause="where group_id in ('".preg_replace('/\s/', "', '", $included_inbound_groups)."')";
}
else
{
$included_campaigns_array=array();
$included_inbound_groups_array=array();
}
$atomic_queue_str="";
@@ -1186,8 +1197,10 @@ $HTML_output.="//-->\n";
if ($DB) {$HTML_output.="<B>$calls_stmt</B>";}
$calls_rslt=mysqli_query($link, $calls_stmt);
if($calls_stmt)
{
$calls_rslt=mysqli_query($link, $calls_stmt);
}
if (file_exists('options.php'))
@@ -1,12 +1,13 @@
<?php
# VERM_main_report_page.php - Vicidial Enhanced Reporting main report display page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220828-1402 - First build
# 230106-1332 - Added auto download variables, permissions, report logging
# 230116-1640 - Ingroup-related clauses no longer allow blank campaign_id values (double-dipping issue)
# 240801-1130 - Code updates for PHP8 compatibility
#
# NANQUE, not an unanswered call?
@@ -566,6 +567,9 @@ if ($vicidial_queue_groups)
$included_campaigns_clause="and campaign_id in ('')";
$included_inbound_groups_clause="and group_id in ('')";
$where_included_inbound_groups_clause="where group_id in ('')";
$included_campaigns_array=array();
$included_inbound_groups_array=array();
}
}
else
@@ -573,6 +577,9 @@ else
$included_campaigns_clause="and campaign_id in ('')";
$included_inbound_groups_clause="and group_id in ('')";
$where_included_inbound_groups_clause="where group_id in ('')";
$included_campaigns_array=array();
$included_inbound_groups_array=array();
}
@@ -1,10 +1,11 @@
<?php
# VERM_wallboard_widgets.php - Vicidial Enhanced Reporting widget-generating script
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1601 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$report_name="VERM reports";
@@ -727,9 +728,9 @@ if ($widget_type=="N_WAITING_CALLS")
}
else
{
$waiting_clause="sum(if(status='LIVE' IN('XFER') $included_campaigns_clause), 1, 0)";
$waiting_clause="sum(if(status in ('LIVE', 'XFER') $included_campaigns_clause, 1, 0))";
# sum(if(status='LIVE' IN('XFER') $included_campaigns_clause), 1, 0)
$stmtB="from vicidial_auto_calls where status='LIVE' IN('XFER') $included_campaigns_clause order by queue_priority desc,campaign_id,call_time;";
$stmtB="from vicidial_auto_calls where status in ('LIVE', 'XFER') $included_campaigns_clause order by queue_priority desc,campaign_id,call_time;";
}
+19 -1
View File
@@ -4,7 +4,7 @@
#
# database connection settings and some global web settings
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 130328-0022 - Converted ereg to preg functions
@@ -16,8 +16,26 @@
# 150626-2120 - Modified mysqli_error() to mysqli_connect_error() where appropriate
# 160325-1434 - Changes for sidebar update
# 220827-1948 - VERM version
# 240801-1130 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
@@ -1,13 +1,15 @@
<?php
# display_agent_details.php - Vicidial Enhanced Reporting agent details page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1612 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$subreport_name="VERM Reports";
$report_display_type="display_agent_details.php";
$startMS = microtime();
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -1,11 +1,12 @@
<?php
# display_call_details.php - Vicidial Enhanced Reporting call details page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1611 - First build
# 230126-1158 - Added recording log access, QXZ translation
# 240801-1130 - Code updates for PHP8 compatibility
#
$subreport_name="VERM Reports";
$report_display_type="display_call_details.php";
@@ -318,8 +319,8 @@ $ENDtime=date("U");
$endMS = microtime();
$startMSary = explode(" ",$startMS);
$endMSary = explode(" ",$endMS);
$runS = ($endMSary[0] - $startMSary[0]);
$runM = ($endMSary[1] - $startMSary[1]);
$runS = ((int)$endMSary[0] - (int)$startMSary[0]);
$runM = ((int)$endMSary[1] - (int)$startMSary[1]);
$TOTALrun = ($runS + $runM);
$stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';";
@@ -1,13 +1,15 @@
<?php
# display_outcomes_details.php - Vicidial Enhanced Reporting outcomes details page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGELOG:
# 220825-1610 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$subreport_name="VERM Reports";
$report_display_type="display_outcomes_details.php";
$startMS=microtime();
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
@@ -0,0 +1,19 @@
<?php
# options.php - manually defined options for vicidial admin scripts
#
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# rename this file to options.php for the settings here to go into effect
#
# CHANGELOG
# 240802-1250 - First Build
# If this option is set to 1, then the error_reporting in php.ini will be ignored and settings below will be used for this directory
$PHP_error_reporting_OVERRIDE = 0;
# PHP error reporting options, set to 1 to keep the type of error from being displayed, either on-screen or to the error logs.
$PHP_error_reporting_HIDE_ERRORS = 0; # STRONGLY advise leaving this value alone, but you do you.
$PHP_error_reporting_HIDE_WARNINGS = 0;
$PHP_error_reporting_HIDE_PARSES = 0;
$PHP_error_reporting_HIDE_NOTICES = 0;
$PHP_error_reporting_HIDE_DEPRECATIONS= 0;
?>
+21 -3
View File
@@ -1,7 +1,7 @@
<?php
# agentCORS.php - CORS processing and responses for Cross-Origin Features
#
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CORS settings coming from the options.php script (the first 3 variables must be set for these features to be active)
# $CORS_allowed_origin = ''; # if multiple origins allowed, separate them by a pipe (also allows PHP preg syntax)
@@ -20,15 +20,33 @@
#
# CHANGELOG
# 210616-1012 - First Build
# 240801-1130 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
$NOW_TIME = date("Y-m-d H:i:s");
if (strlen($php_script) < 1)
{$donothing=1;}
else
{
$CORS_origin = $_SERVER['HTTP_ORIGIN']; # The client browser origin server
$CORS_origin = "$_SERVER[HTTP_ORIGIN]"; # The client browser origin server - treated as string for stripos command
$CORS_method = isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) ? $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']; # Either the requested HTTP method or the current one
$CORS_affected_scripts = " $CORS_affected_scripts "; # surround with spaces for preg match below
@@ -114,4 +132,4 @@ else
}
}
}
?>
?>
+19 -1
View File
@@ -4,14 +4,32 @@
#
# database connection settings and some global web settings
#
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 130328-0022 - Converted ereg to preg functions
# 130802-0957 - Changed to PHP mysqli functions
# 150626-2120 - Modified mysqli_error() to mysqli_connect_error() where appropriate
# 240801-1130 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
+12 -2
View File
@@ -1,7 +1,7 @@
<?php
# options.php - manually defined options for vicidial.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# rename this file to options.php for the settings here to go into effect
#
@@ -30,6 +30,7 @@
# 230617-0815 - Added dead_logging_version option
# 231109-0830 - Changed link_to_grey_version to disabled by default
# 231115-1610 - Added allow_vlc_lookup, default_consultative
# 240802-1250 - Added options to customize PHP error reporting
#
$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording
@@ -114,6 +115,15 @@ $INSERT_window_onload = ''; # inserted at the end of the onload function
$INSERT_agent_events = ''; # inserted within the agent_events function
$INSERT_before_body_close = ''; # inserted before each BODY close tag
# If this option is set to 1, then the error_reporting in php.ini will be ignored and settings below will be used for this directory
$PHP_error_reporting_OVERRIDE = 0;
# PHP error reporting options, set to 1 to keep the type of error from being displayed, either on-screen or to the error logs.
$PHP_error_reporting_HIDE_ERRORS = 0; # STRONGLY advise leaving this value alone, but you do you.
$PHP_error_reporting_HIDE_WARNINGS = 0;
$PHP_error_reporting_HIDE_PARSES = 0;
$PHP_error_reporting_HIDE_NOTICES = 0;
$PHP_error_reporting_HIDE_DEPRECATIONS= 0;
# CORS settings: (to enable, customize the variables below, and uncomment the "require_once('agentCORS.php');" line at the bottom)
# (NOTE: The first 3 variables must be set for these features to be active)
$CORS_allowed_origin = ''; # if multiple origins allowed, separate them by a pipe (also allows PHP preg syntax)
@@ -133,4 +143,4 @@ $CORS_debug = 0; # 0 = no, 1 = yes (default is no) This will generate a lot
$customer_chat_refresh_seconds = 1; # How often (in seconds) to refresh customer ang agent chat window
$manager_chat_refresh_seconds = 1; # How often (in seconds) to refresh manager chat window
?>
?>
+5 -4
View File
@@ -551,10 +551,11 @@
# 240420-2227 - ConfBridge code added
# 240517-0901 - Added ALT option for start_call_url fields
# 240612-0206 - Fix for extension_appended_cidname newer options
# 240801-1140 - Code updates for PHP8 compatibility
#
$version = '2.14-444';
$build = '240612-0206';
$version = '2.14-445';
$build = '240801-1140';
$php_script = 'vdc_db_query.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=913;
@@ -11659,8 +11660,8 @@ if ($ACTION == 'VDADcheckINCOMINGother')
$chat_group_str="";
$VLA_inOUT='NONE';
$queue_seconds=0;
if (!isset($inbound_email_groups)) {$inbound_email_groups=array();}
if (!isset($inbound_chat_groups)) {$inbound_chat_groups=array();}
if (!is_array($inbound_email_groups)) {$inbound_email_groups=array();}
if (!is_array($inbound_chat_groups)) {$inbound_chat_groups=array();}
$email_group_ct=count($inbound_email_groups); # This should always be greater than zero for the script to reach this point, but just in case...
for ($i=0; $i<$email_group_ct; $i++)
@@ -1,7 +1,7 @@
<?php
# customer_chat_code.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Example for incorporating the customer side of the Vicidial chat into a web page.
# Can be called as an include file, if desired.
@@ -13,8 +13,26 @@
# 160108-1659 - Added available_agents variable
# 160120-1944 - Added show_email variable
# 220220-1921 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
if (isset($_GET["chat_id"])) {$chat_id=$_GET["chat_id"];}
@@ -34,17 +52,17 @@ if (isset($_GET["available_agents"])) {$available_agents=$_GET["available_agen
if (isset($_GET["show_email"])) {$show_email=$_GET["show_email"];}
elseif (isset($_POST["show_email"])) {$show_email=$_POST["show_email"];}
$lead_id = preg_replace("/[^0-9]/","",$lead_id);
$chat_id = preg_replace('/[^-\_\.0-9a-zA-Z]/','',$chat_id);
$group_id = preg_replace('/[^-\_0-9\p{L}]/u','',$group_id);
$chat_group_id = preg_replace('/[^-\_0-9\p{L}]/u','',$chat_group_id);
$email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$email);
$unique_userID = preg_replace('/[^-\.\_0-9a-zA-Z]/','',$unique_userID);
$language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);
$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);
$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);
if (isset($lead_id)) {$lead_id = preg_replace("/[^0-9]/","",$lead_id);}
if (isset($chat_id)) {$chat_id = preg_replace('/[^-\_\.0-9a-zA-Z]/','',$chat_id);}
if (isset($group_id)) {$group_id = preg_replace('/[^-\_0-9\p{L}]/u','',$group_id);}
if (isset($chat_group_id)) {$chat_group_id = urlencode(preg_replace('/[^-\_0-9\p{L}]/u','',$chat_group_id));}
if (isset($email)) {$email = urlencode(preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$email));}
if (isset($unique_userID)) {$unique_userID = urlencode(preg_replace('/[^-\.\_0-9a-zA-Z]/','',$unique_userID));}
if (isset($language)) {$language = urlencode(preg_replace('/[^-\_0-9a-zA-Z]/','',$language));}
if (isset($available_agents)) {urlencode($available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents));}
if (isset($show_email)) {$show_email = urlencode(preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email));}
$URL_vars="?user=".urlencode($unique_userID)."&lead_id=".$lead_id."&group_id=".urlencode($chat_group_id)."&chat_id=".$chat_id."&email=".urlencode($email)."&language=".urlencode($language)."&available_agents=".urlencode($available_agents)."&show_email=".urlencode($show_email);
$URL_vars="?user=".$unique_userID."&lead_id=".$lead_id."&group_id=".$chat_group_id."&chat_id=".$chat_id."&email=".$email."&language=".$language."&available_agents=".$available_agents."&show_email=".$show_email;
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
@@ -1,7 +1,7 @@
<?php
# customer_chat_functions.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 151212-0828 - First Build for customer chat
@@ -16,6 +16,7 @@
# 160805-2315 - Added coding to show logos in customer display
# 161026-2230 - Added translation QXZ to untranslated text
# 220220-1940 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -54,24 +55,24 @@ if (isset($_GET["available_agents"])) {$available_agents=$_GET["available_age
if (isset($_GET["show_email"])) {$show_email=$_GET["show_email"];}
elseif (isset($_POST["show_email"])) {$show_email=$_POST["show_email"];}
$chat_member_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/',"",$chat_member_name);
if(isset($chat_member_name)) {$chat_member_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/',"",$chat_member_name);}
if (!$user) {echo "No user, no using."; exit;}
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$lead_id = preg_replace("/[^0-9]/","",$lead_id);
$chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id);
$chat_level = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_level);
$group_id = preg_replace('/[^- \_0-9a-zA-Z]/','',$group_id);
$language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);
$user = preg_replace("/\'|\"|\\\\|;/","",$user);
$chat_member_name = preg_replace("/\'|\"|\\\\|;/","",$chat_member_name);
$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);
$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);
$chat_message = preg_replace('/\|/', '&#124;', $chat_message);
$action = preg_replace('/[^-\_0-9a-zA-Z]/','',$action);
$user_level = preg_replace('/[^-\_0-9a-zA-Z]/','',$user_level);
$keepalive = preg_replace('/[^-\_0-9a-zA-Z]/','',$keepalive);
$current_message_count = preg_replace('/[^-\_0-9a-zA-Z]/','',$current_message_count);
if(isset($DB)) {$DB = preg_replace("/[^0-9a-zA-Z]/","",$DB);}
if(isset($lead_id)) {$lead_id = preg_replace("/[^0-9]/","",$lead_id);}
if(isset($chat_id)) {$chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id);}
if(isset($chat_level)) {$chat_level = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_level);}
if(isset($group_id)) {$group_id = preg_replace('/[^- \_0-9a-zA-Z]/','',$group_id);}
if(isset($language)) {$language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);}
if(isset($user)) {$user = preg_replace("/\'|\"|\\\\|;/","",$user);}
if(isset($chat_member_name)) {$chat_member_name = preg_replace("/\'|\"|\\\\|;/","",$chat_member_name);}
if(isset($available_agents)) {$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);}
if(isset($show_email)) {$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);}
if(isset($chat_message)) {$chat_message = preg_replace('/\|/', '&#124;', $chat_message);}
if(isset($action)) {$action = preg_replace('/[^-\_0-9a-zA-Z]/','',$action);}
if(isset($user_level)) {$user_level = preg_replace('/[^-\_0-9a-zA-Z]/','',$user_level);}
if(isset($keepalive)) {$keepalive = preg_replace('/[^-\_0-9a-zA-Z]/','',$keepalive);}
if(isset($current_message_count)) {$current_message_count = preg_replace('/[^-\_0-9a-zA-Z]/','',$current_message_count);}
$use_agent_colors=1;
if (file_exists('options.php'))
@@ -510,4 +511,4 @@ if ($action=="update_chat_window" && $chat_id) {
}
}
?>
?>
@@ -4,12 +4,30 @@
#
# database connection settings and some global web settings
#
# Copyright (C) 2015 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 151212-0827 - First Build for customer chat
# 240801-1130 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
@@ -1,3 +1,23 @@
<?php
# options.php - manually defined options for vicidial admin scripts
#
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# rename this file to options.php for the settings here to go into effect
#
# CHANGELOG
# 160818-0200 - First build
# 240802-1250 - Added options to customize PHP error output
#
# If this option is set to 1, then the error_reporting in php.ini will be ignored and settings below will be used for this directory
$PHP_error_reporting_OVERRIDE = 0;
# PHP error reporting options, set to 1 to keep the type of error from being displayed, either on-screen or to the error logs.
$PHP_error_reporting_HIDE_ERRORS = 0; # STRONGLY advise leaving this value alone, but you do you.
$PHP_error_reporting_HIDE_WARNINGS = 0;
$PHP_error_reporting_HIDE_PARSES = 0;
$PHP_error_reporting_HIDE_NOTICES = 0;
$PHP_error_reporting_HIDE_DEPRECATIONS= 0;
$use_agent_colors = '1'; # set to 1 to use the agent_screen_colors setting in the system settings
?>
@@ -1,7 +1,7 @@
<?php
# vicidial_chat_customer_side.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# The main page of the customer chat interface. This will display a form for the customer
# to fill out to attempt to initiate a chat with an available agent in the in-group
@@ -19,6 +19,7 @@
# 160203-1052 - Added display of chat message after ending it
# 160805-2315 - Added coding to show logos in customer display
# 220220-1915 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -57,17 +58,17 @@ if (isset($_GET["show_email"])) {$show_email=$_GET["show_email"];}
$PHP_SELF=$_SERVER['PHP_SELF'];
$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF);
$lead_id = preg_replace("/[^0-9]/","",$lead_id);
$user = preg_replace("/\'|\"|\\\\|;/","",$user);
$chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id);
$group_id = preg_replace('/[^- \_0-9a-zA-Z]/','',$group_id);
$language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);
$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);
$status_link = preg_replace('/[^-\_0-9a-zA-Z]/','',$status_link);
$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);
$send_request = preg_replace('/[^-\_0-9a-zA-Z]/','',$send_request);
$join_chat = preg_replace('/[^-\_0-9a-zA-Z]/','',$join_chat);
$stage = preg_replace('/[^-\_0-9a-zA-Z]/','',$stage);
if (isset($lead_id)) {$lead_id = preg_replace("/[^0-9]/","",$lead_id);}
if (isset($user)) {$user = preg_replace("/\'|\"|\\\\|;/","",$user);}
if (isset($chat_id)) {$chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id);}
if (isset($group_id)) {$group_id = preg_replace('/[^- \_0-9a-zA-Z]/','',$group_id);}
if (isset($language)) {$language = preg_replace('/[^-\_0-9a-zA-Z]/','',$language);}
if (isset($available_agents)) {$available_agents = preg_replace('/[^-\_0-9a-zA-Z]/','',$available_agents);}
if (isset($status_link)) {$status_link = preg_replace('/[^-\_0-9a-zA-Z]/','',$status_link);}
if (isset($show_email)) {$show_email = preg_replace('/[^-\_0-9a-zA-Z]/','',$show_email);}
if (isset($send_request)) {$send_request = preg_replace('/[^-\_0-9a-zA-Z]/','',$send_request);}
if (isset($join_chat)) {$join_chat = preg_replace('/[^-\_0-9a-zA-Z]/','',$join_chat);}
if (isset($stage)) {$stage = preg_replace('/[^-\_0-9a-zA-Z]/','',$stage);}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -668,7 +669,7 @@ $chat_title= _QXZ("Request chat with agent"); # This can be modified for customi
</span>
</form>
</body>
<?
<?php
} else if ($chat_id && $group_id && (!$first_name || !$last_name)) {
?>
<body>
@@ -710,7 +711,7 @@ $chat_title= _QXZ("Request chat with agent"); # This can be modified for customi
</form>
</body>
<?
<?php
} else {
?>
<body onLoad="StartRefresh();" onUnload="javascript:clearInterval(rInt); LeaveChat();">
@@ -797,7 +798,7 @@ $chat_title= _QXZ("Request chat with agent"); # This can be modified for customi
<audio id='CustomerChatAudioAlertFile'><source src="sounds/chat_alert.mp3" type="audio/mpeg"></audio>
</form>
</body>
<?
<?php
}
?>
@@ -8,6 +8,7 @@
# 231228-2204 - First build
# 240108-1556 - Added channel/server display
# 240114-1018 - Added Agent Gone summary stat
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -48,7 +49,7 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
$start_screen=0;
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE; $start_screen=1;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -1,13 +1,14 @@
<?php
# AST_AMD_log_report.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 190329-1852 - First build, based on AST_carrier_log_report.php
# 191013-0839 - Fixes for PHP7
# 220303-1415 - Added allow_web_debug system setting
# 220812-0951 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -52,9 +53,9 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$START_TIME=date("U");
$NOW_DATE = date("Y-m-d");
if (!isset($server_ip)) {$server_ip = array();}
if (!isset($AMDSTATUS)) {$AMDSTATUS = array();}
if (!isset($AMDRESPONSE)) {$AMDRESPONSE = array();}
if (!is_array($server_ip)) {$server_ip = array();}
if (!is_array($AMDSTATUS)) {$AMDSTATUS = array();}
if (!is_array($AMDRESPONSE)) {$AMDRESPONSE = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
@@ -3,7 +3,7 @@
#
# This report is for viewing the a report of API activity to the vicidial_api_log table
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -17,6 +17,7 @@
# 180502-2115 - Added new help display
# 191013-0829 - Fixes for PHP7
# 220303-1028 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -63,10 +64,10 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$report_name="API Log Report";
$NOW_DATE = date("Y-m-d");
if (!isset($users)) {$users=array();}
if (!isset($agent_users)) {$agent_users=array();}
if (!isset($functions)) {$functions=array();}
if (!isset($results)) {$results=array();}
if (!is_array($users)) {$users=array();}
if (!is_array($agent_users)) {$agent_users=array();}
if (!is_array($functions)) {$functions=array();}
if (!is_array($results)) {$results=array();}
if (!isset($api_date_D)) {$api_date_D=$NOW_DATE;}
if (!isset($api_date_end_D)) {$api_date_end_D=$NOW_DATE;}
if (!isset($api_date_T)) {$api_date_T="00:00:00";}
@@ -732,6 +733,7 @@ if ($SUBMIT && $api_date_D && $api_date_T && $api_date_end_D && $api_date_end_T)
if ($DB) {print $stmt."\n";}
# print $stmt."\n";
$url_vars=array();
$URL_header='';
$ASCII_border="+---------------------+--------------------------------+------------+----------------------+--------------------------------+------------+----------------------+----------+-----------+----------------------+-----------+\n";
if ($show_urls)
@@ -1,7 +1,7 @@
<?php
# AST_CLOSERstats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat
@@ -70,6 +70,7 @@
# 211022-0735 - Added IR_SLA_all_statuses options.php setting
# 212207-2217 - Added IQNANQ to drop SQL calculation queries
# 220303-0850 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -121,7 +122,7 @@ $MT[0]='0';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_CLOSERstats_v2.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES:
# 60619-1714 - Added variable filtering to eliminate SQL injection attack threat
@@ -75,6 +75,7 @@
# 211027-1050 - Added optional campaign selection(camp_select), for calculation of OCR only
# 212207-2227 - Added IQNANQ to drop SQL calculation queries, fix for AHT calculation in show_camp mode
# 221208-1013 - Added vicidial_inbound_callback_queue stats
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -132,8 +133,8 @@ $MT[0]='0';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($campaigns)) {$campaigns = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($campaigns)) {$campaigns = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_CLOSERsummary_hourly.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -35,6 +35,7 @@
# 200605-1100 - user_group bug fix
# 220303-0829 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -85,7 +86,7 @@ $MT[0]='0';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
+4 -3
View File
@@ -1,13 +1,14 @@
<?php
# AST_CMstats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 180724-2109 - First build
# 180829-1155 - Added totals
# 191013-0849 - Fixes for PHP7
# 220303-0822 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -49,8 +50,8 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($callmenus)) {$callmenus=array();}
if (!isset($group)) {$group = array();}
if (!is_array($callmenus)) {$callmenus=array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";}
+3 -2
View File
@@ -1,11 +1,12 @@
<?php
# AST_DIDdetail.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
# 220510-0945 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -49,7 +50,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($time_BEGIN)) {$time_BEGIN = "00:00:00";}
+3 -2
View File
@@ -1,7 +1,7 @@
<?php
# AST_DIDstats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -38,6 +38,7 @@
# 191013-0850 - Fixes for PHP7
# 210525-1715 - Fixed help display, modification for more call details
# 220303-0759 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -79,7 +80,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($time_BEGIN)) {$time_BEGIN = "00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_DIDstats_v2.php - DID sumary report
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -9,6 +9,7 @@
# 170903-0941 - Added screen color settings
# 191013-0817 - Fixes for PHP7
# 220303-0726 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -50,7 +51,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($time_BEGIN)) {$time_BEGIN = "00:00:00";}
+7 -5
View File
@@ -1,7 +1,7 @@
<?php
# AST_IVRstats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 81026-2026 - First build
@@ -42,6 +42,7 @@
# 180507-2315 - Added new help display
# 191013-0835 - Fixes for PHP7
# 220221-0926 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -81,7 +82,7 @@ if (strlen($type)<2) {$type='inbound';}
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";}
@@ -971,9 +972,7 @@ else
$s++;
}
$TOTALcalls = sprintf("%6s", $TOTALcalls);
$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
$TavgFLOWivr_time = MathZDC($totFLOWivr_time, $TOTALcalls);
$TavgFLOWivr_time = round($TavgFLOWivr_time, 0);
$TavgFLOWivr_time = sprintf("%4s", $TavgFLOWivr_time);
@@ -983,6 +982,9 @@ else
$totFLOWdropPCT = (MathZDC($totFLOWdrop, $totFLOWtotal) * 100);
$totFLOWdropPCT = round($totFLOWdropPCT, 0);
$totFLOWdropPCT = sprintf("%5s", $totFLOWdropPCT);
$TOTALcalls = sprintf("%6s", $TOTALcalls);
$totFLOWtotal = sprintf("%6s", $totFLOWtotal);
$totFLOWdrop = sprintf("%6s", $totFLOWdrop);
$ASCII_text.="+--------+--------+--------+--------+------+------+------------\n";
$ASCII_text.="| $TOTALcalls | $totFLOWtotal | $totFLOWdrop | $totFLOWdropPCT% | $TavgFLOWivr_time | $TavgFLOWtotal_time |\n";
@@ -1,7 +1,7 @@
<?php
# AST_LISTS_campaign_stats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This is a list inventory report, not a calling report. This report will show
# statistics for all of the lists in the selected campaigns
@@ -33,6 +33,7 @@
# 180507-2315 - Added new help display
# 191013-0819 - Fixes for PHP7
# 220302-1315 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -66,7 +67,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
$report_name = 'Lists Campaign Statuses Report';
$db_source = 'M';
@@ -1,7 +1,7 @@
<?php
# AST_LISTS_pass_report.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This is a list inventory report, not a calling report. This report will show
# statistics for all of the lists in the selected campaigns
@@ -27,6 +27,7 @@
# 210330-1659 - Added extra warnings and forced confirmation before running report
# 220221-0906 - Added allow_web_debug system setting
# 221109-0729 - Fix for DOWNLOAD link and use_lists variable in links
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -62,7 +63,7 @@ if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
@@ -589,7 +590,7 @@ if (strlen($group[0]) < 1)
}
else if (strlen($group[0]) >= 1 && !$confirm_run)
{
$MAIN.="<font color='#900' size='3'><B>"._QXZ("REMINDER - THIS REPORT CAN TAKE A LONG TIME TO RUN AND WILL INTERFERE WITH DIALING IF EXECUTED DURING PRODUCTION.")."<BR>"._QXZ("IF YOU ARE SURE YOU WOULD LIKE TO RUN THE REPORT AT THIS TIME")." <a href=\"$PHP_SELF?DB=$DB$groupQS&SUBMIT=$SUBMIT&confirm_run=1&use_lists=1&search_archived_data=$search_archived_data\">"._QXZ("CLICK HERE")."</a></B></font>";
$MAIN.="<font color='#900' size='3'><B>"._QXZ("REMINDER - THIS REPORT CAN TAKE A LONG TIME TO RUN AND WILL INTERFERE WITH DIALING IF EXECUTED DURING PRODUCTION.")."<BR>"._QXZ("IF YOU ARE SURE YOU WOULD LIKE TO RUN THE REPORT AT THIS TIME")." <a href=\"$PHP_SELF?DB=$DB$groupQS&SUBMIT=$SUBMIT&confirm_run=1&use_lists=$use_lists&report_display_type=$report_display_type&search_archived_data=$search_archived_data\">"._QXZ("CLICK HERE")."</a></B></font>";
}
else
{
@@ -1,7 +1,7 @@
<?php
# AST_LISTS_stats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This is a list inventory report, not a calling report. This report will show
# statistics for all of the lists in the selected campaigns
@@ -19,6 +19,7 @@
# 170903-0951 - Added screen color settings
# 180507-2315 - Added new help display
# 220302-1214 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -52,7 +53,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($list)) {$list = array();}
if (!is_array($list)) {$list = array();}
$report_name = 'Lists Statuses Report';
$db_source = 'M';
@@ -1,7 +1,7 @@
<?php
# AST_OUTBOUNDsummary_interval.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -35,6 +35,7 @@
# 180507-2315 - Added new help display
# 191013-0813 - Fixes for PHP7
# 220302-1007 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -83,7 +84,7 @@ $MT[0]='0';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
+5 -4
View File
@@ -1,7 +1,7 @@
<?php
# AST_VDADstats.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 60619-1718 - Added variable filtering to eliminate SQL injection attack threat
@@ -58,6 +58,7 @@
# 190823-1620 - Fixed download archive bug
# 191013-0852 - Fixes for PHP7
# 220301-1641 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -113,8 +114,8 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($list_ids)) {$list_ids = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($list_ids)) {$list_ids = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1395,7 +1396,7 @@ else
if ($Ctally_to_print > 0)
{
$rowx=mysqli_fetch_row($rslt);
$AGENTsec = "$rowx[0]";
$AGENTsec = $rowx[0];
}
if ($DB) {$ASCII_text .= "$AGENTsec|$Ctally_to_print|$stmt\n";}
@@ -1,7 +1,7 @@
<?php
# AST_admin_template_maker.php - version 2.14
#
# Copyright (C) 2022 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 120402-2132 - First Build
@@ -19,6 +19,7 @@
# 180927-0633 - Fix for deleted template function in alternate language, issue #1127
# 210312-1700 - Added layout editing functionality
# 220222-1100 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -107,6 +108,7 @@ $submit_template = preg_replace("/\<|\>|\'|\"|\\\\|;/", '', $submit_template);
$submit_edited_template = preg_replace("/\<|\>|\'|\"|\\\\|;/", '', $submit_edited_template);
$file_format = preg_replace("/\<|\>|\'|\"|\\\\|;/",'',$file_format);
$file_delimiter = preg_replace("/\<|\>|\'|\"|\\\\|;/",'',$file_delimiter);
if (!is_array($template_statuses)) {$template_statuses=array();}
# Variables filtered further down in the code
# $template_statuses
@@ -1,7 +1,7 @@
<?php
# AST_agentDIDstats.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -11,6 +11,7 @@
# 191013-0836 - Fixes for PHP7
# 220303-1422 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -48,7 +49,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if ($file_download>0) {$DB="";}
@@ -1,7 +1,7 @@
<?php
# AST_agent_days_detail.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -36,6 +36,7 @@
# 191013-0848 - Fixes for PHP7
# 220221-0946 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -77,7 +78,7 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -353,7 +354,7 @@ while ($i < $user_groups_to_print)
#if ( (preg_match("/--ALL--/",$group_string) ) or ($group_ct < 1) )
# {
$user_group_SQL = "and user_group IN('".implode("', '", $user_groups)."')";
$user_group_SQL_val = "and vicidial_agent_log.user_group IN('".implode("', '", $user_groups)."')";
$user_group_SQL_val = "and ".$vicidial_agent_log_table.".user_group IN('".implode("', '", $user_groups)."')";
$user_group_IN_clause="user_group in ('".implode("', '", $user_groups)."')";
# }
#else
@@ -1,7 +1,7 @@
<?php
# AST_agent_days_time.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -14,6 +14,7 @@
# 220303-1510 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 231114-1703 - Fix for issue #1490
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -56,7 +57,7 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_agent_inbound_status.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -9,6 +9,7 @@
# 191013-0841 - Fixes for PHP7
# 220303-1503 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -53,8 +54,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_agent_performance_detail.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -67,6 +67,7 @@
# 191030-1530 - Query fixes
# 200421-1411 - user_group bug fix
# 220303-1458 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -125,9 +126,9 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($users)) {$users = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($users)) {$users = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_time)) {$query_time = "00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_agent_performance_detail.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -42,6 +42,7 @@
# 150516-1309 - Fixed Javascript element problem, Issue #857
# 170409-1535 - Added IP List validation code
# 220303-1439 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -84,9 +85,9 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($users)) {$users = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($users)) {$users = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1044,9 +1045,6 @@ while ($n < $j)
}
### END loop through each status ###
$TOTcalls = sprintf("%7s", $TOTcalls);
$TOT_AGENTS = sprintf("%-4s", $m);
if ($TOTtotTALK < 1) {$TOTavgTALK = '0';}
else {$TOTavgTALK = ($TOTtotTALK / $TOTcalls);}
if ($TOTtotDISPO < 1) {$TOTavgDISPO = '0';}
@@ -1103,12 +1101,14 @@ while(strlen($TOTavgWAIT_MS)>6) {$TOTavgWAIT_MS = substr("$TOTavgWAIT_MS", 0, -1
while(strlen($TOTavgCUSTOMER_MS)>6) {$TOTavgCUSTOMER_MS = substr("$TOTavgCUSTOMER_MS", 0, -1);}
$grand_total_hours=($TOTtime/3600);
$STOTsales_per_call=sprintf("%.2f", (100*($Sgrand_total_sales/$TOTcalls)))." %";
$STOTsales_per_hour=sprintf("%.2f", ($Sgrand_total_sales/$grand_total_hours));
$STOTsales_per_call=sprintf("%.2f", (100*(MathZDC($Sgrand_total_sales, $TOTcalls))))." %";
$STOTsales_per_hour=sprintf("%.2f", (MathZDC($Sgrand_total_sales, $grand_total_hours)));
$STOTsales_per_call=sprintf("%13s", $STOTsales_per_call);
$STOTsales_per_hour=sprintf("%14s", $STOTsales_per_hour);
$Sgrand_total_sales=sprintf("%11s", $Sgrand_total_sales);
$TOTcalls = sprintf("%7s", $TOTcalls);
$TOT_AGENTS = sprintf("%-4s", $m);
$ASCII_text.="+-----------------+----------+----------------------+----------------------+---------------+----------------+-------------+--------+-----------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+----------+--------+$statusesHEAD\n";
$ASCII_text.="| TOTALS AGENTS:$TOT_AGENTS | $STOTsales_per_call | $STOTsales_per_hour | $Sgrand_total_sales | $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";
@@ -1,12 +1,13 @@
<?php
# AST_agent_performance_detail_mobile.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
# 200318-1122 - First build, based upon AST_agent_performance_detail.php
# 220303-0812 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -65,9 +66,9 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($users)) {$users = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($users)) {$users = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_time)) {$query_time = "00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_agent_status_detail.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -39,6 +39,7 @@
# 191013-0904 - Fixes for PHP7
# 200605-1100 - user_group bug fix
# 220303-1433 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -83,8 +84,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -531,6 +532,7 @@ else
}
$query_date_BEGIN = "$query_date $time_BEGIN";
$query_date_END = "$end_date $time_END";
if (!is_array($sub_statusesARY)) {$sub_statusesARY=array();}
if ($file_download < 1)
{
@@ -4,7 +4,7 @@
# Pulls time stats per agent selectable by campaign or user group
# should be most accurate agent stats of all of the reports
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 90522-0723 - First build
@@ -60,6 +60,7 @@
# 211115-1513 - Fix for case-mismatch on pause code statuses for multi-campaign selects
# 220303-1427 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -112,8 +113,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_agent_time_sheet.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -32,6 +32,7 @@
# 220811-1440 - Modified for date ranges instead of single-day
# 220822-1728 - Changed total login time calculation to work for multi-day ranges
# 221005-1647 - Added JS calendar functionality for date fields
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -418,13 +419,13 @@ $subcamp_color = '#C6C6C6';
#require("admin_header.php");
$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#$SSframe_background\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#$SSframe_background\"><TD>\n";
$MAIN.="<TABLE WIDTH=$page_width BGCOLOR=\"#$SSframe_background\" cellpadding=2 cellspacing=0><TR BGCOLOR=\"#$SSframe_background\"><TD><font face='arial,helvetica' size='2'>\n";
$MAIN.=_QXZ("Agent Time Sheet for").": <B>$user</B>\n";
$MAIN.="<BR>\n";
$MAIN.="<FORM ACTION=\"$PHP_SELF\" METHOD=GET name='vicidial_report'> &nbsp; &nbsp; \n";
$MAIN.="<table border='0' width='350' cellpadding='3' cellspacing='0'>";
$MAIN.="<tr><td align='right'>"._QXZ("Date").":</td>";
$MAIN.="<tr><td align='right'><font face='arial,helvetica' size='2'>"._QXZ("Date").":</font></td>";
$MAIN.="<td align='left'><INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 VALUE=\"$query_date\">";
$MAIN.="<script language=\"JavaScript\">\n";
$MAIN.="function openNewWindow(url)\n";
@@ -441,7 +442,7 @@ $MAIN.="<td align='left'><INPUT TYPE=TEXT NAME=query_date SIZE=10 MAXLENGTH=10 V
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.="</td>\n";
$MAIN.="<td align='right'>"._QXZ("To").":</td>";
$MAIN.="<td align='right'><font face='arial,helvetica' size='2'>"._QXZ("To").":</font></td>";
$MAIN.="<td align='left'><INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VALUE=\"$end_date\">";
$MAIN.="<script language=\"JavaScript\">\n";
$MAIN.="function openNewWindow(url)\n";
@@ -458,7 +459,7 @@ $MAIN.="<td align='left'><INPUT TYPE=TEXT NAME=end_date SIZE=10 MAXLENGTH=10 VAL
$MAIN.="// o_cal.a_tpl.weekstart = 1; // Monday week start\n";
$MAIN.="</script>\n";
$MAIN.="</td></tr>";
$MAIN.="<tr><td align='right'>"._QXZ("User ID").":</td><td align='left' colspan='3'><INPUT TYPE=TEXT NAME=agent SIZE=20 MAXLENGTH=20 VALUE=\"$agent\"></td></tr>\n";
$MAIN.="<tr><td align='right'><font face='arial,helvetica' size='2'>"._QXZ("User ID").":</font></td><td align='left' colspan='3'><INPUT TYPE=TEXT NAME=agent SIZE=20 MAXLENGTH=20 VALUE=\"$agent\"></td></tr>\n";
@@ -482,14 +483,16 @@ $HTML_text.="</script>\n";
if ($archives_available=="Y")
{
$MAIN.="<tr><td align='center' colspan='4'><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."</td></tr>\n";
$MAIN.="<tr><td align='center' colspan='4'><font face='arial,helvetica' size='2'><input type='checkbox' name='search_archived_data' value='checked' $search_archived_data>"._QXZ("Search archived data")."</font></td></tr>\n";
}
$MAIN.="</table>";
$MAIN.="<BR><BR>\n";
$MAIN.="<tr><td align='center' colspan='4'><BR>";
$MAIN.="<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
$MAIN.="</FORM>\n\n";
$MAIN.="</td></tr>\n";
$MAIN.="</table>";
$MAIN.="<BR>\n";
$MAIN.="</FORM></font>\n\n";
$MAIN.="<PRE><FONT SIZE=3>\n";
@@ -619,8 +622,10 @@ $CSV_text1.=$CSV_login;
##### vicidial_timeclock log records for user #####
$total_login_time=0;
$SQday_ARY = explode('-',$query_date_BEGIN);
$EQday_ARY = explode('-',$end_date_END);
$query_date_BEGIN_ary=explode(" ", $query_date_BEGIN);
$end_date_END_ary=explode(" ", $end_date_END);
$SQday_ARY = explode('-',$query_date_BEGIN_ary[0]);
$EQday_ARY = explode('-',$end_date_END_ary[0]);
$SQepoch = mktime(0, 0, 0, $SQday_ARY[1], $SQday_ARY[2], $SQday_ARY[0]);
$EQepoch = mktime(23, 59, 59, $EQday_ARY[1], $EQday_ARY[2], $EQday_ARY[0]);
@@ -3,7 +3,7 @@
#
# Pulls all timeclock records for an agent
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 90602-2244 - First build
@@ -30,6 +30,7 @@
# 171012-2015 - Fixed javascript/apache errors with graphs
# 191013-0833 - Fixes for PHP7
# 220227-0927 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -68,8 +69,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";}
if (strlen($shift)<2) {$shift='ALL';}
@@ -4,7 +4,7 @@
# This report is designed to show the breakdown by list_id of the calls and
# their statuses for all lists within a campaign for a set time period
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -30,6 +30,7 @@
# 180807-1204 - Fixed log query issue
# 191013-0832 - Fixes for PHP7
# 220303-0812 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -66,7 +67,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$report_name="Campaign Status List Report";
$NOW_DATE = date("Y-m-d");
if (!isset($group)) {$group=array();}
if (!is_array($group)) {$group=array();}
if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;}
if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;}
if (!isset($query_date_T)) {$query_date_T="00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_carrier_log_report.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 120210-2202 - First build
@@ -18,6 +18,7 @@
# 191013-0815 - Fixes for PHP7
# 220303-0925 - Added allow_web_debug system setting
# 220812-0952 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -57,7 +58,7 @@ if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_d
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
if (!isset($server_ip)) {$server_ip = array();}
if (!is_array($server_ip)) {$server_ip = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
@@ -1,7 +1,7 @@
<?php
# AST_chat_log_report.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# This is the report page where you can view report information of any of the dialer's chats. The web page will
# display the information about the chat, including the start time and participants, and will also provide links
@@ -15,6 +15,7 @@
# 170409-1550 - Added IP List validation code
# 191013-0857 - Fixes for PHP7
# 220303-0909 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -71,10 +72,10 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($inbound_group)) {$inbound_group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($users)) {$users = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($inbound_group)) {$inbound_group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($users)) {$users = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_dial_log_report.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 130709-1346 - First build
@@ -16,6 +16,7 @@
# 210129-1010 - Added archive search option, issue #1222
# 220303-0812 - Added allow_web_debug system setting
# 220812-0953 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -156,8 +157,8 @@ $NOW_DATE = date("Y-m-d");
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($server_ip)) {$server_ip = array();}
if (!isset($sip_hangup_cause)) {$sip_hangup_cause = array();}
if (!is_array($server_ip)) {$server_ip = array();}
if (!is_array($sip_hangup_cause)) {$sip_hangup_cause = array();}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -1,7 +1,7 @@
<?php
# AST_dialer_inventory_report.php
#
# Copyright (C) 2022 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Matt Florell <vicidial@gmail.com>
#
# NOTES:
@@ -27,6 +27,7 @@
# 170829-0040 - Added screen color settings
# 191013-0845 - Fixes for PHP7
# 220303-0803 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -71,7 +72,7 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$time_start = microtime(true);
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -1,7 +1,7 @@
<?php
# AST_email_log_report.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# report of emails handled by the system
#
@@ -22,12 +22,13 @@
# 170829-0040 - Added screen color settings
# 191013-0823 - Fixes for PHP7
# 220303-0223 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
$version = '2.14-14';
$build = '220303-0223';
$version = '2.14-15';
$build = '240801-1130';
header ("Content-type: text/html; charset=utf-8");
@@ -64,7 +65,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!is_array($group)) {$group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -1,7 +1,7 @@
<?php
# AST_carrier_log_report.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 120331-2301 - First build
@@ -21,6 +21,7 @@
# 201218-1700 - Modified to include caller ID in results
# 220302-1813 - Added allow_web_debug system setting
# 220812-0940 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -69,10 +70,10 @@ $START_TIME=date("U");
$NOW_DATE = date("Y-m-d");
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
if (!isset($server_ip)) {$server_ip = array();}
if (!isset($hangup_cause)) {$hangup_cause = array();}
if (!isset($dial_status)) {$dial_status = array();}
if (!isset($sip_hangup_cause)) {$sip_hangup_cause = array();}
if (!is_array($server_ip)) {$server_ip = array();}
if (!is_array($hangup_cause)) {$hangup_cause = array();}
if (!is_array($dial_status)) {$dial_status = array();}
if (!is_array($sip_hangup_cause)) {$sip_hangup_cause = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
#############################################
@@ -1,7 +1,7 @@
<?php
# AST_inbound_daily_report.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -36,6 +36,7 @@
# 200701-1500 - Added option to exclude after-hours from abandons, list ID filtering
# 220302-1803 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -88,8 +89,8 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($list_ids)) {$list_ids = array(); $all_lists_selected="selected";}
if (!is_array($group)) {$group = array();}
if (!is_array($list_ids)) {$list_ids = array(); $all_lists_selected="selected";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1592,7 +1593,7 @@ else
}
}
if (!isset($totAGENTSdate[$d])) {$totAGENTSdate[$d]=array();}
if (!is_array($totAGENTSdate[$d])) {$totAGENTSdate[$d]=array();}
$totAGENTSdayCOUNT=count($totAGENTSdate[$d]);
$totAGENTSday=sprintf("%8s", count($totAGENTSdate[$d]));
@@ -1,7 +1,7 @@
<?php
# AST_inbound_forecasting.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -15,6 +15,7 @@
# 210823-0948 - Fix for security issue, added NONE option for campaigns
# 220301-2219 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -105,11 +106,12 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($campaign)) {$campaign = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($campaign)) {$campaign = array();}
if (!isset($drop_percent)) {$drop_percent = '3';}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($target_pqueue)) {$target_pqueue=0;}
if (strlen($shift)<2) {$shift='ALL';}
$report_name = 'Inbound Forecasting Report';
@@ -1,7 +1,7 @@
<?php
# AST_performance_comparison_report.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com LICENSE: AGPLv2
#
# CHANGES
#
@@ -22,6 +22,7 @@
# 191013-0900 - Fixes for PHP7
# 220302-0957 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -68,9 +69,9 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($users)) {$users = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($users)) {$users = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_quality_control_report.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Report for QC activity within VICIdial
#
@@ -9,6 +9,7 @@
# 210306-1556 - First Build
# 210827-1818 - Fix for security issue
# 220302-0927 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$admin_version = '2.14-3';
@@ -70,12 +71,12 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group) || !is_array($group)) {$group = array();}
if (!isset($users) || !is_array($users)) {$users = array();}
if (!isset($user_groups) || !is_array($user_groups)) {$user_groups = array();}
if (!isset($QCusers) || !is_array($QCusers)) {$QCusers = array();}
if (!isset($QCstatuses) || !is_array($QCstatuses)) {$QCstatuses = array();}
if (!isset($QCuser_groups) || !is_array($QCuser_groups)) {$QCuser_groups = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($users)) {$users = array();}
if (!is_array($user_groups)) {$user_groups = array();}
if (!is_array($QCusers)) {$QCusers = array();}
if (!is_array($QCstatuses)) {$QCstatuses = array();}
if (!is_array($QCuser_groups)) {$QCuser_groups = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_time)) {$query_time = "00:00:00";}
@@ -3,7 +3,7 @@
#
# This report is for viewing the a report of which users accessed which recordings
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -14,6 +14,7 @@
# 191013-0830 - Fixes for PHP7
# 220302-0912 - Added allow_web_debug system setting
# 220307-2323 - Fix for display issue
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -57,8 +58,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
if (!isset($users)) {$users=array();}
if (!isset($user_group)) {$user_group=array();}
if (!is_array($users)) {$users=array();}
if (!is_array($user_group)) {$user_group=array();}
if (!isset($access_date_D)) {$access_date_D=$NOW_DATE;}
if (!isset($access_date_end_D)) {$access_date_end_D=$NOW_DATE;}
if (!isset($access_date_T)) {$access_date_T="00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_rt_monitor_log_report.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -11,6 +11,7 @@
# 180712-1508 - Fix for rare allowed reports issue
# 191013-0906 - Fixes for PHP7
# 220302-0849 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -60,9 +61,9 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($campaign)) {$campaign = array();}
if (!isset($managers)) {$managers = array();}
if (!isset($users)) {$users = array();}
if (!is_array($campaign)) {$campaign = array();}
if (!is_array($managers)) {$managers = array();}
if (!is_array($users)) {$users = array();}
if (!isset($report_display_type)) {$report_display_type = "HTML";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -1,7 +1,7 @@
<?php
# AST_rt_whiteboard_rpt.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# Real-time report that allows users to create a customized, graphical display of various data sets
#
@@ -13,6 +13,7 @@
# 210827-1818 - Fix for security issue
# 220221-1505 - Added allow_web_debug system setting
# 220823-1327 - Fix for warnings being thrown on arrays
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -66,11 +67,11 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_time)) {$query_time="08:00:00";}
if (!isset($end_time)) {$end_time="17:00:00";}
if (!isset($campaigns)) {$campaigns = array(); if ($DB) {echo "\$campaigns not set, making array...\n".(is_array($campaigns) ? "Yes" : "No");} } else {if ($DB) {echo "\$campaigns IS set: $campaigns\n";} }
if (!isset($users)) {$users = array();}
if (!isset($user_groups)) {$user_groups = array();}
if (!isset($dids)) {$dids = array();}
if (!isset($groups)) {$groups = array();}
if (!is_array($campaigns)) {$campaigns = array(); if ($DB) {echo "\$campaigns not set, making array...\n".(is_array($campaigns) ? "Yes" : "No");} } else {if ($DB) {echo "\$campaigns IS set: $campaigns\n";} }
if (!is_array($users)) {$users = array();}
if (!is_array($user_groups)) {$user_groups = array();}
if (!is_array($dids)) {$dids = array();}
if (!is_array($groups)) {$groups = array();}
if (!isset($report_display_type)) {$report_display_type = "HTML";}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# AST_rt_whiteboard_rpt_mobile.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# Mobile version of real-time report that allows users to create a customized, graphical display of various data sets
#
@@ -9,6 +9,7 @@
# 200309-1819 - Modifications for display formatting
# 210827-1818 - Fix for security issue
# 220221-1513 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -237,7 +238,11 @@ if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen(
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($groups) || !is_array($groups)) {$groups = array();}
if (!is_array($groups)) {$groups = array();}
if (!is_array($campaigns)) {$campaigns = array();}
if (!is_array($users)) {$users = array();}
if (!is_array($user_groups)) {$user_groups = array();}
if (!is_array($dids)) {$dids = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -406,11 +411,6 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($campaigns)) {$campaign = array();}
if (!isset($users)) {$users = array();}
if (!isset($user_groups)) {$user_groups = array();}
if (!isset($dids)) {$dids = array();}
if (!isset($groups)) {$groups = array();}
if (!isset($report_display_type)) {$report_display_type = "HTML";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -5,7 +5,7 @@
# or aource_id ,user's choice, of the calls and their statuses for all lists
# within a campaign for a set time period
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -14,6 +14,7 @@
# 180507-2315 - Added new help display
# 191013-0834 - Fixes for PHP7
# 220302-0835 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -53,7 +54,7 @@ if (isset($_GET["search_archived_data"])) {$search_archived_data=$_GET["search
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
if (!isset($group)) {$group=array();}
if (!is_array($group)) {$group=array();}
if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;}
if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;}
if (!isset($query_date_T)) {$query_date_T="00:00:00";}
@@ -6,7 +6,7 @@
# QC statuses of QCFAIL, QCCANC and sales are defined by the Sale=Y status
# flags being set on those statuses.
#
# Copyright (C) 2023 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -37,6 +37,7 @@
# 210222-1508 - Added option to show all users
# 220301-2155 - Added allow_web_debug system setting
# 230407-1039 - Added include_sales_in_TPD_report option
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -81,9 +82,10 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($call_statuses)) {$call_statuses = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($call_status)) {$call_status = array();}
if (!is_array($call_statuses)) {$call_statuses = array();}
if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;}
if (!isset($end_date_D)) {$end_date_D=$NOW_DATE;}
if (!isset($query_date_T)) {$query_date_T="00:00:00";}
@@ -1,7 +1,7 @@
<?php
# AST_timeonVDADall.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# live real-time stats for the VICIDIAL Auto-Dialer all servers
#
@@ -132,6 +132,7 @@
# 230421-1636 - Added RS_UGlatencyRESTRICT options.php setting
# 230811-1530 - Added realtime monitoring display information
# 231115-1656 - Added RS_no_DEAD_status and RS_hide_CUST_info options.php settings
# 240801-1130 - Code updates for PHP8 compatibility
#
$version = '2.14-117';
@@ -329,9 +330,9 @@ if (strlen($report_display_type)<2) {$report_display_type = $SSreport_default_fo
if (!isset($DB)) {$DB=0;}
if (!isset($RR)) {$RR=40;}
if (!isset($group)) {$group='ALL-ACTIVE';}
if (!isset($groups)) {$groups=array();}
if (!isset($user_group_filter)) {$user_group_filter=array();}
if (!isset($ingroup_filter)) {$ingroup_filter=array();}
if (!is_array($groups)) {$groups=array();}
if (!is_array($user_group_filter)) {$user_group_filter=array();}
if (!is_array($ingroup_filter)) {$ingroup_filter=array();}
if (!isset($usergroup)) {$usergroup='';}
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
@@ -1,7 +1,7 @@
<?php
# AST_timeonVDADallSUMMARY_mobile.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# Mobile version of summary report for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
#
@@ -12,6 +12,7 @@
# 190129-1258 - First release
# 200414-2000 - Minor display modifications, auto-selecting refresh rate onload
# 220301-2036 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -45,7 +46,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($browser_dimension)) {$browser_dimension=800;}
if (!isset($types)) {$types='LIST ALL CAMPAIGNS';}
if (!is_array($types)) {$types=array('LIST ALL CAMPAIGNS');}
$cell_dimension=floor($browser_dimension/10);
$report_name = 'Real-Time Campaign Summary';
@@ -1,7 +1,7 @@
<?php
# AST_timeonVDADall_mobile.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# live real-time stats for the VICIDIAL Auto-Dialer all servers
#
@@ -10,10 +10,11 @@
# CHANGELOG:
# 200318-1124 - First build, based upon AST_timeonVDADall.php
# 220221-1536 - Added allow_web_debug system setting
# 240801-1137 - Code updates for PHP8 compatibility
#
$version = '2.14-2';
$build = '220221-1536';
$version = '2.14-3';
$build = '240801-1137';
header ("Content-type: text/html; charset=utf-8");
@@ -154,9 +155,9 @@ if (file_exists('options.php'))
if (!isset($DB)) {$DB=0;}
if (!isset($RR)) {$RR=40;}
if (!isset($group)) {$group='ALL-ACTIVE';}
if (!isset($groups)) {$groups=array();}
if (!isset($user_group_filter)) {$user_group_filter=array();}
if (!isset($ingroup_filter)) {$ingroup_filter=array();}
if (!is_array($groups)) {$groups=array();}
if (!is_array($user_group_filter)) {$user_group_filter=array();}
if (!is_array($ingroup_filter)) {$ingroup_filter=array();}
if (!isset($usergroup)) {$usergroup='';}
if (!isset($UGdisplay)) {$UGdisplay=0;} # 0=no, 1=yes
if (!isset($UidORname)) {$UidORname=1;} # 0=id, 1=name
@@ -693,19 +694,19 @@ $NFB = '<b><font size=6 face="courier">';
$NFE = '</font></b>';
$F=''; $FG=''; $B=''; $BG='';
$select_list = "<TABLE class=\"realtime_settings_table\" CELLPADDING=5 BGCOLOR=\"#D9E6FE\"><TR><TD VALIGN=TOP>"._QXZ("Select Campaigns").": <BR>";
$select_list = "<TABLE class='realtime_settings_table' CELLPADDING=5 BGCOLOR='#D9E6FE'><TR><TD VALIGN=TOP>"._QXZ("Select Campaigns").": <BR>";
$select_list .= "<SELECT SIZE=15 NAME=groups[] multiple>";
$o=0;
while ($groups_to_print > $o)
{
if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
{$select_list .= "<option selected value='$LISTgroups[$o]'>$LISTgroups[$o] - $LISTnames[$o]</option>";}
else
{$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
{$select_list .= "<option value='$LISTgroups[$o]'>$LISTgroups[$o] - $LISTnames[$o]</option>";}
$o++;
}
$select_list .= "</SELECT>";
$select_list .= "<BR><font class=\"top_settings_val\">"._QXZ("(To select more than 1 campaign, hold down the Ctrl key and click)")."<font>";
$select_list .= "<BR><font class='top_settings_val'>"._QXZ("(To select more than 1 campaign, hold down the Ctrl key and click)")."<font>";
$select_list .= "<BR><BR>"._QXZ("Select User Groups").": <BR>";
$select_list .= "<SELECT SIZE=8 NAME=user_group_filter[] ID=user_group_filter[] multiple>";
@@ -713,9 +714,9 @@ $o=0;
while ($o < $usergroups_to_print)
{
if (preg_match("/\|$usergroups[$o]\|/",$user_group_filter_string))
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
{$select_list .= "<option selected value='$usergroups[$o]'>$usergroups[$o] - $usergroupnames[$o]</option>";}
else
{$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
{$select_list .= "<option value='$usergroups[$o]'>$usergroups[$o] - $usergroupnames[$o]</option>";}
$o++;
}
$select_list .= "</SELECT>";
@@ -739,36 +740,36 @@ while ($o < $ingroups_to_print)
$select_list .= "</SELECT>";
$select_list .= "</TD><TD VALIGN=TOP ALIGN=CENTER>";
$select_list .= "<a href=\"#\" onclick=\"closeDiv(\'campaign_select_list\');\">"._QXZ("Close Panel")."</a><BR><BR>";
$select_list .= "<a href='#' onclick=\\\"closeDiv('campaign_select_list');\\\">"._QXZ("Close Panel")."</a><BR><BR>";
$select_list .= "<TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>";
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Inbound").": </TD><TD align=left><SELECT SIZE=1 NAME=with_inbound>";
$select_list .= "<option value=\"N\"";
$select_list .= "<option value='N'";
if ($with_inbound=='N') {$select_list .= " selected";}
$select_list .= ">"._QXZ("No")."</option>";
$select_list .= "<option value=\"Y\"";
$select_list .= "<option value='Y'";
if ($with_inbound=='Y') {$select_list .= " selected";}
$select_list .= ">"._QXZ("Yes")."</option>";
$select_list .= "<option value=\"O\"";
$select_list .= "<option value='O'";
if ($with_inbound=='O') {$select_list .= " selected";}
$select_list .= ">"._QXZ("Only")."</option>";
$select_list .= "</SELECT></TD></TR>";
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Monitor").": </TD><TD align=left><SELECT SIZE=1 NAME=monitor_active>";
$select_list .= "<option value=\"\"";
$select_list .= "<option value=''";
if (strlen($monitor_active) < 2) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NONE")."</option>";
if (preg_match("/MONITOR/",$RS_ListenBarge) )
{
$select_list .= "<option value=\"MONITOR\"";
$select_list .= "<option value='MONITOR'";
if ($monitor_active=='MONITOR') {$select_list .= " selected";}
$select_list .= ">"._QXZ("MONITOR")."</option>";
}
if (preg_match("/BARGE/",$RS_ListenBarge) )
{
$select_list .= "<option value=\"BARGE\"";
$select_list .= "<option value='BARGE'";
if ($monitor_active=='BARGE') {$select_list .= " selected";}
$select_list .= ">"._QXZ("BARGE")."</option>";
}
@@ -785,7 +786,7 @@ $select_list .= "</SELECT></TD></TR>";
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Phone").": </TD><TD align=left>";
$select_list .= "<INPUT type=text size=10 maxlength=20 NAME=monitor_phone VALUE=\"$monitor_phone\">";
$select_list .= "<INPUT type=text size=10 maxlength=20 NAME=monitor_phone VALUE='$monitor_phone'>";
$select_list .= "</TD></TR>";
$select_list .= "<TR><TD align=center COLSPAN=2> &nbsp; </TD></TR>";
@@ -794,12 +795,12 @@ if ($UGdisplay > 0)
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Select User Group").": </TD><TD align=left>";
$select_list .= "<SELECT SIZE=1 NAME=usergroup>";
$select_list .= "<option value=\"\">"._QXZ("ALL USER GROUPS")."</option>";
$select_list .= "<option value=''>"._QXZ("ALL USER GROUPS")."</option>";
$o=0;
while ($usergroups_to_print > $o)
{
if ($usergroups[$o] == $usergroup) {$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o]</option>";}
else {$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o]</option>";}
if ($usergroups[$o] == $usergroup) {$select_list .= "<option selected value='$usergroups[$o]'>$usergroups[$o]</option>";}
else {$select_list .= "<option value='$usergroups[$o]'>$usergroups[$o]</option>";}
$o++;
}
$select_list .= "</SELECT></TD></TR>";
@@ -807,30 +808,30 @@ if ($UGdisplay > 0)
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Dialable Leads Alert").": </TD><TD align=left><SELECT SIZE=1 NAME=NOLEADSalert>";
$select_list .= "<option value=\"\"";
$select_list .= "<option value=''";
if (strlen($NOLEADSalert) < 2) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NO")."</option>";
$select_list .= "<option value=\"YES\"";
$select_list .= "<option value='YES'";
if ($NOLEADSalert=='YES') {$select_list .= " selected";}
$select_list .= ">"._QXZ("YES")."</option>";
$select_list .= "</SELECT></TD></TR>";
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Show Drop In-Group Row").": </TD><TD align=left><SELECT SIZE=1 NAME=DROPINGROUPstats>";
$select_list .= "<option value=\"0\"";
$select_list .= "<option value='0'";
if ($DROPINGROUPstats < 1) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NO")."</option>";
$select_list .= "<option value=\"1\"";
$select_list .= "<option value='1'";
if ($DROPINGROUPstats=='1') {$select_list .= " selected";}
$select_list .= ">"._QXZ("YES")."</option>";
$select_list .= "</SELECT></TD></TR>";
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Show Carrier Stats").": </TD><TD align=left><SELECT SIZE=1 NAME=CARRIERstats>";
$select_list .= "<option value=\"0\"";
$select_list .= "<option value='0'";
if ($CARRIERstats < 1) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NO")."</option>";
$select_list .= "<option value=\"1\"";
$select_list .= "<option value='1'";
if ($CARRIERstats=='1') {$select_list .= " selected";}
$select_list .= ">"._QXZ("YES")."</option>";
$select_list .= "</SELECT></TD></TR>";
@@ -850,10 +851,10 @@ if ($presets_enabled > 0)
{
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Show Presets Stats").": </TD><TD align=left><SELECT SIZE=1 NAME=PRESETstats>";
$select_list .= "<option value=\"0\"";
$select_list .= "<option value='0'";
if ($PRESETstats < 1) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NO")."</option>";
$select_list .= "<option value=\"1\"";
$select_list .= "<option value='1'";
if ($PRESETstats=='1') {$select_list .= " selected";}
$select_list .= ">"._QXZ("YES")."</option>";
$select_list .= "</SELECT></TD></TR>";
@@ -861,10 +862,10 @@ if ($presets_enabled > 0)
$select_list .= "<TR><TD align=right>";
$select_list .= _QXZ("Agent Time Stats").": </TD><TD align=left><SELECT SIZE=1 NAME=AGENTtimeSTATS>";
$select_list .= "<option value=\"0\"";
$select_list .= "<option value='0'";
if ($AGENTtimeSTATS < 1) {$select_list .= " selected";}
$select_list .= ">"._QXZ("NO")."</option>";
$select_list .= "<option value=\"1\"";
$select_list .= "<option value='1'";
if ($AGENTtimeSTATS=='1') {$select_list .= " selected";}
$select_list .= ">"._QXZ("YES")."</option>";
$select_list .= "</SELECT></TD></TR>";
@@ -892,14 +893,14 @@ $select_list .= ">"._QXZ("WALL_4")."</option>";
$select_list .= "</SELECT></TD></TR>";
$select_list .= "</TABLE><BR>";
$select_list .= "<INPUT type=hidden name=droppedOFtotal value=\"$droppedOFtotal\">";
$select_list .= "<INPUT style='background-color:#$SSbutton_color' type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; ";
$select_list .= "<INPUT type=hidden name=droppedOFtotal value='$droppedOFtotal'>";
$select_list .= "<INPUT style='background-color:#$SSbutton_color' type=submit NAME=SUBMIT VALUE=SUBMIT><FONT FACE='ARIAL,HELVETICA' COLOR=BLACK SIZE=2> &nbsp; &nbsp; &nbsp; &nbsp; ";
$select_list .= "</TD></TR>";
$select_list .= "<TR><TD ALIGN=CENTER>";
$select_list .= "<font class=\"top_settings_val\"> &nbsp; </font>";
$select_list .= "<font class='top_settings_val'> &nbsp; </font>";
$select_list .= "</TD>";
$select_list .= "<TD NOWRAP align=right>";
$select_list .= "<font class=\"top_settings_val\">"._QXZ("VERSION").": $version &nbsp; "._QXZ("BUILD").": $build</font>";
$select_list .= "<font class='top_settings_val'>"._QXZ("VERSION").": $version &nbsp; "._QXZ("BUILD").": $build</font>";
$select_list .= "</TD></TR></TABLE>";
$open_list = '<TABLE WIDTH=250 CELLPADDING=0 CELLSPACING=0 BGCOLOR=\'#D9E6FE\'><TR><TD ALIGN=CENTER><a href=\'#\' onclick=\\"openDiv(\'campaign_select_list\');\\"><font class=\'top_settings_val\'>'._QXZ("Choose Report Display Options").'</a></TD></TR></TABLE>';
@@ -1183,6 +1184,7 @@ else
.Hfr3 {color: black; background-color: #FF6666; font-family: HELVETICA; font-size: 18; font-weight: bold;}
.Hfr4 {color: white; background-color: #FF0000; font-family: HELVETICA; font-size: 18; font-weight: bold;}
.realtime_settings_table {width: 50vw; max-width: 600px; }
<?php
$stmt="SELECT group_id,group_color from vicidial_inbound_groups;";
$rslt=mysql_to_mysqli($stmt, $link);
@@ -1,7 +1,7 @@
<?php
# AST_url_log_report.php
#
# Copyright (C) 2023 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 130620-0806 - First build
@@ -15,6 +15,7 @@
# 220301-1951 - Added allow_web_debug system setting
# 220812-0931 - Added User Group report permissions checking
# 230310-1051 - Added more missing url types
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -59,7 +60,7 @@ $NOW_DATE = date("Y-m-d");
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($url_type)) {$url_type = array();}
if (!is_array($url_type)) {$url_type = array();}
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
@@ -1,7 +1,7 @@
<?php
# AST_user_group_hourly_detail.php
#
# Copyright (C) 2023 Joseph Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joseph Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# Gives hourly count of distinct agents per user group, with totals.
# For single days only
@@ -15,6 +15,7 @@
# 191013-0855 - Fixes for PHP7
# 220221-0932 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -62,8 +63,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($start_hour)) {$start_hour = date("H");}
if (!isset($end_hour)) {$end_hour = date("H");}
@@ -1,7 +1,7 @@
<?php
# AST_user_group_hourly_detail.php
#
# Copyright (C) 2023 Liz Tejada <liz@softkyrios.com>
# Copyright (C) 2024 Liz Tejada <liz@softkyrios.com>
# Joseph Johnson <freewermadmin@gmail.com>
# Matt Florell <vicidial@gmail.com>
#
@@ -20,6 +20,7 @@
# 191013-0816 - Fixes for PHP7
# 220301-1940 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -68,8 +69,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($start_hour)) {$start_hour = date("H");}
if (!isset($end_hour)) {$end_hour = date("H");}
@@ -509,7 +510,8 @@ if ($SUBMIT && $query_date && $start_hour && $end_hour) {
$UserGroups=array_unique($UserGroups);
$hour_array=array_unique($hour_array);
$total_stmt="select user_group, count(distinct user) as ct from ".$vicidial_agent_log_table." where event_time>='$query_date $start_hour:00:00' and event_time<='$query_date $end_hour:59:59' $group_SQL $user_group_SQL group by user_group order by user_group,2";
$total_stmt="select user_group, count(distinct user) as ct from ".$vicidial_agent_log_table." log where event_time>='$query_date $start_hour:00:00' and event_time<='$query_date $end_hour:59:59' $group_SQL $user_group_SQL group by user_group order by user_group,2";
if ($DB) {$ASCII_text.="* ".$total_stmt."\n";}
$total_rslt=mysql_to_mysqli($total_stmt, $link);
if ($DB) {$ASCII_text.="* ".$total_stmt."\n";}
$total_array=array();
@@ -517,7 +519,7 @@ if ($SUBMIT && $query_date && $start_hour && $end_hour) {
$total_array[$total_row["user_group"]]+=$total_row["ct"];
}
$grand_total_stmt="select distinct user from ".$vicidial_agent_log_table." where event_time>='$query_date $start_hour:00:00' and event_time<='$query_date $end_hour:59:59' $group_SQL $user_group_SQL";
$grand_total_stmt="select distinct user from ".$vicidial_agent_log_table." log where event_time>='$query_date $start_hour:00:00' and event_time<='$query_date $end_hour:59:59' $group_SQL $user_group_SQL";
$grand_total_rslt=mysql_to_mysqli($grand_total_stmt, $link);
$grand_total=mysqli_num_rows($grand_total_rslt);
@@ -539,16 +541,17 @@ if ($SUBMIT && $query_date && $start_hour && $end_hour) {
foreach($UserGroups as $Ugroup){
foreach($hour_array as $hour){
//echo "group-->". $data[0]." hour-->".$data[1]." agent-->".$data[2]."<br/>";
# echo "group-->". $data[0]." hour-->".$data[1]." agent-->".$data[2]."<br/>";
$a=$allData[$Ugroup][$hour];
if (is_array($a)) {$count_a=count($a);} else {$count_a=0;}
if(isset($maxUserByUserGroup[$Ugroup])){
if(count($a)>$maxUserByUserGroup[$Ugroup]){
$maxUserByUserGroup[$Ugroup]=count($a);
if($count_a>$maxUserByUserGroup[$Ugroup]){
$maxUserByUserGroup[$Ugroup]=$count_a;
}
}else{
$maxUserByUserGroup[$Ugroup]=count($a);
$maxUserByUserGroup[$Ugroup]=$count_a;
}
}
@@ -4,7 +4,7 @@
# This User-Group based report runs some very intensive SQL queries, so it is
# not recommended to run this on long time periods.
#
# Copyright (C) 2023 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -26,6 +26,7 @@
# 191013-0822 - Fixes for PHP7
# 220301-1656 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -56,7 +57,7 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($user_group)) {$user_group = array();}
if (!is_array($user_group)) {$user_group = array();}
$report_name = 'User Group Login Report';
$db_source = 'M';
@@ -1,7 +1,7 @@
<?php
# AST_webserver_url_report.php
#
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 140225-0229 - First build
@@ -13,6 +13,7 @@
# 191013-0907 - Fixes for PHP7
# 220301-1616 - Added allow_web_debug system setting
# 220812-0927 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -58,8 +59,8 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
if (strlen($query_date_D) < 6) {$query_date_D = "00:00:00";}
if (strlen($query_date_T) < 6) {$query_date_T = "23:59:59";}
if (!isset($webserver)) {$webserver = array();}
if (!isset($url)) {$url = array();}
if (!is_array($webserver)) {$webserver = array();}
if (!is_array($url)) {$url = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
+11 -8
View File
@@ -1,7 +1,7 @@
<?php
# Erlang_report.php
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -15,6 +15,7 @@
# 191013-0820 - Fixes for PHP7
# 220301-0937 - Added allow_web_debug system setting
# 230526-1740 - Patch for user_group bug, related to Issue #1346
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -105,8 +106,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($campaign)) {$campaign = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($campaign)) {$campaign = array();}
if (!isset($drop_percent)) {$drop_percent = '3';}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
@@ -169,11 +170,13 @@ else
}
$HTML_text="";
$actual_agents+=0;
$hourly_pay+=0;
$revenue_per_sale+=0;
$sale_chance+=0;
$retry_rate+=0;
($actual_agents ? $actual_agents+=0 : $actual_agents=0);
($hourly_pay ? $hourly_pay+=0 : $hourly_pay=0);
($revenue_per_sale ? $revenue_per_sale+=0 : $revenue_per_sale=0);
($sale_chance ? $sale_chance+=0 : $sale_chance=0);
($retry_rate ? $retry_rate+=0 : $retry_rate=0);
if (!$target_pqueue) {$target_pqueue=0;}
switch ($erlang_type) {
default:
+17 -13
View File
@@ -1,12 +1,13 @@
<?php
# KHOMP_admin.php - KHOMP carrier definition administration page
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# Interface for defining KHOMP codes for the dialer
#
# 200210-1604 - First build
# 220223-1109 - Added allow_web_debug system setting
# 240801-1130 - Bug fixes
#
$startMS = microtime();
@@ -110,19 +111,20 @@ $browser = getenv("HTTP_USER_AGENT");
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,allow_chats,enable_languages,language_method,default_language,allow_web_debug FROM system_settings;";
$stmt = "SELECT use_non_latin,allow_chats,enable_languages,language_method,default_language,allow_web_debug,outbound_autodial_active FROM system_settings;";
$rslt=mysql_to_mysqli($stmt, $link);
#if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysqli_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysqli_fetch_row($rslt);
$non_latin = $row[0];
$SSallow_chats = $row[1];
$SSenable_languages = $row[2];
$SSlanguage_method = $row[3];
$SSdefault_language = $row[4];
$SSallow_web_debug = $row[5];
$non_latin = $row[0];
$SSallow_chats = $row[1];
$SSenable_languages = $row[2];
$SSlanguage_method = $row[3];
$SSdefault_language = $row[4];
$SSallow_web_debug = $row[5];
$SSoutbound_autodial_active = $row[6];
}
if ($SSallow_web_debug < 1) {$DB=0;}
$VUselected_language = $SSdefault_language;
@@ -232,11 +234,13 @@ if ($submit_khomp=="UPDATE")
}
}
if (!$link) echo "No DB link.";
$update_khomp_string=trim(preg_replace('/\//', "\/", $update_khomp_string));
$stmt="select * from vicidial_settings_containers where container_id='KHOMPSTATUSMAP'";
$rslt=mysql_to_mysqli($stmt, $link);
while($row=mysqli_fetch_row($rslt))
while($row=mysqli_fetch_array($rslt))
{
$container_entry=$row[4];
$khomps_array=explode("\n", $container_entry);
@@ -263,9 +267,9 @@ if ($submit_khomp=="UPDATE")
$SQL_log = "$update_stmt|";
$SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='KHOMP', event_type='UPDATE', record_id='$PN[$p]', event_code='ADMIN UPDATE KHOMP CODE', event_sql=\"$SQL_log\", event_notes='';";
$log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='KHOMP', event_type='UPDATE', record_id='$PN[$p]', event_code='ADMIN UPDATE KHOMP CODE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$log_rslt=mysql_to_mysqli($log_stmt, $link);
}
else
{
@@ -328,9 +332,9 @@ else if ($submit_khomp=="ADD")
$SQL_log = "$update_stmt|";
$SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='KHOMP', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD KHOMP CODE', event_sql=\"$SQL_log\", event_notes='';";
$log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='KHOMP', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN ADD KHOMP CODE', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$log_rslt=mysql_to_mysqli($log_stmt, $link);
}
else
{
@@ -1,7 +1,7 @@
<?php
# NANPA_running_processes.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script shows running NANPA filter batch proccesses
#
@@ -13,10 +13,11 @@
# 170409-1537 - Added IP List validation code
# 170822-2230 - Added screen color settings
# 220222-1917 - Added allow_web_debug system setting
# 240801-1136 - Code updates for PHP8 compatibility
#
$version = '2.14-6';
$build = '220222-1917';
$version = '2.14-7';
$build = '240801-1136';
$startMS = microtime();
require("dbconnect_mysqli.php");
@@ -197,6 +198,7 @@ if ($agent_screen_colors != 'default')
}
}
if(!is_array($output_codes_to_display)) {$output_codes_to_display=array();}
$oc_ct=count($output_codes_to_display);
$oc_SQL="'',";
+21 -3
View File
@@ -1,7 +1,7 @@
<?php
# adminCORS.php - CORS processing and responses for Cross-Origin Features
#
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CORS settings coming from the options.php script (the first 3 variables must be set for these features to be active)
# $CORS_allowed_origin = ''; # if multiple origins allowed, separate them by a pipe (also allows PHP preg syntax)
@@ -20,15 +20,33 @@
#
# CHANGELOG
# 210618-0938 - First Build
# 240801-1138 - Code updates for PHP8 compatibility
# 240805-2103 - Added PHP_error_reporting_OVERRIDE options
#
$PHP_error_reporting_OVERRIDE=0;
if (file_exists('options.php'))
{
require('options.php');
}
if ($PHP_error_reporting_OVERRIDE > 0)
{
$php_err_suppression_value=32767; # E_ALL
$php_err_suppression_value-=($PHP_error_reporting_HIDE_ERRORS ? 1 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_WARNINGS ? 2 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_PARSES ? 4 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_NOTICES ? 8 : 0);
$php_err_suppression_value-=($PHP_error_reporting_HIDE_DEPRECATIONS ? 8192 : 0);
error_reporting($php_err_suppression_value);
}
$NOW_TIME = date("Y-m-d H:i:s");
if (strlen($php_script) < 1)
{$donothing=1;}
else
{
$CORS_origin = $_SERVER['HTTP_ORIGIN']; # The client browser origin server
$CORS_origin = "$_SERVER[HTTP_ORIGIN]"; # The client browser origin server - treated as string for stripos command
$CORS_method = isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD']) ? $_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'] : $_SERVER['REQUEST_METHOD']; # Either the requested HTTP method or the current one
$CORS_affected_scripts = " $CORS_affected_scripts "; # surround with spaces for preg match below
@@ -116,4 +134,4 @@ else
}
}
?>
?>
@@ -1,7 +1,7 @@
<?php
# admin_NANPA_updater.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# This script is designed to launch NANPA filter batch proccesses through the
# triggering process
@@ -18,10 +18,11 @@
# 180503-2015 - Added new help display
# 191013-0814 - Fixes for PHP7
# 220222-1753 - Added allow_web_debug system setting
# 240801-1138 - Code updates for PHP8 compatibility
#
$version = '2.14-9';
$build = '220222-1753';
$version = '2.14-10';
$build = '240801-1138';
$startMS = microtime();
require("dbconnect_mysqli.php");
@@ -214,7 +215,7 @@ if ($delete_trigger_id)
$delete_rslt=mysql_to_mysqli($delete_stmt, $link);
}
if (!isset($lists)) {$lists=array();}
if (!is_array($lists)) {$lists=array();}
$list_ct=count($lists);
if ($submit_form=="SUBMIT" && $list_ct>0 && (strlen($vl_field_update)>0 || strlen($cellphone_list_id)>0 || strlen($landline_list_id)>0 || strlen($invalid_list_id)>0) )
{
@@ -348,6 +349,7 @@ function StartRefresh() {
rInt=window.setInterval(function() {RefreshNANPA("<?php echo $iframe_url; ?>")}, 10000);
}
function RefreshNANPA(spanURL) {
if (!document.getElementById("running_processes")) {return false;}
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
@@ -420,7 +422,7 @@ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"vicidial_stylesheet.php\
echo "<script language=\"JavaScript\" src=\"help.js\"></script>\n";
echo "<div id='HelpDisplayDiv' class='help_info' style='display:none;'></div>";
echo "</head>\n";
$ADMIN=$PHP_SELF;
# $ADMIN=$PHP_SELF;
$short_header=1;
# $NWB = " &nbsp; <a href=\"javascript:openNewWindow('help.php?ADD=99999";
@@ -34,6 +34,7 @@
# 220222-0821 - Added allow_web_debug system setting
# 230522-1726 - Added missing vicidial_users fields from copy function
# 240217-0908 - Added more missing vicidial_users fields from copy function
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -146,6 +147,7 @@ else
$ACCIDto_insert_raw_ArFilter = array_filter($ACCIDto_insert_raw);
}
$DIDto_insert_raw = preg_replace('/[^0-9\n]/','',$DIDto_insert_raw);
$DIDto_insert_raw = preg_replace('/\n+$/','',$DIDto_insert_raw);
$DIDto_insert_raw = explode("\n", $DIDto_insert_raw);
if ( $form_to_run == "BULKDIDSDELETETB" )
{
@@ -485,6 +487,7 @@ if ($form_to_run == "ACCID")
$ACCIDduplicate = array();
$ACCIDinserted = array();
$ACCIDareacode = array();
$ACCIDbadlen = array();
$i=0; #loop counter
$j=0; #duplicate counter
$k=0; #insert counter
@@ -1018,7 +1021,7 @@ elseif ($form_to_run == "BULKDIDS")
$l=0; #bad length counter
while ($i < count($DIDto_insert_raw))
{
$SQL= "SELECT did_pattern FROM vicidial_inbound_dids WHERE did_pattern=$DIDto_insert_raw[$i];";
$SQL= "SELECT did_pattern FROM vicidial_inbound_dids WHERE did_pattern='$DIDto_insert_raw[$i]';";
if ($DB) {echo "$SQL|";}
$SQL_rslt=mysql_to_mysqli($SQL, $link);
$row = mysqli_fetch_row($SQL_rslt);
@@ -83,10 +83,11 @@
# 230210-1844 - Added invalid_phone_override option <admin_listloader_fifth_gen.php started>
# 231207-1446 - Fix for web_loader_phone_strip duplicate check, issue #1498, also changed format to "Custom layout" default
# 240320-1034 - Added misssing input variable filtering
# 240801-1132 - Code updates for PHP8 compatibility
#
$version = '2.14-81';
$build = '240320-1034';
$version = '2.14-82';
$build = '240801-1132';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -301,6 +302,11 @@ if (is_array($dedupe_statuses))
}
}
}
else
{
$dedupe_statuses=array();
}
if (strlen($dedupe_statuses_override)>0)
{
@@ -1045,9 +1051,9 @@ if ($SSenable_international_dncs)
##### BEGIN custom fields submission #####
if ($OK_to_process)
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\ndocument.forms[0].list_id_override.disabled=true;\ndocument.forms[0].phone_code_override.disabled=true;\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=true;}\n</script>";
flush();
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $Tline=1; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $Tline=1; $phone_list='';
$file=fopen("$lead_file", "r");
if ($webroot_writable > 0)
@@ -1067,7 +1073,7 @@ if ($OK_to_process)
$file=fopen("$lead_file", "r");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing file")."... (s-1)\n";
if (count($dedupe_statuses)>0)
if (is_array($dedupe_statuses) && count($dedupe_statuses)>0)
{
$statuses_clause=" and status in (";
$status_dedupe_str="";
@@ -1549,7 +1555,7 @@ if ($OK_to_process)
if (($leadfile) && ($LF_path))
{
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $Tline=1; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $Tline=1; $phone_list='';
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck | status mismatch action: $status_mismatch_action| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| dnc_country_scrub:$international_dnc_scrub| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length| web_loader_phone_strip:$SSweb_loader_phone_strip|';";
@@ -1626,7 +1632,7 @@ if (($leadfile) && ($LF_path))
}
}
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
flush();
$delim_set=0;
@@ -1679,7 +1685,7 @@ if (($leadfile) && ($LF_path))
{
flush();
$file=fopen("$lead_file", "r");
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $Tline=1; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $Tline=1; $phone_list='';
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing")." $delim_name "._QXZ("file using template")." $template_id... ($tab_count|$pipe_count) (s-2)\n";
if (strlen($list_id_override)>0)
{
@@ -1961,56 +1967,61 @@ if (($leadfile) && ($LF_path))
#$rslt=mysql_to_mysqli($custom_SQL_query, $link);
#$affected_rows = mysqli_affected_rows($link);
$custom_ins_stmt="INSERT INTO $custom_table(lead_id";
$custom_SQL_values="";
for ($q=0; $q<count($custom_fields_ary); $q++)
$custom_tbl_stmt="SHOW TABLES LIKE '$custom_table'";
$custom_tbl_rslt=mysql_to_mysqli($custom_tbl_stmt, $link);
if(mysqli_num_rows($custom_tbl_rslt)>0)
{
if (strlen($custom_fields_ary[$q])>0)
$custom_ins_stmt="INSERT INTO $custom_table(lead_id";
$custom_SQL_values="";
for ($q=0; $q<count($custom_fields_ary); $q++)
{
$fieldno_ary=explode(",", $custom_fields_ary[$q]);
$varname=$fieldno_ary[0]."_field";
$$varname=$fieldno_ary[1];
$custom_ins_stmt.=",$fieldno_ary[0]";
if ( (preg_match("/cf_encrypt/",$SSactive_modules)) and (strlen($custom_fields_row[$$varname]) > 0) )
if (strlen($custom_fields_ary[$q])>0)
{
$field_encrypt='N';
$stmt = "SELECT field_encrypt from vicidial_lists_fields where list_id='$list_id' and field_label='$fieldno_ary[0]' limit 1;";
if ($DB>0) {echo "DEBUG: cf_encrypt query - $stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$sc_recs = mysqli_num_rows($rslt);
if ($sc_recs > 0)
{
$row=mysqli_fetch_row($rslt);
$field_encrypt = $row[0];
}
if ($field_encrypt == 'Y')
{
$field_enc=$MT;
$field_value = $custom_fields_row[$$varname];
$field_value = base64_encode($field_value);
exec("../agc/aes.pl --encrypt --text=$field_value", $field_enc);
$field_enc_ct = count($field_enc);
$k=0;
$field_enc_all='';
while ($field_enc_ct > $k)
{
$field_enc_all .= $field_enc[$k];
$k++;
}
$custom_fields_row[$$varname] = preg_replace("/CRYPT: |\n|\r|\t/",'',$field_enc_all);
}
}
$fieldno_ary=explode(",", $custom_fields_ary[$q]);
$varname=$fieldno_ary[0]."_field";
$$varname=$fieldno_ary[1];
$custom_ins_stmt.=",$fieldno_ary[0]";
$custom_SQL_values.=",\"".$custom_fields_row[$$varname]."\"";
}
if ( (preg_match("/cf_encrypt/",$SSactive_modules)) and (strlen($custom_fields_row[$$varname]) > 0) )
{
$field_encrypt='N';
$stmt = "SELECT field_encrypt from vicidial_lists_fields where list_id='$list_id' and field_label='$fieldno_ary[0]' limit 1;";
if ($DB>0) {echo "DEBUG: cf_encrypt query - $stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$sc_recs = mysqli_num_rows($rslt);
if ($sc_recs > 0)
{
$row=mysqli_fetch_row($rslt);
$field_encrypt = $row[0];
}
if ($field_encrypt == 'Y')
{
$field_enc=$MT;
$field_value = $custom_fields_row[$$varname];
$field_value = base64_encode($field_value);
exec("../agc/aes.pl --encrypt --text=$field_value", $field_enc);
$field_enc_ct = count($field_enc);
$k=0;
$field_enc_all='';
while ($field_enc_ct > $k)
{
$field_enc_all .= $field_enc[$k];
$k++;
}
$custom_fields_row[$$varname] = preg_replace("/CRYPT: |\n|\r|\t/",'',$field_enc_all);
}
}
$custom_SQL_values.=",\"".$custom_fields_row[$$varname]."\"";
}
}
$custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)";
$custom_rslt=mysql_to_mysqli($custom_ins_stmt, $link);
$affected_rows = mysqli_affected_rows($link);
echo "<!-- $custom_ins_stmt //-->\n";
if ( ($webroot_writable > 0) and ($DB>0) )
{fwrite($stmt_file, $custom_ins_stmt."\r\n");}
}
$custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)";
$custom_rslt=mysql_to_mysqli($custom_ins_stmt, $link);
$affected_rows = mysqli_affected_rows($link);
echo "<!-- $custom_ins_stmt //-->\n";
if ( ($webroot_writable > 0) and ($DB>0) )
{fwrite($stmt_file, $custom_ins_stmt."\r\n");}
/*
}
else
@@ -2113,7 +2124,7 @@ if (($leadfile) && ($LF_path))
##### BEGIN process standard file layout #####
if ($file_layout=="standard")
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
flush();
@@ -2167,7 +2178,7 @@ if (($leadfile) && ($LF_path))
{
flush();
$file=fopen("$lead_file", "r");
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $Tline=1; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $Tline=1; $phone_list='';
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing")." $delim_name "._QXZ("file")."... ($tab_count|$pipe_count) (s-3)\n";
if (count($dedupe_statuses)>0) {
@@ -2531,7 +2542,7 @@ if (($leadfile) && ($LF_path))
##### BEGIN field chooser #####
else if ($file_layout=="custom")
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=true;}\n</script><HR>";
flush();
print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n";
print " <tr bgcolor='#$SSmenu_background'>\r\n";
@@ -2752,7 +2763,7 @@ if (($leadfile) && ($LF_path))
print " </tr>\r\n";
print "</table>\r\n";
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=false;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
}
##### END field chooser #####
@@ -82,10 +82,11 @@
# 220222-1002 - Added allow_web_debug system setting
# 231207-1445 - Fix for web_loader_phone_strip duplicate check, issue #1498
# 240320-1033 - Added misssing input variable filtering
# 240801-1131 - Code updates for PHP8 compatibility
#
$version = '2.14-80';
$build = '240320-1033';
$version = '2.14-81';
$build = '240801-1131';
require("dbconnect_mysqli.php");
require("functions.php");
@@ -297,6 +298,11 @@ if (is_array($dedupe_statuses))
}
}
}
else
{
$dedupe_statuses=array();
}
if (strlen($dedupe_statuses_override)>0)
{
@@ -997,9 +1003,9 @@ if ($SSenable_international_dncs)
##### BEGIN custom fields submission #####
if ($OK_to_process)
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true;document.forms[0].list_id_override.disabled=true;document.forms[0].phone_code_override.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\ndocument.forms[0].list_id_override.disabled=true;\ndocument.forms[0].phone_code_override.disabled=true;\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=true;}\n</script>";
flush();
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $phone_list='';
$file=fopen("$lead_file", "r");
if ($webroot_writable > 0)
@@ -1019,7 +1025,7 @@ if ($OK_to_process)
$file=fopen("$lead_file", "r");
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing file")."...\n";
if (count($dedupe_statuses)>0)
if (is_array($dedupe_statuses) && count($dedupe_statuses)>0)
{
$statuses_clause=" and status in (";
$status_dedupe_str="";
@@ -1757,7 +1763,7 @@ if ($OK_to_process)
if (($leadfile) && ($LF_path))
{
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $phone_list='';
### LOG INSERTION Admin Log Table ###
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='LOAD', record_id='$list_id_override', event_code='ADMIN LOAD LIST', event_sql='', event_notes='File Name: $leadfile_name, DEBUG: dedupe_statuses:$dedupe_statuses[0]| dedupe_statuses_override:$dedupe_statuses_override| dupcheck:$dupcheck | status mismatch action: $status_mismatch_action| lead_file:$lead_file| list_id_override:$list_id_override| phone_code_override:$phone_code_override| postalgmt:$postalgmt| template_id:$template_id| usacan_check:$usacan_check| dnc_country_scrub:$international_dnc_scrub| state_conversion:$state_conversion| web_loader_phone_length:$web_loader_phone_length| web_loader_phone_strip:$SSweb_loader_phone_strip|';";
@@ -1834,7 +1840,7 @@ if (($leadfile) && ($LF_path))
}
}
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
flush();
$delim_set=0;
@@ -1887,7 +1893,7 @@ if (($leadfile) && ($LF_path))
{
flush();
$file=fopen("$lead_file", "r");
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $phone_list='';
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing")." $delim_name "._QXZ("file using template")." $template_id... ($tab_count|$pipe_count)\n";
if (strlen($list_id_override)>0)
{
@@ -2424,57 +2430,62 @@ if (($leadfile) && ($LF_path))
#$rslt=mysql_to_mysqli($custom_SQL_query, $link);
#$affected_rows = mysqli_affected_rows($link);
$custom_ins_stmt="INSERT INTO $custom_table(lead_id";
$custom_SQL_values="";
for ($q=0; $q<count($custom_fields_ary); $q++)
$custom_tbl_stmt="SHOW TABLES LIKE '$custom_table'";
$custom_tbl_rslt=mysql_to_mysqli($custom_tbl_stmt, $link);
if(mysqli_num_rows($custom_tbl_rslt)>0)
{
if (strlen($custom_fields_ary[$q])>0)
$custom_ins_stmt="INSERT INTO $custom_table(lead_id";
$custom_SQL_values="";
for ($q=0; $q<count($custom_fields_ary); $q++)
{
$fieldno_ary=explode(",", $custom_fields_ary[$q]);
$varname=$fieldno_ary[0]."_field";
$$varname=$fieldno_ary[1];
$custom_ins_stmt.=",$fieldno_ary[0]";
if ( (preg_match("/cf_encrypt/",$SSactive_modules)) and (strlen($custom_fields_row[$$varname]) > 0) )
if (strlen($custom_fields_ary[$q])>0)
{
$field_encrypt='N';
$stmt = "SELECT field_encrypt from vicidial_lists_fields where list_id='$list_id' and field_label='$fieldno_ary[0]' limit 1;";
if ($DB>0) {echo "DEBUG: cf_encrypt query - $stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$sc_recs = mysqli_num_rows($rslt);
if ($sc_recs > 0)
{
$row=mysqli_fetch_row($rslt);
$field_encrypt = $row[0];
}
if ($field_encrypt == 'Y')
{
$field_enc=$MT;
$field_value = $custom_fields_row[$$varname];
$field_value = base64_encode($field_value);
exec("../agc/aes.pl --encrypt --text=$field_value", $field_enc);
$field_enc_ct = count($field_enc);
$k=0;
$field_enc_all='';
while ($field_enc_ct > $k)
{
$field_enc_all .= $field_enc[$k];
$k++;
}
$custom_fields_row[$$varname] = preg_replace("/CRYPT: |\n|\r|\t/",'',$field_enc_all);
}
}
$fieldno_ary=explode(",", $custom_fields_ary[$q]);
$varname=$fieldno_ary[0]."_field";
$$varname=$fieldno_ary[1];
$custom_ins_stmt.=",$fieldno_ary[0]";
$custom_SQL_values.=",\"".$custom_fields_row[$$varname]."\"";
}
if ( (preg_match("/cf_encrypt/",$SSactive_modules)) and (strlen($custom_fields_row[$$varname]) > 0) )
{
$field_encrypt='N';
$stmt = "SELECT field_encrypt from vicidial_lists_fields where list_id='$list_id' and field_label='$fieldno_ary[0]' limit 1;";
if ($DB>0) {echo "DEBUG: cf_encrypt query - $stmt\n";}
$rslt=mysql_to_mysqli($stmt, $link);
$sc_recs = mysqli_num_rows($rslt);
if ($sc_recs > 0)
{
$row=mysqli_fetch_row($rslt);
$field_encrypt = $row[0];
}
if ($field_encrypt == 'Y')
{
$field_enc=$MT;
$field_value = $custom_fields_row[$$varname];
$field_value = base64_encode($field_value);
exec("../agc/aes.pl --encrypt --text=$field_value", $field_enc);
$field_enc_ct = count($field_enc);
$k=0;
$field_enc_all='';
while ($field_enc_ct > $k)
{
$field_enc_all .= $field_enc[$k];
$k++;
}
$custom_fields_row[$$varname] = preg_replace("/CRYPT: |\n|\r|\t/",'',$field_enc_all);
}
}
$custom_SQL_values.=",\"".$custom_fields_row[$$varname]."\"";
}
}
$custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)";
$custom_rslt=mysql_to_mysqli($custom_ins_stmt, $link);
$affected_rows = mysqli_affected_rows($link);
echo "<!-- $custom_ins_stmt //-->\n";
if ( ($webroot_writable > 0) and ($DB>0) )
{fwrite($stmt_file, $custom_ins_stmt."\r\n");}
}
$custom_ins_stmt.=") VALUES('$lead_id'$custom_SQL_values)";
$custom_rslt=mysql_to_mysqli($custom_ins_stmt, $link);
$affected_rows = mysqli_affected_rows($link);
echo "<!-- $custom_ins_stmt //-->\n";
if ( ($webroot_writable > 0) and ($DB>0) )
{fwrite($stmt_file, $custom_ins_stmt."\r\n");}
/*
/*
}
else
{
@@ -2574,7 +2585,7 @@ if (($leadfile) && ($LF_path))
##### BEGIN process standard file layout #####
if ($file_layout=="standard")
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
flush();
@@ -2628,7 +2639,7 @@ if (($leadfile) && ($LF_path))
{
flush();
$file=fopen("$lead_file", "r");
$total=0; $good=0; $bad=0; $dup=0; $post=0; $moved=0; $phone_list='';
$total=0; $good=0; $bad=0; $dup=0; $inv=0; $post=0; $moved=0; $phone_list='';
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>"._QXZ("Processing")." $delim_name "._QXZ("file")."... ($tab_count|$pipe_count)\n";
if (count($dedupe_statuses)>0) {
@@ -3246,7 +3257,7 @@ if (($leadfile) && ($LF_path))
##### BEGIN field chooser #####
else if ($file_layout=="custom")
{
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script><HR>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=true;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=true;}\n</script><HR>";
flush();
print "<table border=0 cellpadding=3 cellspacing=0 width=700 align=center>\r\n";
print " <tr bgcolor='#$SSmenu_background'>\r\n";
@@ -3462,7 +3473,7 @@ if (($leadfile) && ($LF_path))
print " </tr>\r\n";
print "</table>\r\n";
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=false; document.forms[0].submit_file.disabled=false; document.forms[0].reload_page.disabled=false;</script>";
print "<script language='JavaScript1.2'>\nif(document.forms[0].leadfile) {document.forms[0].leadfile.disabled=false;}\nif(document.forms[0].submit_file) {document.forms[0].submit_file.disabled=true;}\nif(document.forms[0].reload_page) {document.forms[0].reload_page.disabled=false;}\n</script>";
}
##### END field chooser #####
@@ -1,13 +1,14 @@
<?php
# agent_sales_report_mobile.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# Streamlined report for displaying sale-only statistics in a format easily readable on a mobile device
#
# CHANGELOG:
# 200309-1819 - First Build
# 220303-1515 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -54,8 +55,8 @@ $MT[0]='';
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!isset($query_date_D)) {$query_date_D=$NOW_DATE;}
if (!isset($query_date_T)) {$query_date_T="00:00:00";}
if (!isset($refresh_rate)) {$refresh_rate="1000000";}
@@ -411,7 +412,7 @@ if ($SUBMIT==_QXZ("SUBMIT") || $SUBMIT==_QXZ("REFRESH")) {
$campaign_status_rslt=mysql_to_mysqli($campaign_status_stmt, $link);
$campaign_sales=array();
while ($campaign_status_row=mysqli_fetch_row($campaign_status_rslt)) {
if (!isset($campaign_sales["$campaign_status_row[0]"])) {$campaign_sales["$campaign_status_row[0]"]=array();}
if (!is_array($campaign_sales["$campaign_status_row[0]"])) {$campaign_sales["$campaign_status_row[0]"]=array();}
array_push($campaign_sales["$campaign_status_row[0]"], "$campaign_status_row[1]");
}
@@ -6,6 +6,7 @@
# Admin utility for applying hours off for agents, to be used in reports
#
# 240415-1730 - First build
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -97,6 +98,7 @@ $download_month=preg_replace("/[^-0-9]/",'',$download_month);
$update_month=preg_replace("/[^-0-9]/",'',$update_month);
$new_month=preg_replace("/[^-0-9]/",'',$new_month);
$rpt_month=preg_replace("/[^-0-9]/",'',$rpt_month);
if(!is_array($to_types)) {$to_types=array();}
if ($non_latin < 1)
{
@@ -1029,7 +1031,7 @@ if (!$display_all_agents || $display_all_agents==0)
echo "<TR>\n";
echo "<td colspan='".(6+(count($timeoff_types)<1 ? 1 : count($timeoff_types)))."'>\n";
echo "<form action='$PHP_SELF' method='post'>\n";
echo "<input type='text' name='new_month' id='new_month' value='$download_month'>\n";
echo "<input type='hidden' name='new_month' id='new_month' value='$download_month'>\n";
echo "\t<table width='100%'>\n";
echo "\t\t<tr>\n";
echo "<td align='right'><font class='standard_bold'>ADD TIMEOFF DATA:</font></td>\n";
@@ -5,7 +5,7 @@
# and/or vicidial_closer_log information by status, list_id and date range.
# downloads to a flat text file that is tab delimited
#
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -65,6 +65,7 @@
# 220301-1603 - Added allow_web_debug system setting
# 230622-1652 - Added filtering by time (hours), and option for single user exports.
# 230623-1025 - Added sort_dir sort direction
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -132,11 +133,11 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$FILE_TIME = date("Ymd-His");
$STARTtime = date("U");
if (!isset($campaign)) {$campaign = array();}
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($list_id)) {$list_id = array();}
if (!isset($status)) {$status = array();}
if (!is_array($campaign)) {$campaign = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($list_id)) {$list_id = array();}
if (!is_array($status)) {$status = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (!isset($query_hour)) {$query_hour = "00";}
@@ -6,7 +6,7 @@
# downloads to a flat text file that is tab delimited. This version also
# attempts to link carrier and dial log entries to those calls.
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
#
@@ -22,6 +22,7 @@
# 190926-0927 - Fixes for PHP7
# 210911-1908 - Fix for --ALL-- selection user-group permission issue
# 220301-1551 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -79,11 +80,11 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$FILE_TIME = date("Ymd-His");
$STARTtime = date("U");
if (!isset($campaign)) {$campaign = array();}
if (!isset($group)) {$group = array();}
if (!isset($user_group)) {$user_group = array();}
if (!isset($list_id)) {$list_id = array();}
if (!isset($status)) {$status = array();}
if (!is_array($campaign)) {$campaign = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($user_group)) {$user_group = array();}
if (!is_array($list_id)) {$list_id = array();}
if (!is_array($status)) {$status = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -1,7 +1,7 @@
<?php
# callbacks_bulk_move.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 150218-0923 - First build based on callbacks_bulk_change.php
@@ -12,6 +12,7 @@
# 191013-0853 - Fixes for PHP7
# 220224-1656 - Added allow_web_debug system setting
# 231129-1404 - 'SQL/x' variable bug fix
# 240801-1130 - Code updates for PHP8 compatibility
#
require("dbconnect_mysqli.php");
@@ -126,8 +127,12 @@ else
$StarTtimE = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($group)) {$group=array();}
if (!isset($users)) {$users=array();}
if (!is_array($group)) {$group=array();}
if (!is_array($users)) {$users=array();}
if (!is_array($cb_users)) {$cb_users=array();}
if (!is_array($cb_user_groups)) {$cb_user_groups=array();}
if (!is_array($cb_lists)) {$cb_lists=array();}
if (!is_array($cb_groups)) {$cb_groups=array();}
$ip = getenv("REMOTE_ADDR");
$date = date("r");
$ip = getenv("REMOTE_ADDR");
@@ -702,6 +707,7 @@ if ($SUBMIT && $new_list_id && ($new_status || $revert_status))
# else
# {}
$groupsSQL=preg_replace('/ in \(\)/', ' in (\'\')', $groupsSQL);
$callback_dispo_stmt="SELECT distinct status from vicidial_statuses where scheduled_callback='Y' UNION SELECT distinct status from vicidial_campaign_statuses where scheduled_callback='Y' ".preg_replace("/vc\./", "", $groupsSQL);
if ($DB) {echo $callback_dispo_stmt."<BR>";}
$callback_dispo_rslt=mysql_to_mysqli($callback_dispo_stmt, $link);
@@ -878,6 +884,8 @@ else if ($SUBMIT && $new_list_id && ($new_status || $revert_status) && (count($
$callback_stmt="SELECT * from vicidial_callbacks vc, vicidial_list vl where $purge_clause and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$purge_stmt="SELECT vc.status, vl.status from vicidial_callbacks vc, vicidial_list vl where $purge_clause and vc.lead_id=vl.lead_id $usersSQL $user_groupsSQL $listsSQL $groupsSQL $daySQL";
$purge_stmt=preg_replace('/ in \(\)/', ' in (\'\')', $purge_stmt);
if ($DB) {echo $purge_stmt."<BR>";}
$purge_rslt=mysql_to_mysqli($purge_stmt, $link);
$purge_ct=mysqli_num_rows($purge_rslt);
$purge_called_ct=0;
@@ -888,6 +896,7 @@ else if ($SUBMIT && $new_list_id && ($new_status || $revert_status) && (count($
if ($purge_row[0]=="ACTIVE" || ($purge_row[0]=="LIVE" && in_array("$purge_row[1]", $cb_dispos))) {$purge_uncalled_ct++;}
}
}
$callback_stmt=preg_replace('/ in \(\)/', ' in (\'\')', $callback_stmt);
$callback_rslt=mysql_to_mysqli($callback_stmt, $link);
$callback_ct=mysqli_num_rows($callback_rslt);
if ($DB) {echo $callback_stmt."<BR>";}
@@ -1,13 +1,14 @@
<?php
# callbacks_export.php
#
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com>, Joe Johnson <joej@vicidial.com> LICENSE: AGPLv2
#
# CHANGES
# 200622-1615 - First build
# 220228-2126 - Added allow_web_debug system setting
# 220713-1748 - Added user & count to output/modified SQL
# 220812-1000 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -39,7 +40,7 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$StarTtimE = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
if (!isset($cb_groups)) {$cb_groups=array();}
if (!is_array($cb_groups)) {$cb_groups=array();}
if (!isset($query_date)) {$query_date = $TODAY;}
if (!isset($end_date)) {$end_date = $TODAY;}
$ip = getenv("REMOTE_ADDR");
@@ -317,6 +318,7 @@ if ($SUBMIT)
}
$groupsSQL=preg_replace('/,$/', '', $groupsSQL);
$groupsSQL.=") ";
if (!$groupsQS) {$groupsSQL="";}
}
else
{
@@ -1,7 +1,7 @@
<?php
# called_counts_multilist_report.php
#
# Copyright (C) 2022 Joe Johnson <freewermadmin@gmail.com>, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
# Copyright (C) 2024 Joe Johnson <freewermadmin@gmail.com>, Matt Florell <mattf@vicidial.com> LICENSE: AGPLv2
#
# This is a report designed for showing called counts similar to the results
# at the bottom of each list detail screen, but for multiple lists and using
@@ -20,6 +20,7 @@
# 180508-0115 - Added new help display
# 191013-0840 - Fixes for PHP7
# 220228-2108 - Added allow_web_debug system setting
# 240801-1130 - Code updates for PHP8 compatibility
#
$startMS = microtime();
@@ -64,8 +65,8 @@ $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$STARTtime = date("U");
if (!isset($group)) {$group = array();}
if (!isset($list_ids)) {$list_ids = array();}
if (!is_array($group)) {$group = array();}
if (!is_array($list_ids)) {$list_ids = array();}
if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;}
if (strlen($shift)<2) {$shift='ALL';}
@@ -722,6 +723,7 @@ if (strlen($QUERY_STRING) > 5)
$first_row=1;
$all_called_first=1000;
$all_called_last=0;
$status=array();
$count_statuses=array();
$count_called=array();
$count_count=array();

Some files were not shown because too many files have changed in this diff Show More