%@ LANGUAGE="VBSCRIPT" %>
<%
'*****************************************************************************************
' QNguyen 5/02/05 Modified to allow search by applications.
' QNguyen 8/18/05 Removed distinct from applications doc SQL statement
' QNguyen 8/23/05 Change hard coded "Source Code" header string to doctype value
' in child row.
' QNguyen 8/24/05 Modified to use applications doc SQL statement only.
' QNguyen 9/20/05 Removed Hardcopy link.
' QNguyen 3/08/06 Resolved associated docs not being displayed issue.
' (i.e., removed parent is null criteria)
'*****************************************************************************************
'5/02/05
dim blnAPPDOC, blnResults
blnAPPDOC = Request.QueryString("APPDOC")
blnResults = false
dim products
dim docTypes
dim fams
dim docType
dim ordDate, ordSize, ordTitle, ordDocNo
dim oTogg
dim OSimg, ODimg, OTimg, ODNimg
dim oTStr, oDStr, oFStr, oDNStr
dim tMap, oMap, dMap, dnMap
fams = Request.QueryString("FAM")
docType = Request.QueryString("DT")
ordDate = Request.QueryString("OD")
ordSize = Request.QueryString("OS")
ordTitle = Request.QueryString("OT")
ordDocNo = Request.QueryString("DN")
oDNStr = ""
oTStr = ""
oDStr = ""
oFStr = ""
oTogg = "1"
Select Case ordDocNo
Case "0"
oDNStr = " desc"
oTogg = "1"
ODNimg = "
"
dnMap = ""
Case "1"
oDNStr = " asc"
oTogg = "0"
ODNimg = "
"
dnMap = ""
Case Else
ODNimg = "
"
dnMap = ""
dnMap = dnMap & ""
End Select
Select Case ordTitle
Case "0"
oTStr = ", title desc"
oTogg = "1"
OTimg = "
"
tMap = ""
Case "1"
oTStr = ", title asc"
oTogg = "0"
OTimg = "
"
tMap = ""
Case Else
OTimg = "
"
tMap = ""
tMap = tMap & ""
End Select
Select Case ordSize
Case "0"
oFStr = ", filesize desc"
oTogg = "1"
OSimg = "
"
oMap = ""
Case "1"
oFStr = ", filesize asc"
oTogg = "0"
OSimg = "
"
oMap = ""
Case Else
OSimg = "
"
oMap = ""
oMap = oMap & ""
End Select
Select Case ordDate
Case "0"
oDStr = ", rUpdate desc"
oTogg = "1"
ODimg = "
"
dMap = ""
Case "1"
oDStr = ", rUpdate asc"
oTogg = "0"
ODimg = "
"
dMap = ""
Case Else
ODimg = "
"
dMap = ""
dMap = dMap & ""
End Select
'5/02/05
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Provider = "MSDataShape"
oConn.Open strConnWebDB
'if blnAPPDOC <> "true" then
if false then
'docStr = "SHAPE {Select docid, docno, doctype, title, updatedate, filesize, " _
' & "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new from v_AllDocs " _
' & "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _
' & "and isnull(parent, 0) = 0 " _
' & "order by priority, familyshortname, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _
' & "APPEND ({Select docid, docno, doctype, title, updatedate, filesize, " _
' & "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new from v_AllDocs " _
' & "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _
' & "and not isnull(parent, 0) = 0 " _
' & "order by priority, familyshortname, doctype, docno} " _
' & "AS oRSDocs " _
' & "RELATE docid TO parent)"
docStr = "SHAPE {Select docid, docno, doctype, title, updatedate, filesize, " _
& "filetype, parent, businessunitname, familyid, familyshortname, filepath, priority, new, longdesc from v_AllDocs " _
& "where familyid in (" & fams & ") and doctypeid in (" & docType & ") " _
& "and isnull(parent, 0) = 0 " _
& "and docid = "&Request.QueryString("id") _
& "order by priority, familyshortname, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _
& "APPEND ({Select a.docid, a.docno, a.doctype, a.title, a.updatedate, a.filesize, " _
& "a.filetype, a.parent, a.businessunitname, a.familyid, a.familyshortname, " _
& "a.filepath, a.priority, a.new, a.longdesc, b.docid from v_AllDocs a, v_AllDocs b " _
& "where a.familyid in (" & fams & ") and a.doctypeid in (" & docType & ") " _
& "and a.parent = ? " _
& "and a.parent = b.docid " _
& "and a.familyid = b.familyid " _
& "order by a.priority, a.familyshortname, a.doctype, a.docno, a.docid} " _
& "AS oRSDocs " _
& "RELATE docid TO PARAMETER 0)"
Set oRs = Server.CreateObject("ADODB.Recordset")
oRs.Open docStr, oConn, adOpenDynamic, , adCmdText
else
'5/02/05
dim strAppDocSQL, objAppDocRs, strApps, strAppID
'strApps = Request.QueryString("APP")
strAppID = Request.QueryString("APP_ID")
strAppDocSQL = "SHAPE {Select docid, docno, doctype, title, updatedate, filesize, " _
& "filetype, parent, app_id, app_name, filepath, new, longdesc from v_AllDocs_App " _
& "where doctypeid in (" & docType & ") " _
& "and docid = "&Request.QueryString("id") _
& "order by app_name, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _
& "APPEND ({Select a.docid, a.docno, a.doctype, a.title, a.updatedate, a.filesize, " _
& "a.filetype, a.parent, a.app_name, a.app_id, " _
& "a.filepath, a.new, a.longdesc, b.docid from v_AllDocs_App a, v_AllDocs_App b " _
& "where a.doctypeid in (" & docType & ") " _
& "and a.parent = ? " _
& "and a.parent = b.docid " _
& "order by a.app_name, a.doctype, a.docno, a.docid} " _
& "AS objAppDocRSDocs " _
& "RELATE docid TO PARAMETER 0)"
'strAppDocSQL = "SHAPE {Select distinct docid, docno, doctype, title, updatedate, filesize, " _
' & "filetype, parent, app_id, app_name, filepath, new, longdesc from v_AllDocs_App " _
' & "where app_id in (" & strAppID & ") and doctypeid in (" & docType & ") " _
' & "and docid not in (select secdocid from docassociations) " _
' & "and isnull(parent, 0) = 0 " _
' & "and docid = "&Request.QueryString("id") _
' & "union " _
' & "select distinct ad.docid, ad.docno, ad.doctype, ad.title, ad.updatedate, ad.filesize, " _
' & "ad.filetype, ad.parent, a.app_id, a.name AS app_name, ad.filepath, ad.new, ad.longdesc " _
' & "from v_allDocs_App ad inner join t_ref_design_docs rdd " _
' & "on ad.docid = rdd.docid " _
' & "inner join t_ref_design rd " _
' & "on rdd.ref_id = rd.ref_id " _
' & "inner join t_application a " _
' & "on rd.app_id = a.app_id " _
' & "where a.app_id in (" & strAppID & ") and doctypeid in (" & docType & ") " _
' & "and ad.docid not in (select secdocid from docassociations) " _
' & "and isnull(ad.parent, 0) = 0 " _
' & "and ad.docid = "&Request.QueryString("id") _
' & "order by app_name, doctype" & oFStr & oDStr & oTStr & ", docno" & oDNStr & "} AS ParentData " _
' & "APPEND ({select docid, docno, doctype, title, updatedate, filesize, " _
' & " filetype, parent, filepath, new, longdesc " _
' & " from v_allDocs_App where docid in " _
' & " (select docid from t_ref_design_docs " _
' & " where docid in (select secdocid from docAssociations)) " _
' & "order by doctype, docno} " _
' & "AS objAppDocRSDocs " _
' & "RELATE docid TO parent)"
Set objAppDocRs = Server.CreateObject("ADODB.Recordset")
objAppDocRs.Open strAppDocSQL, oConn, adOpenDynamic, , adCmdText
end if
'
' Get reference design info
'
Set oConn2 = Server.CreateObject("ADODB.Connection")
oConn2.Open strConnWebDB
set objRefRs = Server.CreateObject("ADODB.Recordset")
'strRefSQL = "exec sp_get_ref_design " & Request.QueryString("id")
strRefSQL = "select rd.ref_id, rd.name, rd.description, rd.partno, rd.long_description " _
& "from t_ref_design_docs rdd join t_ref_design rd " _
& "on rdd.ref_id = rd.ref_id " _
& "where rdd.docid = " & Request.QueryString("id") _
& "order by rd.name"
objRefRs.Open strRefSQL, oConn2 ,adOpenForwardOnly
%>
Documentation Search Results
<%
Response.Write("" & vbCrLf)
%>
|
Documentation
|
|
Search Results
|
|
|

