diff --git a/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl b/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl index ef5c9bb6..6a95a2dc 100644 --- a/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl +++ b/agc_2-X/trunk/bin/VICIDIAL_IN_new_leads_file.pl @@ -38,6 +38,7 @@ # 90802-0758 - Added sctab08 file format # 90810-0956 - Added sccsv11 file format # 90830-0953 - Added forcelistfilename option +# 91112-0645 - Added title/alt_phone duplicate checks # $secX = time(); @@ -137,6 +138,8 @@ if (length($ARGV[0])>1) print " [--duplicate-check] = checks for the same phone number in the same list id before inserting lead\n"; print " [--duplicate-campaign-check] = checks for the same phone number in the same campaign before inserting lead\n"; print " [--duplicate-system-check] = checks for the same phone number in the entire system before inserting lead\n"; + print " [--duplicate-tap-list-check] = checks for the same title/alt-number in the same list ID before inserting lead\n"; + print " [--duplicate-tap-system-check] = checks for the same title/alt-number in the entire system before inserting lead\n"; print " [--postal-code-gmt] = checks for the time zone based on the postal code given where available\n"; print " [--ftp-pull] = grabs lead files from a remote FTP server, uses REPORTS FTP login information\n"; print " [--ftp-dir=leads_in] = remote FTP server directory to grab files from, should have a DONE sub-directory\n"; @@ -252,6 +255,16 @@ if (length($ARGV[0])>1) $dupchecksys=1; if ($q < 1) {print "\n----- DUPLICATE SYSTEM CHECK -----\n\n";} } + if ($args =~ /-duplicate-tap-list-check/i) + { + $duptapchecklist=1; + if ($q < 1) {print "\n----- DUPLICATE TITLE/ALT-PHONE LIST CHECK -----\n\n";} + } + if ($args =~ /-duplicate-tap-system-check/i) + { + $duptapchecksys=1; + if ($q < 1) {print "\n----- DUPLICATE TITLE/ALT-PHONE SYSTEM CHECK -----\n\n";} + } if ($args =~ /-postal-code-gmt/i) { $postalgmt=1; @@ -1007,10 +1020,57 @@ foreach(@FILES) {$dup_lead++;} } } + ##### Check for duplicate title/alt-phone in vicidial_list table entire database ##### + if ($duptapchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table for one list_id ##### + if ($duptapchecklist > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } if ( (length($phone_number)>6) && ($dup_lead < 1) ) { - $phone_list .= "$phone_number$US$list_id|"; + if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} # set default values $modify_date = ""; $user = ""; @@ -1257,7 +1317,7 @@ foreach(@FILES) else { if ($dup_lead > 0) - {if ($q < 1) {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a\n";} $f++;} + {if ($q < 1) {print "DUPLICATE: $phone_number|$list_id|$dup_lead_list|$a|$title $alt_phone\n";} $f++;} else {if ($q < 1) {print "BAD Home_Phone: $phone_number|$vendor_id|$a\n";} $e++;} } diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 1e45d52a..a47939c3 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -258,10 +258,11 @@ # 90928-1955 - Added lead update before closer transfer # 90930-2243 - Added Territory selection functions # 91108-2118 - Added QM pause code entry +# 91111-1433 - Fixed Gender pulldown list display for IE, remove links for recording channels in SHOW CHANNELS # -$version = '2.2.0-236'; -$build = '91108-2118'; +$version = '2.2.0-237'; +$build = '91111-1433'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=61; $one_mysql_log=0; @@ -3354,6 +3355,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} var conv_ct = (loop_ct + conv_start); var channelfieldA = conf_chan_array[conv_ct]; var regXFcred = new RegExp(flag_string,"g"); + var regRNnolink = new RegExp('Local/5' + taskconfnum,"g") if ( (channelfieldA.match(regXFcred)) && (flag_channels>0) ) { var chan_name_color = 'log_text_red'; @@ -3368,13 +3370,21 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { - if (volumecontrol_active!=1) + if (channelfieldA.match(regRNnolink)) { - live_conf_HTML = live_conf_HTML + "" + loop_ct + "" + channelfieldA + "HANGUP"; + // do not show hangup or volume control links for recording channels + live_conf_HTML = live_conf_HTML + "" + loop_ct + "" + channelfieldA + "recording"; } else { - live_conf_HTML = live_conf_HTML + "" + loop_ct + "" + channelfieldA + "HANGUP           "; + if (volumecontrol_active!=1) + { + live_conf_HTML = live_conf_HTML + "" + loop_ct + "" + channelfieldA + "HANGUP"; + } + else + { + live_conf_HTML = live_conf_HTML + "" + loop_ct + "" + channelfieldA + "HANGUP           "; + } } } // var debugspan = document.getElementById("debugbottomspan").innerHTML; @@ -6923,6 +6933,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Generate the Call Disposition Chooser panel function DispoSelectContent_create(taskDSgrp,taskDSstage) { + HidEGenDerPulldown(); AgentDispoing = 1; var VD_statuses_ct_half = parseInt(VD_statuses_ct / 2); var dispo_HTML = "
CALL DISPOSITION
"; @@ -6959,6 +6970,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} } else { + HidEGenDerPulldown(); showDiv('PauseCodeSelectBox'); WaitingForNextStep=1; PauseCode_HTML = ''; @@ -6988,6 +7000,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Generate the Group Alias Chooser panel function GroupAliasSelectContent_create(task3way) { + HidEGenDerPulldown(); showDiv('GroupAliasSelectBox'); WaitingForNextStep=1; GroupAlias_HTML = ''; @@ -7233,6 +7246,8 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function PauseCodeSelect_submit(newpausecode) { hideDiv('PauseCodeSelectBox'); + ShoWGenDerPulldown(); + WaitingForNextStep=0; var xmlhttp=false; @@ -7277,6 +7292,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} function GroupAliasSelect_submit(newgroupalias,newgroupcid,newusegroup) { hideDiv('GroupAliasSelectBox'); + ShoWGenDerPulldown(); WaitingForNextStep=0; if (newusegroup > 0) @@ -7421,6 +7437,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} // Generate the Closer In Group Chooser panel function CloserSelectContent_create() { + HidEGenDerPulldown(); if (VU_agent_choose_ingroups == '1') { var live_CSC_HTML = "
GROUPS NOT SELECTEDSELECTED GROUPS
  --- ADD ALL ---
