Cache field of the name table // NameId: Integer --> Id of the Name of the potential taxons // PTRefFk: integer --> Id of the reference of the potential taxons // //----------------------------------------------------------------------------------------------------------------------- //Specify if the project is IOPI, HACK!!!! //project="iopi" //---------------------------------------------------------------------------------------- // Construct the SQL statement depending on the paramenter passed. // That selects all the potential taxon. //If the project is IOPI we have to select also the edition level of the potential taxon, and that makes the SQL statement different if ($project=="iopi") { $SQL="SELECT Name.NameCache, Name.FullNameCache, PTaxon.PTRefFk, Name.NameId, Reference.RefCache, EditionLevel FROM Name INNER JOIN PTaxon ON Name.NameId = PTaxon.PTNameFk INNER JOIN Reference ON PTaxon.PTRefFk = Reference.RefId LEFT OUTER JOIN ReferenceEditionLevel ON Reference.RefId = ReferenceEditionLevel.RefId"; } else { $SQL="SELECT Name.NameCache, Name.FullNameCache, PTaxon.PTRefFk, Name.NameId, Reference.RefCache FROM Name INNER JOIN PTaxon ON Name.NameId = PTaxon.PTNameFk INNER JOIN Reference ON PTaxon.PTRefFk = Reference.RefId"; } //All potential taxon using a specific NameId if ($_REQUEST['NameId']!="") { $SQL=$SQL." WHERE Name.NameId = ".$_REQUEST['NameId']; if ($_REQUEST['PTRefFk']!="") { $SQL=$SQL." AND PTRefFk=".$_REQUEST['PTRefFk']; } else { print "The current WebPublisher doesn't support to display names not use in a potential taxon, sorry."; exit(); } } else { $SQL=$SQL." WHERE Name.NameId > 0"; if ($_REQUEST['NameCache']!="") { $SQL=$SQL." AND Name.NameCache = '".str_replace("'","''",$_REQUEST['NameCache'])."'"; // SQL=SQL&" AND Name.NameCache = '"& Request("NameCache") "''" } else { $SQL=$SQL." AND Name.Genus IS NULL"; } if ($_REQUEST['PTRefFk']!="") { $SQL=$SQL." AND PTRefFk=".$_REQUEST['PTRefFk']; } } //We order them finally by the Edition Level, the references allready edited should be show first. if ($project=="iopi") { $SQL=$SQL." ORDER BY dbo.ReferenceEditionLevel.EditionLevel DESC, Reference.OrderApparence DESC"; } else { $SQL=$SQL." ORDER BY Reference.OrderApparence DESC"; } //Response.write(SQL) //This recordset returns all the potential taxon that match the name criteria and order them by source. echo "
".$SQL; $rs=mssql_query($SQL, $dbcon); if ($_REQUEST['NameCache']!="") { $NameTotal=$_REQUEST['NameCache']; } else { if (mssql_num_rows($rs)>0) { $row=mysql_fetch_array($rs); $NameTotal=$row["NameCache"]; } } ?>
Details for:
Link to species in Tropicos | Google Images

