%
' Include file with specific project code to add at the end of the potential taxon view
' Parameters: Rptaxon("PTNameFk") --> integer with the NameId of the Potential Taxon.
' Rptaxon("PTRefFk") --> second part of the potential taxon primary key with the reference id
' Rptaxon("StatusFk") --> the status of the PTaxon, 1 accepted, 2 synonym, 3 unresolved
'
' Example of a connection to the database:
'----------------------------------------------------------------
' SQL="SELECT * FROM Name WHERE...."
' Set Rconn = Server.CreateObject("ADODB.Recordset")
' Rconn.ActiveConnection = MM_jun_STRING
' Rconn.Source = SQL
' Rconn.CursorType = 3
' Rconn.CursorLocation = 2
' Rconn.LockType = 1
' Rconn.Open()
' if Rconn.RecordCount > 0 then
' Response.write("
Example: | |
")
' While NOT Rconn.EOF
' Response.write(""&Rconn("FactCategory")&": | "&Rconn("Fact")&" |
")
' Rfacts.Movenext
' Wend
' end if
'Rconn.close
'set Rconn=Nothing
'-----------------------------------------------------------------------------------------------------------------------
%>
<%
' Show the Type information
SQL="SELECT Name.NameId, Type.TypeId, Type.TypeCache FROM Name INNER JOIN Type ON Name.TypeId = Type.TypeId WHERE Name.NameId = " & Rptaxon("PTNameFk")
Set Rtype = Server.CreateObject("ADODB.Recordset")
Rtype.ActiveConnection = MM_jun_STRING
Rtype.Source = SQL
Rtype.CursorType = 3
Rtype.CursorLocation = 2
Rtype.LockType = 1
Rtype.Open()
if Rtype.RecordCount > 0 then
Response.write("Type: | "&Rtype("TypeCache")&" |
")
end if
Rtype.close
set Rtype=Nothing
'------------------------------------------------------------------------------------------------------------
%>
<%' Taking care of the Distribution code TDWG DISTRIBUTION CODE
'------------------------------------------------------------------------------------------------------------------
SQL="SELECT DISTINCT PTaxonGeoTDWG.PTNameFk, PTaxonGeoTDWG.PTRefFk, tblLevel1.[L1 continent] AS continent, tblLevel2.[L2 region] AS region, tblLevel3.[L3 area] AS area, GeoTDWG.BasicRecUnitName AS subarea, PTaxonGeoTDWG.doubtful, PTaxonGeoTDWG.extinct, PTaxonGeoTDWG.nv, PTaxonGeoTDWG.n FROM tblLevel2 RIGHT OUTER JOIN tblLevel3 RIGHT OUTER JOIN GeoTDWG RIGHT OUTER JOIN PTaxonGeoTDWG ON GeoTDWG.BasicRecUnitCode_Pk4 = PTaxonGeoTDWG.l4_code ON tblLevel3.[L3 code] = PTaxonGeoTDWG.l3_code ON tblLevel2.[L2 code] = PTaxonGeoTDWG.l2_code LEFT OUTER JOIN tblLevel1 ON PTaxonGeoTDWG.l1_code = tblLevel1.[L1 code] WHERE (PTaxonGeoTDWG.PTNameFk = "& Rptaxon("PTNameFk")&") AND (dbo.PTaxonGeoTDWG.PTRefFk = "& Rptaxon("PTRefFk") &")"
Set Rdistrib = Server.CreateObject("ADODB.Recordset")
Rdistrib.ActiveConnection = MM_jun_STRING
Rdistrib.Source = SQL
Rdistrib.CursorType = 3
Rdistrib.CursorLocation = 2
Rdistrib.LockType = 1
Rdistrib.Open()
if Rdistrib.Recordcount >0 then
%>
Distribution table: |
<%
control_cont=0
control_reg=0
control_area=0
control_subarea=0
While not Rdistrib.eof
if Rdistrib("continent")<>last_cont then
control_cont=control_cont+1
if (control_cont mod 2)=0 then
color_continent="#E6E6D9"
else
color_continent="#C9C9AD"
end if
end if
if Rdistrib("region")<>last_reg then
control_reg=control_reg+1
if (control_reg mod 2)=0 then
color_region="#FFF4DF"
else
color_region="#FFEAC1"
end if
end if
if Rdistrib("area")<>last_area then
control_area=control_area+1
if (control_area mod 2)=0 then
color_area="#DBDBDB"
else
color_area="#EBEBEB"
end if
end if
control_subarea=control_subarea+1
if Rdistrib("subarea")<>"" then
color_subarea="#B2B2B2"
else
color_subarea="#F8F8F8"
end if
%>
<%if Rdistrib("continent")<>last_cont then%><%=Rdistrib("continent")%><%end if%> |
<%if Rdistrib("region")<>last_reg then%><%=Rdistrib("region")%><%end if%> |
<%if Rdistrib("area")<>last_area then%><%=Rdistrib("area")%><%end if%> |
<%if Rdistrib("subarea")<>last_subarea then%><%=Rdistrib("subarea")%><%end if%><%if Rdistrib("doubtful")=True then%> (doubtful)<%end if%><%if Rdistrib("extinct")=True then%> (extinct)<%end if%><%if Rdistrib("n")=True then%> (n)<%end if%> |
<%
last_cont=Rdistrib("continent")
last_reg=Rdistrib("region")
last_area=Rdistrib("area")
Rdistrib.MoveNext
wend
%>
|
<%
end if
Rdistrib.close
set Rdistrib=Nothing
%>