From 1185045b946beddf7b55225186b6d3f7a78e51b1 Mon Sep 17 00:00:00 2001 From: mattf Date: Sun, 14 Feb 2010 23:17:12 +0000 Subject: [PATCH] Added ingroup and drop ingroup displays to Real-time report changed several reports to list menu items in alphabetical order Added AGENTVMAIL option to all ingroup drop methods in trunk git-svn-id: svn://192.168.202.10@1336 3d104415-ff17-0410-8863-d5cf3c621b8a --- .../www/vicidial/AST_CLOSER_service_level.php | 9 +- .../www/vicidial/AST_CLOSERstats.php | 3 +- .../www/vicidial/AST_CLOSERsummary_hourly.php | 11 +- .../agc_2.2.0/www/vicidial/AST_DIDstats.php | 3 +- .../www/vicidial/AST_GROUP_ALIASstats.php | 6 +- .../agc_2.2.0/www/vicidial/AST_IVRstats.php | 9 +- .../vicidial/AST_OUTBOUNDsummary_interval.php | 11 +- .../agc_2.2.0/www/vicidial/AST_VDADstats.php | 3 +- .../www/vicidial/AST_VICIDIAL_hopperlist.php | 14 +- .../www/vicidial/AST_agent_days_detail.php | 9 +- .../vicidial/AST_agent_performance_detail.php | 5 +- .../www/vicidial/AST_agent_status_detail.php | 11 +- .../www/vicidial/AST_agent_time_detail.php | 5 +- .../www/vicidial/AST_server_performance.php | 17 +- .../www/vicidial/AST_timeonVDADall.php | 445 ++++++++++++------ .../www/vicidial/call_report_export.php | 13 +- .../agc_2.2.0/www/vicidial/fcstats.php | 17 +- .../www/vicidial/timeclock_report.php | 11 +- .../www/vicidial/timeclock_status.php | 25 +- agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi | 48 +- .../www/vicidial/AST_CLOSER_service_level.php | 9 +- .../trunk/www/vicidial/AST_CLOSERstats.php | 3 +- .../www/vicidial/AST_CLOSERsummary_hourly.php | 11 +- agc_2-X/trunk/www/vicidial/AST_DIDstats.php | 3 +- .../www/vicidial/AST_GROUP_ALIASstats.php | 6 +- agc_2-X/trunk/www/vicidial/AST_IVRstats.php | 9 +- .../vicidial/AST_OUTBOUNDsummary_interval.php | 11 +- agc_2-X/trunk/www/vicidial/AST_VDADstats.php | 3 +- .../www/vicidial/AST_VICIDIAL_hopperlist.php | 14 +- .../www/vicidial/AST_agent_days_detail.php | 9 +- .../vicidial/AST_agent_performance_detail.php | 5 +- .../www/vicidial/AST_agent_status_detail.php | 11 +- .../www/vicidial/AST_agent_time_detail.php | 5 +- .../www/vicidial/AST_server_performance.php | 17 +- .../trunk/www/vicidial/AST_timeonVDADall.php | 441 +++++++++++------ agc_2-X/trunk/www/vicidial/admin.php | 6 +- .../trunk/www/vicidial/call_report_export.php | 13 +- agc_2-X/trunk/www/vicidial/fcstats.php | 17 +- .../trunk/www/vicidial/timeclock_report.php | 11 +- .../trunk/www/vicidial/timeclock_status.php | 25 +- 40 files changed, 805 insertions(+), 499 deletions(-) diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSER_service_level.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSER_service_level.php index ae53c78d..f249462d 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSER_service_level.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 90310-2117 - Added admin header # 90508-0644 - Changed to PHP long tags # 90801-0923 - Added in-group name to pulldown +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -43,12 +44,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -76,7 +75,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERstats.php index 8c45501d..eb2ff840 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERstats.php @@ -25,6 +25,7 @@ # 90801-0921 - Added in-group name to pulldown # 91214-0955 - Added INITIAL QUEUE POSITION BREAKDOWN # 100206-1454 - Fixed TMR(service level) calculation +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -105,7 +106,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERsummary_hourly.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERsummary_hourly.php index 14010001..485e1865 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_CLOSERsummary_hourly.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 90801-0910 - First build # 90809-0216 - Added Exclude Outbound Drop Group option +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -56,12 +57,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -103,7 +102,7 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $exclude_rolloverSQL=''; if (eregi("YES",$exclude_rollover)) {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} -$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -155,7 +154,7 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $times_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_DIDstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_DIDstats.php index 875aacc7..ca4e8c6b 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_DIDstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_DIDstats.php @@ -7,6 +7,7 @@ # # 90601-1443 - First build # 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -72,7 +73,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids;"; +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids order by did_pattern;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_GROUP_ALIASstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_GROUP_ALIASstats.php index 0c7fee84..28b7b2d1 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_GROUP_ALIASstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_GROUP_ALIASstats.php @@ -39,12 +39,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -57,7 +55,7 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_IVRstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_IVRstats.php index e4eece31..f8be12ac 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_IVRstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -11,6 +11,7 @@ # 90310-2056 - Admin header # 90508-0644 - Changed to PHP long tags # 91112-0719 - Added in-group names to select list +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -44,12 +45,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -77,7 +76,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_OUTBOUNDsummary_interval.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_OUTBOUNDsummary_interval.php index c4989c46..2b808c37 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_OUTBOUNDsummary_interval.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 091128-0311 - First build # 091129-0017 - Added Sales-type and DNC-type tallies +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -54,12 +55,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -140,7 +139,7 @@ while($i < $group_ct) $i++; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL;"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -224,7 +223,7 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $times_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VDADstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VDADstats.php index b7063771..faf6368d 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VDADstats.php @@ -24,6 +24,7 @@ # 90827-1154 - Added List ID breakdown of calls # 91222-0843 - Fixed ALL-CAMPAIGNS inbound rollover issue(bug #262), and some other bugs # 100202-1034 - Added statuses to no-answer section +# 100214-1421 - Sort menu alphabetically # header ("Content-type: text/html; charset=utf-8"); @@ -128,7 +129,7 @@ while($i < $group_ct) $i++; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns;"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VICIDIAL_hopperlist.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VICIDIAL_hopperlist.php index 53e70dd8..3efb562f 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_VICIDIAL_hopperlist.php @@ -29,13 +29,13 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -129,7 +129,7 @@ else echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; - $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; + $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 5000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_days_detail.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_days_detail.php index 50406f89..96c8a6d4 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_days_detail.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 90225-1051 - Added CSV download option # 90310-0752 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # @@ -46,12 +47,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -66,7 +65,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_performance_detail.php index a6bfcb1e..d08c200d 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_performance_detail.php @@ -21,6 +21,7 @@ # 90717-1500 - Changed to be multi-campaign, multi-user-group select # 90908-1058 - Added DEAD time statistics # 100203-1131 - Added CUSTOMER time statistics +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -93,7 +94,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -104,7 +105,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_status_detail.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_status_detail.php index 916bd514..25bdbc09 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_status_detail.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_status_detail.php @@ -10,6 +10,7 @@ # 90310-2030 - Admin header # 90508-0644 - Changed to PHP long tags # 100119-0935 - Fixed bug 291 +# 100214-1421 - Sort menu alphabetically # @@ -47,12 +48,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -67,7 +66,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -83,7 +82,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -94,7 +93,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_time_detail.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_time_detail.php index dbb85f42..2c779972 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_time_detail.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_agent_time_detail.php @@ -10,6 +10,7 @@ # 90522-0723 - First build # 90908-1103 - Added DEAD time stats # 100203-1147 - Added CUSTOMER time statistics +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -82,7 +83,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -93,7 +94,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_server_performance.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_server_performance.php index 5003c37c..3688ca34 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_server_performance.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 80118-1508 - Fixed horizontal scale marking issues # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -35,13 +36,13 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -61,7 +62,7 @@ if (!isset($begin_query_time)) {$begin_query_time = "$NOW_DATE 09:00:00";} if (!isset($end_query_time)) {$end_query_time = "$NOW_DATE 15:30:00";} if (!isset($group)) {$group = '';} -$stmt="select server_ip from servers;"; +$stmt="select server_ip from servers order by server_ip;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php index 99338a0b..6b40a9da 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -58,11 +58,11 @@ # 90914-1154 - Added AgentOnly display column to waiting calls section # 91102-2013 - Changed in-group color styles for incoming calls waiting # 91204-1548 - Added ability to change agent in-groups and blended +# 100214-1127 - Added no-dialable-leads alert and in-groups stats option # - -$version = '2.2.0-49'; -$build = '91204-1548'; +$version = '2.2.0-50'; +$build = '100214-1127'; header ("Content-type: text/html; charset=utf-8"); @@ -110,6 +110,12 @@ if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];} + elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];} +if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];} + elseif (isset($_POST["DROPINGROUPstats"])) {$DROPINGROUPstats=$_POST["DROPINGROUPstats"];} +if (isset($_GET["ALLINGROUPstats"])) {$ALLINGROUPstats=$_GET["ALLINGROUPstats"];} + elseif (isset($_POST["ALLINGROUPstats"])) {$ALLINGROUPstats=$_POST["ALLINGROUPstats"];} if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"];} @@ -124,13 +130,11 @@ $stmt = "SELECT use_non_latin,outbound_autodial_active FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $outbound_autodial_active = $row[1]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -242,14 +246,14 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y';"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; - $LISTgroups[$i]='ALL-ACTIVE'; - $i++; - $groups_to_print++; +$LISTgroups[$i]='ALL-ACTIVE'; +$i++; +$groups_to_print++; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); @@ -270,6 +274,14 @@ while($i < $group_ct) } $group_SQL = eregi_replace(",$",'',$group_SQL); +### if no campaigns selected, display all +if ($group_ct < 1) + { + $groups[0] = 'ALL-ACTIVE'; + $group_string = 'ALL-ACTIVE'; + $group = 'ALL-ACTIVE'; + $groupQS .= "&groups[]=ALL-ACTIVE"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -313,7 +325,7 @@ $NFE = ''; $F=''; $FG=''; $B=''; $BG=''; $select_list = ""; @@ -422,10 +452,16 @@ var pass = ''; function openDiv(divvar) { document.getElementById(divvar).innerHTML = select_list; + document.getElementById(divvar).style.left = 0; } function closeDiv(divvar) { document.getElementById(divvar).innerHTML = open_list; + document.getElementById(divvar).style.left = 160; + } +function closeAlert(divvar) + { + document.getElementById(divvar).innerHTML = ''; } // function to launch monitoring calls @@ -669,7 +705,7 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "Real-Time Report: $group\n"; $short_header=1; @@ -694,6 +730,8 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "Real-Time Report                                                                               \n"; echo "\n"; echo "
Select Campaigns:
"; -$select_list .= ""; $o=0; while ($groups_to_print > $o) { @@ -337,7 +349,7 @@ if ($UGdisplay > 0) while ($usergroups_to_print > $o) { if ($usergroups[$o] == $usergroup) {$select_list .= "";} - else {$select_list .= "";} + else {$select_list .= "";} $o++; } $select_list .= "