0) { $cont_sources=0; While ($row=mysql_fetch_array($rs)){ { //counter for each movement $cont_sources=$cont_sources+1; //I first obtain the information that belongs to this potential taxon: //IOPI!SQL="SELECT PTaxon.PTNameFk, PTaxon.PTRefFk, Status.Status, PTaxon.StatusFk, Reference.NomTitleAbbrev, Reference.RefCache, PTaxon.Notes, Type.TypeCache, Type.TypeId, Rank.Rank FROM Rank RIGHT JOIN ((Reference RIGHT JOIN (Name RIGHT JOIN (PTaxon LEFT JOIN Status ON PTaxon.StatusFk = Status.StatusId) ON Name.NameId = PTaxon.PTNameFk) ON Reference.RefId = PTaxon.PTRefFk) LEFT JOIN Type ON Name.TypeId = Type.TypeId) ON Rank.RankId = Name.RankFk WHERE (((PTaxon.PTNameFk)="&Recordset1("NameId")&") AND ((PTaxon.PTRefFk)="&Recordset1("PTRefFk")&"))" $SQL="SELECT PTaxon.PTNameFk, PTaxon.DoubtfulFlag, PTaxon.PTRefFk, Status.Status, PTaxon.StatusFk, Reference.NomTitleAbbrev, Reference.RefCache, PTaxon.Notes, Rank.Rank, Rank.RankId FROM Rank RIGHT JOIN ((Reference RIGHT JOIN (Name RIGHT JOIN (PTaxon LEFT JOIN Status ON PTaxon.StatusFk = Status.StatusId) ON Name.NameId = PTaxon.PTNameFk) ON Reference.RefId = PTaxon.PTRefFk) ) ON Rank.RankId = Name.RankFk WHERE (((PTaxon.PTNameFk)=".$Recordset1["NameId"].") AND ((PTaxon.PTRefFk)=".$Recordset1["PTRefFk"]."))"; echo "
".$SQL; $rsPtaxon=mssql_query($SQL, $dbcon); $Rptaxon=mysql_fetch_array($rsPtaxon); //First select all the information posible from this name $SQL="SELECT Name.NameCache, Name.FullNameCache, Name.NameId, Name.Genus, Name.SpeciesEpi, Name.InfraSpeciesEpi, Name.GenusSubdivisionEpi, Reference.NomTitleAbbrev, Reference.Volume, RefDetail.Details, Reference.InRefFk, Reference.RefYear, RefDetail.FullNomRefCache, Name.AuthorTeamFk, Name.ExAuthorTeamFk, Name.BasAuthorTeamFk, Name.ExBasAuthorTeamFk, Rank.RankAbbrev, NomStatus.NomStatus, Name.Notes, Name.UnnamedNamePhrase, Name.RankFk FROM NomStatus RIGHT JOIN ((((Name LEFT JOIN Reference ON Name.NomRefFk = Reference.RefId) LEFT JOIN RefDetail ON Name.NomRefDetailFk = RefDetail.RefDetailId) INNER JOIN Rank ON Name.RankFk = Rank.RankId) LEFT JOIN NomStatusRel ON Name.NameId = NomStatusRel.NameFk) ON NomStatus.NomStatusId = NomStatusRel.NomStatusFk WHERE (((Name.NameId)=".$Rptaxon["PTNameFk"]."))"; echo "
".$SQL; $rsName=mssql_query($SQL, $dbcon); $Rname=mysql_fetch_array($rsName); //0--> Name Part (Juncus Roemeriani) //1--> Authors string (L.) //2--> Complete Reference starting with ", " (, Byull. Moskovsk. Obshch. Isp. Prir., Otd. Biol., 95: 117 (1990)) //3--> status part (,nom. illeg.) //4--> non part (,non Buchenau(1545)) //5--> total, all in the same 0+1+2+3+4 //6--> 0+1 //7--> Name notes if ($Rname["notes"]="ll") { //if there's something in the notes field i will use this as the complete name. This solution is valid for the IOPI project $NameA[0]=$Rname["FullNameCache"]; $NameA[1]="Not parsed, see the notes"; $NameA[2]="Not parsed, see the notes"; $NameA[3]="Not parsed, see the notes"; $NameA[4]="Not parsed, see the name"; $NameA[5]=$Rname["FullNameCache"]; $NameA[6]=$Rname["FullNameCache"]; $NameA[7]=$Rname["Notes"]; } else { //I have to add the status of the name (nomenclature status). It's possible to have more than one status, but maximum here is 2 if ($Rname["NomStatus"]!="") { $status_part=$Rname["NomStatus"]; if (mssql_num_rows($rsName)>1) { //There's more than one status $Rname=mssql_fetch_array($Rname_query); $status_part=$status_part.", ".$Rname["NomStatus"]; } } $NameA[0]=$Rname["NameCache"]; $NameA[1]=str_replace($Rname["NameCache"],"",$Rname["FullNameCache"]); $NameA[2]=$Rname["FullNomRefCache"]; $NameA[3]=$status_part; $NameA[4]=$non_part; $NameA[5]=$Rname["FullNameCache"].", ".$Rname["FullNomRefCache"]; $NameA[6]=$Rname["FullNameCache"]; $NameA[7]=$Rname["Notes"]; } $Rname=null; // Show the reference where is restricted the search. if ($_REQUEST['PTRefFk']!="") { ?> Search restricted to    ?NameCache=">Check for other Sources using this name

different source(s) use this name:

-

0) { ?> 0) { ?> 0) { //If it has homonyms show them, take the details. $SQL="SELECT Name.NameId, Name.NameCache, Name.FullNameCache, Reference.RefYear FROM Name LEFT JOIN Reference ON Name.NomRefFk = Reference.RefId WHERE (Name.NameId = ".$Rhom["NameFk1"].")"; // $Rhom_details is of type "ADODB.Recordset" echo $MM_jun_STRING; echo $SQL; echo 3; echo 2; echo 1; $rs=mssql_query(); while(!($Rhom_details==0)) { $non_part=$Rhom_details["FullNameCache"]; if ($Rhom_details["RefYear"]!="") { $non_part=$non_part." (".$Rhom_details["RefYear"].")"; } ?> 0) { ?> 0) { $nameid=$Rherar["PTNameFk"]; $refid=$Rherar["PTRefFk"]; $herarchy[0][$cont]=$nameid; $herarchy[1][$cont]=$refid; //Show the reference as "sec." when the reference is different from the one using the potential taxon if ($Rherar["PTRefFk"]!=$refid) { $herarchy[2][$cont]="".$Rherar["FullNameCache"]." sec. ".$Rherar["RefCache"]; } else { $herarchy[2][$cont]="".$Rherar["FullNameCache"].""; } $herarchy[3][$cont]=$Rherar["Rank"]; $cont=$cont+1; } else { $nameid=""; $refid=""; $control=0; } $Rherar=null; } if ($herarchy[0][0]!="") { ?> 0) { $contador=0; while(!($Rinclu==0)) { $contador=$contador+1; ?> 0) { $contador=0; while(!($Racc==0)) { $contador=$contador+1; ?> 0) { ?> 0) { $contador=0; $syn_rel=""; while(!($Rsyn==0)) { $contador=$contador+1; ?> 0) { ?> 0) { $contador=0; while(!($Rmiss==0)) { $contador=$contador+1; ?> 0) { $VisibleColExist=true; } else { $VisibleColExist=false; } $RVisibleCol=null; //I create a different SQL depending if the Visible column exist or not in the database if ($VisibleColExist==true) { $SQL="SELECT PTaxon.PTNameFk, PTaxon.PTRefFk, FactCategory.FactCategory, FactCategory.FactCategoryId , FactCategory.Visible, Fact.Fact, FactCategory.MaxFactNumber 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"].")) ORDER BY FactCategory.FactCategory"; } else { $SQL="SELECT PTaxon.PTNameFk, PTaxon.PTRefFk, FactCategory.FactCategory, FactCategory.FactCategoryId , Fact.Fact, FactCategory.MaxFactNumber 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"].")) ORDER BY FactCategory.FactCategory"; } // $Rfacts is of type "ADODB.Recordset" echo $MM_jun_STRING; echo $SQL; echo 3; echo 2; echo 1; $rs=mssql_query(); if (mssql_num_rows($Rfacts_query)>0) { //-------------------------------------------------------- //To concatenate the facts by category first all of them are included in an array $control=0; //I will use a different code depending if the Visible column exist or not, using the VisibleColExist= True while(!($Rfacts==0)) { if ($VisibleColExist==true) { if ($control>0) { //Only add the fact to the array if it can be output (MaxFactNumber<>0) if ($Rfacts["Visible"]=true) { if ($facts[0][$control-1]==$Rfacts["FactCategory"]) { $facts[1][$control-1]=$facts[1][$control-1].", ".$Rfacts["Fact"]; } else { $facts[0][$control]=$Rfacts["FactCategory"]; $facts[1][$control]=$Rfacts["Fact"]; $control=$control+1; } } } } else { if ($Rfacts["Visible"]=true) { $facts[0][0]=$Rfacts["FactCategory"]; } $facts[1][0]=$Rfacts["Fact"]; $control=1; } else { $control=0; } } if () { } else { } if ($control>0) { if ($facts[0][$control-1]==$Rfacts["FactCategory"]) { $facts[1][$control-1]=$facts[1][$control-1].", ".$Rfacts["Fact"]; } else { $facts[0][$control]=$Rfacts["FactCategory"]; $facts[1][$control]=$Rfacts["Fact"]; $control=$control+1; } } else { $facts[0][0]=$Rfacts["FactCategory"]; $facts[1][0]=$Rfacts["Fact"]; $control=1; } } $Rfacts=mssql_fetch_array($Rfacts_query); } $Rfacts=null; ?>
Source:

Name:
Nomencl. ref.
Nomencl. status(es)
Homonyms
Rank:
Status: ; $red>; if ($Rptaxon["DoubtfulFlag"]="d") { $PRELIMINARY<$%; } ; } ?>
Is basionym for: ">
Taxonomy (this taxon is included in): =0; $i=$i-1) { ?> -
    
Included taxa: &PTRefFk="> sec.
Synonym of: &PTRefFk=">
Basionym: &PTRefFk=">
&PTRefFk=">
Concept Synonym(s):  
  According to:
  "; } if ($Rcsyn["is_included_in"]!=0) { if ($concept_images!="") { $concept_images=$concept_images.","; } else { $concept_images=""; } } if ($Rcsyn["includes"]!=0) { if ($concept_images!="") { $concept_images=$concept_images.","; } else { $concept_images=""; } } if ($Rcsyn["overlaps"]!=0) { if ($concept_images!="") { $concept_images=$concept_images.","; } else { $concept_images=""; } } if ($Rcsyn["excludes"]!=0) { if ($concept_images!="") { $concept_images=$concept_images.","; } else { $concept_images=""; } } $concept_images="{".$concept_images."}"; if ($Rcsyn["doubtful"]!=0) { $concept_images="?".$concept_images; } ?> &PTRefFk="> sec.
Missaplied Name(s): &PTRefFk="> sec. []
Name Notes:
Taxon Notes:
 
Facts:  
:

There are no potential taxons using this name!
Open"GET" $url $False; $xmlhttp->Send; // Parse result // $XMLDOM is of type "Microsoft.XMLDOM" $XMLDOM->Load($xmlhttp->responseBody); $xmlhttp=null; $XMLNodeTaxonKey=$XMLDOM->SelectSingleNode; $XMLNodeTotalRecords=$XMLDOM->SelectSingleNode; $XMLNodeTotalGisRecords=$XMLDOM->SelectSingleNode; $XMLNodeurl=$XMLDOM->SelectSingleNode; if (!$XMLNodeTaxonKey==null) { $function_ret="| text."\" target=\"_blank\">".$XMLNodeTotalRecords->text." record(s) in GBIF"; if ($XMLNodeTotalGisRecords->text>0) { $function_ret=$GetGBIFData." | text."&secondKey=0\" target=\"_blank\">Show map! |"; } } else { $function_ret="| No data in GBIF |"; } return $function_ret; } php include 'template_inf.php' ?> }