diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 6f529f35..ae2560b7 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -203,6 +203,9 @@ NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom 51. Rewrote how scripts are displayed in the ViciDial agent interface +52. Added List agent script override setting allowing different scripts to be + used for each list ID even within the same campaign + diff --git a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi index ec33118b..b8a66795 100644 --- a/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi +++ b/agc_2-X/trunk/agi/agi-VDAD_ALL_outbound.agi @@ -67,6 +67,7 @@ # 90702-2240 - Added option to send to remote agent as phone*vendor_id # 90721-1137 - Added rank and owner as vicidial_list fields # 90808-0307 - Added longest_wait_time as agent routing option +# 90827-1535 - Added proper logging of list_id in vicidial_log table # $script = 'agi-VDAD_ALL_outbound.agi'; @@ -594,7 +595,20 @@ if ($affected_rows > 0) } } - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial')"; + $xCLlist_id=0; + $stmtA = "SELECT list_id from vicidial_list where lead_id='$CIDlead_id' limit 1;"; + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsLI=$sthA->rows; + $dbhP=$dbhA; $mysql_count='010XX'; $MEL_aff_rows=$sthArowsLI; &mysql_error_logging; + if ($sthArowsLI > 0) + { + @aryA = $sthA->fetchrow_array; + $xCLlist_id = "$aryA[0]"; + } + $sthA->finish(); + + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,alt_dial,list_id) values('$uniqueid','$CIDlead_id','$VDADcampaign','$SQLdate','$now_date_epoch','$vdlog_status','$VDADphone_code','$VDADphone','VDAD','N','$VDADalt_dial','$xCLlist_id')"; if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} $affected_rows = $dbhA->do($stmtA); $dbhP=$dbhA; $mysql_count='01008'; $MEL_aff_rows=$affected_rows; &mysql_error_logging; @@ -634,10 +648,10 @@ if ($affected_rows > 0) $rec_count=0; while ($sthArows > $rec_count) { - @aryA = $sthA->fetchrow_array; - $phone_number = "$aryA[0]"; - $data2 = "$phone_number"; - $rec_count++; + @aryA = $sthA->fetchrow_array; + $phone_number = "$aryA[0]"; + $data2 = "$phone_number"; + $rec_count++; } $sthA->finish(); diff --git a/agc_2-X/trunk/bin/AST_VDauto_dial.pl b/agc_2-X/trunk/bin/AST_VDauto_dial.pl index e2d6747b..f49cf4b3 100644 --- a/agc_2-X/trunk/bin/AST_VDauto_dial.pl +++ b/agc_2-X/trunk/bin/AST_VDauto_dial.pl @@ -79,6 +79,7 @@ # 90619-1948 - Format fixing # 90630-2252 - Added Sangoma CDP pre-Answer call processing # 90816-0057 - Changed default vicidial_log time to 0 from 1 second +# 90827-1227 - Added list_id logging in vicidial_log on NA calls # @@ -1193,7 +1194,20 @@ while($one_day_interval > 0) $end_epoch = $now_date_epoch; if ($insertVLcount < 1) { - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','$insertVLuser','N','$CLstage','$end_epoch','$CLalt_dial')"; + $xCLlist_id=0; + $stmtA="SELECT list_id from vicidial_list where lead_id='$CLlead_id' limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsVLL=$sthA->rows; + if ($sthArowsVLL > 0) + { + @aryA = $sthA->fetchrow_array; + $xCLlist_id = "$aryA[0]"; + } + $sthA->finish(); + + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','$CLnew_status','$CLphone_code','$CLphone_number','$insertVLuser','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); @@ -1651,14 +1665,27 @@ while($one_day_interval > 0) if ( ($affected_rows > 0) && ($CLlead_id > 0) ) { - $jam_string = "| lagged call vdac call DELETED $affected_rows|$BDtsSQLdate|$auto_call_id|$CLcallerid|$CLuniqueid|$CLphone_number|$CLstatus|"; + $xCLlist_id=0; + $stmtA="SELECT list_id from vicidial_list where lead_id='$CLlead_id' limit 1;"; + if ($AGILOG) {$agi_string = "|$stmtA|"; &agi_output;} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArowsVLL=$sthA->rows; + if ($sthArowsVLL > 0) + { + @aryA = $sthA->fetchrow_array; + $xCLlist_id = "$aryA[0]"; + } + $sthA->finish(); + + $jam_string = "| lagged call vdac call DELETED $affected_rows|$BDtsSQLdate|$auto_call_id|$CLcallerid|$CLuniqueid|$CLphone_number|$CLstatus|$xCLlist_id|"; &jam_event_logger; $CLstage =~ s/LIVE|-//gi; if ($CLstage < 0.25) {$CLstage=0;} $end_epoch = $now_date_epoch; - $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial')"; + $stmtA = "INSERT INTO vicidial_log (uniqueid,lead_id,campaign_id,call_date,start_epoch,status,phone_code,phone_number,user,processed,length_in_sec,end_epoch,alt_dial,list_id) values('$CLuniqueid','$CLlead_id','$CLcampaign_id','$SQLdate','$now_date_epoch','DROP','$CLphone_code','$CLphone_number','VDAD','N','$CLstage','$end_epoch','$CLalt_dial','$xCLlist_id')"; if($M){print STDERR "\n|$stmtA|\n";} $affected_rows = $dbhA->do($stmtA); diff --git a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql index 424e5e36..559dac73 100644 --- a/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql +++ b/agc_2-X/trunk/extras/MySQL_AST_CREATE_tables.sql @@ -682,7 +682,8 @@ active ENUM('Y','N'), list_description VARCHAR(255), list_changedate DATETIME, list_lastcalldate DATETIME, -reset_time VARCHAR(100) default '' +reset_time VARCHAR(100) default '', +agent_script_override VARCHAR(10) default '' ); CREATE TABLE vicidial_statuses ( @@ -1890,7 +1891,7 @@ CREATE INDEX phone_number on vicidial_closer_log (phone_number); CREATE INDEX date_user on vicidial_closer_log (call_date,user); CREATE INDEX comment_a on live_inbound_log (comment_a); -UPDATE system_settings SET db_schema_version='1168'; +UPDATE system_settings SET db_schema_version='1169'; GRANT RELOAD ON *.* TO cron@'%'; GRANT RELOAD ON *.* TO cron@localhost; diff --git a/agc_2-X/trunk/extras/upgrade_2.2.0.sql b/agc_2-X/trunk/extras/upgrade_2.2.0.sql index e8550ffb..e40a6a76 100644 --- a/agc_2-X/trunk/extras/upgrade_2.2.0.sql +++ b/agc_2-X/trunk/extras/upgrade_2.2.0.sql @@ -489,3 +489,7 @@ UPDATE system_settings SET db_schema_version='1167'; ALTER TABLE vicidial_campaigns MODIFY drop_call_seconds TINYINT(3) default '5'; UPDATE system_settings SET db_schema_version='1168'; + +ALTER TABLE vicidial_lists ADD agent_script_override VARCHAR(10) default ''; + +UPDATE system_settings SET db_schema_version='1169'; diff --git a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt index aabd126a..8bb0c14c 100644 --- a/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt +++ b/agc_2-X/trunk/translations/raw_translation_files/TO_BE_TRANSLATED_2.2.0.txt @@ -259,6 +259,8 @@ VICIDIAL Balance Rank|| This field allows you to set the order in which this server is to be used for balance dialing, if balance dialing is enabled. The server with the highest rank will be used first in placing Balance fill calls. Default is 0|| Inbound Summary Hourly Report|| orders by the amount of time agent has been actively waiting for a call|| +Agent Script Override|| +If this field is set, this will be the script that the agent sees on their screen instead of the campaign script when the lead is from this list. Default is not set|| add-file: user_territories.php diff --git a/agc_2-X/trunk/www/agc/vdc_script_display.php b/agc_2-X/trunk/www/agc/vdc_script_display.php index f7a8eccd..cb950d39 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_display.php +++ b/agc_2-X/trunk/www/agc/vdc_script_display.php @@ -7,10 +7,11 @@ # # CHANGELOG: # 90824-1435 - First build of script +# 90827-1548 - Added list override script option # -$version = '2.2.0-1'; -$build = '90824-1435'; +$version = '2.2.0-2'; +$build = '90827-1548'; require("dbconnect.php"); @@ -72,6 +73,8 @@ if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} +if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} + elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} @@ -122,11 +125,14 @@ if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} -if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} - elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} +if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} + elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} +if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} + elseif (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} + header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 @@ -214,6 +220,16 @@ if (strlen($in_script) < 1) else {$call_script = $in_script;} +if ($ignore_list_script < 1) + { + $stmt="SELECT agent_script_override from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $agent_script_override = $row[0]; + if (strlen($agent_script_override) > 0) + {$call_script = $agent_script_override;} + } + $stmt="SELECT script_name,script_text from vicidial_scripts where script_id='$call_script';"; $rslt=mysql_query($stmt, $link); $row=mysql_fetch_row($rslt); @@ -252,6 +268,7 @@ if (eregi("iframe src",$script_text)) $pass = eregi_replace(' ','+',$pass); $campaign = eregi_replace(' ','+',$campaign); $phone_login = eregi_replace(' ','+',$phone_login); + $original_phone_login = eregi_replace(' ','+',$original_phone_login); $phone_pass = eregi_replace(' ','+',$phone_pass); $fronter = eregi_replace(' ','+',$fronter); $closer = eregi_replace(' ','+',$closer); @@ -309,6 +326,7 @@ $script_text = eregi_replace('--A--user--B--',"$user",$script_text); $script_text = eregi_replace('--A--pass--B--',"$pass",$script_text); $script_text = eregi_replace('--A--campaign--B--',"$campaign",$script_text); $script_text = eregi_replace('--A--phone_login--B--',"$phone_login",$script_text); +$script_text = eregi_replace('--A--original_phone_login--B--',"$original_phone_login",$script_text); $script_text = eregi_replace('--A--phone_pass--B--',"$phone_pass",$script_text); $script_text = eregi_replace('--A--fronter--B--',"$fronter",$script_text); $script_text = eregi_replace('--A--closer--B--',"$closer",$script_text); diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index e4d6342f..c2bc1199 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -248,10 +248,11 @@ # 90812-0046 - Added no-delete-sessions = 1 as default, unused sessions cleared out at timeclock end of day # 90814-0829 - Moved mute button next to hotkeys button # 90827-0133 - Reworked Script display code +# 90827-1549 - Added list script override option, original_phone_login variable # -$version = '2.2.0-225'; -$build = '90827-0133'; +$version = '2.2.0-226'; +$build = '90827-1549'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=61; $one_mysql_log=0; @@ -1399,6 +1400,8 @@ $VDloginDISPLAY=0; exit; } +$original_phone_login = $phone_login; + # code for parsing load-balanced agent phone allocation where agent interface # will send multiple phones-table logins so that the script can determine the # server that has the fewest agents logged into it. @@ -2305,6 +2308,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var VU_closer_default_blended = ''; var VDstop_rec_after_each_call = ''; var phone_login = ''; + var original_phone_login = ''; var phone_pass = ''; var user = ''; var user_abb = ''; @@ -4623,6 +4627,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&pass=" + pass + "&campaign=" + campaign + "&phone_login=" + phone_login + + "&original_phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + @@ -5610,6 +5615,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&pass=" + pass + "&campaign=" + campaign + "&phone_login=" + phone_login + + "&original_phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + @@ -5754,6 +5760,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} "&pass=" + pass + "&campaign=" + campaign + "&phone_login=" + phone_login + + "&original_phone_login=" + original_phone_login + "&phone_pass=" + phone_pass + "&fronter=" + fronter + "&closer=" + user + @@ -7020,7 +7027,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} if (tempreason=='SHIFT') {logout_content='Your Shift is over or has changed, you have been logged out of your session

