<% if session("site") <> "rabex" then %>
<% end if %>
<%
'if session("site") = "rabex" then
' cSQL = "SELECT * FROM categories where id=181 or parent_id=181 ORDER BY categories.main_order, categories.sub_order"
'else
cSQL = "SELECT * FROM categories WHERE [Flash]=False ORDER BY categories.main_order, categories.sub_order"
'end if
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.Open cSQL, objConn, 3, 1, 1 ' Open Source, ActiveConnection, adOpenStatic, adLockReadOnly, adCmdText
dim rabexCategory
rabexCategory = 0
do until objRS.EOF
' BT write code here to only display the top Radiobiology Category on advmedpub.com, but all the categories on rabex.net
if session("site") = "amp" and objRS("ID") = 80 then 'Radiation Oncology (Physics)
exit do
end if
if objRS("id") = 181 then ' Radiobiology
rabexCategory = 1
end if
if objRS("parent_id") = -1 and rabexCategory > 1 then
rabexCategory = 0
end if
if session("site") = "amp" and rabexCategory > 1 then
' do nothing
else
if rabexCategory > 0 then
rabexCategory = rabexCategory + 1
end if
if session("site") = "rabex" and rabexCategory = 0 then
'do nothing
else
if objRS("name") <> "home" then
if objRS("parent_id") = -1 then
response.write ""
end if
if objRS("parent_id") <> -1 then
if objRS("clickable") then
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>"> color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>">><%=Replace(objRS("name"), " ", " ")%> <%
end if
else
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
color=<%=objRS("color")%>> <%=Replace(objRS("name"), " ", " ")%> <%
else %>
> <%=Replace(objRS("name"), " ", " ")%> <%
end if
end if
else
if objRS("clickable") then
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>"> color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>">><%=Replace(objRS("name"), " ", " ")%> <%
end if
else
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
><%=Replace(objRS("name"), " ", " ")%> <%
end if
end if
end if
end if
end if
end if
objRS.MoveNext
loop
%>
|
 |
<%
search_executed = false
if category_id <> "" then
' if we have a category id
'cSQL = "SELECT id, title, title_color, subtitle, editors, authors, ad_graphic, graphic, price FROM books, book_categories WHERE (books.id = book_categories.book_id) And (book_categories.category_id = " & category_id & ") ORDER BY books.title"
cSQL = "SELECT * FROM books, book_categories WHERE (books.id = book_categories.book_id) And (book_categories.category_id = " & clng(category_id) & ") ORDER BY books.title"
elseif request("search") <> "" then
' if the user used the search box
Dim stext
stext = request("search")
stext = replace(stext, "'", "''")
'cSQL = "SELECT id, title, title_color, subtitle, editors, authors, ad_graphic, graphic, price FROM books WHERE title LIKE '%" & stext & "%' OR subtitle LIKE '%" & stext & "%' OR authors LIKE '%" & stext & "%' OR editors LIKE '%" & stext & "%' OR short_description LIKE '%" & stext & "%' OR long_description LIKE '%" & stext & "%' OR keywords LIKE '%" & stext & "%' OR isbn LIKE '%" & stext & "%' ORDER BY books.title"
cSQL = "SELECT * FROM books WHERE title LIKE '%" & stext & "%' OR subtitle LIKE '%" & stext & "%' OR authors LIKE '%" & stext & "%' OR editors LIKE '%" & stext & "%' OR short_description LIKE '%" & stext & "%' OR long_description LIKE '%" & stext & "%' OR keywords LIKE '%" & stext & "%' OR isbn LIKE '%" & stext & "%' ORDER BY books.title"
search_executed = true
category_name = ""
else
'cSQL = "SELECT id, title, title_color, subtitle, editors, authors, ad_graphic, graphic, price FROM books, book_categories WHERE (books.id = book_categories.book_id) And (book_categories.category_id = (SELECT id FROM categories WHERE name = 'home')) ORDER BY books.title"
cSQL = "SELECT * FROM books, book_categories WHERE (books.id = book_categories.book_id) And (book_categories.category_id = (SELECT id FROM categories WHERE name = 'home')) ORDER BY books.title"
end if
Set catRS = Server.CreateObject("ADODB.Recordset")
' Use client cursor to enable AbsolutePosition property.
catRS.CursorLocation = 3 ' adUseClient
catRS.Open cSQL, objConn, , , 1
catRS.PageSize = NumItemsPerPage
Dim intPageCount
intPageCount = catRS.PageCount
' Determine if the user requested a particular page
Dim cur_page
Dim valid_page
cur_page = request.QueryString("page")
intPageCount = catRS.PageCount
' Go to the page the user requested, if it is valid
if IsNumeric(cur_page) And cur_page <> "" then
cur_page = CInt(cur_page)
if cur_page <= intPageCount then
catRS.AbsolutePage = cur_page
valid_page = True
else
catRS.AbsolutePage = 1
valid_page = False
end if
else
valid_page = False
end if
if session("site") = "rabex" then
%>
">
<% end if %>
<%
if search_executed then
' Print out the search text %>
| Search results for "<%=stext%>" | <%
elseif category_name = "home" then %>
| Best Sellers | <%
else
' Print out the category name %>
| <%=category_name%> | <%
end if %>
 |
