2006-06-16 snapshot
git-svn-id: svn://192.168.202.10@9 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -9,9 +9,10 @@
|
||||
# 50602-1640 - First version created by Joe Johnson
|
||||
# 51128-1108 - Removed PHP global vars requirement
|
||||
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
|
||||
# 60616-1006 - added listID override and gmt_offset lookup while loading
|
||||
#
|
||||
# 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.
|
||||
|
||||
#
|
||||
|
||||
header ("Content-type: text/html; charset=utf-8");
|
||||
|
||||
@@ -23,13 +24,18 @@ $PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
$leadfile=$_FILES["leadfile"];
|
||||
$LF_orig = $_FILES['leadfile']['name'];
|
||||
$LF_path = $_FILES['leadfile']['tmp_name'];
|
||||
$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];}
|
||||
$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];}
|
||||
$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
$submit_file=$_GET["submit_file"]; if (!$submit_file) {$submit_file=$_POST["submit_file"];}
|
||||
$list_id_override=$_GET["list_id_override"]; if (!$list_id_override) {$list_id_override=$_POST["list_id_override"];}
|
||||
$list_id_override = (preg_replace("/\D/","",$list_id_override));
|
||||
$submit=$_GET["submit"]; if (!$submit) {$submit=$_POST["submit"];}
|
||||
$SUBMIT=$_GET["SUBMIT"]; if (!$SUBMIT) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
|
||||
$version = '1.1.11';
|
||||
$build = '60421-1043';
|
||||
#$DB=1;
|
||||
#$DBX=1;
|
||||
|
||||
$version = '1.1.12';
|
||||
$build = '60616-1006';
|
||||
|
||||
$script_name = getenv("SCRIPT_NAME");
|
||||
$server_name = getenv("SERVER_NAME");
|
||||
@@ -42,9 +48,53 @@ $admSCR = 'admin.php';
|
||||
$NWB = " <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
|
||||
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
|
||||
|
||||
|
||||
$secX = date("U");
|
||||
$hour = date("H");
|
||||
$min = date("i");
|
||||
$sec = date("s");
|
||||
$mon = date("m");
|
||||
$mday = date("d");
|
||||
$year = date("Y");
|
||||
$isdst = date("I");
|
||||
$Shour = date("H");
|
||||
$Smin = date("i");
|
||||
$Ssec = date("s");
|
||||
$Smon = date("m");
|
||||
$Smday = date("d");
|
||||
$Syear = date("Y");
|
||||
$pulldate0 = "$year-$mon-$mday $hour:$min:$sec";
|
||||
$inSD = $pulldate0;
|
||||
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
|
||||
|
||||
### Grab Server GMT value from the database
|
||||
$stmt="SELECT local_gmt FROM servers where server_ip = '$server_ip';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$gmt_recs = mysql_num_rows($rslt);
|
||||
if ($gmt_recs > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$DBSERVER_GMT = "$row[0]";
|
||||
if (strlen($DBSERVER_GMT)>0) {$SERVER_GMT = $DBSERVER_GMT;}
|
||||
if ($isdst) {$SERVER_GMT++;}
|
||||
}
|
||||
else
|
||||
{
|
||||
$SERVER_GMT = date("O");
|
||||
$SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
|
||||
$SERVER_GMT = ($SERVER_GMT + 0);
|
||||
$SERVER_GMT = ($SERVER_GMT / 100);
|
||||
}
|
||||
|
||||
$LOCAL_GMT_OFF = $SERVER_GMT;
|
||||
$LOCAL_GMT_OFF_STD = $SERVER_GMT;
|
||||
|
||||
#if ($DB) {print "SEED TIME $secX : $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF\n";}
|
||||
|
||||
echo "<html>\n";
|
||||
echo "<head>\n";
|
||||
echo "<!-- VERSION: $version BUILD: $build -->\n";
|
||||
echo "<!-- SEED TIME $secX: $year-$mon-$mday $hour:$min:$sec LOCAL GMT OFFSET NOW: $LOCAL_GMT_OFF DST: $isdst -->\n";
|
||||
|
||||
|
||||
?>
|
||||
@@ -68,6 +118,10 @@ function ShowProgress(good, bad, total) {
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>Load leads from this file:</font></td>
|
||||
<td align=left width="75%"><input type=file name="leadfile" value="<?=$leadfile ?>"> <? echo "$NWB#vicidial_list_loader$NWE"; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=right width="25%"><font face="arial, helvetica" size=2>List ID Override: </font></td>
|
||||
<td align=left width="75%"><font face="arial, helvetica" size=1><input type=text value="" name='list_id_override' size=10 maxlength=8> (numbers only or leave blank for values in the file)</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center><input type=submit value="SUBMIT" name='submit_file'></td>
|
||||
<td align=center><input type=button onClick="javascript:document.location='listloader.php'" value="START OVER" name='reload_page'></td>
|
||||
@@ -79,7 +133,7 @@ function ShowProgress(good, bad, total) {
|
||||
|
||||
#echo "|$LF_orig|$LF_path|\n";
|
||||
|
||||
if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
if ($leadfile and filesize($LF_path)<=8388608) {
|
||||
print "<script language='JavaScript1.2'>document.forms[0].leadfile.disabled=true; document.forms[0].submit_file.disabled=true; document.forms[0].reload_page.disabled=true;</script>";
|
||||
flush();
|
||||
copy($LF_path, "$WeBServeRRooT/vicidial/vicidial_temp_file.txt");
|
||||
@@ -100,6 +154,12 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
$file=fopen("./vicidial_temp_file.txt", "r");
|
||||
$total=0; $good=0; $bad=0;
|
||||
print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name-delimited file... ($tab_count|$pipe_count)\n";
|
||||
|
||||
if (strlen($list_id_override)>0)
|
||||
{
|
||||
print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
|
||||
}
|
||||
|
||||
while (!feof($file)) {
|
||||
$record++;
|
||||
$buffer=rtrim(fgets($file, 4096));
|
||||
@@ -107,18 +167,13 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
|
||||
if (strlen($buffer)>0) {
|
||||
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer));
|
||||
$entry_date = "$pulldate";
|
||||
$modify_date = "";
|
||||
$status = "NEW";
|
||||
$user = "";
|
||||
$vendor_lead_code = $row[0];
|
||||
$source_code = $row[1];
|
||||
$source_id=$source_code;
|
||||
$list_id = $row[2];
|
||||
$campaign_id = '';
|
||||
$called_since_last_reset='N';
|
||||
$phone_code = eregi_replace("[^0-9]", "", $row[3]);
|
||||
$phone_number = eregi_replace("[^0-9]", "", $row[4]);
|
||||
$USarea = substr($phone_number, 0, 3);
|
||||
$title = $row[5];
|
||||
$first_name = $row[6];
|
||||
$middle_initial = $row[7];
|
||||
@@ -138,11 +193,460 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
$security_phrase = $row[21];
|
||||
$comments = trim($row[22]);
|
||||
|
||||
if (strlen($phone_number)>8) {
|
||||
if (strlen($phone_number)>8)
|
||||
{
|
||||
$entry_date = "$pulldate";
|
||||
$modify_date = "";
|
||||
$status = "NEW";
|
||||
$user = "";
|
||||
$gmt_offset = '0';
|
||||
$called_since_last_reset='N';
|
||||
|
||||
if (strlen($list_id_override)>0)
|
||||
{
|
||||
# print "<BR><BR>LIST ID OVERRIDE FOR THIS FILE: $list_id_override<BR><BR>";
|
||||
$list_id = $list_id_override;
|
||||
}
|
||||
|
||||
$PC_processed=0;
|
||||
### UNITED STATES ###
|
||||
if ($phone_code =='1')
|
||||
{
|
||||
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$pc_recs = mysql_num_rows($rslt);
|
||||
if ($pc_recs > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
|
||||
$dst = $row[5];
|
||||
$dst_range = $row[6];
|
||||
$PC_processed++;
|
||||
}
|
||||
}
|
||||
### MEXICO ###
|
||||
if ($phone_code =='52')
|
||||
{
|
||||
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and areacode='$USarea';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$pc_recs = mysql_num_rows($rslt);
|
||||
if ($pc_recs > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
|
||||
$dst = $row[5];
|
||||
$dst_range = $row[6];
|
||||
$PC_processed++;
|
||||
}
|
||||
}
|
||||
### AUSTRALIA ###
|
||||
if ($phone_code =='61')
|
||||
{
|
||||
$stmt="select * from vicidial_phone_codes where country_code='$phone_code' and state='$state';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$pc_recs = mysql_num_rows($rslt);
|
||||
if ($pc_recs > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
|
||||
$dst = $row[5];
|
||||
$dst_range = $row[6];
|
||||
$PC_processed++;
|
||||
}
|
||||
}
|
||||
### ALL OTHER COUNTRY CODES ###
|
||||
if (!$PC_processed)
|
||||
{
|
||||
$PC_processed++;
|
||||
$stmt="select * from vicidial_phone_codes where country_code='$phone_code';";
|
||||
$rslt=mysql_query($stmt, $link);
|
||||
$pc_recs = mysql_num_rows($rslt);
|
||||
if ($pc_recs > 0)
|
||||
{
|
||||
$row=mysql_fetch_row($rslt);
|
||||
$gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
|
||||
$dst = $row[5];
|
||||
$dst_range = $row[6];
|
||||
$PC_processed++;
|
||||
}
|
||||
}
|
||||
|
||||
### Find out if DST to raise the gmt offset ###
|
||||
$AC_GMT_diff = ($gmt_offset - $LOCAL_GMT_OFF_STD);
|
||||
$AC_localtime = mktime(($Shour + $AC_GMT_diff), $Smin, $Ssec, $Smon, $Smday, $Syear);
|
||||
$hour = date("H",$AC_localtime);
|
||||
$min = date("i",$AC_localtime);
|
||||
$sec = date("s",$AC_localtime);
|
||||
$mon = date("m",$AC_localtime);
|
||||
$mday = date("d",$AC_localtime);
|
||||
$wday = date("w",$AC_localtime);
|
||||
$year = date("Y",$AC_localtime);
|
||||
$dsec = ( ( ($hour * 3600) + ($min * 60) ) + $sec );
|
||||
|
||||
$AC_processed=0;
|
||||
if ( (!$AC_processed) and ($dst_range == 'FSA-LSO') )
|
||||
{
|
||||
if ($DBX) {print " First Sunday April to Last Sunday October\n";}
|
||||
#**********************************************************************
|
||||
# FSA-LSO
|
||||
# This is returns 1 if Daylight Savings Time is in effect and 0 if
|
||||
# Standard time is in effect.
|
||||
# Based on first Sunday in April and last Sunday in October at 2 am.
|
||||
# INPUTS:
|
||||
# mm INTEGER Month.
|
||||
# dd INTEGER Day of the month.
|
||||
# ns INTEGER Seconds into the day.
|
||||
# dow INTEGER Day of week (0=Sunday, to 6=Saturday)
|
||||
# OPTIONAL INPUT:
|
||||
# timezone INTEGER hour difference UTC - local standard time
|
||||
# (DEFAULT is blank)
|
||||
# make calculations based on UTC time,
|
||||
# which means shift at 10:00 UTC in April
|
||||
# and 9:00 UTC in October
|
||||
# OUTPUT:
|
||||
# INTEGER 1 = DST, 0 = not DST
|
||||
#**********************************************************************
|
||||
|
||||
$USA_DST=0;
|
||||
$mm = $mon;
|
||||
$dd = $mday;
|
||||
$ns = $dsec;
|
||||
$dow= $wday;
|
||||
|
||||
if ($mm < 4 || $mm > 10) {
|
||||
$USA_DST=0;
|
||||
} elseif ($mm >= 5 and $mm <= 9) {
|
||||
$USA_DST=1;
|
||||
} elseif ($mm == 4) {
|
||||
if ($dd > 7) {
|
||||
$USA_DST=1;
|
||||
} elseif ($dd >= ($dow+1)) {
|
||||
if ($timezone) {
|
||||
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
|
||||
$USA_DST=0;
|
||||
} else {
|
||||
$USA_DST=1;
|
||||
}
|
||||
} else {
|
||||
if ($dow == 0 and $ns < 7200) {
|
||||
$USA_DST=0;
|
||||
} else {
|
||||
$USA_DST=1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$USA_DST=0;
|
||||
}
|
||||
} elseif ($mm == 10) {
|
||||
if ($dd < 25) {
|
||||
$USA_DST=1;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$USA_DST=1;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (7200+($timezone-1)*3600)) {
|
||||
$USA_DST=1;
|
||||
} else {
|
||||
$USA_DST=0;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 7200) {
|
||||
$USA_DST=1;
|
||||
} else {
|
||||
$USA_DST=0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$USA_DST=0;
|
||||
}
|
||||
} # end of month checks
|
||||
|
||||
if ($DBX) {print " DST: $USA_DST\n";}
|
||||
if ($USA_DST) {$gmt_offset++;}
|
||||
$AC_processed++;
|
||||
}
|
||||
|
||||
if ( (!$AC_processed) and ($dst_range == 'LSM-LSO') )
|
||||
{
|
||||
if ($DBX) {print " Last Sunday March to Last Sunday October\n";}
|
||||
#**********************************************************************
|
||||
# This is s 1 if Daylight Savings Time is in effect and 0 if
|
||||
# Standard time is in effect.
|
||||
# Based on last Sunday in March and last Sunday in October at 1 am.
|
||||
#**********************************************************************
|
||||
|
||||
$GBR_DST=0;
|
||||
$mm = $mon;
|
||||
$dd = $mday;
|
||||
$ns = $dsec;
|
||||
$dow= $wday;
|
||||
|
||||
if ($mm < 3 || $mm > 10) {
|
||||
$GBR_DST=0;
|
||||
} elseif ($mm >= 4 and $mm <= 9) {
|
||||
$GBR_DST=1;
|
||||
} elseif ($mm == 3) {
|
||||
if ($dd < 25) {
|
||||
$GBR_DST=0;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$GBR_DST=0;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$GBR_DST=0;
|
||||
} else {
|
||||
$GBR_DST=1;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$GBR_DST=0;
|
||||
} else {
|
||||
$GBR_DST=1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$GBR_DST=1;
|
||||
}
|
||||
} elseif ($mm == 10) {
|
||||
if ($dd < 25) {
|
||||
$GBR_DST=1;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$GBR_DST=1;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$GBR_DST=1;
|
||||
} else {
|
||||
$GBR_DST=0;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$GBR_DST=1;
|
||||
} else {
|
||||
$GBR_DST=0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$GBR_DST=0;
|
||||
}
|
||||
} # end of month checks
|
||||
if ($DBX) {print " DST: $GBR_DST\n";}
|
||||
if ($GBR_DST) {$gmt_offset++;}
|
||||
$AC_processed++;
|
||||
}
|
||||
if ( (!$AC_processed) and ($dst_range == 'LSO-LSM') )
|
||||
{
|
||||
if ($DBX) {print " Last Sunday October to Last Sunday March\n";}
|
||||
#**********************************************************************
|
||||
# This is s 1 if Daylight Savings Time is in effect and 0 if
|
||||
# Standard time is in effect.
|
||||
# Based on last Sunday in October and last Sunday in March at 1 am.
|
||||
#**********************************************************************
|
||||
|
||||
$AUS_DST=0;
|
||||
$mm = $mon;
|
||||
$dd = $mday;
|
||||
$ns = $dsec;
|
||||
$dow= $wday;
|
||||
|
||||
if ($mm < 3 || $mm > 10) {
|
||||
$AUS_DST=1;
|
||||
} elseif ($mm >= 4 and $mm <= 9) {
|
||||
$AUS_DST=0;
|
||||
} elseif ($mm == 3) {
|
||||
if ($dd < 25) {
|
||||
$AUS_DST=1;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$AUS_DST=1;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$AUS_DST=1;
|
||||
} else {
|
||||
$AUS_DST=0;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$AUS_DST=1;
|
||||
} else {
|
||||
$AUS_DST=0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$AUS_DST=0;
|
||||
}
|
||||
} elseif ($mm == 10) {
|
||||
if ($dd < 25) {
|
||||
$AUS_DST=0;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$AUS_DST=0;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$AUS_DST=0;
|
||||
} else {
|
||||
$AUS_DST=1;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$AUS_DST=0;
|
||||
} else {
|
||||
$AUS_DST=1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$AUS_DST=1;
|
||||
}
|
||||
} # end of month checks
|
||||
if ($DBX) {print " DST: $AUS_DST\n";}
|
||||
if ($AUS_DST) {$gmt_offset++;}
|
||||
$AC_processed++;
|
||||
}
|
||||
|
||||
if ( (!$AC_processed) and ($dst_range == 'FSO-LSM') )
|
||||
{
|
||||
if ($DBX) {print " First Sunday October to Last Sunday March\n";}
|
||||
#**********************************************************************
|
||||
# TASMANIA ONLY
|
||||
# This is s 1 if Daylight Savings Time is in effect and 0 if
|
||||
# Standard time is in effect.
|
||||
# Based on first Sunday in October and last Sunday in March at 1 am.
|
||||
#**********************************************************************
|
||||
|
||||
$AUST_DST=0;
|
||||
$mm = $mon;
|
||||
$dd = $mday;
|
||||
$ns = $dsec;
|
||||
$dow= $wday;
|
||||
|
||||
if ($mm < 3 || $mm > 10) {
|
||||
$AUST_DST=1;
|
||||
} elseif ($mm >= 4 and $mm <= 9) {
|
||||
$AUST_DST=0;
|
||||
} elseif ($mm == 3) {
|
||||
if ($dd < 25) {
|
||||
$AUST_DST=1;
|
||||
} elseif ($dd < ($dow+25)) {
|
||||
$AUST_DST=1;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$AUST_DST=1;
|
||||
} else {
|
||||
$AUST_DST=0;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$AUST_DST=1;
|
||||
} else {
|
||||
$AUST_DST=0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$AUST_DST=0;
|
||||
}
|
||||
} elseif ($mm == 10) {
|
||||
if ($dd > 7) {
|
||||
$AUST_DST=1;
|
||||
} elseif ($dd >= ($dow+1)) {
|
||||
if ($timezone) {
|
||||
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
|
||||
$AUST_DST=0;
|
||||
} else {
|
||||
$AUST_DST=1;
|
||||
}
|
||||
} else {
|
||||
if ($dow == 0 and $ns < 3600) {
|
||||
$AUST_DST=0;
|
||||
} else {
|
||||
$AUST_DST=1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$AUST_DST=0;
|
||||
}
|
||||
} # end of month checks
|
||||
if ($DBX) {print " DST: $AUST_DST\n";}
|
||||
if ($AUST_DST) {$gmt_offset++;}
|
||||
$AC_processed++;
|
||||
}
|
||||
if ( (!$AC_processed) and ($dst_range == 'FSO-TSM') )
|
||||
{
|
||||
if ($DBX) {print " First Sunday October to Third Sunday March\n";}
|
||||
#**********************************************************************
|
||||
# This is s 1 if Daylight Savings Time is in effect and 0 if
|
||||
# Standard time is in effect.
|
||||
# Based on first Sunday in October and third Sunday in March at 1 am.
|
||||
#**********************************************************************
|
||||
|
||||
$NZL_DST=0;
|
||||
$mm = $mon;
|
||||
$dd = $mday;
|
||||
$ns = $dsec;
|
||||
$dow= $wday;
|
||||
|
||||
if ($mm < 3 || $mm > 10) {
|
||||
$NZL_DST=1;
|
||||
} elseif ($mm >= 4 and $mm <= 9) {
|
||||
$NZL_DST=0;
|
||||
} elseif ($mm == 3) {
|
||||
if ($dd < 14) {
|
||||
$NZL_DST=1;
|
||||
} elseif ($dd < ($dow+14)) {
|
||||
$NZL_DST=1;
|
||||
} elseif ($dow == 0) {
|
||||
if ($timezone) { # UTC calculations
|
||||
if ($ns < (3600+($timezone-1)*3600)) {
|
||||
$NZL_DST=1;
|
||||
} else {
|
||||
$NZL_DST=0;
|
||||
}
|
||||
} else { # local time calculations
|
||||
if ($ns < 3600) {
|
||||
$NZL_DST=1;
|
||||
} else {
|
||||
$NZL_DST=0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$NZL_DST=0;
|
||||
}
|
||||
} elseif ($mm == 10) {
|
||||
if ($dd > 7) {
|
||||
$NZL_DST=1;
|
||||
} elseif ($dd >= ($dow+1)) {
|
||||
if ($timezone) {
|
||||
if ($dow == 0 and $ns < (7200+$timezone*3600)) {
|
||||
$NZL_DST=0;
|
||||
} else {
|
||||
$NZL_DST=1;
|
||||
}
|
||||
} else {
|
||||
if ($dow == 0 and $ns < 3600) {
|
||||
$NZL_DST=0;
|
||||
} else {
|
||||
$NZL_DST=1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$NZL_DST=0;
|
||||
}
|
||||
} # end of month checks
|
||||
if ($DBX) {print " DST: $NZL_DST\n";}
|
||||
if ($NZL_DST) {$gmt_offset++;}
|
||||
$AC_processed++;
|
||||
}
|
||||
if (!$AC_processed)
|
||||
{
|
||||
if ($DBX) {print " No DST Method Found\n";}
|
||||
if ($DBX) {print " DST: 0\n";}
|
||||
$AC_processed++;
|
||||
}
|
||||
|
||||
|
||||
if ($multi_insert_counter > 8) {
|
||||
### 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','$campaign_id','$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);";
|
||||
$rslt=mysql_query($stmtZ, $link);
|
||||
if ($WeBRooTWritablE > 0)
|
||||
{fwrite($stmt_file, $stmtZ."\r\n");}
|
||||
@@ -150,7 +654,7 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
$multi_insert_counter=0;
|
||||
|
||||
} else {
|
||||
$multistmt .= "('','$entry_date','$modify_date','$status','$user','$vendor_lead_code','$source_id','$list_id','$campaign_id','$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),";
|
||||
$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),";
|
||||
$multi_insert_counter++;
|
||||
}
|
||||
|
||||
@@ -185,4 +689,4 @@ if ($leadfile && filesize($LF_path)<=8388608) {
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user