"; @@ -374,6 +386,24 @@ $select_list .= "Phone: "; $select_list .= ""; $select_list .= "

"; +$select_list .= "   Dialable Leads Alert:
"; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + } + + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { $multi_drop++; - if ($adastats>1) - { - $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; - - if ($DB > 0) {echo "\n|$stmtB|\n";} - - $r=0; - $rslt=mysql_query($stmtB, $link); - $ingroups_to_print = mysql_num_rows($rslt); - if ($ingroups_to_print > 0) - {$ingroup_detail .= "
\n"; @@ -703,9 +741,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFY | \n"; @@ -718,7 +756,8 @@ echo "
please select a campaign from the pulldown above\n"; exit;} +if (!$group) + {echo "

please select a campaign from the pulldown above\n"; exit;} else { $multi_drop=0; @@ -764,124 +803,169 @@ else if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} +##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ### +if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($adastats > 1) ) ) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL) order by campaign_id;"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); + $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); + } + else + {$AVG_ANSWERagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ANSWERagent_non_pause_sec=0; + } + + if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} + else {$bgcolor='white';} + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + + $r++; + } + + if ($ingroups_to_print > 0) + {$ingroup_detail .= "
        $ingroupdetail   CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls  
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
ANSWERS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + } + + +##### DROP IN-GROUP ONLY TOTALS ROW ### +$DROPINGROUPstatsHTML=''; +if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) + { + $DIGcampaigns=''; + $stmtB="select drop_inbound_group from vicidial_campaigns where campaign_id IN($group_SQL) and drop_inbound_group NOT IN('---NONE---','');"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $dig_to_print = mysql_num_rows($rslt); + $dtp=0; + while ($dig_to_print > $dtp) + { + $row=mysql_fetch_row($rslt); + $DIGcampaigns .= "'$row[0]',"; + $dtp++; + } + $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + if ( ($dropsTODAY > 0) and ($callsTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $callsTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + $DROPINGROUPstatsHTML .= "
DROP IN-GROUP STATS -DROP PERCENT:  $drpctTODAY%     CALLS:  $callsTODAY     DROPS/ANSWERS:  $dropsTODAY / $answersTODAY    
";} - while ($ingroups_to_print > $r) - { - $row=mysql_fetch_row($rslt); - $callsTODAY = $row[0]; - $dropsTODAY = $row[1]; - $answersTODAY = $row[2]; - $VSCcat1 = $row[3]; - $VSCcat1tally = $row[4]; - $VSCcat2 = $row[5]; - $VSCcat2tally = $row[6]; - $VSCcat3 = $row[7]; - $VSCcat3tally = $row[8]; - $VSCcat4 = $row[9]; - $VSCcat4tally = $row[10]; - $hold_sec_stat_one = $row[11]; - $hold_sec_stat_two = $row[12]; - $hold_sec_answer_calls = $row[13]; - $hold_sec_drop_calls = $row[14]; - $hold_sec_queue_calls = $row[15]; - $ingroupdetail = $row[16]; - if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) - { - $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); - $drpctTODAY = round($drpctTODAY, 2); - $drpctTODAY = sprintf("%01.2f", $drpctTODAY); - } - else - {$drpctTODAY=0;} - - if ($callsTODAY > 0) - { - $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); - $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); - } - else - {$AVGhold_sec_queue_calls=0;} - - if ($dropsTODAY > 0) - { - $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); - $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); - } - else - {$AVGhold_sec_drop_calls=0;} - - if ($answersTODAY > 0) - { - $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); - $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); - $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); - $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); - $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); - $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); - $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); - $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); - if ($agent_non_pause_sec > 0) - { - $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); - $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); - $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); - } - else - {$AVG_ANSWERagent_non_pause_sec=0;} - } - else - { - $PCThold_sec_stat_one=0; - $PCThold_sec_stat_two=0; - $AVGhold_sec_answer_calls=0; - $AVG_ANSWERagent_non_pause_sec=0; - } - - if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} - else {$bgcolor='white';} - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - - $r++; - } - - if ($ingroups_to_print > 0) - {$ingroup_detail .= "
        $ingroupdetail   CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls  
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
ANSWERS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} - - } - $stmt="select agent_pause_codes_active from vicidial_campaigns $group_SQLwhere;"; $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; @@ -1184,6 +1268,8 @@ else echo "DIFF:  $diffpctONEMIN%     "; echo "ORDER:  $DIALorder     "; echo ""; + + echo "$DROPINGROUPstatsHTML\n"; } echo ""; @@ -1204,66 +1290,99 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       SHOW AGENT ID"; - } -else - { - echo "       SHOW AGENT NAME"; + echo "       VIEW USER GROUP"; } if ($SERVdisplay>0) { - echo "       HIDE SERVER INFO"; + echo "       HIDE SERVER INFO"; } else { - echo "       SHOW SERVER INFO"; + echo "       SHOW SERVER INFO"; } if ($CALLSdisplay>0) { - echo "       HIDE WAITING CALLS"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS"; + echo "       SHOW WAITING CALLS"; + } + +if ($ALLINGROUPstats>0) + { + echo "       HIDE IN-GROUP STATS"; + } +else + { + echo "       SHOW IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       HIDE PHONES"; + echo "       HIDE PHONES"; } else { - echo "       SHOW PHONES"; + echo "       SHOW PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       HIDE CUSTPHONES"; + echo "       HIDE CUSTPHONES"; } else { - echo "       SHOW CUSTPHONES"; + echo "       SHOW CUSTPHONES"; } echo ""; echo ""; echo ""; echo "\n\n"; + +##### check for campaigns with no dialable leads if enabled ##### +if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) + { + $NDLcampaigns=''; + $stmtB="select campaign_id from vicidial_campaign_stats where campaign_id IN($group_SQL) and dialable_leads < 1 order by campaign_id;"; + if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($campaigns_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $NDLcampaigns .= " $row[0]   "; + $ctp++; + if (preg_match("/0$|5$/",$ctp)) + {$NDLcampaigns .= "
";} + } + if ($ctp > 0) + { + echo "\n"; + echo "
\n"; + echo "