';} - document.getElementById("LogouTBoxLink").innerHTML = logout_content + "CLICK HERE TO LOG IN AGAIN\n"; + document.getElementById("LogouTBoxLink").innerHTML = logout_content + "CLICK HERE TO LOG IN AGAIN\n"; logout_stop_timeouts = 1; @@ -7195,6 +7202,7 @@ encoded=utf8_decode(xtest); var SClead_id = document.vicidial_form.lead_id.value; var SCcampaign = campaign; var SCphone_login = phone_login; + var SCoriginal_phone_login = original_phone_login; var SCgroup = group; var SCchannel_group = group; var SCSQLdate = SQLdate; @@ -7249,6 +7257,7 @@ encoded=utf8_decode(xtest); SClead_id = SClead_id.replace(RGplus,'+'); SCcampaign = SCcampaign.replace(RGplus,'+'); SCphone_login = SCphone_login.replace(RGplus,'+'); + SCoriginal_phone_login = SCoriginal_phone_login.replace(RGplus,'+'); SCgroup = SCgroup.replace(RGplus,'+'); SCchannel_group = SCchannel_group.replace(RGplus,'+'); SCSQLdate = SCSQLdate.replace(RGplus,'+'); @@ -7300,6 +7309,7 @@ encoded=utf8_decode(xtest); var RGlead_id = new RegExp("--A--lead_id--B--","g"); var RGcampaign = new RegExp("--A--campaign--B--","g"); var RGphone_login = new RegExp("--A--phone_login--B--","g"); + var RGoriginal_phone_login = new RegExp("--A--original_phone_login--B--","g"); var RGgroup = new RegExp("--A--group--B--","g"); var RGchannel_group = new RegExp("--A--channel_group--B--","g"); var RGSQLdate = new RegExp("--A--SQLdate--B--","g"); @@ -7352,6 +7362,7 @@ encoded=utf8_decode(xtest); encoded = encoded.replace(RGlead_id, SClead_id); encoded = encoded.replace(RGcampaign, SCcampaign); encoded = encoded.replace(RGphone_login, SCphone_login); + encoded = encoded.replace(RGoriginal_phone_login, SCoriginal_phone_login); encoded = encoded.replace(RGgroup, SCgroup); encoded = encoded.replace(RGchannel_group, SCchannel_group); encoded = encoded.replace(RGSQLdate, SCSQLdate); @@ -8862,7 +8873,7 @@ if ($view_calls_in_queue > 0)
  Other Agents Status:  
 
