diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index 5070bf85..3284f80e 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -3754,12 +3754,13 @@ else # 160331-2204 - Made URL form input fields longer # 160404-0940 - design changes # 160414-1013 - Added default_phone_code to system_settings +# 160427-1656 - Added more detail on active servers column on reports page # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time -$admin_version = '2.12-550a'; -$build = '160414-1013'; +$admin_version = '2.12-551a'; +$build = '160427-1656'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -35758,7 +35759,7 @@ if ($ADD==999999) echo ""; - echo "\n"; + echo ""; + echo "\n"; } else { - echo ""; - echo "\n"; + echo ""; + echo "\n"; } $o=0; @@ -36085,14 +36088,14 @@ if ($ADD==999999) } } echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; if ($stage == 'TIME') { $stmt="SELECT svn_revision from servers where server_ip='$server_ip[$o]';"; @@ -36104,29 +36107,29 @@ if ($ADD==999999) $row=mysqli_fetch_row($rslt); $s_ver = $row[0]; } - echo ""; + echo ""; } else { if ( (preg_match("/Real-Time Main Report/",$LOGallowed_reports)) or (preg_match("/ALL REPORTS/",$LOGallowed_reports)) ) { - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; } else { - echo "\n"; - echo "\n"; + echo "\n"; + echo "\n"; } } echo "\n"; - echo "$FROZEN_output"; + echo "$FROZEN_output"; $o++; } if ($stage == 'TIME') { - echo ""; + echo ""; $stmt="SELECT NOW();"; $rslt=mysql_to_mysqli($stmt, $link); @@ -36135,7 +36138,7 @@ if ($ADD==999999) if ($dbtime_to_print) { $row=mysqli_fetch_row($rslt); - echo ""; + echo ""; } } echo "
\n"; echo ""; - $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage from servers order by server_id;"; + $stmt="SELECT server_id,server_description,server_ip,active,sysload,channels_total,cpu_idle_percent,disk_usage,active_agent_login_server,active_asterisk_server from servers order by server_id;"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysqli_num_rows($rslt); @@ -35766,14 +35767,16 @@ if ($ADD==999999) while ($i < $servers_to_print) { $row=mysqli_fetch_row($rslt); - $server_id[$i] = $row[0]; - $server_description[$i] = $row[1]; - $server_ip[$i] = $row[2]; - $active[$i] = $row[3]; - $sysload[$i] = $row[4]; - $channels_total[$i] = $row[5]; - $cpu_idle_percent[$i] = $row[6]; - $disk_usage[$i] = $row[7]; + $server_id[$i] = $row[0]; + $server_description[$i] = $row[1]; + $server_ip[$i] = $row[2]; + $active[$i] = $row[3]; + $sysload[$i] = $row[4]; + $channels_total[$i] = $row[5]; + $cpu_idle_percent[$i] = $row[6]; + $disk_usage[$i] = $row[7]; + $active_agent_login_server[$i] = $row[8]; + $active_asterisk_server[$i] = $row[9]; $i++; } @@ -35994,13 +35997,13 @@ if ($ADD==999999) if ($stage == 'TIME') { - echo "
"._QXZ("SERVER")." -"._QXZ("DESCRIPTION").""._QXZ("IP").""._QXZ("ACT").""._QXZ("LOAD").""._QXZ("CHAN").""._QXZ("AGNT").""._QXZ("DISK").""._QXZ("TIME").""._QXZ("VER")."
"._QXZ("SERVER")." -"._QXZ("DESCRIPTION").""._QXZ("IP").""._QXZ("ACT").""._QXZ("LOAD").""._QXZ("CHAN").""._QXZ("AGNT").""._QXZ("DISK").""._QXZ("TIME").""._QXZ("VER")."
"._QXZ("SERVER")." +"._QXZ("DESCRIPTION").""._QXZ("IP").""._QXZ("ACT").""._QXZ("LOAD").""._QXZ("CHAN").""._QXZ("AGNT").""._QXZ("DISK").""._QXZ("OUTBOUND").""._QXZ("INBOUND")."
"._QXZ("SERVER")." +"._QXZ("DESCRIPTION").""._QXZ("IP").""._QXZ("ACT").""._QXZ("LOAD").""._QXZ("CHAN").""._QXZ("AGNT").""._QXZ("DISK").""._QXZ("OUTBOUND").""._QXZ("INBOUND")."
$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o]$sysload[$o] - $cpu%$channels_total[$o]$agnt$disk$server_id[$o]$server_description[$o]$server_ip[$o]$active[$o] / $active_asterisk_server[$o] / $active_agent_login_server[$o]$sysload[$o] - $cpu%$channels_total[$o]$agnt$disk$s_time$s_ver$s_time$s_ver"._QXZ("LINK").""._QXZ("LINK").""._QXZ("LINK").""._QXZ("LINK")."        
  "._QXZ("PHP Time")."   " . date("Y-m-d H:i:s") . "  
  "._QXZ("PHP Time")."   " . date("Y-m-d H:i:s") . "  
  "._QXZ("DB Time")."   $row[0]  
  "._QXZ("DB Time")."   $row[0]  