Close Alert"; + echo "




Campaigns with no dialable leads:

$NDLcampaigns
"; + echo "










  "; + echo "
\n"; + echo "
\n"; + } + } } + + + ################################################################################### ###### INBOUND/OUTBOUND CALLS ################################################################################### @@ -1468,11 +1587,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " USER INFO |"; + + +$HTuser = " USER "; +if ($UidORname>0) + { + $HTuser .= "SHOW ID "; + } +else + { + $HTuser .= "SHOW NAME"; + } + +$HTuser .= " INFO |"; + + $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1486,9 +1619,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php index 3b032c1d..a9c5fb6e 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/call_report_export.php @@ -15,6 +15,7 @@ # 90721-1137 - Added rank and owner as vicidial_list fields # 91121-0253 - Added list name, list description and status name # 100119-1039 - Filtered comments for \n newlines +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -358,7 +359,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns;"; + $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -373,7 +374,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups;"; + $stmt="select group_id from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -388,7 +389,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups;"; + $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -403,7 +404,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists;"; + $stmt="select list_id from vicidial_lists order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -418,7 +419,7 @@ else $i++; } - $stmt="select status from vicidial_statuses;"; + $stmt="select status from vicidial_statuses order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); @@ -433,7 +434,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses;"; + $stmt="select distinct status from vicidial_campaign_statuses order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/fcstats.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/fcstats.php index cd2e4f4b..2ca3c310 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/fcstats.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 80328-1139 - adapted for basic fronter/closer stats # 90310-2132 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -37,13 +38,13 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -57,7 +58,7 @@ $STARTtime = date("U"); if (!isset($group)) {$group = 'CL_TEST_L';} if (!isset($query_date)) {$query_date = $NOW_DATE;} -$stmt="select group_id from vicidial_inbound_groups;"; +$stmt="select group_id from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_report.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_report.php index 1d1bb654..87ef139e 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_report.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -10,6 +10,7 @@ # 80707-0754 - Fixed groups bug, changed formatting # 90310-2059 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -46,14 +47,12 @@ $stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM sys $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $webroot_writable = $row[1]; $SSoutbound_autodial_active = $row[2]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -68,7 +67,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -83,7 +82,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_status.php b/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_status.php index 03727924..2dd5883c 100644 --- a/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_status.php +++ b/agc_2-X/branches/agc_2.2.0/www/vicidial/timeclock_status.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80603-1500 - formatting changes # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # header ("Content-type: text/html; charset=utf-8"); @@ -40,16 +41,13 @@ $stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_aut $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $webroot_writable = $row[1]; $timeclock_end_of_day = $row[2]; $SSoutbound_autodial_active = $row[3]; - - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -70,27 +68,26 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; @@ -115,7 +112,7 @@ $browser = getenv("HTTP_USER_AGENT"); } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi index 007797b5..54bdebaf 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_inbound.agi @@ -120,6 +120,7 @@ # 91230-0911 - Reset to original callerID when sending the call to VMAIL/CALLMENU/PHONE/etc... # 100121-1954 - Added TIMEOT/AFTHRS/NANQUE dropping event statuses # 100123-1015 - Added voicemail_id lookup for user from AGENTDIRECT drop +# 100212-0653 - Added AGENTVMAIL AGENTDIRECT option for no-queue, hold time and after hours features # $script = 'agi-VDAD_ALL_inbound.agi'; @@ -809,6 +810,21 @@ if ( ($hm < $ct_default_start) || ($hm > $ct_default_stop) ) } if ($after_hours_action =~ /VOICEMAIL/) { + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($after_hours_voicemail =~ /AGENTVMAIL/) ) + { + ### Grab user's voicemail ID from the database + $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $after_hours_voicemail = $aryA[0]; + } + $sthA->finish(); + } $newcallerid = "\"$VCcallerid <$originalCID>\""; $AGI->set_callerid($newcallerid); print STDERR "Setting CID \"$newcallerid\"\n"; @@ -996,6 +1012,21 @@ if ($no_agent_no_queue =~ /Y|NO_PAUSED/) } if ($no_agent_action =~ /VOICEMAIL/) { + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($no_agent_action_value =~ /AGENTVMAIL/) ) + { + ### Grab user's voicemail ID from the database + $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $no_agent_action_value = $aryA[0]; + } + $sthA->finish(); + } $newcallerid = "\"$VCcallerid <$originalCID>\""; $AGI->set_callerid($newcallerid); print STDERR "Setting CID \"$newcallerid\"\n"; @@ -2288,7 +2319,7 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) ) } } - if ($hold_recall_xfer_group !~ /NONE/) + if ( ($hold_recall_xfer_group !~ /NONE/) && (length($hold_recall_xfer_group) > 1) ) { $now_date_epoch = time(); $FDtarget = ($now_date_epoch - 86400); @@ -2732,6 +2763,21 @@ while ( ($drop_timer <= $DROP_TIME) && ($wait_in_queue > 0) ) } if ($hold_time_option =~ /VOICEMAIL/) { + if ( ($channel_group =~ /AGENTDIRECT/) && (length($agent_only) > 1) && ($hold_time_option_voicemail =~ /AGENTVMAIL/) ) + { + ### Grab user's voicemail ID from the database + $stmtA = "SELECT voicemail_id FROM vicidial_users where user='$agent_only';"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + $dbhP=$dbhA; $mysql_count='02XXX'; $MEL_aff_rows=$sthArows; &mysql_error_logging; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $hold_time_option_voicemail = $aryA[0]; + } + $sthA->finish(); + } $newcallerid = "\"$VCcallerid <$originalCID>\""; $AGI->set_callerid($newcallerid); print STDERR "Setting CID \"$newcallerid\"\n"; diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php b/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php index ae53c78d..f249462d 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSER_service_level.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 90310-2117 - Added admin header # 90508-0644 - Changed to PHP long tags # 90801-0923 - Added in-group name to pulldown +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -43,12 +44,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -76,7 +75,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php index 8c45501d..eb2ff840 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERstats.php @@ -25,6 +25,7 @@ # 90801-0921 - Added in-group name to pulldown # 91214-0955 - Added INITIAL QUEUE POSITION BREAKDOWN # 100206-1454 - Fixed TMR(service level) calculation +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -105,7 +106,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php b/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php index 14010001..485e1865 100644 --- a/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php +++ b/agc_2-X/trunk/www/vicidial/AST_CLOSERsummary_hourly.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 90801-0910 - First build # 90809-0216 - Added Exclude Outbound Drop Group option +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -56,12 +57,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -103,7 +102,7 @@ if (!isset($end_date)) {$end_date = $NOW_DATE;} $exclude_rolloverSQL=''; if (eregi("YES",$exclude_rollover)) {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns)";} -$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL;"; +$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -155,7 +154,7 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $times_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_DIDstats.php b/agc_2-X/trunk/www/vicidial/AST_DIDstats.php index 875aacc7..ca4e8c6b 100644 --- a/agc_2-X/trunk/www/vicidial/AST_DIDstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_DIDstats.php @@ -7,6 +7,7 @@ # # 90601-1443 - First build # 100116-0620 - Bug fixes +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -72,7 +73,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids;"; +$stmt="select did_id,did_pattern,did_description from vicidial_inbound_dids order by did_pattern;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php b/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php index 0c7fee84..28b7b2d1 100644 --- a/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_GROUP_ALIASstats.php @@ -39,12 +39,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -57,7 +55,7 @@ $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); diff --git a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php index e4eece31..f8be12ac 100644 --- a/agc_2-X/trunk/www/vicidial/AST_IVRstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_IVRstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # 81026-2026 - First build @@ -11,6 +11,7 @@ # 90310-2056 - Admin header # 90508-0644 - Changed to PHP long tags # 91112-0719 - Added in-group names to select list +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -44,12 +45,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -77,7 +76,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} if (!isset($end_date)) {$end_date = "$NOW_DATE 23:23:59";} -$stmt="select group_id,group_name from vicidial_inbound_groups;"; +$stmt="select group_id,group_name from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php index c4989c46..2b808c37 100644 --- a/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php +++ b/agc_2-X/trunk/www/vicidial/AST_OUTBOUNDsummary_interval.php @@ -1,12 +1,13 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # # 091128-0311 - First build # 091129-0017 - Added Sales-type and DNC-type tallies +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -54,12 +55,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -140,7 +139,7 @@ while($i < $group_ct) $i++; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL;"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns $whereLOGallowed_campaignsSQL order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -224,7 +223,7 @@ while ($i < $statcats_to_print) $i++; } -$stmt="select call_time_id,call_time_name from vicidial_call_times;"; +$stmt="select call_time_id,call_time_name from vicidial_call_times order by call_time_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $times_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php index b7063771..faf6368d 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php @@ -24,6 +24,7 @@ # 90827-1154 - Added List ID breakdown of calls # 91222-0843 - Fixed ALL-CAMPAIGNS inbound rollover issue(bug #262), and some other bugs # 100202-1034 - Added statuses to no-answer section +# 100214-1421 - Sort menu alphabetically # header ("Content-type: text/html; charset=utf-8"); @@ -128,7 +129,7 @@ while($i < $group_ct) $i++; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns;"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php index 53e70dd8..3efb562f 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php +++ b/agc_2-X/trunk/www/vicidial/AST_VICIDIAL_hopperlist.php @@ -29,13 +29,13 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -129,7 +129,7 @@ else echo "|ORDER |PRIORITY| LEAD ID | LIST ID | PHONE NUM | STATE | STATUS | COUNT | GMT | ALT |\n"; echo "+------+--------+-----------+------------+------------+-------+--------+-------+--------+-------+\n"; - $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 2000;"; + $stmt="select vicidial_hopper.lead_id,phone_number,vicidial_hopper.state,vicidial_list.status,called_count,vicidial_hopper.gmt_offset_now,hopper_id,alt_dial,vicidial_hopper.list_id,vicidial_hopper.priority from vicidial_hopper,vicidial_list where vicidial_hopper.campaign_id='" . mysql_real_escape_string($group) . "' and vicidial_hopper.status='READY' and vicidial_hopper.lead_id=vicidial_list.lead_id order by priority desc,hopper_id limit 5000;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $users_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php index 50406f89..96c8a6d4 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_days_detail.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 90225-1051 - Added CSV download option # 90310-0752 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # @@ -46,12 +47,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -66,7 +65,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php index a6bfcb1e..d08c200d 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_performance_detail.php @@ -21,6 +21,7 @@ # 90717-1500 - Changed to be multi-campaign, multi-user-group select # 90908-1058 - Added DEAD time statistics # 100203-1131 - Added CUSTOMER time statistics +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -93,7 +94,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -104,7 +105,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php index 916bd514..25bdbc09 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_status_detail.php @@ -10,6 +10,7 @@ # 90310-2030 - Admin header # 90508-0644 - Changed to PHP long tags # 100119-0935 - Fixed bug 291 +# 100214-1421 - Sort menu alphabetically # @@ -47,12 +48,10 @@ $stmt = "SELECT use_non_latin FROM system_settings;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -67,7 +66,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -83,7 +82,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -94,7 +93,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php index dbb85f42..2c779972 100644 --- a/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php +++ b/agc_2-X/trunk/www/vicidial/AST_agent_time_detail.php @@ -10,6 +10,7 @@ # 90522-0723 - First build # 90908-1103 - Added DEAD time stats # 100203-1147 - Added CUSTOMER time statistics +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -82,7 +83,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select campaign_id from vicidial_campaigns;"; +$stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -93,7 +94,7 @@ while ($i < $campaigns_to_print) $groups[$i] =$row[0]; $i++; } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_server_performance.php b/agc_2-X/trunk/www/vicidial/AST_server_performance.php index 5003c37c..3688ca34 100644 --- a/agc_2-X/trunk/www/vicidial/AST_server_performance.php +++ b/agc_2-X/trunk/www/vicidial/AST_server_performance.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 80118-1508 - Fixed horizontal scale marking issues # 90310-2151 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -35,13 +36,13 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} $PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_servers='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -61,7 +62,7 @@ if (!isset($begin_query_time)) {$begin_query_time = "$NOW_DATE 09:00:00";} if (!isset($end_query_time)) {$end_query_time = "$NOW_DATE 15:30:00";} if (!isset($group)) {$group = '';} -$stmt="select server_ip from servers;"; +$stmt="select server_ip from servers order by server_ip;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $servers_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php index 3a306d95..6b40a9da 100644 --- a/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php +++ b/agc_2-X/trunk/www/vicidial/AST_timeonVDADall.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # live real-time stats for the VICIDIAL Auto-Dialer all servers # @@ -58,11 +58,11 @@ # 90914-1154 - Added AgentOnly display column to waiting calls section # 91102-2013 - Changed in-group color styles for incoming calls waiting # 91204-1548 - Added ability to change agent in-groups and blended +# 100214-1127 - Added no-dialable-leads alert and in-groups stats option # - -$version = '2.2.0-49'; -$build = '91204-1548'; +$version = '2.2.0-50'; +$build = '100214-1127'; header ("Content-type: text/html; charset=utf-8"); @@ -110,6 +110,12 @@ if (isset($_GET["PHONEdisplay"])) {$PHONEdisplay=$_GET["PHONEdisplay"];} elseif (isset($_POST["PHONEdisplay"])) {$PHONEdisplay=$_POST["PHONEdisplay"];} if (isset($_GET["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_GET["CUSTPHONEdisplay"];} elseif (isset($_POST["CUSTPHONEdisplay"])) {$CUSTPHONEdisplay=$_POST["CUSTPHONEdisplay"];} +if (isset($_GET["NOLEADSalert"])) {$NOLEADSalert=$_GET["NOLEADSalert"];} + elseif (isset($_POST["NOLEADSalert"])) {$NOLEADSalert=$_POST["NOLEADSalert"];} +if (isset($_GET["DROPINGROUPstats"])) {$DROPINGROUPstats=$_GET["DROPINGROUPstats"];} + elseif (isset($_POST["DROPINGROUPstats"])) {$DROPINGROUPstats=$_POST["DROPINGROUPstats"];} +if (isset($_GET["ALLINGROUPstats"])) {$ALLINGROUPstats=$_GET["ALLINGROUPstats"];} + elseif (isset($_POST["ALLINGROUPstats"])) {$ALLINGROUPstats=$_POST["ALLINGROUPstats"];} if (isset($_GET["with_inbound"])) {$with_inbound=$_GET["with_inbound"];} elseif (isset($_POST["with_inbound"])) {$with_inbound=$_POST["with_inbound"];} if (isset($_GET["monitor_active"])) {$monitor_active=$_GET["monitor_active"];} @@ -240,14 +246,14 @@ if ( (!isset($monitor_phone)) or (strlen($monitor_phone)<1) ) $monitor_phone = $row[0]; } -$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y';"; +$stmt="select campaign_id,campaign_name from vicidial_campaigns where active='Y' order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); $i=0; - $LISTgroups[$i]='ALL-ACTIVE'; - $i++; - $groups_to_print++; +$LISTgroups[$i]='ALL-ACTIVE'; +$i++; +$groups_to_print++; while ($i < $groups_to_print) { $row=mysql_fetch_row($rslt); @@ -268,6 +274,14 @@ while($i < $group_ct) } $group_SQL = eregi_replace(",$",'',$group_SQL); +### if no campaigns selected, display all +if ($group_ct < 1) + { + $groups[0] = 'ALL-ACTIVE'; + $group_string = 'ALL-ACTIVE'; + $group = 'ALL-ACTIVE'; + $groupQS .= "&groups[]=ALL-ACTIVE"; + } if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) { @@ -311,7 +325,7 @@ $NFE = '
'; $F=''; $FG=''; $B=''; $BG=''; $select_list = ""; @@ -420,10 +452,16 @@ var pass = ''; function openDiv(divvar) { document.getElementById(divvar).innerHTML = select_list; + document.getElementById(divvar).style.left = 0; } function closeDiv(divvar) { document.getElementById(divvar).innerHTML = open_list; + document.getElementById(divvar).style.left = 160; + } +function closeAlert(divvar) + { + document.getElementById(divvar).innerHTML = ''; } // function to launch monitoring calls @@ -667,7 +705,7 @@ $rslt=mysql_query($stmt, $link); $campaign_allow_inbound = $row[0]; echo "\n"; -echo"\n"; +echo"\n"; echo "Real-Time Report: $group\n"; $short_header=1; @@ -692,6 +730,8 @@ echo "\n"; echo "\n"; echo "\n"; echo "\n"; +echo "\n"; +echo "\n"; echo "Real-Time Report                                                                               \n"; echo "\n"; echo "
Select Campaigns:
"; -$select_list .= ""; $o=0; while ($groups_to_print > $o) { @@ -335,7 +349,7 @@ if ($UGdisplay > 0) while ($usergroups_to_print > $o) { if ($usergroups[$o] == $usergroup) {$select_list .= "";} - else {$select_list .= "";} + else {$select_list .= "";} $o++; } $select_list .= "

