Source:
|
<%=Rptaxon("Refcache")%>
|
<% if (len (Rptaxon("IdInSource")) > 0) then %>
MCL No.:
|
<%=Rptaxon("IdInSource")%>
|
<%end if%>
Name:
|
<%=NameA(6)%>
|
<% if len(NameA(2)) > 0 then %>
Nomencl. ref.: |
<%=NameA(2)%> |
<%end if %>
<% if len(NameA(3)) > 0 then %>
Nomencl. status(es): |
<% = NameA(3)%> |
<%end if %>
<%
'---------------- Rank -------------------------------------------------------------------
%>
Rank: |
<%=Rptaxon("Rank")%> |
<%
' ---------------------------- NAME RELATIONS --------------------------------------------------------------------------
%>
<%
' ---------------------------- RELATED TO ------------------------------------------------------------
'Is this name related to another name ? (e.g. this is basionym of that)
SQL=" SELECT NameFrom.NameId, NameTo.NameId AS NameIdTo, NameTo.FullNameCache, RelName.RelNameQualifierFk relQualFk, RelNameQualifier.RelNameQualifier " & _
" FROM Name NameFrom INNER JOIN Name NameTo INNER JOIN RelName ON NameTo.NameId = RelName.NameFk2 ON NameFrom.NameId = RelName.NameFk1 " & _
" INNER JOIN RelNameQualifier On RelNameQualifier.RelNameQualifierId = RelName.RelNameQualifierFk " & _
" WHERE (NameFrom.NameId="& Request("NameId")& ")"
'MCL specific
'no basionyms and no syn. subst.
SQL=SQL & " AND RelName.RelNameQualifierFk <> 1 AND RelName.RelNameQualifierFk <> 3 "
Set RRelTo = Server.CreateObject("ADODB.Recordset")
openRecordset RRelTo, SQL
While (NOt RRelTo.EOF)
%>
<%=RRelTo("RelNameQualifier")& ":"%> |
">
<%=RRelTo("FullNameCache")%> |
<%
RRelTo.moveNext
WEnd
RRelTo.close
set RRelTo=Nothing
' ---------------------------- RELATED FROM ------------------------------------------------------------
'IS a name related to this name ?
SQL=" SELECT NameTo.NameId, NameFrom.NameId AS NameIdFrom, NameFrom.FullNameCache, RelName.RelNameQualifierFk relQualFk " & _
" FROM Name NameFrom INNER JOIN Name NameTo INNER JOIN RelName ON NameTo.NameId = RelName.NameFk2 ON NameFrom.NameId = RelName.NameFk1 " & _
" WHERE (NameTo.NameId="& Request("NameId")& ")"
'MCL specific
'no basionyms and no syn. subst.
SQL=SQL & " AND RelName.RelNameQualifierFk <> 1 AND RelName.RelNameQualifierFk <> 3 "
Set RRelFrom = Server.CreateObject("ADODB.Recordset")
openRecordset RRelFrom, SQL
While (NOt RRelFrom.EOF)
%>
<%=getNameRelation(RRelFrom("relQualFk")) & ":"%> |
">
<%=RRelFrom("FullNameCache")%> |
<%
RRelFrom.moveNext
WEnd
RRelFrom.close
set RRelFrom=Nothing
' ------------------ STATUS OF TAXON ----------------------------------------------------
%>
Status: |
<%if Rptaxon("StatusFk")=1 then%>
<%else%>
<%end if%>
<%
' If the DoubtfulFlag is set to d then show a PRELIMARY text in fron of the status
if Rptaxon("DoubtfulFlag")="d" then%>PRELIMINARY<% end if %>
<%=ucase(Rptaxon("Status"))%> |
<%
'--------------HIERARCHY----------------------------------------------------------------------------
' See where this taxon is included.
'only check hierarchy if the PTaxon is accepted, if not it is not supposed to be linked to anything (integrity rule)
if Rptaxon("StatusFk")=1 then
'First we will store in an array all the hierarchy in inverse order, then they will be shown. This array will
' be three dimensional, the first dimension will store the nameid, the second the refid and the tirth
' the namecache field. The very first is an index.
nameid=Rptaxon("PTNameFk")
refid=Rptaxon("PTRefFk")
ReDim hierarchy(3,0)
control=1
cont=0
While control=1
SQL="SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk, Name.NameCache, Name.FullNameCache, Reference.RefCache, Name.Notes AS NameNotes, Rank.Rank"&_
" FROM (PTaxon AS PTaxon_1 INNER JOIN Name ON PTaxon_1.PTNameFk = Name.NameId) INNER JOIN (PTaxon INNER JOIN RelPTaxon ON (PTaxon.PTNameFk = RelPTaxon.PTNameFk1) AND (PTaxon.PTRefFk = RelPTaxon.PTRefFk1)) ON (PTaxon_1.PTNameFk = RelPTaxon.PTNameFk2) AND (PTaxon_1.PTRefFk = RelPTaxon.PTRefFk2) INNER JOIN Reference ON PTaxon_1.PTRefFk = Reference.RefId INNER JOIN Rank ON Name.RankFk = Rank.RankId"&_
" WHERE (((PTaxon.PTNameFk)="&nameid&") AND ((PTaxon.PTRefFk)="&refid&") AND ((RelPTaxon.RelQualifierFk)=1)) ORDER BY Name.NameCache"
Set Rherar = Server.CreateObject("ADODB.Recordset")
openRecordset Rherar, SQL
if Rherar.Recordcount > 0 then
nameid=Rherar("PTNameFk")
refid=Rherar("PTRefFk")
Redim Preserve hierarchy(3,cont)
hierarchy(0,cont)=nameid
hierarchy(1,cont)=refid
'Show the reference as "sec." when the reference is different from the one using the potential taxon
if Rherar("PTRefFk")<> refid then
hierarchy(2,cont)=""&Rherar("FullNameCache") & " sec. " & Rherar("RefCache")
else
hierarchy(2,cont)=""&Rherar("FullNameCache") & ""
end if
hierarchy(3,cont)=Rherar("Rank")
cont=cont+1
else
nameid=""
refid=""
control=0
end if
Rherar.close
set Rherar=Nothing
Wend
If hierarchy(0,0)<>"" then
%>
Taxonomy (this taxon is included in): |
<%
col=0
for i=ubound(hierarchy,2) to 0 step -1
%>
<%=hierarchy(3,i)%> - <%=hierarchy(2,i)%> <%for c=0 to col%> <%next%>
<%
col=col+1
next %>
|
<%
end if
Redim hierarchy(0)
hierarchy(0)=""
end if
%>
<%'-------------------- ACCEPTED NAME -----------------------------------------------------------------------
' If the taxon is a synonymum find the accepted name.
if Rptaxon("StatusFk") = 2 then
SQL= "SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk, Name.NameCache, Name.FullNameCache, Name.Notes AS NameNotes" & _
" FROM (PTaxon AS PTaxon_1 INNER JOIN Name ON PTaxon_1.PTNameFk = Name.NameId) INNER JOIN (PTaxon INNER JOIN RelPTaxon ON (PTaxon.PTNameFk = RelPTaxon.PTNameFk1) AND (PTaxon.PTRefFk = RelPTaxon.PTRefFk1)) ON (PTaxon_1.PTNameFk = RelPTaxon.PTNameFk2) AND (PTaxon_1.PTRefFk = RelPTaxon.PTRefFk2)" & _
" WHERE (((PTaxon.PTNameFk)="&Rptaxon("PTNameFk")&") AND ((PTaxon.PTRefFk)="&Rptaxon("PTRefFk")&") AND ((RelPTaxon.RelQualifierFk) in (2, 4, 5, 6, 7))) ORDER BY Name.NameCache"
Set Racc = Server.CreateObject("ADODB.Recordset")
openRecordset Racc, SQL
if Racc.Recordcount>0 then
contador=0
While NOT Racc.EOF
contador=contador+1
%>
<%if contador=1 then%>
Synonym of:
<%end if%> |
&PTRefFk=<%=Racc("PTRefFk")%>"><%=Racc("FullNameCache")%> |
<%
Racc.Movenext
Wend
Racc.Close
set Racc=Nothing
end if
end if
%>
<%'----------------- SYNONYMS -------------------------------------------------------------------------------------------
'Look for synonyms only if the potential taxon is accepted. SYNONYMS
if Rptaxon("StatusFk")=1 then
SQL= _
" SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk AS PTRefFk_s, Name.NameCache, Name.FullNameCache, Name.Notes AS NameNotes, Name.UnnamedNamePhrase, PTaxon.PTRefFk AS PTRefFk, RelPTQualifier.RelPTQualifier "&_
" FROM (PTaxon AS PTaxon_1 INNER JOIN (PTaxon INNER JOIN RelPTaxon ON (PTaxon.PTNameFk = RelPTaxon.PTNameFk2) AND (PTaxon.PTRefFk = RelPTaxon.PTRefFk2)) ON (PTaxon_1.PTNameFk = RelPTaxon.PTNameFk1) AND (PTaxon_1.PTRefFk = RelPTaxon.PTRefFk1)) INNER JOIN Name ON PTaxon_1.PTNameFk = Name.NameId INNER JOIN RelPTQualifier ON RelPTaxon.RelQualifierFk = RelPTQualifier.RelPTQualifierId " & _
" WHERE (((PTaxon.PTNameFk)="&Rptaxon("PTNameFk")&") AND ((PTaxon.PTRefFk)="&Rptaxon("PTRefFk")&") AND ((RelPTaxon.RelQualifierFk) in (2,4,5,6,7))) ORDER BY RelPTQualifier.RelPTQualifier DESC,Name.RankFk, Name.NameCache"
Set Rsyn = Server.CreateObject("ADODB.Recordset")
openRecordset Rsyn, SQL
if Rsyn.Recordcount>0 then
contador=0
syn_rel=""
While NOT Rsyn.EOF
contador=contador+1
%>
<%if contador=1 or syn_rel<>Rsyn("RelPTQualifier") then%>
<%=ucase(left(Trim(Replace(Replace(Rsyn("RelPTQualifier"),"is",""),"of","")),1))&right(Trim(Replace(Replace(Rsyn("RelPTQualifier"),"is",""),"of","")),len(Trim(Replace(Replace(Rsyn("RelPTQualifier"),"is",""),"of","")))-1)&"(s):"%>
<%end if%>
|
&PTRefFk=<%=Rsyn("PTRefFk_s")%>"><%=Rsyn("FullNameCache")%> |
<%
syn_rel=Rsyn("RelPTQualifier")
Rsyn.Movenext
Wend
Rsyn.Close
set Rsyn=Nothing
end if
end if
%>
<%'------------------------MISAPPLIED NAMES--------------------------------------------------------------------------------
'Look for misapplied names only if the potential taxon is accepted
if Rptaxon("StatusFk")=1 then
SQL= _
" SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk AS PTRefFk_s, Name.NameCache, Name.FullNameCache, Name.Notes AS NameNotes, PTaxon.PTRefFk AS PTRefFk, RelPTQualifier.RelPTQualifier as RelQualifier, RelPTaxon.Notes as RelNotes, Reference.RefCache"&_
" FROM (PTaxon AS PTaxon_1 INNER JOIN (PTaxon INNER JOIN RelPTaxon ON (PTaxon.PTNameFk = RelPTaxon.PTNameFk2) AND (PTaxon.PTRefFk = RelPTaxon.PTRefFk2)) ON (PTaxon_1.PTNameFk = RelPTaxon.PTNameFk1) AND (PTaxon_1.PTRefFk = RelPTaxon.PTRefFk1)) INNER JOIN Name ON PTaxon_1.PTNameFk = Name.NameId INNER JOIN RelPTQualifier ON RelPTaxon.RelQualifierFk = RelPTQualifier.RelPTQualifierId INNER JOIN Reference ON PTaxon_1.PTRefFk = Reference.RefId"&_
" WHERE (((PTaxon.PTNameFk)="&Rptaxon("PTNameFk")&") AND ((PTaxon.PTRefFk)="&Rptaxon("PTRefFk")&") AND ((RelPTaxon.RelQualifierFk)=3)) ORDER BY Name.NameCache"
Set Rmiss = Server.CreateObject("ADODB.Recordset")
openRecordset Rmiss, SQL
if Rmiss.Recordcount > 0 then
contador=0
While NOT Rmiss.EOF
contador=contador + 1
%>
<%if contador=1 then%>
Misapplied Name(s):
<%end if%>
|
&PTRefFk=<%=Rmiss("PTRefFk_s")%>">
<%=Rmiss("FullNameCache")%> sec. <%=Left(Rmiss("RefCache") & Rmiss("RelNotes"), 50) & "..." %> |
<%
Rmiss.Movenext
Wend
Rmiss.Close
set Rmiss=Nothing
end if
end if
%>
<%'-----------------INCLUDED TAXA------------------------------------------------------------------------------------
'Look for included taxa only if the potential taxon is accepted. INCLUDED TAXA, hierarchy DOWN
if Rptaxon("StatusFk")=1 then
SQL="SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk, Name.FullNameCache, Reference.RefCache, Reference.RefId AS RefId "&_
" FROM Reference INNER JOIN ((PTaxon AS PTaxon_1 INNER JOIN (PTaxon INNER JOIN RelPTaxon ON (PTaxon.PTNameFk = RelPTaxon.PTNameFk2) AND (PTaxon.PTRefFk = RelPTaxon.PTRefFk2)) ON (PTaxon_1.PTNameFk = RelPTaxon.PTNameFk1) AND (PTaxon_1.PTRefFk = RelPTaxon.PTRefFk1)) INNER JOIN Name ON PTaxon_1.PTNameFk = Name.NameId) ON Reference.RefId = PTaxon_1.PTRefFk "&_
" WHERE (((PTaxon.PTNameFk)="&Rptaxon("PTNameFk")&") AND ((PTaxon.PTRefFk)="&Rptaxon("PTRefFk")&") AND ((RelPTaxon.RelQualifierFk)=1)) "&_
" ORDER BY Name.FullNameCache"
Set Rinclu = Server.CreateObject("ADODB.Recordset")
openRecordset Rinclu, SQL
if Rinclu.Recordcount>0 then
contador=0
%>|
|
<%
While NOT Rinclu.EOF
contador=contador+1
%>
<%if contador=1 then%> Included taxa:
<%end if%> |
&PTRefFk=<%=Rinclu("PTRefFk")%>"><%=Rinclu("FullNameCache")%>
<%if Rinclu("PTRefFk")<>Rptaxon("PTRefFk") then%> sec. <%=Rinclu("RefCache")%><%end if%>
|
<%
Rinclu.Movenext
Wend
Rinclu.Close
set Rinclu=Nothing
end if
end if
%>
<%'---------------------------NOTES----------------------------------------------------------------------------------------
'There are two type of notes here, the one from the potential taxon and the one from the name. Show them if there´s something inside
if NameA(7)<>"" then %>
Name Notes: |
<%=NameA(7)%> |
<%end if%>
<% if Rptaxon("Notes")<>"" then %>
Taxon Notes: |
<%=Rptaxon("Notes")%> |
<%end if%>
|
|
<% '-------------- OCCURENCE ------------------------------------------------------------------------------------------
'TODO Anfragen Rfacts20 + Rfacts21 können noch zusammengefasst werden, wenn alles so bleibt
' Show the Type information
SQL= _
" SELECT Fact.Fact, FactCategory.FactCategory, FactCategory.FactCategoryId " & _
" FROM (PTaxon INNER JOIN Fact ON (PTaxon.PTRefFk = Fact.PTRefFk) AND (PTaxon.PTNameFk = Fact.PTNameFk)) INNER JOIN FactCategory ON Fact.FactCategoryFk = FactCategory.FactCategoryId " & _
" WHERE (((PTaxon.PTNameFk)=" & Rptaxon("PTNameFk")&") " & _
" AND ((PTaxon.PTRefFk)=" & Rptaxon("PTRefFk")&")) " & _
" AND (FactCategory.FactCategoryId = 20) "
SET Rfacts20 = Server.CreateObject("ADODB.Recordset")
openRecordset Rfacts20, SQL
SQL= _
" SELECT Fact.Fact, FactCategory.FactCategory, FactCategory.FactCategoryId, Reference.IdInSource as ref " & _
" FROM (PTaxon INNER JOIN Fact ON (PTaxon.PTRefFk = Fact.PTRefFk) AND (PTaxon.PTNameFk = Fact.PTNameFk)) " & _
" INNER JOIN FactCategory ON Fact.FactCategoryFk = FactCategory.FactCategoryId " & _
" LEFT OUTER JOIN Reference ON Fact.FactRefFK = Reference.RefId " & _
" WHERE (((PTaxon.PTNameFk)=" & Rptaxon("PTNameFk")&") " & _
" AND ((PTaxon.PTRefFk)=" & Rptaxon("PTRefFk")&")) " & _
" AND (FactCategory.FactCategoryId = 21) " & _
" ORDER BY Fact.Fact"
SET Rfacts21 = Server.CreateObject("ADODB.Recordset")
openRecordset Rfacts21, SQL
IF Rfacts20.RecordCount > 0 THEN
'----- Category 20--------------------------
While ( NOT Rfacts20.EOF )
%>
Occurrence status:
|
<%
IF (Rfacts20("Fact") = "E") THEN
Response.Write("Endemic")
ELSEIF (Rfacts20("Fact") = "X") THEN
Response.Write("Xenophyte")
ELSE
Response.Write("ERROR: unknown")
END IF
%>
|
<%
Rfacts20.MoveNext
WEnd
END IF
Rfacts20.close
SET Rfacts20=Nothing
IF (Rfacts21.RecordCount > 0) THEN
%>
Geographical occurrence: |
<%
While ( NOT Rfacts21.EOF )
%>
<%
Rfacts21.MoveNext
WEnd
%>
|
<%
ELSE ' no MCL-facts
%>
<%
END IF
Rfacts21.close
SET Rfacts21=Nothing
'-----------END of TAXON --------------------------------------------------------------------------------------------------------
%>
|