\n"; diff --git a/www/vicidial/medialog_inventory_report.php b/www/vicidial/medialog_inventory_report.php index 42a68a63..6802be0d 100644 --- a/www/vicidial/medialog_inventory_report.php +++ b/www/vicidial/medialog_inventory_report.php @@ -9,6 +9,7 @@ # CHANGES # 160411-1917 - First build based upon called_counts_multilist_report.php # 160412-2022 - Callback bug fixed, modified Total count to use modify_date instead of entry_date +# 160427-1655 - Added called count categories # $startMS = microtime(); @@ -707,7 +708,14 @@ if (count($list_ids) > 0 && count($group) > 0) $call_count_stmt="select ".$vicidial_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_log_table.".status,".$vicidial_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_log_table." where ".$vicidial_log_table.".call_date>='$query_date 00:00:00' and ".$vicidial_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_log_table.".status in ('".implode("', '", $all_statuses)."') $group_SQLand $list_id_SQLandVLJOIN UNION select ".$vicidial_closer_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_closer_log_table.".status,".$vicidial_closer_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_closer_log_table." where ".$vicidial_closer_log_table.".call_date>='$query_date 00:00:00' and ".$vicidial_closer_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_closer_log_table.".status in ('".implode("', '", $all_statuses)."') $list_id_SQLandVCLJOIN"; $stmt="select list_id, called_count, status from vicidial_list $list_id_SQLwhere"; # QUERY 1 - + + $zb_counts=array(); + $cc_stmt="select if(called_count>15, '4', if(called_count>10, '3', if(called_count>5, '2', if(called_count>0, '1', '0')))) as ary_index, count(*) from vicidial_list $list_id_SQLwhere group by ary_index"; + $cc_rslt=mysql_to_mysqli($cc_stmt, $link); + while ($ccrow=mysqli_fetch_row($cc_rslt)) { + $zb_counts[$ccrow[0]]=$ccrow[1]; + } + # $call_count_stmt="select ".$vicidial_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_log_table.".status,".$vicidial_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_log_table." where ".$vicidial_log_table.".call_date>='$query_date 00:00:00' and ".$vicidial_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_log_table.".status in ('".implode("', '", $all_statuses)."') $group_SQLand $list_id_SQLandVLJOIN UNION select ".$vicidial_closer_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_closer_log_table.".status,".$vicidial_closer_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_closer_log_table." where ".$vicidial_closer_log_table.".call_date>='$query_date 00:00:00' and ".$vicidial_closer_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_closer_log_table.".status in ('".implode("', '", $all_statuses)."') $list_id_SQLandVCLJOIN"; # QUERY 2 $call_count_stmt="select ".$vicidial_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_log_table.".status,".$vicidial_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_log_table." where ".$vicidial_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_log_table.".status in ('".implode("', '", $all_statuses)."') $group_SQLand $list_id_SQLandVLJOIN UNION select ".$vicidial_closer_log_table.".lead_id,".$vicidial_list_table.".called_count,".$vicidial_closer_log_table.".status,".$vicidial_closer_log_table.".call_date from ".$vicidial_list_table.", ".$vicidial_closer_log_table." where ".$vicidial_closer_log_table.".call_date<='$end_date 23:59:59' and ".$vicidial_closer_log_table.".status in ('".implode("', '", $all_statuses)."') $list_id_SQLandVCLJOIN"; # QUERY 3 $stmt="select lead_id, called_count, status, max(call_date) from ($call_count_stmt) as dt group by lead_id, called_count, status"; # USED WITH QUERY 2 and 3 @@ -741,15 +749,19 @@ if (count($list_ids) > 0 && count($group) > 0) if(in_array($status, $no_statuses)) { $no_counts[0]++; $no_counts[$ary_index]++; + $zb_counts[$ary_index]--; } else if (in_array($status, $nixi_statuses)) { $nixi_counts[0]++; $nixi_counts[$ary_index]++; + $zb_counts[$ary_index]--; } else if (in_array($status, $afc_statuses)) { $afc_counts[0]++; $afc_counts[$ary_index]++; + $zb_counts[$ary_index]--; } else if (in_array($status, $sale_statuses)) { $sales_counts[0]++; $sales_counts[$ary_index]++; + $zb_counts[$ary_index]--; } else { $workoff_total++; } @@ -764,6 +776,7 @@ if (count($list_ids) > 0 && count($group) > 0) $nixi_counts[$i]+=0; $no_counts[$i]+=0; $sales_counts[$i]+=0; + $zb_counts[$i]+=0; } @@ -838,14 +851,14 @@ if (count($list_ids) > 0 && count($group) > 0) $CSV_text.="\"WV Team\",\"$anyone_counts[0]\",\"\",\"\",\"$anyone_counts[1]\",\"$anyone_counts[2]\",\"$anyone_counts[3]\",\"$anyone_counts[4]\"\n"; $CSV_text.="\"WV persönlich\",\"$useronly_counts[0]\",\"\",\"\",\"$useronly_counts[1]\",\"$useronly_counts[2]\",\"$useronly_counts[3]\",\"$useronly_counts[4]\"\n"; $CSV_text.="\"WV Vergangenheit \",\"$calledback_counts[0]\",\"\",\"\",\"$calledback_counts[1]\",\"$calledback_counts[2]\",\"$calledback_counts[3]\",\"$calledback_counts[4]\"\n\n"; - $CSV_text.="\"Zu bearbeiten\",\"$workoff_total\"\n\n\n\n"; + $CSV_text.="\"Zu bearbeiten\",\"$workoff_total\",\"\",\"\",\"$zb_counts[1]\",\"$zb_counts[2]\",\"$zb_counts[3]\",\"$zb_counts[4]\",\"$zb_counts[0] (undialed)\"\n\n\n\n"; $MAIN.="| WV Team | ".sprintf("%7s", $anyone_counts[0])." | ".sprintf("%7s", " ")." | | ".sprintf("%7s", $anyone_counts[1])." | ".sprintf("%7s", $anyone_counts[2])." | ".sprintf("%7s", $anyone_counts[3])." | ".sprintf("%7s", $anyone_counts[4])." |\n"; $MAIN.="| WV persönlich | ".sprintf("%7s", $useronly_counts[0])." | ".sprintf("%7s", " ")." | | ".sprintf("%7s", $useronly_counts[1])." | ".sprintf("%7s", $useronly_counts[2])." | ".sprintf("%7s", $useronly_counts[3])." | ".sprintf("%7s", $useronly_counts[4])." |\n"; $MAIN.="| WV Vergangenheit | ".sprintf("%7s", $calledback_counts[0])." | ".sprintf("%7s", " ")." | | ".sprintf("%7s", $calledback_counts[1])." | ".sprintf("%7s", $calledback_counts[2])." | ".sprintf("%7s", $calledback_counts[3])." | ".sprintf("%7s", $calledback_counts[4])." |\n"; $MAIN.=$head; - $MAIN.="| Zu bearbeiten | ".sprintf("%7s", $workoff_total)." |\n"; - $MAIN.="+------------------+---------+\n\n\n"; + $MAIN.="| Zu bearbeiten | ".sprintf("%7s", $workoff_total)." | ".sprintf("%7s", " ")." | | ".sprintf("%7s", $zb_counts[1])." | ".sprintf("%7s", $zb_counts[2])." | ".sprintf("%7s", $zb_counts[3])." | ".sprintf("%7s", $zb_counts[4])." | ".sprintf("%7s", $zb_counts[0])." (undialed)\n"; + $MAIN.=$head; ## Lower section $CSV_text.="\"Tagesstatus\"\n";