"; @@ -372,6 +386,24 @@ $select_list .= "Phone: "; $select_list .= ""; $select_list .= "

"; +$select_list .= "   Dialable Leads Alert:
"; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + $DROPINGROUPstatsHTML .= ""; + } + + ##### INBOUND ONLY ### if (ereg('O',$with_inbound)) { $multi_drop++; - if ($adastats>1) - { - $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; - - if ($DB > 0) {echo "\n|$stmtB|\n";} - - $r=0; - $rslt=mysql_query($stmtB, $link); - $ingroups_to_print = mysql_num_rows($rslt); - if ($ingroups_to_print > 0) - {$ingroup_detail .= "
\n"; @@ -701,9 +741,9 @@ echo "\n"; echo "\n"; echo "   "; echo "\n"; -echo "STOP | "; -echo "SLOW | "; -echo "GO"; +echo "STOP | "; +echo "SLOW | "; +echo "GO"; if (eregi('ALL-ACTIVE',$group_string)) { echo "       MODIFY | \n"; @@ -716,7 +756,8 @@ echo "
please select a campaign from the pulldown above\n"; exit;} +if (!$group) + {echo "

please select a campaign from the pulldown above\n"; exit;} else { $multi_drop=0; @@ -762,124 +803,169 @@ else if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";} +##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ### +if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($adastats > 1) ) ) + { + $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL) order by campaign_id;"; + + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $r=0; + $rslt=mysql_query($stmtB, $link); + $ingroups_to_print = mysql_num_rows($rslt); + if ($ingroups_to_print > 0) + {$ingroup_detail .= "";} + while ($ingroups_to_print > $r) + { + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + $VSCcat1 = $row[3]; + $VSCcat1tally = $row[4]; + $VSCcat2 = $row[5]; + $VSCcat2tally = $row[6]; + $VSCcat3 = $row[7]; + $VSCcat3tally = $row[8]; + $VSCcat4 = $row[9]; + $VSCcat4tally = $row[10]; + $hold_sec_stat_one = $row[11]; + $hold_sec_stat_two = $row[12]; + $hold_sec_answer_calls = $row[13]; + $hold_sec_drop_calls = $row[14]; + $hold_sec_queue_calls = $row[15]; + $ingroupdetail = $row[16]; + if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + if ($callsTODAY > 0) + { + $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); + $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); + } + else + {$AVGhold_sec_queue_calls=0;} + + if ($dropsTODAY > 0) + { + $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); + $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); + } + else + {$AVGhold_sec_drop_calls=0;} + + if ($answersTODAY > 0) + { + $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); + $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); + $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); + $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); + $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); + $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); + $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); + $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); + if ($agent_non_pause_sec > 0) + { + $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); + $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); + $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); + } + else + {$AVG_ANSWERagent_non_pause_sec=0;} + } + else + { + $PCThold_sec_stat_one=0; + $PCThold_sec_stat_two=0; + $AVGhold_sec_answer_calls=0; + $AVG_ANSWERagent_non_pause_sec=0; + } + + if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} + else {$bgcolor='white';} + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + $ingroup_detail .= ""; + + $r++; + } + + if ($ingroups_to_print > 0) + {$ingroup_detail .= "
        $ingroupdetail   CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls  
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
ANSWERS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} + } + + +##### DROP IN-GROUP ONLY TOTALS ROW ### +$DROPINGROUPstatsHTML=''; +if ( ($DROPINGROUPstats > 0) and (!preg_match("/ALL-ACTIVE/",$group_string)) ) + { + $DIGcampaigns=''; + $stmtB="select drop_inbound_group from vicidial_campaigns where campaign_id IN($group_SQL) and drop_inbound_group NOT IN('---NONE---','');"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $dig_to_print = mysql_num_rows($rslt); + $dtp=0; + while ($dig_to_print > $dtp) + { + $row=mysql_fetch_row($rslt); + $DIGcampaigns .= "'$row[0]',"; + $dtp++; + } + $DIGcampaigns = preg_replace("/,$/",'',$DIGcampaigns); + + $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today) from vicidial_campaign_stats where campaign_id IN($DIGcampaigns);"; + if ($DB > 0) {echo "\n|$stmtB|\n";} + + $rslt=mysql_query($stmtB, $link); + $row=mysql_fetch_row($rslt); + $callsTODAY = $row[0]; + $dropsTODAY = $row[1]; + $answersTODAY = $row[2]; + if ( ($dropsTODAY > 0) and ($callsTODAY > 0) ) + { + $drpctTODAY = ( ($dropsTODAY / $callsTODAY) * 100); + $drpctTODAY = round($drpctTODAY, 2); + $drpctTODAY = sprintf("%01.2f", $drpctTODAY); + } + else + {$drpctTODAY=0;} + + $DROPINGROUPstatsHTML .= "
DROP IN-GROUP STATS -DROP PERCENT:  $drpctTODAY%     CALLS:  $callsTODAY     DROPS/ANSWERS:  $dropsTODAY / $answersTODAY    
";} - while ($ingroups_to_print > $r) - { - $row=mysql_fetch_row($rslt); - $callsTODAY = $row[0]; - $dropsTODAY = $row[1]; - $answersTODAY = $row[2]; - $VSCcat1 = $row[3]; - $VSCcat1tally = $row[4]; - $VSCcat2 = $row[5]; - $VSCcat2tally = $row[6]; - $VSCcat3 = $row[7]; - $VSCcat3tally = $row[8]; - $VSCcat4 = $row[9]; - $VSCcat4tally = $row[10]; - $hold_sec_stat_one = $row[11]; - $hold_sec_stat_two = $row[12]; - $hold_sec_answer_calls = $row[13]; - $hold_sec_drop_calls = $row[14]; - $hold_sec_queue_calls = $row[15]; - $ingroupdetail = $row[16]; - if ( ($dropsTODAY > 0) and ($answersTODAY > 0) ) - { - $drpctTODAY = ( ($dropsTODAY / $answersTODAY) * 100); - $drpctTODAY = round($drpctTODAY, 2); - $drpctTODAY = sprintf("%01.2f", $drpctTODAY); - } - else - {$drpctTODAY=0;} - - if ($callsTODAY > 0) - { - $AVGhold_sec_queue_calls = ($hold_sec_queue_calls / $callsTODAY); - $AVGhold_sec_queue_calls = round($AVGhold_sec_queue_calls, 0); - } - else - {$AVGhold_sec_queue_calls=0;} - - if ($dropsTODAY > 0) - { - $AVGhold_sec_drop_calls = ($hold_sec_drop_calls / $dropsTODAY); - $AVGhold_sec_drop_calls = round($AVGhold_sec_drop_calls, 0); - } - else - {$AVGhold_sec_drop_calls=0;} - - if ($answersTODAY > 0) - { - $PCThold_sec_stat_one = ( ($hold_sec_stat_one / $answersTODAY) * 100); - $PCThold_sec_stat_one = round($PCThold_sec_stat_one, 2); - $PCThold_sec_stat_one = sprintf("%01.2f", $PCThold_sec_stat_one); - $PCThold_sec_stat_two = ( ($hold_sec_stat_two / $answersTODAY) * 100); - $PCThold_sec_stat_two = round($PCThold_sec_stat_two, 2); - $PCThold_sec_stat_two = sprintf("%01.2f", $PCThold_sec_stat_two); - $AVGhold_sec_answer_calls = ($hold_sec_answer_calls / $answersTODAY); - $AVGhold_sec_answer_calls = round($AVGhold_sec_answer_calls, 0); - if ($agent_non_pause_sec > 0) - { - $AVG_ANSWERagent_non_pause_sec = (($answersTODAY / $agent_non_pause_sec) * 60); - $AVG_ANSWERagent_non_pause_sec = round($AVG_ANSWERagent_non_pause_sec, 2); - $AVG_ANSWERagent_non_pause_sec = sprintf("%01.2f", $AVG_ANSWERagent_non_pause_sec); - } - else - {$AVG_ANSWERagent_non_pause_sec=0;} - } - else - { - $PCThold_sec_stat_one=0; - $PCThold_sec_stat_two=0; - $AVGhold_sec_answer_calls=0; - $AVG_ANSWERagent_non_pause_sec=0; - } - - if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} - else {$bgcolor='white';} - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - $ingroup_detail .= ""; - - $r++; - } - - if ($ingroups_to_print > 0) - {$ingroup_detail .= "
        $ingroupdetail   CALLS TODAY:  $callsTODAY    TMA 1:  $PCThold_sec_stat_one%     Average Hold time for Answered Calls:  $AVGhold_sec_answer_calls  
