workaround for IE pulldown issue in vicidial.php

added title/alt-phone duplication check in lead loaders

git-svn-id: svn://192.168.202.10@1257 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2009-11-12 11:56:26 +00:00
parent 31161fedeb
commit edc7792b8a
5 changed files with 464 additions and 68 deletions
@@ -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++;}
}
+57 -7
View File
@@ -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 + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">HANGUP</a></td><td></td></tr>";
// do not show hangup or volume control links for recording channels
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\">recording</td><td></td></tr>";
}
else
{
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">HANGUP</a></td><td><a href=\"#\" onclick=\"volume_control('UP','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_up.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('DOWN','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_down.gif\" BORDER=0></a> &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"volume_control('MUTING','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_MUTE.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('UNMUTE','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_UNMUTE.gif\" BORDER=0></a></td></tr>";
if (volumecontrol_active!=1)
{
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">HANGUP</a></td><td></td></tr>";
}
else
{
live_conf_HTML = live_conf_HTML + "<tr bgcolor=\"" + row_color + "\"><td><font class=\"log_text\">" + loop_ct + "</td><td><font class=\"" + chan_name_color + "\">" + channelfieldA + "</td><td><font class=\"log_text\"><a href=\"#\" onclick=\"livehangup_send_hangup('" + channelfieldA + "');return false;\">HANGUP</a></td><td><a href=\"#\" onclick=\"volume_control('UP','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_up.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('DOWN','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_down.gif\" BORDER=0></a> &nbsp; &nbsp; &nbsp; <a href=\"#\" onclick=\"volume_control('MUTING','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_MUTE.gif\" BORDER=0></a> &nbsp; <a href=\"#\" onclick=\"volume_control('UNMUTE','" + channelfieldA + "','');return false;\"><IMG SRC=\"./images/vdc_volume_UNMUTE.gif\" BORDER=0></a></td></tr>";
}
}
}
// 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 = "<table cellpadding=5 cellspacing=5 width=500><tr><td colspan=2><B> CALL DISPOSITION</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=DispoSelectA>";
@@ -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 = "<table cellpadding=5 cellspacing=5 width=500><tr><td><B>GROUPS NOT SELECTED</B></td><td><B>SELECTED GROUPS</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=CloserSelectAdd> &nbsp; <a href=\"#\" onclick=\"CloserSelect_change('-----ADD-ALL-----','ADD');return false;\"><B>--- ADD ALL ---</B><BR>";
@@ -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 = "<table cellpadding=5 cellspacing=5 width=500><tr><td><B>TERRITORIES NOT SELECTED</B></td><td><B>SELECTED TERRITORIES</B></td></tr><tr><td bgcolor=\"#99FF99\" height=300 width=240 valign=top><font class=\"log_text\"><span id=TerritorySelectAdd> &nbsp; <a href=\"#\" onclick=\"TerritorySelect_change('-----ADD-ALL-----','ADD');return false;\"><B>--- ADD ALL ---</B><BR>";
@@ -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="<?php echo $MAIN_COLOR ?>";
hideDiv('ScriptPanel');
showDiv('MainPanel');
ShoWGenDerPulldown();
if (resumevar != 'NO')
{
if (alt_phone_dialing == 1)
@@ -9423,6 +9447,32 @@ else
document.getElementById("MaiNfooter").style.backgroundColor="<?php echo $SCRIPT_COLOR ?>";
panel_bgcolor='<?php echo $SCRIPT_COLOR ?>';
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 = '<select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Undefined</option><option value="M">M - Male</option><option value="F">F - Female</option></select>';
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 = '<select size=1 name=gender_list class="cust_form" id=gender_list><option value="U">U - Undefined</option><option value="M">M - Male</option><option value="F">F - Female</option></select>';
document.getElementById("GENDERhideFORieALT").innerHTML = '';
document.getElementById("gender_list").selectedIndex = gIndex;
}
</script>
@@ -9807,7 +9857,7 @@ if ($agent_display_dialable_leads > 0)
</TD></TR></TABLE>
</span>
<span style="position:absolute;left:0px;top:1000px;z-index:65;" id="GENDERhideFORieALT"></span>
<span style="position:absolute;left:0px;top:1500px;z-index:65;" id="GENDERhideFORieALT"></span>
<span style="position:absolute;left:0px;top:0px;z-index:48;" id="CallBackSelectBox">
+76 -24
View File
@@ -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';}
+76 -24
View File
@@ -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';}
@@ -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 "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
<option value="DUPLIST">CHECK FOR DUPLICATES BY PHONE IN LIST ID</option>
<option value="DUPCAMP">CHECK FOR DUPLICATES BY PHONE IN ALL CAMPAIGN LISTS</option>
<option value="DUPSYS">CHECK FOR DUPLICATES BY PHONE IN ENTIRE SYSTEM</option>
<option value="DUPTITLEALTPHONELIST">CHECK FOR DUPLICATES BY TITLE/ALT-PHONE IN LIST ID</option>
<option value="DUPTITLEALTPHONESYS">CHECK FOR DUPLICATES BY TITLE/ALT-PHONE IN ENTIRE SYSTEM</option>
</select></td>
</tr>
<tr>
@@ -556,12 +561,55 @@ echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
}
}
##### 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 "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
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 "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
}
}
##### 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");
}