Source: |
echo $Rptaxon["Refcache"];?> echo $ReferenceSuffixForIOPI;?>
|
Name: |
echo $NameA[6];?> |
if (strlen($NameA[2])>0)
{
?>
Nomencl. ref. |
echo $NameA[2];?> |
} ?>
if (strlen($NameA[3])>0)
{
?>
Nomencl. status(es) |
echo $NameA[3];?> |
}
// Search if the name has HOMONYMS and print them
//------------------------------------------------------------------------------------------
$SQL="SELECT NameFk1 FROM RelName WHERE NameFk2=".$Rptaxon["PTNameFk"]." AND RelNameQualifierFk=2";
// $Rhom is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rhom_query)>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"].")";
}
?>
Homonyms |
echo $non_part;?> |
$Rhom_details=mssql_fetch_array($Rhom_details_query);
}
$Rhom_details=null;
}
$Rhom=null;
//---------------------------------------------------------------------------------------------
?>
Rank: |
echo $Rptaxon["Rank"];?> |
// status of the taxon --------------------------------------------------------------------------- ?>
Status: |
if ($Rptaxon["StatusFk"]=1)
{
$green>;
$red>;
if ($Rptaxon["DoubtfulFlag"]="d")
{
$PRELIMINARY<$%;
}
;
} ?>
echo strtoupper($Rptaxon["Status"]);?> |
//Look to see if it's a basyonym of something and print it. BASYONYM OF
//------------------------------------------------------------------------------------------------------
$SQL="SELECT dbo.Name.NameId, Name_1.NameId AS NameIdBas, Name_1.FullNameCache FROM dbo.Name Name_1 INNER JOIN Name INNER JOIN RelName ON Name.NameId = RelName.NameFk1 ON Name_1.NameId = RelName.NameFk2 WHERE (((Name.NameId)=".$Rptaxon["PTNameFk"].") AND ((RelName.RelNameQualifierFk)=1))";
// $Rbas is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rbas_query)>0)
{
?>
Is basionym for: |
"> echo $Rbas["FullNameCache"];?> |
}
$Rbas=null;
//-------------------------------------------------------------------------------------------------------
// See where this taxon it's included. HERARCHY
//-------------------------------------------------------------------------------------------------------
//only check herarchy if the PTaxon is accepted, if not is not supossed to be linked to anything (integrity rule)
if ($Rptaxon["StatusFk"]=1)
{
//First we will store in an array all the herarchy 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"];
$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".
;
$nameid.") AND ((PTaxon.PTRefFk)=".$refid.") AND ((RelPTaxon.RelQualifierFk)=1)) ORDER BY Name.NameCache";
// $Rherar is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rherar_query)>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]!="")
{
?>
Taxonomy (this taxon is included in): |
$col=0;
for ($i=count($herarchy); $i>=0; $i=$i-1)
{
?>
echo $herarchy[3][$i];?> - echo $herarchy[2][$i];?> for ($c=0; $c<=$col; $c=$c+1)
{?>
}?>
$col=$col+1;
}?>
|
}
$herarchy[0]="";
}
//----------------------------------------------------------------------------------------------------------
//Look for incluided taxa only if the potential taxon is accepted. INCLUDED TAXA, HERARCHY DOWN
//-------------------------------------------------------------------------------------------------------------------
if ($Rptaxon["StatusFk"]=1)
{
$SQL="SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk, Name.FullNameCache, Reference.RefCache, Reference.RefId AS RefId ".
;
$Rptaxon["PTNameFk"] $Rptaxon["PTRefFk"]
// $Rinclu is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rinclu_query)>0)
{
$contador=0;
while(!($Rinclu==0))
{
$contador=$contador+1;
?>
if ($contador==1)
{
?> Included taxa:
} ?> |
&PTRefFk= echo $Rinclu["PTRefFk"];?>"> echo $Rinclu["FullNameCache"];?> if ($Rinclu["PTRefFk"]!=$Rptaxon["PTRefFk"])
{
?> sec. echo $Rinclu["RefCache"];?> } ?> |
$Rinclu=mssql_fetch_array($Rinclu_query);
}
$Rinclu=null;
}
}
//--------------------------------------------------------------------------------------------------------------------------
// If the taxon is a synonymum find the accepted name. ACCEPTED NAME
//---------------------------------------------------------------------------------------------------
if ($Rptaxon["StatusFk"]=2)
{
$SQL="SELECT PTaxon_1.PTNameFk, PTaxon_1.PTRefFk, Name.NameCache, Name.FullNameCache, Name.Notes AS NameNotes".
;
$Rptaxon["PTNameFk"] $Rptaxon["PTRefFk"]
// $Racc is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Racc_query)>0)
{
$contador=0;
while(!($Racc==0))
{
$contador=$contador+1;
?>
if ($contador==1)
{
?>
Synonym of:
} ?> |
&PTRefFk= echo $Racc["PTRefFk"];?>"> echo $Racc["FullNameCache"];?> |
$Racc=mssql_fetch_array($Racc_query);
}
$Racc=null;
}
}
//---------------------------------------------------------------------------------------------------------------
//Look to see if it has a basyonym of something. BASYONYM
//-----------------------------------------------------------------------------------------------------------------
$SQL="SELECT dbo.Name.NameId, Name_1.NameId AS NameIdBas, Name_1.FullNameCache FROM Name Name_1 INNER JOIN Name INNER JOIN RelName ON Name.NameId = RelName.NameFk2 ON Name_1.NameId = RelName.NameFk1 WHERE (((Name.NameId)=".$Rptaxon["PTNameFk"].") AND ((RelName.RelNameQualifierFk)=1))";
// $Rbas is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rbas_query)>0)
{
?>
Basionym: |
&PTRefFk= echo $_REQUEST['PTRefFk'];?>"> echo $Rbas["FullNameCache"];?> |
}
$Rbas=null;
//----------------------------------------------------------------------------------------------------------------
//Look for synonyms only if the potential taxon is accepted. SYNONYMS
//----------------------------------------------------------------------------------------------------------------
if ($Rptaxon["StatusFk"]=1)
{
$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".
;
$Rptaxon["PTNameFk"] $Rptaxon["PTRefFk"]
// $Rsyn is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rsyn_query)>0)
{
$contador=0;
$syn_rel="";
while(!($Rsyn==0))
{
$contador=$contador+1;
?>
if ($contador==1 || $syn_rel!=$Rsyn["RelPTQualifier"])
{
?>
echo strtoupper(substr(trim(str_replace("of","",str_replace("is","",$Rsyn["RelPTQualifier"]))),0,1)).substr(trim(str_replace("of","",str_replace("is","",$Rsyn["RelPTQualifier"]))),strlen(trim(str_replace("of","",str_replace("is","",$Rsyn["RelPTQualifier"]))))-(strlen(trim(str_replace("of","",str_replace("is","",$Rsyn["RelPTQualifier"]))))-1))."(s):";?>
} ?>
|
&PTRefFk= echo $Rsyn["PTRefFk_s"];?>"> echo $Rsyn["FullNameCache"];?> |
$syn_rel=$Rsyn["RelPTQualifier"];
$Rsyn=mssql_fetch_array($Rsyn_query);
}
$Rsyn=null;
}
}
//-------------------------------------------------------------------------------------------------------------------
//Look for concept synonyms only if the potential taxon is accepted CONCEPT SYNONYMS
if ($Rptaxon["StatusFk"]=1)
{
$SQL="SELECT RelQualifierFk, NameId, Reference.RefId, NameCache, FullNameCache, Name.Notes AS NameNotes, RelPTQualifier AS RelQualifier, RelPTaxon.Notes AS RelNotes, Reference.RefCache, RelRefFk, is_congruent, is_included_in, includes, overlaps, excludes, doubtful, Reference_1.RefCache AS RelRefCache, RankFk ".
;
$Rptaxon["PTRefFk"] $Rptaxon["PTNameFk"]
$Rptaxon["PTRefFk"] $Rptaxon["PTNameFk"]
// $Rcsyn is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rcsyn_query)>0)
{
?>
Concept Synonym(s):
|
|
$contador=0;
$ult_ref="";
while(!($Rcsyn==0))
{
$contador=$contador+1;
if ($Rcsyn["RelRefCache"]!=$ult_ref)
{
?>
|
According to: echo $Rcsyn["RelRefCache"];?> |
} ?>
|
//Construct a string concatenating the images that are needed to represent the concept relation
$concept_images="";
if ($Rcsyn["is_congruent"]!=0)
{
$concept_images="";
}
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;
}
?>
echo $concept_images;?> &PTRefFk= echo $Rcsyn["RefId"];?>"> echo $Rcsyn["FullNameCache"];?> sec. echo $Rcsyn["RefCache"];?> echo $Rcsyn["RelNotes"];?> |
$Rcsyn=mssql_fetch_array($Rcsyn_query);
if (!($Rcsyn==0))
{
$ult_ref=$Rcsyn["RelRefCache"];
}
}
$Rcsyn=null;
}
}
//------------------------------------------------------------------------------------------------------------------
//Look for missaplied names only if the potential taxon is accepted MISSAPLIED NAMES
if ($Rptaxon["StatusFk"]=1)
{
$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".
;
$Rptaxon["PTNameFk"] $Rptaxon["PTRefFk"]
// $Rmiss is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($Rmiss_query)>0)
{
$contador=0;
while(!($Rmiss==0))
{
$contador=$contador+1;
?>
if ($contador==1)
{
?>
Missaplied Name(s):
} ?>
|
&PTRefFk= echo $Rmiss["PTRefFk_s"];?>"> echo $Rmiss["FullNameCache"];?> sec. echo $Rmiss["RefCache"];?> [ echo $Rmiss["RelQualifier"];?>] echo $Rmiss["RelNotes"];?> |
$Rmiss=mssql_fetch_array($Rmiss_query);
}
$Rmiss=null;
}
}
//------------------------------------------------------------------------------------------------------------------
//There are two type of notes here, the one from the potential taxon and the one from the name. Show them if theres something inside
//---------------------------------------------------------------------
if ($NameA[7]!="")
{
?>
Name Notes: |
echo $NameA[7];?> |
} if ($Rptaxon["Notes"]!="")
{
?>
Taxon Notes: |
echo $Rptaxon["Notes"];?> |
} ?>
|
|
//Select all the facts and present them FACTS
//------------------------------------------------------------------------------------------------------------------------
//We need to see if the column "Visible" is in the FactCategory Table to use it or not.//if it is no present then all factcategories will be shown. $SQL="SELECT sysobjects.name AS Exp1 FROM sysobjects INNER JOIN syscolumns ON sysobjects.id = syscolumns.id WHERE (sysobjects.name LIKE 'FactCategory') AND (syscolumns.name LIKE N'Visible')";
// $RVisibleCol is of type "ADODB.Recordset"
echo $MM_jun_STRING;
echo $SQL;
echo 3;
echo 2;
echo 1;
$rs=mssql_query();
if (mssql_num_rows($RVisibleCol_query)>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;
?>
Facts: |
|
for ($i=0; $i<=count($facts); $i=$i+1)
{?>
echo $facts[0][$i];?>: |
echo $facts[1][$i];?> |
}
}
//-----------------------------------------------------------------------------------------------------------------------
php include 'ProjectSpecific.php' ?>
|