fixed two errors in VICIDIAL_IN_new_leads_file.pl script
git-svn-id: svn://192.168.202.10@271 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -140,10 +140,20 @@ if (length($ARGV[0])>1)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print "no command line options set\n";
|
print "no command line options set\n";
|
||||||
|
$args = "";
|
||||||
|
$i=0;
|
||||||
|
$forcelistid = '';
|
||||||
}
|
}
|
||||||
### end parsing run-time options ###
|
### end parsing run-time options ###
|
||||||
|
|
||||||
|
|
||||||
|
if (!$VARDB_port) {$VARDB_port='3306';}
|
||||||
|
|
||||||
|
use DBI;
|
||||||
|
|
||||||
|
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
||||||
|
or die "Couldn't connect to database: " . DBI->errstr;
|
||||||
|
|
||||||
$suf = '.txt';
|
$suf = '.txt';
|
||||||
$people_packages_id_update='';
|
$people_packages_id_update='';
|
||||||
$dir1 = "$PATHhome/LEADS_IN";
|
$dir1 = "$PATHhome/LEADS_IN";
|
||||||
@@ -186,13 +196,6 @@ foreach(@FILES)
|
|||||||
|| die "Can't open $source$FILES[$i]: $!\n";
|
|| die "Can't open $source$FILES[$i]: $!\n";
|
||||||
|
|
||||||
|
|
||||||
if (!$VARDB_port) {$VARDB_port='3306';}
|
|
||||||
|
|
||||||
use DBI;
|
|
||||||
|
|
||||||
$dbhA = DBI->connect("DBI:mysql:$VARDB_database:$VARDB_server:$VARDB_port", "$VARDB_user", "$VARDB_pass")
|
|
||||||
or die "Couldn't connect to database: " . DBI->errstr;
|
|
||||||
|
|
||||||
### Grab Server values from the database
|
### Grab Server values from the database
|
||||||
$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';";
|
$stmtA = "SELECT local_gmt FROM servers where server_ip = '$server_ip';";
|
||||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||||
@@ -438,8 +441,8 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC
|
|||||||
{
|
{
|
||||||
### insert good deal into pending_transactions table ###
|
### insert good deal into pending_transactions table ###
|
||||||
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0');";
|
$stmtZ = "INSERT INTO vicidial_list values$multistmt('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$gmt_offset','$called_since_last_reset','$phone_code','$phone_number','$title','$first_name','$middle_initial','$last_name','$address1','$address2','$address3','$city','$state','$province','$postal_code','$country_code','$gender','$date_of_birth','$alt_phone','$email','$security_phrase','$comments','0');";
|
||||||
if($DB){print STDERR "\n|$stmtZ|\n";}
|
if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n";
|
||||||
if (!$T) {$affected_rows = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtA|\n";
|
if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";}
|
||||||
|
|
||||||
$multistmt='';
|
$multistmt='';
|
||||||
$multi_insert_counter=0;
|
$multi_insert_counter=0;
|
||||||
@@ -479,8 +482,8 @@ if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOC
|
|||||||
chop($multistmt);
|
chop($multistmt);
|
||||||
### insert good deal into pending_transactions table ###
|
### insert good deal into pending_transactions table ###
|
||||||
$stmtZ = "INSERT INTO vicidial_list values$multistmt;";
|
$stmtZ = "INSERT INTO vicidial_list values$multistmt;";
|
||||||
if($DB){print STDERR "\n|$stmtZ|\n";}
|
if (!$T) {$affected_rows = $dbhA->do($stmtZ); } # or die "Couldn't execute query: |$stmtZ|\n";
|
||||||
if (!$T) {$affected_rows = $dbhA->do($stmtA); } # or die "Couldn't execute query: |$stmtA|\n";
|
if($DB){print STDERR "\n|$affected_rows|$stmtZ|\n";}
|
||||||
|
|
||||||
$multistmt='';
|
$multistmt='';
|
||||||
$multi_insert_counter=0;
|
$multi_insert_counter=0;
|
||||||
|
|||||||
Reference in New Issue
Block a user