<% '# The process and all the routines contained herein are the proprietary '# properties and trade secrets of Jet Delivery. Except as provided '# by license agreement this code shall not be duplicated, used or disclosed '# for any purpose or reason, in whole or in part, without the express '# written consent of Jet Delivery. '# '#------------------------------------------------------------------------ '# '# File: str_prep.asp '# '# Purpose: Strip unwanted characters. '# '# Description: Use this function to strip know problem characters from '# string(s) prior to writing to the SQL database. '# '# Author: Jason Barbata '# '# Created: August 13, 2004 '# '#------------------------------------------------------------------------- '#==== Begin Script ==== 'This site is protected by copyright and trademark laws under U.S. and International law. 'Copyright © 1997-2005 Jet Delivery, Inc. - All rights reserved. '**Start Encode** Dim validStr, dstr, cpos Function strPrep(inVar) validStr = InStr(inVar, "'") If validStr = 0 Then Else dstr = inVar cpos = instr(dstr,"'") do while (cpos > 0) dstr = left(dstr, cpos-1) & mid(dstr, cpos+1) cpos = instr(dstr,"'") loop inVar = dstr End If inVar = FixCR(inVar, len(inVar)) strPrep = Trim(inVar) End Function Function strPrep2(invar) strFix = Replace(invar, "'", "''") 'strFix = Replace(strFix, """, "") strPrep2 = Trim(strFix) End Function Function strPrep3(inVar) validStr = InStr(inVar, """") If validStr = 0 Then Else dstr = inVar cpos = instr(dstr,"""") do while (cpos > 0) dstr = left(dstr, cpos-1) & mid(dstr, cpos+1) cpos = instr(dstr,"""") loop inVar = dstr End If validStr = InStr(Trim(inVar), "'") If validStr = 0 Then Else dstr = inVar cpos = instr(dstr,"'") do while (cpos > 0) dstr = left(dstr, cpos-1) & mid(dstr, cpos+1) cpos = instr(dstr,"'") loop inVar = dstr End If strPrep3 = Trim(inVar) End Function '########################### '### Replace ' function ### '########################### Function strRplc(inVar) strRplc = Replace(inVar, "'", "''") strRplc = Trim(inVar) End Function Function DeleteVbCrLf(strString) '################################### '### UPDATED FixCR - ONLY SINGLE STRING VAR NEEDS TO BE PASSED IN '################################### intLength = len(strString) strString = Replace(strString, vbCrLf, " ") If Len(strString) > intLength Then strString = Left(strString, intLength) aryString = Split(strString, " ") strString = "" For a = 0 to UBound(aryString)-1 strString = strString & " " & aryString(a) Next strString = Trim(strString) strString = strString & " ..." End If DeleteVbCrLf = strString End Function Function FixCR(strString, intLength) '######################################### '### REMOVE any 's in the string. ### '######################################### If IsNull(strString) <> True Then strString = Replace(strString, vbCrLf, " ") If Len(strString) > intLength Then strString = Left(strString, intLength) aryString = Split(strString, " ") strString = "" For a = 0 to UBound(aryString)-1 strString = strString & " " & aryString(a) Next strString = Trim(strString) strString = strString & " ..." End If End If FixCR = strString End Function %> <% '#------------------------------------------------------------------------ '# '# File: cgi_db_pvrds.asp '# '# Purpose: Holds key database connection strings. '# '# Description: This is where we keep a list of our important '# database connections strings. '# '# Author: Jason Barbata '# '# Created: January 30, 2007 '# '#------------------------------------------------------------------------- '#==== Begin Script ==== '# 'Global Site Settings: 'Modifing these settings will effect entire site. ACTIVE_DB = "WWW-JDL9" 'errno: 2212 '---------------------------------------- SYNGXProvider = "MSDASQL.1;Persist Security Info=False;Data Source=xfODBC" 'errno: 2213 '---------------------------------------- COPSDataProvider = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=COPSData;Data Source=WWW-JDL9" 'errno: 2215 '---------------------------------------- MAS90Provider = "MSDASQL.1;Persist Security Info=False;Data Source=SOTAMAS90_IIS" 'errno: 2213 '---------------------------------------- ASIDataProvider = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=ASIData;Data Source=WWW-JDL9" 'errno: 2216 '---------------------------------------- ACTDataProvider = "Provider=SQLNCLI.1;Password=UJYW1JK4Z3C36812710;Persist Security Info=True;User ID=sa;Initial Catalog=HOSTSvr_db1_1;Data Source=WWW-JDL4\ACT7" 'errno: 2217 '---------------------------------------- 'AVAYAProvider = "dsn=AvayaData;uid=root;pwd=cms500" '<-- old method AVAYAProvider = "MSDASQL.1;Persist Security Info=False;Data Source=AvayaData;User ID=root;Password=cms500" %> <% '# The process and all the routines contained herein are the proprietary '# properties and trade secrets of Jet Delivery. Except as provided '# by license agreement this code shall not be duplicated, used or disclosed '# for any purpose or reason, in whole or in part, without the express '# written consent of Jet Delivery. '# '#------------------------------------------------------------------------ '# '# File: tzn_mile_logic.asp '# '# Purpose: Provide distance and time-zone information. '# '# Description: Use this function to return the distance between '# two points and also the time-zone differences. '# '# Author: Jason Barbata '# '# Created: September 21, 2004 '# '#------------------------------------------------------------------------- '#==== Begin Script ==== 'This site is protected by copyright and trademark laws under U.S. and International law. 'Copyright © 1997-2005 Jet Delivery, Inc. - All rights reserved. '**Start Encode** Public Miles, TimeZoneAdjustment Public pZipFail, pTimeZone, pZipTime, pCity, pState, DispZone Public dZipFail, dTimeZone, dZipTime, dCity, dState Public sZipFail, sTimeZone, sZipTime, sCity, sState, sZip, sDispZone Function GetMiles(pZip, dZip) '################################################## '### Return zip code information from database ### '################################################## If FUNC_DEBUG = "ON" Then Response.Write("GetMiles Function was passed in " & pZip & ", " & dZip & "
") Call zipInfo(pZip, dZip) TimeZoneAdjustment = DateDiff("n", pZipTime, dZipTime) End Function Function zipInfo(pZip, dZip) '############################################## '### RETURNS THE PROPER LOCAL TIME FOR ZIP ### '############################################## If CONN_DEBUG = "OFF" Then On Error Resume Next Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open COPSDataProvider If Conn.errors.count <> 0 Then Response.Redirect("/error/?err=2213&page=" & Request.ServerVariables("URL") & "&svrid=" & Request.ServerVariables("SERVER_NAME") & "&usrid=" & Request.ServerVariables("REMOTE_ADDR")) If CONN_DEBUG = "OFF" Then On Error Goto 0 'Get Pickup Zip-Code Details '----------------------------------- sSQL = "SELECT OPGC_CITY, OPGC_STAT, OPGC_CLAT, OPGC_CLON, TZ, DST, OPGC_DZON FROM PUBLIC_OPGCTY WHERE PRIMARY_KEY='" & pZip & "'" Set Rs = Conn.Execute(sSQL) If Rs.EOF = True Then pZipFail = True If FUNC_DEBUG = "ON" Then Response.Write("pickup-zip " & pZip & " is not listed in the database
") Else pCity = (Rs.Fields("OPGC_CITY").value) pState = (Rs.Fields("OPGC_STAT").value) pLat = (Rs.Fields("OPGC_CLAT").value) pLon = (Rs.Fields("OPGC_CLON").value) pTimeZone = (Rs.Fields("TZ").value) pDlytTime = (Rs.Fields("DST").value) DispZone = (Rs.Fields("OPGC_DZON").value) Rs.Close Set Rs = Nothing If FUNC_DEBUG = "ON" Then Response.Write("pickup-zip " & pZip & " is " & pTimeZone & " " & pDlytTime & "
") End If 'Get Deliver Zip-Code Details '----------------------------------- sSQL = "SELECT OPGC_CITY, OPGC_STAT, OPGC_CLAT, OPGC_CLON, TZ, DST FROM PUBLIC_OPGCTY WHERE PRIMARY_KEY='" & dZip & "'" Set Rs = Conn.Execute(sSQL) If Rs.EOF = True Then dZipFail = True If FUNC_DEBUG = "ON" Then Response.Write("deliver-zip " & dZip & " is not listed in the database
") Else DCity = (Rs.Fields("OPGC_CITY").value) DState = (Rs.Fields("OPGC_STAT").value) DLat = (Rs.Fields("OPGC_CLAT").value) DLon = (Rs.Fields("OPGC_CLON").value) dTimeZone = (Rs.Fields("TZ").value) dDlytTime = (Rs.Fields("DST").value) Rs.Close Set Rs = Nothing If FUNC_DEBUG = "ON" Then Response.Write("deliver-zip " & dZip & " is " & dTimeZone & " " & dDlytTime & "
") End If Conn.Close Set Conn = Nothing 'Get Curent Time and TimeZone '----------------------------------- pZipTime = TimeZone(pTimeZone) '<-- Pickup Zip-Code Local Time pTimeZone = TimeZoneDesc(pTimeZone, pZipTime) '<-- Pickup Zip-Code Standard Time/Daylight Time dZipTime = TimeZone(dTimeZone) '<-- Deliver Zip-Code Local Time dTimeZone = TimeZoneDesc(dTimeZone, dZipTime) '<-- Deliver Zip-Code Standard Time/Daylight Time 'Calculate Miles based off LAT/LON '----------------------------------- AirMiles = COPSLatLonDistance(PLat, PLon, DLat, DLon) Miles = Round(AirMiles * 1.4) End Function Function SingleZipLookup(invar) '################################# '### LOOKUP A SINGLE ZIP-CODE ### '################################# If CONN_DEBUG = "OFF" Then On Error Resume Next Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open COPSDataProvider If Conn.errors.count <> 0 Then Response.Redirect("/error/?err=2213&page=" & Request.ServerVariables("URL") & "&svrid=" & Request.ServerVariables("SERVER_NAME") & "&usrid=" & Request.ServerVariables("REMOTE_ADDR")) If CONN_DEBUG = "OFF" Then On Error Goto 0 'Get Zip-Code Details '----------------------------------- sSQL = "SELECT OPGC_CITY, OPGC_STAT, OPGC_CLAT, OPGC_CLON, TZ, DST, OPGC_DZON, OPGC_ZIPP FROM PUBLIC_OPGCTY WHERE PRIMARY_KEY='" & invar & "'" Set Rs = Conn.Execute(sSQL) If Rs.EOF <> True Then sCity = (Rs.Fields("OPGC_CITY").value) sState = (Rs.Fields("OPGC_STAT").value) sZip = (Rs.Fields("OPGC_ZIPP").value) sLat = (Rs.Fields("OPGC_CLAT").value) sLon = (Rs.Fields("OPGC_CLON").value) sTimeZone = (Rs.Fields("TZ").value) sDlytTime = (Rs.Fields("DST").value) sDispZone = (Rs.Fields("OPGC_DZON").value) Rs.Close End If Set Rs = Nothing Conn.Close Set Conn = Nothing sZipTime = TimeZone(sTimeZone) sTimeZone = TimeZoneDesc(sTimeZone, sZipTime) End Function '########################################################## '### MILEAGE LAT/LON CONVERSION FUNCTION - DO NOT EDIT ### '########################################################## Function LatLonDistance(ByVal pDb_Lat1, ByVal pDb_Lon1, ByVal pDb_Lat2, ByVal pDb_Lon2) Dim lDb_R Dim lDb_deltaLat Dim lDb_deltaLon Dim lDb_a Dim lDb_c 'Radius of the Earth (Km) lDb_R = 6367 'Calculate the Deltas... lDb_deltaLon = AsRadians(pDb_Lon2) - AsRadians(pDb_Lon1) lDb_deltaLat = AsRadians(pDb_Lat2) - AsRadians(pDb_Lat1) 'Intermediate values... lDb_a = Sin2(lDb_deltaLat / 2) + Cos(AsRadians(pDb_Lat1)) * Cos(AsRadians(pDb_Lat2)) * Sin2(lDb_deltaLon / 2) 'Intermediate result c is the great circle distance in radians... lDb_c = 2 * Arcsin(GetMin(1, Sqr(lDb_a))) 'Multiply the radians by the radius to get the distance in specified units... LatLonDistance = lDb_R * lDb_c End Function Function AsRadians(ByVal pDb_Degrees) 'To convert decimal degrees to radians, multiply 'the number of degrees by pi/180 = 0.017453293 radians/degree AsRadians = pDb_Degrees * (3.14159265358979 / 180) End Function Function Sin2(ByVal X) 'sin^2(X) = (1 - cos(2X))/2 [from Greer and Hancox, 1991] Sin2 = (1 - Cos(2 * X)) / 2 End Function Function Arcsin(ByVal X) 'Arcsin(X) = Atn(X / Sqr(-X * X + 1)) [from MS Help - VB4, 1995] Arcsin = Atn(X / Sqr(-X * X + 1)) End Function Function GetMin(ByVal X, ByVal Y) 'The min() function protects against possible roundoff errors that 'could sabotage computation of the arcsine if the two points are 'very nearly antipodal (that is, on opposide sides of the Earth) ' - RGC, 1996 If X <= Y Then GetMin = X Else GetMin = Y End If End Function Function COPSLatLonDistance(ByVal lat1, ByVal long1, ByVal lat2, ByVal long2) '############################################################# '### CALCULATE MILES WITH LAT/LON USING COPS 'NEW' METHOD ### '############################################################# plug = 0.0174532922 '#radians per degree (pi/180) i = sin(lat1*plug)*sin(lat2*plug) + _ (cos(lat1*plug)*cos(lat2*plug)*cos((long2*plug)-(long1*plug))) '# calculate if i > -1 and i < 1 then '# make sure -1 < i < 1 tlong = Arccos(i) '# take the inverse cosine miles = 69.093 * (tlong * 57.29577951) '# convert radians back to degrees (180/pi) else miles = 0 '<--- same coordinates end if COPSLatLonDistance = Round(miles) '# round to ones place End Function Function Arccos(invar) Arccos = Atn(-invar / Sqr(-invar * invar + 1)) + 2 * Atn(1) '# get the inverse cosine End Function Function IsDaylightSavings(invar) '############################################## '### ARE WE CURRENTLY IN DAYLIGHT SAVINGS? ### '############################################## '# 2am on the second Sunday of March (instead of the first Sunday of April [1990-2006]) '# 2am on the first Sunday of November (instead of the last Sunday in October [1990-2006]). 'if the date time has the milliseconds, clean them off If InStr(1,CStr(invar),".") <> 0 Then thisDate = Left(invar, Len(invar) - 4) Else thisDate = invar End If If IsDate(thisDate) Then 'We instantly know the outcome in these months. If Month(thisDate) <> 3 And Month(thisDate) <> 11 Then Select Case Month(thisDate) Case 1 '<-- January retVal = False Case 2 '<-- February retVal = False Case 4 '<-- April retVal = True Case 5 '<-- May retVal = True Case 6 '<-- June retVal = True Case 7 '<-- July retVal = True Case 8 '<-- August retVal = True Case 9 '<-- September retVal = True Case 10 '<-- October retVal = True Case 12 '<-- December retVal = False End Select Else If Month(thisDate) = 3 Then If Day(thisDate) > 7 AND Day(thisDate) =< 14 Then For x = 7 To (Day(thisDate) + 7) tmpDate = CStr(Month(thisDate)) & "/" & x & "/" & CStr(Year(thisDate)) 'Response.Write(tmpDate & " " & WeekdayName(Weekday(tmpDate)) & "
") If Weekday(tmpDate) = 1 Then If Day(tmpDate) < Day(thisDate) Then 'Response.Write("It's not the second Sunday in March! (" & tmpDate & ")") 'Second sunday in March has already passed, so we in DST retVal = True Exit For ElseIf Day(tmpDate) = Day(thisDate) Then 'It's the second Sunday in March! 'Response.Write("It's the second Sunday in March!") 'Let's see if it's past 2 AM. If there is no time part in thisDate (time part = "00:00:00"), 'we are going to assume it's past 2 AM If (Hour(thisDate) >= 2) Or (Hour(thisDate) = 0 And Minute(thisDate) = 0 And Second(thisDate) = 0) Then retVal = True Exit For Else retVal = False End If End If Else retVal = False End If Next Else If Day(thisDate) =< 7 Then retval = False Else retval = True End If End If ElseIf Month(thisDate) = 11 Then If Day(thisDate) > 7 Then retval = False Else For x = 1 To Day(thisDate) tmpDate = CStr(Month(thisDate)) & "/" & x & "/" & CStr(Year(thisDate)) If Weekday(tmpDate) = 1 Then If Day(tmpDate) < Day(thisDate) Then 'We're still in DST retVal = False Exit For ElseIf Day(tmpDate) = Day(thisDate) Then 'Let's see if it's past 2 AM. If there is no time part in thisDate (time part = "00:00:00"), 'we are going to assume it's past 2 AM If (Hour(thisDate) >= 2) Or (Hour(thisDate) = 0 And Minute(thisDate) = 0 And Second(thisDate) = 0) Then retVal = False Exit For Else retVal = True End If End If Else retVal = True End If Next End If End If End If Else 'if the string passed to the function is not a valid date, let's return false. retVal = False End If IsDaylightSavings = retVal End Function Function TimeZone(InZone) '####################################################### '### Get the current time in the selected time zone ### '####################################################### DaylightSavings = IsDaylightSavings(Now) 'Set the UTC '----------------- If DaylightSavings = True Then UTC = DateAdd("h", 7, Now) Else UTC = DateAdd("h", 8, Now) 'Find the Time in the Zone '----------------- If InZone = "CST" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -5, UTC) Else CurrentTime = DateAdd("h", -6, UTC) ElseIf InZone = "EST" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -4, UTC) Else CurrentTime = DateAdd("h", -5, UTC) ElseIf InZone = "EST1" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -3, UTC) Else CurrentTime = DateAdd("h", -4, UTC) ElseIf InZone = "MST" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -6, UTC) Else CurrentTime = DateAdd("h", -7, UTC) ElseIf InZone = "PST" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -7, UTC) Else CurrentTime = DateAdd("h", -8, UTC) ElseIf InZone = "PST1" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -8, UTC) Else CurrentTime = DateAdd("h", -9, UTC) ElseIf InZone = "PST2" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -9, UTC) Else CurrentTime = DateAdd("h", -10, UTC) ElseIf InZone = "PST3" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -10, UTC) Else CurrentTime = DateAdd("h", -11, UTC) ElseIf InZone = "PST4" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -11, UTC) Else CurrentTime = DateAdd("h", -12, UTC) ElseIf InZone = "PST5" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -12, UTC) Else CurrentTime = DateAdd("h", -13, UTC) ElseIf InZone = "PST6" Then If DaylightSavings = True Then CurrentTime = DateAdd("h", -13, UTC) Else CurrentTime = DateAdd("h", -14, UTC) Else 'If all else fails use our La Verne Time! If DaylightSavings = True Then CurrentTime = DateAdd("h", -7, UTC) Else CurrentTime = DateAdd("h", -8, UTC) End If TimeZone = CurrentTime End Function Function TimeZoneDesc(inZone, ZoneTime) '########################################### '### Description Standard/Daylight Time ### '########################################### If IsDate(ZoneTime) = True Then If IsDaylightSavings(ZoneTime) = True Then TimeZoneDesc = Replace(inZone, "ST", "DT") Else TimeZoneDesc = inZone Else TimeZoneDesc = "???" End If End Function %> Agent Benefits - Same Day Delivery Courier Service Courier Shipping Services

Jet Delivery

Getting Started | Contact Us | Site Map

 

 
Expedited Same Day Delivery Services Warehouse and Logistic Services Shipping Tools
Related Items
   
Benefits Agent Benefits 
     
  Jet Delivery is a nationwide service provider who in order to meet our customers strict time commitments must occasionally outsource contracts to agents/contractors in areas where it has no base of operations. Even in areas where our base of operations is strong, we frequently outsource work to our pre-approved agents in order to meet these commitments.

Our agents/contractors vary in size from a one-man operation to large courier companies whose vehicles vary in size from cars to tractor trailers.

All approved agents will have access to their account through our agent portal. Account access will allow you to manage your profile, review and approve your jobs, access payment history and view your pending jobs.

See Getting Approved to start the process.
 
     

 
Home | Site Map | Contact Us | Careers | Terms of Use | Privacy Statement

Copyright © 1997-2008 Jet Delivery, Inc. - All rights reserved.