DROPS TODAY:  $dropsTODAY    TMA 2:  $PCThold_sec_stat_two%     Average Hold time for Dropped Calls:  $AVGhold_sec_drop_calls  
ANSWERS TODAY:  $answersTODAY    DROP PERCENT:  $drpctTODAY%    Average Hold time for All Calls:  $AVGhold_sec_queue_calls  
";} - - } - $stmt="select agent_pause_codes_active from vicidial_campaigns $group_SQLwhere;"; $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; @@ -1182,6 +1268,8 @@ else echo "DIFF:  $diffpctONEMIN%     "; echo "ORDER:  $DIALorder     "; echo ""; + + echo "$DROPINGROUPstatsHTML\n"; } echo ""; @@ -1202,66 +1290,99 @@ echo "$ingroup_detail"; if ($adastats<2) { - echo "+ VIEW MORE"; + echo "+ VIEW MORE"; } else { - echo "+ VIEW LESS"; + echo "+ VIEW LESS"; } if ($UGdisplay>0) { - echo "       HIDE USER GROUP"; + echo "       HIDE USER GROUP"; } else { - echo "       VIEW USER GROUP"; - } -if ($UidORname>0) - { - echo "       SHOW AGENT ID"; - } -else - { - echo "       SHOW AGENT NAME"; + echo "       VIEW USER GROUP"; } if ($SERVdisplay>0) { - echo "       HIDE SERVER INFO"; + echo "       HIDE SERVER INFO"; } else { - echo "       SHOW SERVER INFO"; + echo "       SHOW SERVER INFO"; } if ($CALLSdisplay>0) { - echo "       HIDE WAITING CALLS"; + echo "       HIDE WAITING CALLS"; } else { - echo "       SHOW WAITING CALLS"; + echo "       SHOW WAITING CALLS"; + } + +if ($ALLINGROUPstats>0) + { + echo "       HIDE IN-GROUP STATS"; + } +else + { + echo "       SHOW IN-GROUP STATS"; } if ($PHONEdisplay>0) { - echo "       HIDE PHONES"; + echo "       HIDE PHONES"; } else { - echo "       SHOW PHONES"; + echo "       SHOW PHONES"; } if ($CUSTPHONEdisplay>0) { - echo "       HIDE CUSTPHONES"; + echo "       HIDE CUSTPHONES"; } else { - echo "       SHOW CUSTPHONES"; + echo "       SHOW CUSTPHONES"; } echo ""; echo ""; echo ""; echo "\n\n"; + +##### check for campaigns with no dialable leads if enabled ##### +if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') ) + { + $NDLcampaigns=''; + $stmtB="select campaign_id from vicidial_campaign_stats where campaign_id IN($group_SQL) and dialable_leads < 1 order by campaign_id;"; + if ($DB > 0) {echo "\n|$stmt|$stmtB|\n";} + $rslt=mysql_query($stmtB, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $ctp=0; + while ($campaigns_to_print > $ctp) + { + $row=mysql_fetch_row($rslt); + $NDLcampaigns .= " $row[0]   "; + $ctp++; + if (preg_match("/0$|5$/",$ctp)) + {$NDLcampaigns .= "
";} + } + if ($ctp > 0) + { + echo "\n"; + echo "
\n"; + echo "



