%@LANGUAGE="VBSCRIPT"%>
<%
'Let's get the section
Section = Request.QueryString("Section")
'Let's temporary redirect the server pages based on the section the user is visiting
If Len(Section) > 0 Then
Response.Redirect("http://www.myimportstore.com/index.asp?Section="&Section)
Else
Response.Redirect("http://www.myimportstore.com")
End If
Page = Request.QueryString("Page")
Ref = Request.QueryString("Ref")
'Initialise FS as the default store / Not used for the time being
'If len(SiteName) = 0 then
'SiteName = "myfs"
'End If
'Initialise the cookie to write based on referenced link
If len(Ref) > 0 And Len(Session("Ref")) = 0 then
Response.cookies("FSStore")("Ref") = Ref
Response.cookies("FSStore").expires = Date + 30
Session("Ref") = Ref
ElseIf len(Ref) = 0 And Request.cookies("FSStore").count = 1 And Len(Session("Ref")) = 0 Then
Session("Ref") = Request.cookies("FSStore")("Ref")
End if
'Let's open the database
Set Con = Server.CreateObject("ADODB.Connection")
Con.open DBName
'Get universal variables (items to load per page & currency symbol)
Set RS2 = Con.execute("Select Items_Per_Page, Currency_Symbol from Variables")
Offset = RS2("Items_Per_Page")
'Load index store page / featured section if no section is indicated
If len(Section) = 0 or Section = "Featured" then
'Let's count how many items there are to load, split them to different pages
'And calculate how many pages to load
NumOfItems = countItems(DBName, "Items", "Where Featured_Item = 1")
NumOfPages = countPages(NumOfItems, Offset)
'Check whether there are more pages to load
PageNav = makePageNav(NumOfPages, "Featured")
'Let's create the body header
BodyHeader = "Final Fantasy, Naruto & Anime Featured Items"
'Load page 1 details
If Page < 2 Then
'Load the first page (Featured Items)
Set RS = Con.execute("Select Top "&Offset&" * from Items Where Featured_Item = 1 Order by Item_Position Asc")
'Load pages bigger than 1
Else
RSMoveFigure = (Page * Offset) - Offset
ItemsLoaded = Page * Offset
Set RS = Con.execute("SELECT Top "&ItemsLoaded&" * FROM Items WHERE Featured_Item = 1 ORDER BY Item_Position ASC;")
'Move to record
RS.move RSMoveFigure
End If
'Start store edit / handle the new items section
ElseIf Section = "New" Then
'Let's count how many items there are to load, split them to different pages
'And calculate how many pages to load
NumOfItems = countItems(DBName, "Items", "Where New_Item = 1")
NumOfPages = countPages(NumOfItems, Offset)
'Check whether there are more pages to load
PageNav = makePageNav(NumOfPages, "New")
'Let's create the body header
BodyHeader = "New Items & Products"
'Load page 1 details
If Page < 2 Then
'Load the first page (Featured Items)
Set RS = Con.execute("Select Top "&Offset&" * from Items Where New_Item = 1 Order by Item_Position Asc")
'Load pages bigger than 1
Else
RSMoveFigure = (Page * Offset) - Offset
ItemsLoaded = Page * Offset
Set RS = Con.execute("SELECT Top "&ItemsLoaded&" * FROM Items WHERE New_Item = 1 ORDER BY Item_Position ASC;")
'Move to record
RS.move RSMoveFigure
End If
'End Store Edit (New Items 18 Sept 2005
'Handle all other sections / This is the most buggy part
Else
'Count variables
NumOfItems = countItems(DBName, "Items", "Where Category = "&Section&" And Display = 1 And Category = "&Section&"")
NumOfPages = countPages(NumOfItems, Offset)
PageNav = makePageNav(NumOfPages, Section)
'Let's create the body header
Set RS = Con.execute("Select Name, Description from Categories Where ID = "&Section&"")
BodyHeader = RS("Name")
CatDescription = RS("Description")
'Load the first page
If Page < 2 Then
Set RS = Con.execute("Select Top "&Offset&" * From Items Where Category = "&Section&" AND Display = 1 AND Category = "&Section&" ORDER BY Featured_Item DESC, Stock_Level DESC, Backorder_Status DESC, Item_Position ASC;")
Else
'14 July 03 4:45 pm / Hope it works this time
RSMoveFigure = (Page * Offset) - Offset
ItemsLoaded = Page * Offset
'Response.write "
RSMoveFigure: " & RSMoveFigure
Set RS = Con.execute("SELECT Top "&ItemsLoaded&" * FROM Items WHERE Category = "&Section&" AND Display = 1 AND Category = "&Section&" ORDER BY Featured_Item DESC, Stock_Level DESC, Backorder_Status DESC, Item_Position ASC;")
'Move to record
RS.move RSMoveFigure
End If
End If
'Let's create the main header
Output = "
| "&RS("Name")&""& myPopularText &" "&RS("Description")&" Original Price: | |
| "&RS("Name")&""& myPopularText &" "&RS("Description")&" Status: "&StatusText&" | |
| "&RS("Name")&""& myPopularText &" "&RS("Description")&" Status: "&StatusText&" | |
| "&RS("Name")&" "&RS("Description")&" "&RS2("Currency_Symbol") & FormatNumber(RS("Price"), 2)&" | |
| "&RS("Name")&" "&RS("Description")&" "&RS2("Currency_Symbol") & FormatNumber(RS("Price"), 2)&" |
"
while not CatModule.eof
CatMenu = CatMenu & "» " & "" & CatModule("Name") & "
"
CatModule.moveNext
wend
'Let's kill all sessions
Con.close
Set RS = Nothing
Set RS2 = Nothing
%>
![]() |
|||||||||||||||
|
|
|||||||||||||||
|
|
![]() |
|
|||||||||||||
|
|
|||||||||||||||
|
|
|
|
|
||||||||||||
![]() |
|||||||||||||||
|
|
|
|
|
|
|
|
|
|
|||||||