"; @@ -7573,6 +7590,7 @@ if ($enable_fast_refresh < 1) {echo "\tvar refresh_interval = 1000;\n";} { if (agent_select_territories == '1') { + HidEGenDerPulldown(); if (agent_choose_territories > 0) { var live_TERR_HTML = "
TERRITORIES NOT SELECTEDSELECTED TERRITORIES
  --- ADD ALL ---
"; @@ -8530,6 +8548,7 @@ function phone_number_format(formatphone) { } else { + HidEGenDerPulldown(); showDiv('CloserSelectBox') } } @@ -8818,7 +8837,10 @@ else VtigeRwin.blur(); } - + if (INgroupCOUNT > 0) + { + HidEGenDerPulldown(); + } VICIDiaL_closer_login_checked = 1; } else @@ -9377,6 +9399,8 @@ else document.getElementById("MaiNfooter").style.backgroundColor=""; hideDiv('ScriptPanel'); showDiv('MainPanel'); + ShoWGenDerPulldown(); + if (resumevar != 'NO') { if (alt_phone_dialing == 1) @@ -9423,6 +9447,32 @@ else document.getElementById("MaiNfooter").style.backgroundColor=""; panel_bgcolor=''; document.getElementById("MainStatuSSpan").style.background = panel_bgcolor; + + HidEGenDerPulldown(); + } + + function HidEGenDerPulldown() + { + var gIndex = 0; + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + if (genderValue == 'M') {var gIndex = 1;} + if (genderValue == 'F') {var gIndex = 2;} + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("gender_list").selectedIndex = gIndex; + } + + function ShoWGenDerPulldown() + { + var gIndex = 0; + var genderIndex = document.getElementById("gender_list").selectedIndex; + var genderValue = document.getElementById('gender_list').options[genderIndex].value; + if (genderValue == 'M') {var gIndex = 1;} + if (genderValue == 'F') {var gIndex = 2;} + document.getElementById("GENDERhideFORie").innerHTML = ''; + document.getElementById("GENDERhideFORieALT").innerHTML = ''; + document.getElementById("gender_list").selectedIndex = gIndex; } @@ -9807,7 +9857,7 @@ if ($agent_display_dialable_leads > 0)
- + diff --git a/agc_2-X/trunk/www/vicidial/listloader.pl b/agc_2-X/trunk/www/vicidial/listloader.pl index 8b202aec..c2430ec2 100644 --- a/agc_2-X/trunk/www/vicidial/listloader.pl +++ b/agc_2-X/trunk/www/vicidial/listloader.pl @@ -20,65 +20,70 @@ # 80428-0144 - UTF8 cleanup # 80713-0023 - added last_local_call_time field default of 2008-01-01 # 90721-1425 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking # ### begin parsing run-time options ### if (length($ARGV[0])>1) -{ + { $i=0; while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } + { + $args = "$args $ARGV[$i]"; + $i++; + } if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - exit; - } + exit; + } else - { + { if ($args =~ /-duplicate-check/i) {$dupcheck=1;} if ($args =~ /-duplicate-campaign-check/i) {$dupcheckcamp=1;} if ($args =~ /-duplicate-system-check/i) {$dupchecksys=1;} + if ($args =~ /-duplicate-tap-list-check/i) + {$duptapchecklist=1;} + if ($args =~ /-duplicate-tap-system-check/i) + {$duptapchecksys=1;} if ($args =~ /-postal-code-gmt/i) {$postalgmt=1;} if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); + { + @data_in = split(/--forcelistid=/,$args); $forcelistid = $data_in[1]; $forcelistid =~ s/ .*//gi; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } else {$forcelistid = '';} if ($args =~ /--forcephonecode=/i) - { - @data_in = split(/--forcephonecode=/,$args); + { + @data_in = split(/--forcephonecode=/,$args); $forcephonecode = $data_in[1]; $forcephonecode =~ s/ .*//gi; - print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; - } + print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; + } else {$forcephonecode = '';} if ($args =~ /--lead-file=/i) - { - @data_in = split(/--lead-file=/,$args); + { + @data_in = split(/--lead-file=/,$args); $lead_file = $data_in[1]; $lead_file =~ s/ .*//gi; - # print "\n----- LEAD FILE: $lead_file -----\n\n"; - } + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } else {$lead_file = './vicidial_temp_file.xls';} + } } -} ### end parsing run-time options ### @@ -375,10 +380,57 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { {$dup_lead++;} } } + ##### Check for duplicate title/alt-phone in vicidial_list table entire database ##### + if ($duptapchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table for one list_id ##### + if ($duptapchecklist > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } if ( (length($phone_number)>6) && ($dup_lead < 1) ) { - $phone_list .= "$phone_number$US$list_id|"; + if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} $postalgmt_found=0; if (length($phone_code)<1) {$phone_code = '1';} diff --git a/agc_2-X/trunk/www/vicidial/listloader_super.pl b/agc_2-X/trunk/www/vicidial/listloader_super.pl index 114eeb55..c7aaa625 100644 --- a/agc_2-X/trunk/www/vicidial/listloader_super.pl +++ b/agc_2-X/trunk/www/vicidial/listloader_super.pl @@ -19,65 +19,70 @@ # 80428-0144 - UTF8 cleanup # 80713-0023 - added last_local_call_time field default of 2008-01-01 # 90721-1341 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking # ### begin parsing run-time options ### if (length($ARGV[0])>1) -{ + { $i=0; while ($#ARGV >= $i) - { - $args = "$args $ARGV[$i]"; - $i++; - } + { + $args = "$args $ARGV[$i]"; + $i++; + } if ($args =~ /--help|-h/i) - { - print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; + { + print "allowed run time options:\n [-forcelistid=1234] = overrides the listID given in the file with the 1234\n [-h] = this help screen\n\n"; - exit; - } + exit; + } else - { + { if ($args =~ /-duplicate-check/i) {$dupcheck=1;} if ($args =~ /-duplicate-campaign-check/i) {$dupcheckcamp=1;} if ($args =~ /-duplicate-system-check/i) {$dupchecksys=1;} + if ($args =~ /-duplicate-tap-list-check/i) + {$duptapchecklist=1;} + if ($args =~ /-duplicate-tap-system-check/i) + {$duptapchecksys=1;} if ($args =~ /-postal-code-gmt/i) {$postalgmt=1;} if ($args =~ /--forcelistid=/i) - { - @data_in = split(/--forcelistid=/,$args); + { + @data_in = split(/--forcelistid=/,$args); $forcelistid = $data_in[1]; $forcelistid =~ s/ .*//gi; - print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; - } + print "\n----- FORCE LISTID OVERRIDE: $forcelistid -----\n\n"; + } else {$forcelistid = '';} if ($args =~ /--forcephonecode=/i) - { - @data_in = split(/--forcephonecode=/,$args); + { + @data_in = split(/--forcephonecode=/,$args); $forcephonecode = $data_in[1]; $forcephonecode =~ s/ .*//gi; - print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; - } + print "\n----- FORCE PHONECODE OVERRIDE: $forcephonecode -----\n\n"; + } else {$forcephonecode = '';} if ($args =~ /--lead-file=/i) - { - @data_in = split(/--lead-file=/,$args); + { + @data_in = split(/--lead-file=/,$args); $lead_file = $data_in[1]; $lead_file =~ s/ .*//gi; - # print "\n----- LEAD FILE: $lead_file -----\n\n"; - } + # print "\n----- LEAD FILE: $lead_file -----\n\n"; + } else {$lead_file = './vicidial_temp_file.xls';} + } } -} ### end parsing run-time options ### use Spreadsheet::ParseExcel; @@ -377,10 +382,57 @@ foreach $oWkS (@{$oBook->{Worksheet}}) { {$dup_lead++;} } } + ##### Check for duplicate title/alt-phone in vicidial_list table entire database ##### + if ($duptapchecksys > 0) + { + $dup_lead=0; + $stmtA = "select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead = $aryA[0]; + $dup_lead_list=$list_id; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } + ##### Check for duplicate title/alt-phone in vicidial_list table for one list_id ##### + if ($duptapchecklist > 0) + { + $dup_lead=0; + $stmtA = "select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id' limit 1;"; + if($DBX){print STDERR "\n|$stmtA|\n";} + $sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr; + $sthA->execute or die "executing: $stmtA ", $dbhA->errstr; + $sthArows=$sthA->rows; + if ($sthArows > 0) + { + @aryA = $sthA->fetchrow_array; + $dup_lead_list = $aryA[0]; + $dup_lead++; + } + $sthA->finish(); + if ($dup_lead < 1) + { + if ($phone_list =~ /\|$alt_phone$title$US$list_id\|/) + {$dup_lead++;} + } + } if ( (length($phone_number)>6) && ($dup_lead < 1) ) { - $phone_list .= "$phone_number$US$list_id|"; + if ( ($duptapchecklist > 0) || ($duptapchecksys > 0) ) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} $postalgmt_found=0; if (length($phone_code)<1) {$phone_code = '1';} diff --git a/agc_2-X/trunk/www/vicidial/new_listloader_superL.php b/agc_2-X/trunk/www/vicidial/new_listloader_superL.php index 2723e682..51be6bf3 100644 --- a/agc_2-X/trunk/www/vicidial/new_listloader_superL.php +++ b/agc_2-X/trunk/www/vicidial/new_listloader_superL.php @@ -28,11 +28,12 @@ # 90508-0644 - Changed to PHP long tags # 90522-0506 - Security fix # 90721-1339 - Added rank and owner as vicidial_list fields +# 91112-0616 - Added title/alt-phone duplicate checking # # make sure vicidial_list exists and that your file follows the formatting correctly. This page does not dedupe or do any other lead filtering actions yet at this time. -$version = '2.2.0-32'; -$build = '90721-1339'; +$version = '2.2.0-33'; +$build = '91112-0616'; require("dbconnect.php"); @@ -42,6 +43,8 @@ require("dbconnect.php"); #mysql_select_db("asterisk"); #$WeBServeRRooT = '/home/www/htdocs'; +$US='_'; + $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_SELF=$_SERVER['PHP_SELF']; @@ -369,6 +372,8 @@ echo " @@ -556,12 +561,55 @@ echo "
"; + +
"; } } + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { if (strlen($phone_code)<1) {$phone_code = '1';} - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); @@ -622,6 +670,8 @@ echo "
"; if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_super.pl $vendor_lead_code_field,$source_id_field,$list_id_field,$phone_code_field,$phone_number_field,$title_field,$first_name_field,$middle_initial_field,$last_name_field,$address1_field,$address2_field,$address3_field,$city_field,$state_field,$province_field,$postal_code_field,$country_code_field,$gender_field,$date_of_birth_field,$alt_phone_field,$email_field,$security_phrase_field,$comments_field,$rank_field,$owner_field, --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); } else { @@ -774,12 +824,55 @@ echo "
"; } } + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { if (strlen($phone_code)<1) {$phone_code = '1';} - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); @@ -1006,14 +1099,57 @@ if ($leadfile) { } } + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { if (strlen($phone_code)<1) {$phone_code = '1';} - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} - $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); + + $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); if ($multi_insert_counter > 8) { @@ -1074,6 +1210,8 @@ if ($leadfile) { if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader.pl --forcelistid=$list_id_override --forcephonecode=$phone_code_override --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); @@ -1234,12 +1372,54 @@ if ($leadfile) { } } + ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) + { + $dup_lead=0; + $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $row=mysql_fetch_row($rslt); + $dup_lead = $row[0]; + $dup_lead_list = $list_id; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + + ##### Check for duplicate phone numbers in vicidial_list table entire database ##### + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) + { + $dup_lead=0; + $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; + $rslt=mysql_query($stmt, $link); + $pc_recs = mysql_num_rows($rslt); + if ($pc_recs > 0) + { + $dup_lead=1; + $row=mysql_fetch_row($rslt); + $dup_lead_list = $row[0]; + } + if ($dup_lead < 1) + { + if (eregi("$alt_phone$title$US$list_id",$phone_list)) + {$dup_lead++; $dup++;} + } + } + if ( (strlen($phone_number)>6) and ($dup_lead<1) ) { if (strlen($phone_code)<1) {$phone_code = '1';} - $US='_'; - $phone_list .= "$phone_number$US$list_id|"; + if (eregi("TITLEALTPHONE",$dupcheck)) + {$phone_list .= "$alt_phone$title$US$list_id|";} + else + {$phone_list .= "$phone_number$US$list_id|";} $gmt_offset = lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code); @@ -1371,6 +1551,8 @@ if ($leadfile) { if (eregi("DUPLIST",$dupcheck)) {$dupcheckCLI='--duplicate-check';} if (eregi("DUPCAMP",$dupcheck)) {$dupcheckCLI='--duplicate-campaign-check';} if (eregi("DUPSYS",$dupcheck)) {$dupcheckCLI='--duplicate-system-check';} + if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) {$dupcheckCLI='--duplicate-tap-list-check';} + if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) {$dupcheckCLI='--duplicate-tap-system-check';} if (eregi("POSTAL",$postalgmt)) {$postalgmtCLI='--postal-code-gmt';} passthru("$WeBServeRRooT/vicidial/listloader_rowdisplay.pl --lead-file=$lead_file $postalgmtCLI $dupcheckCLI"); }