Close Alert"; + echo "




Campaigns with no dialable leads:

$NDLcampaigns
"; + echo "










  "; + echo "
\n"; + echo "
\n"; + } + } } + + + ################################################################################### ###### INBOUND/OUTBOUND CALLS ################################################################################### @@ -1466,11 +1587,25 @@ $HTbegin = "|"; $HDstation = "----------------+"; $HTstation = " STATION |"; $HDphone = "-------------+"; -$HTphone = " PHONE |"; +$HTphone = " PHONE |"; $HDuser = "------------------------+"; -$HTuser = " USER INFO |"; + + +$HTuser = " USER "; +if ($UidORname>0) + { + $HTuser .= "SHOW ID "; + } +else + { + $HTuser .= "SHOW NAME"; + } + +$HTuser .= " INFO |"; + + $HDusergroup = "--------------+"; -$HTusergroup = " USER GROUP |"; +$HTusergroup = " USER GROUP |"; $HDsessionid = "------------------+"; $HTsessionid = " SESSIONID |"; $HDbarge = "-------+"; @@ -1484,9 +1619,9 @@ $HTserver_ip = " SERVER IP |"; $HDcall_server_ip = "-----------------+"; $HTcall_server_ip = " CALL SERVER IP |"; $HDtime = "---------+"; -$HTtime = " MM:SS |"; +$HTtime = " MM:SS |"; $HDcampaign = "------------+"; -$HTcampaign = " CAMPAIGN |"; +$HTcampaign = " CAMPAIGN |"; $HDcalls = "-------+"; $HTcalls = " CALLS |"; $HDpause = ''; diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 0bc3b8b9..6a595f3a 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -4288,7 +4288,7 @@ if ($ADD==99999)