-
+
Available Agents Transfer:
Agents View +
diff --git a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php index 53171c02..68ad8fa5 100644 --- a/agc_2-X/trunk/www/vicidial/AST_VDADstats.php +++ b/agc_2-X/trunk/www/vicidial/AST_VDADstats.php @@ -21,6 +21,7 @@ # 90524-2231 - Changed to use functions.php for seconds to HH:MM:SS conversion # 90608-0251 - Added optional carrier codes stats, made graph at bottom optional # 90806-0001 - Added CI(Customer Interaction/Human Answered) stats, added option to add inbound rollover stats to these +# 90827-1154 - Added List ID breakdown of calls # header ("Content-type: text/html; charset=utf-8"); @@ -824,6 +825,63 @@ else + ############################## + ######### LIST ID BREAKDOWN STATS + + $TOTALcalls = 0; + + $OUToutput .= "\n"; + $OUToutput .= "---------- LIST ID STATS\n"; + $OUToutput .= "+------------------------------------------+------------+\n"; + $OUToutput .= "| LIST | CALLS |\n"; + $OUToutput .= "+------------------------------------------+------------+\n"; + + $stmt="select count(*),list_id from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand group by list_id;"; + if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} + $rslt=mysql_query($stmt, $link); + if ($DB) {$OUToutput .= "$stmt\n";} + $listids_to_print = mysql_num_rows($rslt); + $i=0; + while ($i < $listids_to_print) + { + $row=mysql_fetch_row($rslt); + $LISTIDcalls[$i] = $row[0]; + $LISTIDlists[$i] = $row[1]; + $i++; + } + + $i=0; + while ($i < $listids_to_print) + { + $stmt="select list_name from vicidial_lists where list_id='$LISTIDlists[$i]';"; + $rslt=mysql_query($stmt, $link); + if ($DB) {$OUToutput .= "$stmt\n";} + $list_name_to_print = mysql_num_rows($rslt); + if ($list_name_to_print > 0) + { + $row=mysql_fetch_row($rslt); + $LISTIDlist_names[$i] = $row[0]; + } + + $TOTALcalls = ($TOTALcalls + $LISTIDcalls[$i]); + + $LISTIDcount = sprintf("%10s", $LISTIDcalls[$i]);while(strlen($LISTIDcount)>10) {$LISTIDcount = substr("$LISTIDcount", 0, -1);} + $LISTIDname = sprintf("%-40s", "$LISTIDlists[$i] - $LISTIDlist_names[$i]");while(strlen($LISTIDname)>40) {$LISTIDname = substr("$LISTIDname", 0, -1);} + + $OUToutput .= "| $LISTIDname | $LISTIDcount |\n"; + + $i++; + } + + $TOTALcalls = sprintf("%10s", $TOTALcalls); + + $OUToutput .= "+------------------------------------------+------------+\n"; + $OUToutput .= "| TOTAL: | $TOTALcalls |\n"; + $OUToutput .= "+------------------------------------------+------------+\n"; + + + + if ( ($carrier_logging_active > 0) and ($carrier_stats == 'YES') ) { diff --git a/agc_2-X/trunk/www/vicidial/admin.php b/agc_2-X/trunk/www/vicidial/admin.php index 2b79a312..a1495fd4 100644 --- a/agc_2-X/trunk/www/vicidial/admin.php +++ b/agc_2-X/trunk/www/vicidial/admin.php @@ -1093,6 +1093,8 @@ if (isset($_GET["agent_display_dialable_leads"])) {$agent_display_dialable_lea elseif (isset($_POST["agent_display_dialable_leads"])) {$agent_display_dialable_leads=$_POST["agent_display_dialable_leads"];} if (isset($_GET["vicidial_balance_rank"])) {$vicidial_balance_rank=$_GET["vicidial_balance_rank"];} elseif (isset($_POST["vicidial_balance_rank"])) {$vicidial_balance_rank=$_POST["vicidial_balance_rank"];} +if (isset($_GET["agent_script_override"])) {$agent_script_override=$_GET["agent_script_override"];} + elseif (isset($_POST["agent_script_override"])) {$agent_script_override=$_POST["agent_script_override"];} if (isset($script_id)) {$script_id= strtoupper($script_id);} if (isset($lead_filter_id)) {$lead_filter_id = strtoupper($lead_filter_id);} @@ -1359,6 +1361,8 @@ if ($non_latin < 1) ### ALPHA-NUMERIC ONLY ### $script_id = ereg_replace("[^0-9a-zA-Z]","",$script_id); + $agent_script_override = ereg_replace("[^0-9a-zA-Z]","",$agent_script_override); + $campaign_script = ereg_replace("[^0-9a-zA-Z]","",$campaign_script); $submit = ereg_replace("[^0-9a-zA-Z]","",$submit); $campaign_cid = ereg_replace("[^0-9a-zA-Z]","",$campaign_cid); $get_call_launch = ereg_replace("[^0-9a-zA-Z]","",$get_call_launch); @@ -1908,11 +1912,12 @@ else # 90726-0153 - Added allow_alerts for users to disable agent browser alerts # 90729-0555 - Added agent_display_dialable_leads and vicidial_balance_rank options # 90808-0300 - Added longest_wait_time option for agent call routing +# 90827-1552 - Added agent_script_override option for lists # # make sure you have added a user to the vicidial_users MySQL table with at least user_level 8 to access this page the first time -$admin_version = '2.2.0-211'; -$build = '90808-0300'; +$admin_version = '2.2.0-212'; +$build = '90827-1552'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -3871,6 +3876,12 @@ if ($SSqc_features_active > 0)
Reset Times - This field allows you to put times in, separated by a dash-, that this list will be automatically reset by the system. The times must be in 24 hour format with no punctuation, for example 0800-1700 would reset the list at 8AM and 5PM every day. Default is empty. +
+ +
+Agent Script Override - If this field is set, this will be the script that the agent sees on their screen instead of the campaign script when the lead is from this list. Default is not set. + +

