%@ Language=VBScript %>
<% Option Explicit %>
<% Response.Buffer = True %>
<%
' -----------------------------------------------------------------
' -- START EDITING THESE CONSTANTS --
' -----------------------------------------------------------------
' -- CONNECTION FOR ACCESS DATABASE
Dim MM_connGlobal_STRING
MM_connGlobal_STRING = "A7647_bi"
Const globalPath = "http://www.itnetwork365.com/"
' -- SET THE NUMBER TO BE USED TO ENCODE / DECODE THE MEMBER ID QUERYSTRING STRING USED IN BULK EMAIL LINKS
' -- THIS CONSTANT CAN BE ANY NUMBER OR CALCULATED VALUE YOU CHOOSE
Const intCodeNumber = "65536"
' -- SET SOME SIMPLE NAMES AND EMAIL ADDRESSES
' -- THESE CONSTANTS ARE ONLY USED IN THE SUBSCRIBE AND UNSUBSCRIBE CONFIRMATION EMAILS
Const strMailFromName = "BI Administrator"
Const strEmailFromName = "biadmin@businessintelligence.com"
Const strCompanyName = "www.businessintelligence.com"
' -- THESE TWO CONSTANTS ARE USED IN /JOBS/REGISTER_PROCESS.ASP TO SEND CONFIRMATION EMAIL
Const strMailFromNameBIJobs = "BI Jobs Administrator"
Const strEmailFromNameBIJobs = "bijobs@businessintelligence.com"
' -- THE STRDOMAIN NAME IS ONLY USED IN THE SUBSCRIBE AND UNSUBSCRIBE CONFIRMATION EMAILS
' -- REMEMBER THE TRAILING SLASH BUT DO NOT USE HTTP:// AS THIS IS SET IN THE SCRIPT ALREADY
' -- EXAMPLE: www.yourcompany.com/
Const strDomainName = "www.businessintelligence.com"
' -- THE STRMAILINGLISTPATH IS USED IN SOME EMAILS IN CASE YOU PLACE THIS SET OF PAGES DEEPER INTO YOUR WEB SITE
' -- THIS IS ONLY USED IN PERSONAL EMAIL TYPES SENT TO LIST MEMBERS TO ALLOW THEM TO UPDATE OR REMOVE THEIR DETAILS
' -- YOU SHOULD ENSURE THAT YOU HAVE ENABLED DEFAULT.ASP IN THE ENABLE DEFAULT DOCUMENT LIST FOR YOUR IIS SETUP
' -- REMEMBER THE TRAILING SLASH BUT DO NOT USE HTTP:// AS THIS IS SET IN THE SCRIPT ALREADY
' -- EXAMPLE: www.yourcompany.com/mailinglist/
Const strMailingListPath = "www.businessintelligence.com/register.asp"
' -----------------------------------------------------------------
' -- FINISH EDITING THE CONSTANTS
' -----------------------------------------------------------------
' -- THERE SHOULD BE NO NEED TO EDIT ANYTHING BELOW THIS LINE
' -- APART FROM POSSIBLY THE openDB() FUNCTION TO OPEN THE DATABASE
' -----------------------------------------------------------------
' -- START ERROR HANDLING
' -- UNCOMMENT IF REQUIRED BUT I RECOMMEND LEAVING IT COMMENTED OUT FOR BETTER ERROR REPORTING WHILE DEVELOPING
' On Error Resume Next
' -- DEFINE DATABASE FUNCTIONS
' -- SET SOME BASIC VARIABLES
Dim DSN_Name ' Application DB Connection
Dim objConn ' Connection Object
Dim strSQL ' SQL String
Dim objRs ' Recordset Object
Dim DB_CONNECTIONSTRING
' -- FUNCTION TO OPEN THE DATABASE CONNECTION. USAGE = Call openDB ()
' -- COMMENT-OUT OR UNCOMMENT-IN TO USE ANOTHER CONNECTION TYPE
Function openDB
' -- GLOBAL.ASA CONNECTION. CHECK APPLICATION NAME. UNCOMMENT IF REQUIRED
' DSN_Name = Application ("dbMailList_ConnectionString")
' Set objConn = Server.CreateObject ("ADODB.Connection")
' objConn.Open (DSN_Name)
' -- DSN-LESS CONNECTION. CHECK FILE NAME AND PATH. UNCOMMENT IF REQUIRED
' -- JET 4.0 DRIVER FOR MICROSOFT ACCESS
' DSN_Name = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
' DSN_Name = DSN_Name & Server.Mappath("_data/register.mdb")
' Set objConn = Server.CreateObject("ADODB.Connection")
' objConn.Open DSN_Name
' -- DSN-LESS CONNECTION. CHECK FILE NAME AND PATH. COMMENT OUT IF NOT REQUIRED
' -- NATIVE ODBC DRIVER FOR MICROSOFT ACCESS
' DSN_Name = "busine582.data"
' DSN_Name = DSN_Name & Server.Mappath("database/register.mdb")
' DB_CONNECTIONSTRING = "DSN=db114411.sql; Database=db114411; UID=busine58;PWD=1912tiong"
' DB_CONNECTIONSTRING = "DSN=M7647_BI; Database=M7647_BI; UID=Douglas_Campbel;PWD=twinsoft"
' DB_CONNECTIONSTRING = "Driver={mySQL}; Server=mysql4.uplinkearth.com; Port=3306; Option=0; Socket=; Stmt=; Database=M7647_BI; Uid=Douglas_Campbel; Pwd=twinsoft;"
DB_CONNECTIONSTRING = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=h41mysql7.secureserver.net; PORT=3306; DATABASE=itnetwork365; USER=itnetwork365; PASSWORD=JMNH9.wn@!; OPTION=0;"
CONST DB_TYPE="MySQL"
Set objConn = Server.CreateObject("ADODB.Connection")
' objConn.Open "DSN=busine582.data"
objConn.Open DB_CONNECTIONSTRING
End Function
' -- FUNCTION TO CREATE A RECORDSET. USAGE = Call createRS (objRs)
Function createRS (objRs)
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.LockType = 3
objRS.CursorLocation = 3
objRS.CursorType = 0
Set objRS = objConn.Execute (strSQL)
End Function
' -- FUNCTION TO CLOSE CONNECTION AND RELEASE OBJECTS. USAGE = Call closeConnRS (objRs, objConn)
Function closeConnRS (objRs, objConn)
If isObject (objRs) Then
If LCase(TypeName(objRS)) = "recordset" Then
If objRs.State = 1 Then
objRs.Close
End If
End If
Set objRs = Nothing
End If
If isObject (objConn) Then
If LCase(TypeName(objConn)) = "connection" Then
If objConn.State = 1 Then
objConn.Close
End If
End If
Set objConn = Nothing
End If
End Function
' -- END DATABASE FUNCTIONS
' -- DEFINE RECORD FUNCTION
Function recordStandClicks(hall, stand)
strSQL = "INSERT INTO record_stand (mem_id, hall, stand, login_date) VALUES ('" + cStr(Request.Cookies("uid")) + "','" + hall + "','" + stand + "',curDate())"
objConn.Execute (strSQL)
End Function
Function recordHallClicks(hall)
strSQL = "INSERT INTO record_hall (mem_id, hall, login_date) VALUES ('" + cStr(Request.Cookies("uid")) + "','" + hall + "',curDate())"
objConn.Execute (strSQL)
End Function
Function recordKeynoteClicks(keynote)
strSQL = "INSERT INTO record_keynote (mem_id, keynote, login_date) VALUES ('" + cStr(Request.Cookies("uid")) + "','" + keynote + "',curDate())"
objConn.Execute (strSQL)
End Function
' -- END RECORD FUNCTIONS
' -- DEFINE ARRAY FUNCTIONS
' -- SET ARRAY VARIABLES
Dim intpage ' For Request.QueryString Page Number
Dim arrayData ' Array for objRs.GetRows
Dim arrayDataCount ' For Total Number of Records in Array
Dim i ' For Looping Through Array
Dim rowbgcolor ' For Alternate Rowcolour
rowbgcolor = "#F3F3F3"
Dim intRecordsPerPage ' Number of Records to be displayed per page
Dim intTotalPages ' Total number of Array Records
Dim intFirstRecord ' First record in Array
Dim intLastRecord ' Last record in Array
Dim totalRecords
' -- FUNCTION TO STORE objRS RECORDSET RESULTS IN ARRAY. USAGE = Call arrayGetRows ()
Function arrayGetRows
If not objRs.EOF Then
arrayData = objRs.GetRows
arrayDataCount = UBound (arrayData, 2) + 1
End If
End Function
' -- FUNCTION FOR ARRAY RECORDSET PAGING. USAGE = Call arrayPaging ()
Function arrayPaging
intRecordsPerPage = 20
totalRecords = ubound(arrayData, 2)+1
intTotalpages = int((ubound(arrayData, 2)/intRecordsPerPage)+1)
intFirstRecord = (intPage - 1) * intRecordsPerPage
If intFirstRecord + (intRecordsPerPage - 1) >= ubound(arrayData,2) then
intLastRecord = ubound(arrayData, 2)
Else
intLastRecord = intFirstRecord + (intRecordsPerPage - 1)
End If
End Function
' -- FUNCTION TO ALTERNATE ROW COLOURS. USAGE = Call rowColor ()
Function rowColor
If rowbgcolor = "#F3F3F3" Then
rowbgcolor = "#FFFFFF"
Else
rowbgcolor = "#F3F3F3"
End If
End Function
' -- END ARRAY FUNCTIONS
function chkEmail(theAddress)
' checks for a vaild email
' returns 1 for invalid addresses
' returns 1 for invalid addresses
dim atCnt
chkEmail = 0
' chk length
if len(theAddress) < 5 then
' a@b.c should be the shortest an
' address could be
chkEmail = 1
' chk format
' has at least one "@"
elseif instr(theAddress,"@") = 0 then
chkEmail = 1
' has at least one letter before "@"
elseif instrrev(theAddress,"@") = 1 then
chkEmail = 1
' has at least one "."
elseif instr(theAddress,".") = 0 then
chkEmail = 1
' has no more than 3 chars after last "."
elseif len(theAddress) - instrrev(theAddress,".") > 3 then
chkEmail = 1
' has less than 2 chars after last "."
elseif len(theAddress) - instrrev(theAddress,".") < 2 then
chkEmail = 1
' has no "_" after the "@"
elseif instr(theAddress,"_") <> 0 and _
instrrev(theAddress,"_") > instrrev(theAddress,"@") then
chkEmail = 1
else
' has only one "@"
atCnt = 0
for i = 1 to len(theAddress)
if mid(theAddress,i,1) = "@" then
atCnt = atCnt + 1
end if
next
if atCnt > 1 then
chkEmail = 1
end if
' chk each char for validity
for i = 1 to len(theAddress)
if not isnumeric(mid(theAddress,i,1)) and _
(lcase(mid(theAddress,i,1)) < "a" or _
lcase(mid(theAddress,i,1)) > "z") and _
mid(theAddress,i,1) <> "_" and _
mid(theAddress,i,1) <> "." and _
mid(theAddress,i,1) <> "@" and _
mid(theAddress,i,1) <> "-" then
chkEmail = 1
end if
next
end if
end function
%>
<%
Dim strWebsite
Dim strTitle
strWebsite = "itnetwork365"
strTitle = "ITNetwork365"
%>
<%
Dim strConfirm
Dim strYourName
Dim strBusinessName
Dim strYourEmail
Dim strOptionEmail
' -- CHECK IF CONFIRMED
If Request.QueryString ("con") <> "" Then
strConfirm = Request.QueryString("con")
End If
' -- CHECK IF ERROR
If Request.QueryString ("err") = "1" Then
If Request.QueryString ("yn") <> "" Then
strYourName = Request.QueryString ("yn")
End If
If Request.QueryString ("com") <> "" Then
strBusinessName = Request.QueryString ("com")
End If
If Request.QueryString ("ye") <> "" Then
strYourEmail = Request.QueryString ("ye")
End If
End If
%>
<%= strTitle %> :: Contact Us
<% If strConfirm <> "1" Then %>
Contact
Us
<% If Request.QueryString ("err") = "1" Then %>
<%= Session ("strMessage") %>
<% Session.Contents.Remove ("strMessage") %>
<% End If %>
<% Else %>
Thank you. We will review
your request and contact you as soon as possible.