% '----------General section------------ CURRENT_VERSION = ("2001") CURRENT_STYLE = ("../.css") FormAction = ("SidePage.asp") ScriptRelativeFolder = ("WebStore") pos=InstrRev(LCase(Request.ServerVariables("PATH_TRANSLATED")),LCase(ScriptRelativeFolder) & "\" & LCase(FormAction)) BS_Root = Left(Request.ServerVariables("PATH_TRANSLATED"), pos-1 ) DB_Path =BS_Root & "\" ScriptFolderAddress =BS_Root & "\" & ScriptRelativeFolder & "\" URL =Request.ServerVariables("URL") SERVER_NAME=Request.ServerVariables("SERVER_NAME") SERVER_NAME="http://"&SERVER_NAME&URL ScriptRelativeFolder = ("WebStore") pos=InstrRev(LCase(SERVER_NAME),LCase(ScriptRelativeFolder) & "/" & LCase(FormAction)) BS_Root_URL = Left(SERVER_NAME, pos-1) BS_Root_URL = BS_Root_URL & "/" bHeaderFired = FALSE '==========Constants============= '---- CursorTypeEnum Values ---- Const adOpenForwardOnly = 0 Const adOpenKeyset = 1 Const adOpenDynamic = 2 Const adOpenStatic = 3 '---- LockTypeEnum Values ---- Const adLockReadOnly = 1 Const adLockPessimistic = 2 Const adLockOptimistic = 3 Const adLockBatchOptimistic = 4 '=========End of Section=========== '----------Variables section------------ Dim VarArray(4,0) VarNum = 5 'Initialization of Vars Variable_266 = "0" 'Initial value Variable_279 = "products.asp?producttype=" 'Initial value Variable_745 = "" 'Initial value Variable_20 = "IS_SHOP_LOCKED" 'Initial value Variable_21 = "" 'Initial value 'Subroutins and functions Sub PushVars() VarArray(0,0)=Variable_266 VarArray(1,0)=Variable_279 VarArray(2,0)=Variable_745 VarArray(3,0)=Variable_20 VarArray(4,0)=Variable_21 end sub Sub PopVars() end sub Sub RestoreVars() Variable_266=VarArray(0,0) Variable_279=VarArray(1,0) Variable_745=VarArray(2,0) Variable_20=VarArray(3,0) Variable_21=VarArray(4,0) end sub '----------Cookie section------------ if Request.Cookies("WS_Visitors_99")("WS_VisitorID")= "" Then Cookie_910 = "" 'Empty else Cookie_910 = Request.Cookies("WS_Visitors_99")("WS_VisitorID") end if 'Functions that in the future should be placed in stanalone .INC File 'Function to format date string Function format_date(date,dataformat) months =Array("January","February","March","April","May","June","July","August","September","October","November","December") mon = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec") 'dd-MMM-yyyy = 0 'MM/dd/yyyy = 1 'dd MMMM,yyyy = 2 'MMMM dd,yyyy = 3 daypart = Day(date) monthpart = Month(date) yearpart = Year(date) monthpart = monthpart -1 if(dataformat = 0) then format_date = daypart & " " & mon(monthpart) & "," & yearpart end if if(dataformat = 1) then format_date = monthpart & "-" & daypart & "-" & yearpart end if if(dataformat = 2) then format_date = daypart & " " & months(monthpart) & "," & yearpart end if if(dataformat = 3) then format_date = months(monthpart) & " " & daypart & "," & yearpart end if end Function 'Function to format time string Function format_time(date,dataformat) hourpart = Hour(date) minutepart = Minute(date) secondpart = Second(date) format_time = hourpart & ":" & minutepart & ":" & secondpart end Function '----------Start Algorithm section------------ %> <% '==============Query_2("shopDB")================ DataSource1 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ= "& DB_Path &"WebStore/Databases/ShopDB.mdb;" PageSize1 = 1 GeneratedSQL= "SELECT CompanyInfo.MerchantID as QueryOutput_242"_ &" FROM CompanyInfo" %> <%'===============Execute Query And Get Total Count======================== Set Conn1 = Server.CreateObject("ADODB.Connection") Set RS1 = Server.CreateObject("ADODB.RecordSet") RS1.CursorType = adOpenStatic Conn1.Open DataSource1 RS1.Open GeneratedSQL,Conn1,adOpenKeyset,adLockReadOnly 'both keys are to be variables TotalCount1=RS1.RecordCount RS1.PageSize = PageSize1 'Number of rows per page ScrollAction = Request("_NavAction1") if ScrollAction <> "" Then PageNo1 = mid(ScrollAction, 5) if PageNo1 < 1 Then PageNo1 = 1 end if else PageNo1 = 1 end if 'set the page number on which the current record is located. if(TotalCount1 <> 0) then RS1.AbsolutePage = PageNo1 'Page Number end if FromRec1=(PageNo1-1)*PageSize1 +1 if PageNo1*PageSize1 > TotalCount1 Then ToRec1 = TotalCount1 else ToRec1 = PageNo1*PageSize1 end if URLTail1 = "" FNavAhead1 = "Next" FNavBack1 = "Previous" FLinkAhead1 = FormAction & "?_NavAction1=Page" & (PageNo1+1)& URLTail1 FLinkBack1 = FormAction & "?_NavAction1=Page" & (PageNo1-1)& URLTail1 %><%RowCount1 = rs1.PageSize CurrentRecordNumber1 = 0 bSetBegin1 = TRUE Do While Not RS1.EOF and rowcount1 > 0 QueryOutput_242 = rs1.fields("QueryOutput_242") %><%Variable_20=Variable_20&QueryOutput_242%> <%'----------------End Repetition Section------------------------------- RowCount1 = RowCount1 - 1 CurrentRecordNumber1 = CurrentRecordNumber1 + 1 RS1.MoveNext Loop %><% Conn1.Close set rs1 = nothing set Conn1 = nothing %> <%Variable_21 = Application(Variable_20) %><%if(Variable_21 = "SHOP_LOCKED") Then%> <%Response.Redirect "Sorry.asp"%><%else%> <%end if%><% '==============Query_23("shopDB")================ DataSource1 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ= "& DB_Path &"WebStore/Databases/ShopDB.mdb;" PageSize1 = 1 GeneratedSQL= "SELECT ProductCategories.Type as QueryOutput_4,ProductCategories.ID as QueryOutput_5"_ &" FROM ProductCategories" %> <%'===============Execute Query And Get Total Count======================== Set Conn1 = Server.CreateObject("ADODB.Connection") Set RS1 = Server.CreateObject("ADODB.RecordSet") RS1.CursorType = adOpenStatic Conn1.Open DataSource1 RS1.Open GeneratedSQL,Conn1,adOpenKeyset,adLockReadOnly 'both keys are to be variables TotalCount1=RS1.RecordCount if(TotalCount1 > 0) then RS1.PageSize = TotalCount1 'All records PageSize1 = TotalCount1 'All records end if ScrollAction = Request("_NavAction1") if ScrollAction <> "" Then PageNo1 = mid(ScrollAction, 5) if PageNo1 < 1 Then PageNo1 = 1 end if else PageNo1 = 1 end if 'set the page number on which the current record is located. if(TotalCount1 <> 0) then RS1.AbsolutePage = PageNo1 'Page Number end if FromRec1=(PageNo1-1)*PageSize1 +1 if PageNo1*PageSize1 > TotalCount1 Then ToRec1 = TotalCount1 else ToRec1 = PageNo1*PageSize1 end if URLTail1 = "" FNavAhead1 = "Next" FNavBack1 = "Previous" FLinkAhead1 = FormAction & "?_NavAction1=Page" & (PageNo1+1)& URLTail1 FLinkBack1 = FormAction & "?_NavAction1=Page" & (PageNo1-1)& URLTail1 %><%if (bHeaderFired = FALSE) then%>