%
mTitle = "Downloads"
ID = "8"
'ID = TRIM(Request("ID"))
FormPost = TRIM(Request("FormPost"))
cID = TRIM(Request("cID"))
DocumentTypeID = Request.QueryString("DocumentTypeID")
Title = TRIM(Request("Title"))
Author = TRIM(Request("Author"))
mYear = TRIM(Request("Year"))
LanguageID = TRIM(Request("languageid"))
SubjectID = TRIM(Request("subjectid"))
If NOT ISNumeric(ID) Then
ID = 0
End If
If NOT ISNumeric(cID) Then
cID = 0
End If
If FormPost <> "1" Then
ErrorTrap(Top() & "
" & Classification() & Bottom())
Else
ErrorTrap(Top() & Documents() & Bottom())
End If
Function Documents()
'Set fs = CreateObject("Scripting.FileSystemObject")
sql = "SELECT ID, Title, Author, Documentfile, ID, DocumentTypeID, LanguageID, Summary, URL FROM document "
If TRIM(Title) <> "" Then
sql2=sql2 & " Title Like '%" & TRIM(Title) & "%' OR Summary Like '%" & TRIM(Title) & "%' AND "
End If
If TRIM(Author)<>"" Then
sql2=sql2 & " Author Like '%" & TRIM(Author) & "%' AND "
End If
If TRIM(mYear)<>"" Then
sql2=sql2 & " Year Like '%" & TRIM(mYear) & "%' AND "
End If
If ISNumeric(TRIM(LanguageID)) Then
sql2=sql2 & " LanguageID=" & LanguageID & " AND "
End If
If ISNumeric(TRIM(DocumentTypeID)) Then
sql2=sql2 & " DocumentTypeID=" & DocumentTypeID & " AND "
End If
If Len(sql2)>4 Then
sql2=LEFT(sql2,LEN(sql2)-4)
sql=sql & " WHERE " & sql2
End If
sql=sql & " ORDER BY DocumentTypeID, ID DESC;"
Set RS = dba.Execute(sql, RecAffect, 1)
If NOT RS.EOF Then
Str=Str & "
" & PubTop() & " The following publication(s) and/or report(s) fall within the classification you have selected. To search for more specific publications please use the document search engine located at the bottom of this page. |
"
If ISNumeric(TRIM(DocumentTypeID)) Then
'Str=Str & "
" & GetMyField("documenttype", DocumentTypeID) & "
"
Str=Str & "
" & GetMyField("documenttype", DocumentTypeID) & "
"
End If
Str=Str & "
"
Str=Str & ""
Str=Str & ""
mColor = "beige"
Str=Str & "| Title | Author(s) | Language | Classification | "
'Str=Str & "| Title | Author(s) | Language | Classification | "
Do While NOT RS.EOF
If mColor = "#FFF5F4" Then
mColor = "#ffffff"
Else
mColor = "#FFF5F4"
End If
mTemp = ""
mTemp = mTemp & RS(7)
Str=Str & ""
Str=Str & ""
if trim(rs(3)) <> "" Then
Str=Str & "" & RS(1) & ""
'Str=Str & "" & RS(1) & ""
'response.write(server.urlencode(" "))
else
If rs(8) <> "" Then
Str=Str & "" & RS(1) & ""
Else
Str=Str & "" & RS(1) & ""
End If
end if
If TRIM(mTemp) <> "" Then
Str=Str & "
" & putbreaks(mTemp) & " "
End If
Str=Str & " | "
If RS(2) <> "" Then
Str=Str & "" & RS(2) & " | "
Else
Str=Str & " - | "
End If
If ISNumeric(RS(6)) Then
Str=Str & "" & GetMyField("language",RS(6)) & " | "
Else
Str=Str & " - | "
End If
If ISNumeric(RS(5)) Then
Str=Str & "" & GetMyField("documenttype",RS(5)) & " | "
Else
Str=Str & " - | "
End If
Str=Str & " "
RS.MoveNext
LOOP
Str=Str & " |
"
Else
Str=Str & "
No document matches the criteria requested or no documents have been published under this category.
"
End If
Str=Str & DocumentSearch()
Documents = Str
End Function
Function Classification()
sql = "SELECT ID, Title, Description FROM documenttype ORDER BY ID;"
Set RS = dba.Execute(sql, RecAffect, 1)
If NOT RS.EOF Then
Str=Str & "" & PubTop() & " Welcome to our publications depository. To search for more specific publications please use the document search engine located at the bottom of this page. |
"
Str=Str & "
"
Str=Str & ""
Str=Str & ""
mColor = "beige"
Do While NOT RS.EOF
If mColor = "#FFF5F4" Then
mColor = "#ffffff"
Else
mColor = "#FFF5F4"
End If
mTemp = ""
mTemp = mTemp & ""
mTemp = mTemp & RS(2)
ssql = "SELECT Count(*) FROM document WHERE DocumentTypeID=" & RS(0) & ";"
Set RSS = dba.Execute(ssql, RecAffect, 1)
mTotal = RSS(0)
Str=Str & "" & RS(1) & "
" & mTemp & " | " & mTotal & " Document(s) Available | View | "
RS.MoveNext
LOOP
Str=Str & " |
"
End If
Str=Str & DocumentSearch()
Classification = Str
End Function
Function PubTop()
Str=Str & ""
PubTop = Str
End Function
Function DocumentSearch()
Str=Str & ""
DocumentSearch = Str
End Function
%>