<%
' Print out the books for this page and category
if (Not (catRS.BOF and catRS.EOF)) And intPageCount > 0 then
For intRecord = 1 To catRS.PageSize
' determine rowspan
Dim rspan
if catRS("editors") = "" and catRS("authors") = "" then
rspan = 5
else
rspan = 6
end if
%>
align=center valign=center>
<%
if catRS("ad_graphic") <> "" then %>
"> <%
end if
'BT 05-06-03 added thumbnails
if catRS("graphic") <> "" then
CreateThumbnail catRS("graphic"), "/bookpictures", "thumbs", "", 50, 50
Response.Write(vbcrlf & "" & vbcrlf)
%>
&cat=<%=server.urlencode(category_name)%>&s=<%= session("site")%>"> " border=0 hspace=15 vspace=5 ONERROR='javascript:this.src="/gif/transpace.gif";'>
<% end if %>
|
|
"><%=catRS("title")%>
|
| "><%=catRS("subtitle")%>!strong> |
<%
if catRS("authors") <> "" then
response.write catRS("authors")
end if
if catRS("editors") <> "" then
response.write " Edited by: " & catRS("editors")
end if
%>
(<% if (not isnull(catRS("retail_price")) and catRS("retail_price")) > 0 then response.write "" & formatcurrency(catRS("retail_price")) & " now " %><%=FormatCurrency(catRS("price"), 2)%>)
|
 |
 |
 |
<%
catRS.MoveNext
If catRS.EOF Then
Exit For
End If
Next
catRS.Close
Set catRS = Nothing %>
 |
<%
' if we got a valid page number from the query string
if valid_page And cur_page > 1 then
' display up to 5 pages on each side of the current page
%>&id=<%=category_id%>&s=<%= session("site")%>">Previous <%
if cur_page > 5 then
i = 5
do until i = 0
%>&id=<%=category_id%>&s=<%= session("site")%>"><%=cur_page - i%> <%
i = i - 1
loop
else
for i = 1 to cur_page - 1
%>&id=<%=category_id%>&s=<%= session("site")%>"><%=i%> <%
next
end if
' display the valid page highlighted
%>&id=<%=category_id%>&s=<%= session("site")%>"><%=cur_page%> <%
' display up to five pages after the current page
if intPageCount > cur_page then
i = cur_page + 1
do until (i > (cur_page + 5)) Or i > intPageCount
%>&id=<%=category_id%>&s=<%= session("site")%>"><%=i%> <%
i = i + 1
loop
end if
if cur_page < intPageCount then
%>&id=<%=category_id%>&s=<%= session("site")%>">Next<%
end if
else ' just print out the first 10 pages, if there are that many
Dim pgcnt
pgcnt = intPageCount
if pgcnt > 10 then
pgcnt = 10
end if
if pgcnt > 1 then
for i = 1 to pgcnt
if i = 1 then %>
&id=<%=category_id%>&s=<%= session("site")%>"><%=i%> <%
else %>
&id=<%=category_id%>&s=<%= session("site")%>"><%=i%> <%
end if
next %>
&id=<%=category_id%>&s=<%= session("site")%>">Next<%
end if ' if page count = 1, then simply display current page
end if %>
|
<%
else '%>
<%
if search_executed then %>
| Sorry, no books currently match your search. However, we are frequently updating our selection, so please try this search again in the future. | <%
else %>
Sorry, there are currently no books in this category. We are frequently updating our selection, so please search this category again in the future. | <%
end if %>
<%
end if %>
|
<% if session("site") <> "rabex" then %>
 |
<% if session("site") <> "rabex" then %>
<% end if %>
<%
'if session("site") = "rabex" then
' cSQL = "SELECT * FROM categories where id=181 or parent_id=181 ORDER BY categories.main_order, categories.sub_order"
'else
cSQL = "SELECT * FROM categories WHERE [Flash]=False ORDER BY categories.main_order, categories.sub_order"
'end if
'Set objRS = Server.CreateObject("ADODB.Recordset")
'objRS.Open cSQL, objConn, 3, 1, 1 ' Open Source, ActiveConnection, adOpenStatic, adLockReadOnly, adCmdText
objRS.movefirst
'dim rabexCategory
rabexCategory = 0
dim clinicalflag
clinicalflag = false
do until objRS.EOF
' BT write code here to only display the top Radiobiology Category on advmedpub.com, but all the categories on rabex.net
' BT 9-24-07 wrote code to dispaly clinical on the righthand side and physical on the left
if session("site") = "amp" and not clinicalflag and objRS("id") = 80 then
clinicalflag = true
end if
if objRS("id") = 181 then ' Radiobiology
rabexCategory = 1
end if
if objRS("parent_id") = -1 and rabexCategory > 1 then
rabexCategory = 0
end if
if session("site") = "amp" and rabexCategory > 1 then
' do nothing
elseif clinicalflag then
if rabexCategory > 0 then
rabexCategory = rabexCategory + 1
end if
if session("site") = "rabex" and rabexCategory = 0 then
'do nothing
else
if objRS("name") <> "home" then
if objRS("parent_id") = -1 then
response.write ""
end if
if objRS("parent_id") <> -1 then
if objRS("clickable") then
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>"> color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>">><%=Replace(objRS("name"), " ", " ")%> <%
end if
else
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
color=<%=objRS("color")%>> <%=Replace(objRS("name"), " ", " ")%> <%
else %>
> <%=Replace(objRS("name"), " ", " ")%> <%
end if
end if
else
if objRS("clickable") then
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>"> color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
&cat=<%=server.urlencode(objRS("name"))%>&s=<%= session("site")%>">><%=Replace(objRS("name"), " ", " ")%> <%
end if
else
if (objRS("color") <> "") And (Not IsNull(objRS("color"))) then %>
color=<%=objRS("color")%>><%=Replace(objRS("name"), " ", " ")%> <%
else %>
><%=Replace(objRS("name"), " ", " ")%> <%
end if
end if
end if
end if
end if
end if
objRS.MoveNext
loop
%>
|
<%
end if ' session("site") <> "rabex"
objRS.close
set objRS = Nothing
objConn.close
set objConn = Nothing
%>