|
|
<% 'If blnAPPDOC <> "true" then
If false then
If Not oRs.EOF Then ' Display product search results. %>
<%
blnResults = true
setFlag = 0
BLFirst = ""
PFFirst = ""
DTFirst = ""
DFirst = ""
oRs.MoveFirst
RowCount = 0
'Do While Not oRs.EOF
docno = oRs.Fields("docno")
famID = oRs.Fields("familyid")
title = oRs.Fields("title")
longdesc = oRs.Fields("longdesc")
BLCurrent = oRs.Fields("BusinessUnitName")
If BLFirst <> BLCurrent Then
If PFFirst <> "" AND BLFIRST <> BLCurrent AND setFlag <> 1 Then %>
|
<% setFlag = 1
End If
BLFirst = BLCurrent %>
<%
End IF
PFCurrent = oRs.Fields("FamilyShortName")
If PFFirst <> PFCurrent Then
If PFFirst <> "" AND BLFIRST = BLCurrent AND setFlag <> 1 Then %>
<% End If
setFlag = 0
PFFirst = PFCurrent %>
| <%= oRs.Fields("DocType")%> |
<% If DTFirst = oRs.Fields("DocType") AND RowCount <> 0 Then %>
| Doc ID | Title | Updated | File Type | Size (KB) |
<% End If
End If
DTCurrent = oRs.Fields("DocType")
If DTFirst <> DTCurrent Then
DTFirst = DTCurrent %>
| Doc ID | Title | Updated | File Type | Size (KB) |
<%
End If
DCurrent = oRs.Fields("DocID")
If DFirst = DCurrent Then
'DFirst = DCurrent %>
<%
If RowCount MOD 2 = 0 Then 'Even Row
thisColor = "#FFFFFF"
Else 'Odd Row
thisColor = "#EDEDED"
End If
%>
| <%=UCASE(docno)%> |
"><%=title%> |
<%=oRs.Fields("updatedate")%> |
"><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %> |
<%=oRs.Fields("filesize")%> |
<%
End If
' New Stuff
If DFirst <> DCurrent Then
DFirst = DCurrent %>
<%
If RowCount MOD 2 = 0 Then 'Even Row
thisColor = "#FFFFFF"
Else 'Odd Row
thisColor = "#EDEDED"
End If
%>
| <%=UCASE(docno)%> |
"><%=title%> |
<%=oRs.Fields("updatedate")%> |
"><% Call getPic(oRs.Fields("fileType"),oRs.Fields("new")) %> |
<%=oRs.Fields("filesize")%> |
<%
End If
' New Stuff
RowCount = RowCount + 1
'oRs.MoveNext
'Loop
%>
|
|
<%
Set oRSChild = oRS("oRSDocs").Value
If Not oRSChild.EOF Then
%>
| Doc ID | Title | Updated | File Type | Size (KB) |
<%
'Set oRSChild = oRS("oRSDocs").Value
'childFirst = ""
Do While Not oRSChild.EOF
LongDescSC = oRsChild("longdesc")
If PFCurrent = oRsChild("FamilyShortName") Then
%>
| <%=UCASE(oRSChild("docno"))%> |
<%if not isnull(LongDescSC) and len(LongDescSC)>0 then %> <% end if %>"><%=oRSChild.Fields("title")%> |
<%=oRSChild.Fields("updatedate")%> |
"><% Call getPic(oRSChild.Fields("fileType"),oRSChild.Fields("new")) %> |
<%=oRSChild.Fields("filesize")%> |
|
|
<% End If
oRSChild.MoveNext
Loop
oRSChild.Close
%>
|
|
<%
End If
oRs.Close
Set oRs = Nothing
oConn.Close
end if
end if
'5/02/05 - Display application search results.
'If blnAPPDOC="true" then
if true then
If Not objAppDocRs.EOF Then
blnResults = true
objAppDocRs.MoveFirst
RowCount = 0
docno = objAppDocRs.Fields("docno")
title = objAppDocRs.Fields("title")
longdesc = objAppDocRs.Fields("longdesc")
%>
| <%= objAppDocRs.Fields("DocType")%> |
<%
Set oRSChild = objAppDocRs("objAppDocRSDocs").Value
If Not oRSChild.EOF Then
%>
<%
End If
objAppDocRs.Close
set objAppDocRs = nothing
oConn.Close
end if
end if
%>
<% ' Display reference designs
If Not objRefRs.EOF Then %>
| Reference Design | Description | Product |
<%
RefFirst = ""
objRefRs.MoveFirst
RowCount = 0
Do While Not objRefRs.EOF
RefCurrent = objRefRs("ref_id")
LongDescRef = objRefRs("long_description")
If cstr(RefFirst) <> cstr(RefCurrent) Then
RefFirst = RefCurrent
'' Set row colors based on odd even
If RowCount MOD 2 = 0 Then
thisColor = "#FFFFFF"
Else
thisColor = "#EDEDED"
End If
%>
<% End If
RowCount = RowCount + 1
objRefRs.MoveNext
Loop
objRefRs.Close
%>
|
|
<%
Set objRefRs = Nothing
End If
%>
|
<%
if blnResults=false then '5/02/05 - If no results were returned %>
The Search Returned No Results. Please try again.
<%
end if
%>
|