- After Hours Voicemail - The voicemail box to send the call to if the Action is set to VOICEMAIL. + After Hours Voicemail - The voicemail box to send the call to if the Action is set to VOICEMAIL. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
@@ -4298,7 +4298,7 @@ if ($ADD==99999)

- No Agents No Queueing - If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N. + No Agents No Queueing - If this field is set to Y or NO_PAUSED then no calls will be put into the queue for this in-group if there are no agents logged in and the calls will go to the No Agent No Queue Action. The NO_PAUSED option will also not send the callers into the queue if there are only paused agents in the in-group. Default is N. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
@@ -4363,7 +4363,7 @@ if ($ADD==99999)

- Hold Time Option Voicemail - If Hold Time Option is set to VOICEMAIL, this is the voicemail box that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. + Hold Time Option Voicemail - If Hold Time Option is set to VOICEMAIL, this is the voicemail box that the call will be sent to if the estimated hold time exceeds the Hold Time Option Seconds. In an AGENTDIRECT in-group, setting this to AGENTVMAIL will select the User voicemail ID to use.
diff --git a/agc_2-X/trunk/www/vicidial/call_report_export.php b/agc_2-X/trunk/www/vicidial/call_report_export.php index 3b032c1d..a9c5fb6e 100644 --- a/agc_2-X/trunk/www/vicidial/call_report_export.php +++ b/agc_2-X/trunk/www/vicidial/call_report_export.php @@ -15,6 +15,7 @@ # 90721-1137 - Added rank and owner as vicidial_list fields # 91121-0253 - Added list name, list description and status name # 100119-1039 - Filtered comments for \n newlines +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -358,7 +359,7 @@ else if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} - $stmt="select campaign_id from vicidial_campaigns;"; + $stmt="select campaign_id from vicidial_campaigns order by campaign_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $campaigns_to_print = mysql_num_rows($rslt); @@ -373,7 +374,7 @@ else $i++; } - $stmt="select group_id from vicidial_inbound_groups;"; + $stmt="select group_id from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); @@ -388,7 +389,7 @@ else $i++; } - $stmt="select user_group from vicidial_user_groups;"; + $stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); @@ -403,7 +404,7 @@ else $i++; } - $stmt="select list_id from vicidial_lists;"; + $stmt="select list_id from vicidial_lists order by list_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $lists_to_print = mysql_num_rows($rslt); @@ -418,7 +419,7 @@ else $i++; } - $stmt="select status from vicidial_statuses;"; + $stmt="select status from vicidial_statuses order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $statuses_to_print = mysql_num_rows($rslt); @@ -433,7 +434,7 @@ else $i++; } - $stmt="select distinct status from vicidial_campaign_statuses;"; + $stmt="select distinct status from vicidial_campaign_statuses order by status;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $Cstatuses_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/fcstats.php b/agc_2-X/trunk/www/vicidial/fcstats.php index cd2e4f4b..2ca3c310 100644 --- a/agc_2-X/trunk/www/vicidial/fcstats.php +++ b/agc_2-X/trunk/www/vicidial/fcstats.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -12,6 +12,7 @@ # 80328-1139 - adapted for basic fronter/closer stats # 90310-2132 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -37,13 +38,13 @@ $PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); if (strlen($shift)<2) {$shift='ALL';} - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; +if ($DB) {echo "|$stmt|\n";} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -57,7 +58,7 @@ $STARTtime = date("U"); if (!isset($group)) {$group = 'CL_TEST_L';} if (!isset($query_date)) {$query_date = $NOW_DATE;} -$stmt="select group_id from vicidial_inbound_groups;"; +$stmt="select group_id from vicidial_inbound_groups order by group_id;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/timeclock_report.php b/agc_2-X/trunk/www/vicidial/timeclock_report.php index 1d1bb654..87ef139e 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_report.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_report.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -10,6 +10,7 @@ # 80707-0754 - Fixed groups bug, changed formatting # 90310-2059 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # require("dbconnect.php"); @@ -46,14 +47,12 @@ $stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active FROM sys $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $webroot_writable = $row[1]; $SSoutbound_autodial_active = $row[2]; - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -68,7 +67,7 @@ $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); $auth=$row[0]; - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); @@ -83,7 +82,7 @@ if (!isset($group)) {$group = '';} if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;} -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt); diff --git a/agc_2-X/trunk/www/vicidial/timeclock_status.php b/agc_2-X/trunk/www/vicidial/timeclock_status.php index 03727924..2dd5883c 100644 --- a/agc_2-X/trunk/www/vicidial/timeclock_status.php +++ b/agc_2-X/trunk/www/vicidial/timeclock_status.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2010 Matt Florell LICENSE: AGPLv2 # # CHANGES # @@ -9,6 +9,7 @@ # 80603-1500 - formatting changes # 90310-2103 - Added admin header # 90508-0644 - Changed to PHP long tags +# 100214-1421 - Sort menu alphabetically # header ("Content-type: text/html; charset=utf-8"); @@ -40,16 +41,13 @@ $stmt = "SELECT use_non_latin,webroot_writable,timeclock_end_of_day,outbound_aut $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $qm_conf_ct = mysql_num_rows($rslt); -$i=0; -while ($i < $qm_conf_ct) +if ($qm_conf_ct > 0) { $row=mysql_fetch_row($rslt); $non_latin = $row[0]; $webroot_writable = $row[1]; $timeclock_end_of_day = $row[2]; $SSoutbound_autodial_active = $row[3]; - - $i++; } ##### END SETTINGS LOOKUP ##### ########################################### @@ -70,27 +68,26 @@ else $EoDdate = date("Y-m-d H:i:s", $EoD); - $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; - if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $auth=$row[0]; +$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1';"; +if ($non_latin > 0) { $rslt=mysql_query("SET NAMES 'UTF8'");} +$rslt=mysql_query($stmt, $link); +$row=mysql_fetch_row($rslt); +$auth=$row[0]; $fp = fopen ("./project_auth_entries.txt", "a"); $date = date("r"); $ip = getenv("REMOTE_ADDR"); $browser = getenv("HTTP_USER_AGENT"); - if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) +if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth)) { Header("WWW-Authenticate: Basic realm=\"VICI-PROJECTS\""); Header("HTTP/1.0 401 Unauthorized"); echo "Invalid Username/Password: |$PHP_AUTH_USER|$PHP_AUTH_PW|\n"; exit; } - else +else { - if($auth>0) { $stmt="SELECT full_name from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW'"; @@ -115,7 +112,7 @@ $browser = getenv("HTTP_USER_AGENT"); } -$stmt="select user_group from vicidial_user_groups;"; +$stmt="select user_group from vicidial_user_groups order by user_group;"; $rslt=mysql_query($stmt, $link); if ($DB) {echo "$stmt\n";} $user_groups_to_print = mysql_num_rows($rslt);