@@ -11412,7 +11423,7 @@ if ($ADD==411) echo "
LIST MODIFIED: $list_id\n"; - $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time' where list_id='$list_id';"; + $stmt="UPDATE vicidial_lists set list_name='$list_name',campaign_id='$campaign_id',active='$active',list_description='$list_description',list_changedate='$SQLdate',reset_time='$reset_time',agent_script_override='$agent_script_override' where list_id='$list_id';"; $rslt=mysql_query($stmt, $link); ### LOG INSERTION Admin Log Table ### @@ -17517,504 +17528,526 @@ echo "
\n"; ###################### if ($ADD==311) -{ + { if ($LOGmodify_lists==1) - { - echo "
\n"; - echo ""; - - $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time from vicidial_lists where list_id='$list_id';"; - $rslt=mysql_query($stmt, $link); - $row=mysql_fetch_row($rslt); - $campaign_id = $row[2]; - $active = $row[3]; - $list_description = $row[4]; - $list_changedate = $row[5]; - $list_lastcalldate = $row[6]; - - # grab names of global statuses and statuses in the selected campaign - $stmt="SELECT * from vicidial_statuses order by status"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - while ($statuses_to_print > $o) { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } + echo "
\n"; + echo ""; - $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; - $rslt=mysql_query($stmt, $link); - $Cstatuses_to_print = mysql_num_rows($rslt); + $stmt="SELECT list_id,list_name,campaign_id,active,list_description,list_changedate,list_lastcalldate,reset_time,agent_script_override from vicidial_lists where list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $row=mysql_fetch_row($rslt); + $campaign_id = $row[2]; + $active = $row[3]; + $list_description = $row[4]; + $list_changedate = $row[5]; + $list_lastcalldate = $row[6]; + $reset_time = $row[7]; + $agent_script_override = $row[8]; - $o=0; - while ($Cstatuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $statuses_list["$rowx[0]"] = "$rowx[1]"; - $o++; - } - # end grab status names + # grab names of global statuses and statuses in the selected campaign + $stmt="SELECT * from vicidial_statuses order by status"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); - - echo "
MODIFY A LISTS RECORD: $row[0]
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign: $NWB#vicidial_lists-campaign_id$NWE
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
Reset Times: $NWB#vicidial_lists-reset_time$NWE
List Change Date: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
\n"; - - echo "
\n"; - echo "
STATUSES WITHIN THIS LIST:
\n"; - echo "\n"; - echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') + $o=0; + while ($statuses_to_print > $o) { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($dispo,) = each($lead_list[$since_reset])) - { - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - if ($dispo == 'CBHOLD') - { - $CLB=""; - $CLE=""; - } - else - { - $CLB=''; - $CLE=''; + $rowx=mysql_fetch_row($rslt); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; } - echo "\n"; - $o++; - } - } + $stmt="SELECT * from vicidial_campaign_statuses where campaign_id='$campaign_id' order by status"; + $rslt=mysql_query($stmt, $link); + $Cstatuses_to_print = mysql_num_rows($rslt); - echo "\n"; - echo "\n"; - - echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; - unset($lead_list); - - - echo "
\n"; - echo "
TIME ZONES WITHIN THIS LIST:
\n"; - echo "\n"; - echo "\n"; - - $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset"; - $rslt=mysql_query($stmt, $link); - $statuses_to_print = mysql_num_rows($rslt); - - $o=0; - $plus='+'; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($statuses_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') - { - $since_reset = 'N'; - $since_resetX = 'Y'; - } - else - { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - if ($lead_list['count'] > 0) - { - while (list($tzone,) = each($lead_list[$since_reset])) - { - $LOCALzone=3600 * $tzone; - $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); - - if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} - else {$DISPtzone = "$tzone";} - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - echo "\n"; - } - } - - echo "\n"; - echo "\n"; - - echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; - unset($lead_list); - - - - - - echo "
\n"; - echo "
OWNERS WITHIN THIS LIST:
\n"; - echo "\n"; - echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $owners_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($owners_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') + $o=0; + while ($Cstatuses_to_print > $o) { - $since_reset = 'N'; - $since_resetX = 'Y'; + $rowx=mysql_fetch_row($rslt); + $statuses_list["$rowx[0]"] = "$rowx[1]"; + $o++; } - else + # end grab status names + + ##### get scripts listings for pulldown + $Lscripts_list = "\n"; + $stmt="SELECT script_id,script_name from vicidial_scripts order by script_id"; + $rslt=mysql_query($stmt, $link); + $scripts_to_print = mysql_num_rows($rslt); + $o=0; + while ($scripts_to_print > $o) { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; + $rowx=mysql_fetch_row($rslt); + $Lscripts_list .= "\n"; + $scriptname_list["$rowx[0]"] = "$rowx[1]"; + $o++; } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($owner,) = each($lead_list[$since_reset])) - { - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $CLB=''; - $CLE=''; - - echo "\n"; - $o++; - } - } - - echo "\n"; - echo "\n"; - - echo "
OWNERCALLEDNOT CALLED
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; - unset($lead_list); + echo "
MODIFY A LISTS RECORD: $row[0]\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo ""; - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } - echo "\n"; - - echo "
List ID: $row[0]$NWB#vicidial_lists-list_id$NWE
List Name: $NWB#vicidial_lists-list_name$NWE
List Description: $NWB#vicidial_lists-list_description$NWE
Campaign: \n"; - echo "\n"; - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_query($stmt, $link); - $ranks_to_print = mysql_num_rows($rslt); - - $o=0; - $lead_list['count'] = 0; - $lead_list['Y_count'] = 0; - $lead_list['N_count'] = 0; - while ($ranks_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - - $lead_list['count'] = ($lead_list['count'] + $rowx[2]); - if ($rowx[1] == 'N') + $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns order by campaign_id"; + $rslt=mysql_query($stmt, $link); + $campaigns_to_print = mysql_num_rows($rslt); + $campaigns_list=''; + $o=0; + while ($campaigns_to_print > $o) { - $since_reset = 'N'; - $since_resetX = 'Y'; + $rowx=mysql_fetch_row($rslt); + $campaigns_list .= "\n"; + $o++; } - else + echo "$campaigns_list"; + echo "\n"; + echo "$NWB#vicidial_lists-campaign_id$NWE\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "
RANKCALLEDNOT CALLED
Active: $NWB#vicidial_lists-active$NWE
Reset Lead-Called-Status for this list: $NWB#vicidial_lists-reset_list$NWE
Reset Times: $NWB#vicidial_lists-reset_time$NWE
List Change Date: $list_changedate   $NWB#vicidial_lists-list_changedate$NWE
List Last Call Date: $list_lastcalldate   $NWB#vicidial_lists-list_lastcalldate$NWE
Agent Script Override: $NWB#vicidial_lists-agent_script_override$NWE
\n"; + + echo "
\n"; + echo "
STATUSES WITHIN THIS LIST:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT status,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by status,called_since_last_reset order by status,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) { - $since_reset = 'Y'; - $since_resetX = 'N'; - } - $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); - $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); - #If opposite side is not set, it may not in the future so give it a value of zero - if (!isset($lead_list[$since_resetX][$rowx[0]])) - { - $lead_list[$since_resetX][$rowx[0]]=0; - } - $o++; - } - - $o=0; - if ($lead_list['count'] > 0) - { - while (list($rank,) = each($lead_list[$since_reset])) - { - - if (eregi("1$|3$|5$|7$|9$", $o)) - {$bgcolor='bgcolor="#B9CBFD"';} - else - {$bgcolor='bgcolor="#9BB9FB"';} - - $CLB=''; - $CLE=''; - - echo "\n"; - $o++; - } - } - - echo "\n"; - echo "\n"; - - echo "
STATUSSTATUS NAMECALLEDNOT CALLED
$CLB$rank$CLE".$lead_list['Y'][$rank]."".$lead_list['N'][$rank]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; - unset($lead_list); - - - - - - $leads_in_list = 0; - $leads_in_list_N = 0; - $leads_in_list_Y = 0; - $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; - $rslt=mysql_query($stmt, $link); - $status_called_to_print = mysql_num_rows($rslt); - - $o=0; - $sts=0; - $first_row=1; - $all_called_first=1000; - $all_called_last=0; - while ($status_called_to_print > $o) - { - $rowx=mysql_fetch_row($rslt); - $leads_in_list = ($leads_in_list + $rowx[2]); - $count_statuses[$o] = "$rowx[0]"; - $count_called[$o] = "$rowx[1]"; - $count_count[$o] = "$rowx[2]"; - $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); - - if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) - { - if ($first_row) {$first_row=0;} - else {$sts++;} - $status[$sts] = "$rowx[0]"; - $status_called_first[$sts] = "$rowx[1]"; - if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} - } - $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); - $status_called_last[$sts] = "$rowx[1]"; - if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} - - $o++; - } - - - - - echo "
\n"; - echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; - echo "\n"; - echo ""; - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} - else{$AB='bgcolor="#E0FFFF"';} - echo ""; - $first++; - } - echo "\n"; - - $sts=0; - $statuses_called_to_print = count($status); - while ($statuses_called_to_print > $sts) - { - $Pstatus = $status[$sts]; - if (eregi("1$|3$|5$|7$|9$", $sts)) - {$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';} - else - {$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';} - # echo "$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n"; - # echo "$status[$sts]|"; - echo ""; - - $first = $all_called_first; - while ($first <= $all_called_last) - { - if (eregi("1$|3$|5$|7$|9$", $sts)) + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') { - if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($dispo,) = each($lead_list[$since_reset])) + { + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + if ($dispo == 'CBHOLD') + { + $CLB=""; + $CLE=""; } else { - if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} - else{$AB='bgcolor="#B9CBFD"';} + $CLB=''; + $CLE=''; } - $called_printed=0; - $o=0; - while ($status_called_to_print > $o) + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
STATUSSTATUS NAME$firstSUBTOTAL
$Pstatus$statuses_list[$Pstatus]
$CLB$dispo$CLE$statuses_list[$dispo]".$lead_list['Y'][$dispo]."".$lead_list['N'][$dispo]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + echo "
\n"; + echo "
TIME ZONES WITHIN THIS LIST:
\n"; + echo "\n"; + echo "\n"; + + $stmt="SELECT gmt_offset_now,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by gmt_offset_now,called_since_last_reset order by gmt_offset_now,called_since_last_reset"; + $rslt=mysql_query($stmt, $link); + $statuses_to_print = mysql_num_rows($rslt); + + $o=0; + $plus='+'; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($statuses_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + if ($lead_list['count'] > 0) + { + while (list($tzone,) = each($lead_list[$since_reset])) + { + $LOCALzone=3600 * $tzone; + $LOCALdate=gmdate("D M Y H:i", time() + $LOCALzone); + + if ($tzone >= 0) {$DISPtzone = "$plus$tzone";} + else {$DISPtzone = "$tzone";} + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + echo "\n"; + } + } + + echo "\n"; + echo "\n"; + + echo "
GMT OFFSET NOW (local time)CALLEDNOT CALLED
".$DISPtzone."     ($LOCALdate)".$lead_list['Y'][$tzone]."".$lead_list['N'][$tzone]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + + + + echo "
\n"; + echo "
OWNERS WITHIN THIS LIST:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT owner,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by owner,called_since_last_reset order by owner,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $owners_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($owners_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') { - if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) - { - $called_printed++; - echo ""; - } - - - $o++; + $since_reset = 'N'; + $since_resetX = 'Y'; } - if (!$called_printed) - {echo "";} + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($owner,) = each($lead_list[$since_reset])) + { + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
OWNERCALLEDNOT CALLED
$count_count[$o]  
$CLB$owner$CLE".$lead_list['Y'][$owner]."".$lead_list['N'][$owner]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + + + + echo "
\n"; + echo "
RANKS WITHIN THIS LIST:
\n"; + echo "\n"; + echo "\n"; + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT rank,called_since_last_reset,count(*) from vicidial_list where list_id='$list_id' group by rank,called_since_last_reset order by rank,called_since_last_reset"; + if ($DB) {echo "$stmt\n";} + $rslt=mysql_query($stmt, $link); + $ranks_to_print = mysql_num_rows($rslt); + + $o=0; + $lead_list['count'] = 0; + $lead_list['Y_count'] = 0; + $lead_list['N_count'] = 0; + while ($ranks_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + + $lead_list['count'] = ($lead_list['count'] + $rowx[2]); + if ($rowx[1] == 'N') + { + $since_reset = 'N'; + $since_resetX = 'Y'; + } + else + { + $since_reset = 'Y'; + $since_resetX = 'N'; + } + $lead_list[$since_reset][$rowx[0]] = ($lead_list[$since_reset][$rowx[0]] + $rowx[2]); + $lead_list[$since_reset.'_count'] = ($lead_list[$since_reset.'_count'] + $rowx[2]); + #If opposite side is not set, it may not in the future so give it a value of zero + if (!isset($lead_list[$since_resetX][$rowx[0]])) + { + $lead_list[$since_resetX][$rowx[0]]=0; + } + $o++; + } + + $o=0; + if ($lead_list['count'] > 0) + { + while (list($rank,) = each($lead_list[$since_reset])) + { + + if (eregi("1$|3$|5$|7$|9$", $o)) + {$bgcolor='bgcolor="#B9CBFD"';} + else + {$bgcolor='bgcolor="#9BB9FB"';} + + $CLB=''; + $CLE=''; + + echo "\n"; + $o++; + } + } + + echo "\n"; + echo "\n"; + + echo "
RANKCALLEDNOT CALLED
$CLB$rank$CLE".$lead_list['Y'][$rank]."".$lead_list['N'][$rank]."
SUBTOTALS$lead_list[Y_count]$lead_list[N_count]
TOTAL$lead_list[count]

\n"; + unset($lead_list); + + + + + + $leads_in_list = 0; + $leads_in_list_N = 0; + $leads_in_list_Y = 0; + $stmt="SELECT status,called_count,count(*) from vicidial_list where list_id='$list_id' group by status,called_count order by status,called_count"; + $rslt=mysql_query($stmt, $link); + $status_called_to_print = mysql_num_rows($rslt); + + $o=0; + $sts=0; + $first_row=1; + $all_called_first=1000; + $all_called_last=0; + while ($status_called_to_print > $o) + { + $rowx=mysql_fetch_row($rslt); + $leads_in_list = ($leads_in_list + $rowx[2]); + $count_statuses[$o] = "$rowx[0]"; + $count_called[$o] = "$rowx[1]"; + $count_count[$o] = "$rowx[2]"; + $all_called_count[$rowx[1]] = ($all_called_count[$rowx[1]] + $rowx[2]); + + if ( (strlen($status[$sts]) < 1) or ($status[$sts] != "$rowx[0]") ) + { + if ($first_row) {$first_row=0;} + else {$sts++;} + $status[$sts] = "$rowx[0]"; + $status_called_first[$sts] = "$rowx[1]"; + if ($status_called_first[$sts] < $all_called_first) {$all_called_first = $status_called_first[$sts];} + } + $leads_in_sts[$sts] = ($leads_in_sts[$sts] + $rowx[2]); + $status_called_last[$sts] = "$rowx[1]"; + if ($status_called_last[$sts] > $all_called_last) {$all_called_last = $status_called_last[$sts];} + + $o++; + } + + + + + echo "
\n"; + echo "
CALLED COUNTS WITHIN THIS LIST:
\n"; + echo "\n"; + echo ""; + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + echo ""; $first++; } - echo "\n\n"; + echo "\n"; - $sts++; + $sts=0; + $statuses_called_to_print = count($status); + while ($statuses_called_to_print > $sts) + { + $Pstatus = $status[$sts]; + if (eregi("1$|3$|5$|7$|9$", $sts)) + {$bgcolor='bgcolor="#B9CBFD"'; $AB='bgcolor="#9BB9FB"';} + else + {$bgcolor='bgcolor="#9BB9FB"'; $AB='bgcolor="#B9CBFD"';} + # echo "$status[$sts]|$status_called_first[$sts]|$status_called_last[$sts]|$leads_in_sts[$sts]|\n"; + # echo "$status[$sts]|"; + echo ""; + + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $sts)) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#9BB9FB"';} + else{$AB='bgcolor="#B9CBFD"';} + } + else + { + if (eregi("0$|2$|4$|6$|8$", $first)) {$AB='bgcolor="#9BB9FB"';} + else{$AB='bgcolor="#B9CBFD"';} + } + + $called_printed=0; + $o=0; + while ($status_called_to_print > $o) + { + if ( ($count_statuses[$o] == "$Pstatus") and ($count_called[$o] == "$first") ) + { + $called_printed++; + echo ""; + } + + + $o++; + } + if (!$called_printed) + {echo "";} + $first++; + } + echo "\n\n"; + + $sts++; + } + + echo ""; + $first = $all_called_first; + while ($first <= $all_called_last) + { + if (eregi("1$|3$|5$|7$|9$", $first)) {$AB='bgcolor="#AFEEEE"';} + else{$AB='bgcolor="#E0FFFF"';} + echo ""; + $first++; + } + echo "\n"; + + echo "
STATUSSTATUS NAME$first$leads_in_sts[$sts]
SUBTOTAL
$Pstatus$statuses_list[$Pstatus] $count_count[$o]  $leads_in_sts[$sts]
TOTAL$all_called_count[$first]$leads_in_list

\n"; + + + + + + echo "
\n"; + + echo "

Click here to see all CallBack Holds in this list

\n"; + echo "

Click here to download this list

\n"; + + if ($LOGdelete_lists > 0) + { + echo "

DELETE THIS LIST\n"; + } + if ($LOGuser_level >= 9) + { + echo "

Click here to see Admin chages to this list\n"; + } } - - echo "
TOTAL$all_called_count[$first]$leads_in_list

\n"; - - - - - - echo "
\n"; - - echo "

Click here to see all CallBack Holds in this list

\n"; - echo "

Click here to download this list

\n"; - - if ($LOGdelete_lists > 0) - { - echo "

DELETE THIS LIST\n"; - } - if ($LOGuser_level >= 9) - { - echo "

Click here to see Admin chages to this list
\n"; - } - } else - { - echo "You do not have permission to view this page\n"; - exit; + { + echo "You do not have permission to view this page\n"; + exit; + } } -}