require("../../includes/db.php");
require("includes/global.php");
$sSpecies = $HTTP_GET_VARS['s'];;
if (!isset($sSpecies)) {
header("Location:index.html");
}
$query = "select s.speciesid, s.family, s.genus, s.namescientific, s.namecommon_fr, s.namecomalias_fr, s.native, s.status, s.growtype, s.color, s.fruitcolour, s.heightfrom, s.heightto, s.spreadfrom, s.spreadto, s.coverbird, s.covermammal, s.covernesting, s.foodbutterfly, s.foodbee, s.foodmoth, s.foodfly, s.foodhummingbird, s.foodseedbird, s.foodseedwintersource, s.foodseedmammal, s.bloomapr, s.bloommay, s.bloomjun, s.bloomjul, s.bloomaug, s.bloomsep, s.fruittype, s.fruitcolour, s.seedspring, s.seedsummer, s.seedfall, s.seedwinter, s.invasive, s.rhizome, s.slowgrowing, s.fallcolour, s.dioecious, s.thicketforming, s.tallgrassprairie, s.mixedgrassprairie, s.oakforest, s.aspenforest, s.riverbottomforest, s.wetland, s.fullsun, s.partialsun, s.shade, s.dry, s.average, s.wet, s.welldrained, s.moist, s.comments, s.distribution, s.uses, s.mcdcs, f.namescientific as familyscientific, f.namecommon_fr as familycommon from lcll_specieslist as s, lcll_familylist as f where s.family = f.namescientific and speciesid = ".$sSpecies;
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
if (mysql_numrows($result) == 0) {header("Location:index.html"); }
$row = mysql_fetch_object($result);
$speciesid = $row->speciesid;
$famsci = $row->family;
$family = clean_utf8($row->familycommon);
/*$family= preg_replace ('/([\x80-\xff])/se', "pack (\"C*\", (ord ($1) >> 6) | 0xc0, (ord ($1) & 0x3f) | 0x80)", $row->familycommon); */
if(empty($family)){
$family = "$famsci";
} else {
$family = "$famsci ($family)";
}
$namesci = $row->genus." ".$row->namescientific;
$namecom = clean_utf8($row->namecommon_fr);
$alias = clean_utf8($row->namecomalias_fr);
if(!empty($alias)){
$namecom = "$namecom, $alias";
}
$colour = $row->color;
$fruitcolour = $row->fruitcolour;
$uses = $row->uses;
$comments = $row->comments;
$distrib = $row->distribution;
if (!empty($row->heightfrom)) {$height = $row->heightfrom*100; $startFound = true;}
if (!empty($row->heightto)) {if($startFound) {$height = $height." - ".$row->heightto*100;} else {$height = $row->heightto*100;}}
if (!empty($height)) {$height = $height." cm";}
if (!empty($row->spreadfrom)) {$spread = $row->spreadfrom*100; $startFound = true;}
if (!empty($row->spreadto)) {if($startFound) {$spread = $spread." - ".$row->spreadto*100;} else {$spread = $row->spreadto*100;}}
if (!empty($spread)) {$spread = $spread." cm";}
$startFound = False;
if ($row->bloomapr == 1) {$start = "Avril"; $startFound = true;}
if ($row->bloommay == 1) {if (!$startFound){$start = "Mai"; $startFound = true;} else {$end = "Mai";}}
if ($row->bloomjun == 1) {if (!$startFound){$start = "Juin"; $startFound = true;} else {$end = "Juin";}}
if ($row->bloomjul == 1) {if (!$startFound){$start = "Juillet"; $startFound = true;} else {$end = "Juillet";}}
if ($row->bloomaug == 1) {if (!$startFound){$start = "Août"; $startFound = true;} else {$end = "Août";}}
if ($row->bloomsep == 1) {if (!$startFound){$start = "Septembre"; $startFound = true;} else {$end = "Septembre";}}
if (!empty($start)){
$bloom = $start;
}
if (!empty($end)){
if(!empty($start)){
$bloom = $bloom." - ";
}
$bloom = $bloom.$end;
}
$start = $end = "";
if ($row->seedspring == 1) {$start = "au printemps"; $startFound = true;}
if ($row->seedsummer == 1) {if (!$startFound){$start = "en été"; $startFound = true;} else {$end = "en été";}}
if ($row->seedfall == 1) {if (!$startFound){$start = "à l’automne"; $startFound = true;} else {$end = "à l’automne";}}
if ($row->seedwinter == 1) {if (!$startFound){$start = "en hiver"; $startFound = true;} else {$end = "en hiver";}}
if (!empty($start)) {$seed = $start;} if (!empty($end)){if(!empty($start)){$seed = $seed." to ";} $seed = $seed.$end;}
$start = $end = "";
if ($row->fullsun == 1) {$sExposure = "plein soleil"; $startFound = true;}
if ($row->partialsun == 1) {if (!$startFound){$sExposure = "soleil partiel"; $startFound = true;} else {$sExposure = $sExposure.", soleil partiel";}}
if ($row->shade == 1) {if (!$startFound){$sExposure = "ombre"; $startFound = true;} else {$sExposure = $sExposure.", ombre";}}
$startFound = false;
if ($row->dry == 1) {$moisture = "sec"; $startFound = true;}
if ($row->average == 1) {if (!$startFound){$moisture = "moyen"; $startFound = true;} else {$moisture = $moisture.", moyen";}}
if ($row->wet == 1) {if (!$startFound){$moisture = "mouillé(e)"; $startFound = true;} else {$moisture= $moisture.", mouillé(e)";}}
if ($row->welldrained == 1) {if (!$startFound){$moisture = "bien asséché(e)"; $startFound = true;} else {$moisture= $moisture.", bien asséché(e)";}}
if ($row->moist == 1) {if (!$startFound){$moisture = "humide"; $startFound = true;} else {$moisture = $moisture.", humide";}}
$startFound = false;
if ($row->tallgrassprairie == 1) {$habitats = "prairie des herbes hautes"; $startFound = true;}
if ($row->mixedgrassprairie == 1) {if (!$startFound){$habitats = "prairie d’herbes mélangées"; $startFound = true;} else {$habitats = $habitats.", prairie d’herbes mélangées";}}
if ($row->oakforest == 1) {if (!$startFound){$habitats = "forêt de chênes"; $startFound = true;} else {$habitats = $habitats.", forêt de chênes";}}
if ($row->aspenforest == 1) {if (!$startFound){$habitats = "forêt de trembles"; $startFound = true;} else {$habitats = $habitats.", forêt de trembles";}}
if ($row->riverbottomforest == 1) {if (!$startFound){$habitats = "forêt alluviale"; $startFound = true;} else {$habitats = $habitats.", forêt alluviale";}}
if ($row->wetland == 1) {if (!$startFound){$habitats = "terrain marécageux"; $startFound = true;} else {$habitats = $habitats.", terrain marécageux";}}
$startFound = false;
//get nectar source for wildlife
if ($row->foodbutterfly == 1) {$sNectar = "papillons"; $startFound = true;}
if ($row->foodbee == 1) {if (!$startFound){$sNectar = "abeilles"; $startFound = true;} else {$sNectar = $sNectar.", abeilles";}}
if ($row->foodmoth == 1) {if (!$startFound){$sNectar = "papillons nocturnes"; $startFound = true;} else {$sNectar = $sNectar.", papillons nocturnes";}}
if ($row->foodfly == 1) {if (!$startFound){$sNectar = "mouches"; $startFound = true;} else {$sNectar = $sNectar.", mouches";}}
$startFound = false;
//get edible to wildlife
if ($row->foodseedbird == 1) {$sEdible = "oiseaux"; $startFound = true;}
if ($row->foodseedmammal == 1) {if (!$startFound){$sEdible = "mammifères"; $startFound = true;} else {$sEdible = $sEdible.", mammifères";}}
if ($row->foodseedwintersource == 1) {if (!$startFound){$sEdible = "comme source de nourriture pour l’hiver"; $startFound = true;} else {$sEdible = $sEdible.", comme source de nourriture pour l’hiver";}}
$startFound = false;
//get cover to wildlife
if ($row->coverbird == 1) {$sCover = "oiseaux"; $startFound = true;}
if ($row->covermammal == 1) {if (!$startFound){$sCover = "mammifères"; $startFound = true;} else {$sCover = $sCover.", mammifères";}}
if ($row->covernesting == 1) {if (!$startFound){$sCover = "pour la nidification"; $startFound = true;} else {$sCover = $sCover.", pour la nidification";}}
$startFound = false;
if ($row->invasive == 1) {$habits = "envahissant(e)"; $startFound = true;}
if ($row->rhizome == 1) {if (!$startFound){$habits = "rhizome"; $startFound = true;} else {$habits = $habits.", rhizome";}}
if ($row->slowgrowing == 1) {if (!$startFound){$habits = "à croissance lente"; $startFound = true;} else {$habits = $habits.", à croissance lente";}}
if ($row->fallcolour == 1) {if (!$startFound){$habits = "couleur à l’automne"; $startFound = true;} else {$habits = $habits.", couleur à l’automne";}}
if ($row->dioecious == 1) {if (!$startFound){$habits = "dioïque"; $startFound = true;} else {$habits = $habits.", dioïque";}}
if ($row->thicketforming == 1) {if (!$startFound){$habits = "forme des buissons"; $startFound = true;} else {$habits = $habits.", forme des buissons";}}
$startFound = false;
$fruit = $row->fruittype;
switch ($fruit) {
case "achene": $fruit = "akène"; break;
case "berry": $fruit = "baie"; break;
case "capsule": $fruit = "capsule"; break;
case "drupe": $fruit = "drupe"; break;
case "follicle": $fruit = "follicule"; break;
case "nutlette": $fruit = "nucule"; break;
case "pod": $fruit = "cosse"; break;
case "pome": $fruit = "fruit à pépins"; break;
case "rose hip": $fruit = "fruit du rosier"; break;
case "seed": $fruit = "graine"; break;
case "spore": $fruit = "spore"; break;
}
$colour = $row->color;
switch ($colour) {
case "yellow": $colour="jaune";break;
case "red": $colour="rouge";break;
case "blue": $colour="bleu";break;
case "purple": $colour="violet";break;
case "green": $colour="vert";break;
case "white": $colour="blanc";break;
case "pink": $colour="rose";break;
}
$fruitcolour = $row->fruitcolour;
switch ($fruitcolour) {
case "yellow": $fruitcolour="jaune";break;
case "red": $fruitcolour="rouge";break;
case "blue": $fruitcolour="bleu";break;
case "purple": $fruitcolour="violet";break;
case "green": $fruitcolour="vert";break;
case "white": $fruitcolour="blanc";break;
case "pink": $fruitcolour="rose";break;
}
$growth = $row->growtype;
switch ($growth) {
case "P": $growth = "vivace"; break;
case "B": $growth = "bisannuel(le)"; break;
case "A": $growth = "annuel(le)"; break;
}
$origin = $row->native;
switch ($origin) {
case "N": $origin = "indigène"; break;
case "O": $origin = "non indigène"; break;
}
$cosewic = $row->status;
switch ($cosewic) {
case "E": $cosewic = "éteint(e)"; break;
case "EX": $cosewic = "disparue"; break;
case "EN": $cosewic = "en voie de disparition"; break;
case "T": $cosewic = "menacé(e)"; break;
case "S": $cosewic = "préoccupant(e)"; break;
case "D": $cosewic = "données insuffisantes"; break;
case "N": $cosewic = "non en péril"; break;
Case "L": $cosewic = "non inscrit(e)"; break;
default : $cosewic = "non spécifié(e)";
}
$mcdc = $row->mcdcs;
switch ($mcdc) {
//case ($mcdc <= 7) : break;
case "U": $mcdc = "incertain(e)"; break;
case "H": $mcdc = "a une présence historique"; break;
case "X": $mcdc = "éteint(e)"; break;
case "E": $mcdc = "exotique"; break;
//default : $mcdc = "unspecified";
}
//get herbarium id
$haherbid = false;
//$query = "select imglocation, filename from lcll_specieslist as s inner join lcll_images as i on s.speciesid = i.speciesid where (i.herbariumid <> null or i.herbariumid <> '') and s.speciesid=$sSpecies";
$query = "select i.herbariumid from lcll_images as i where i.speciesid = $speciesid and (i.herbariumid <> null or i.herbariumid <> '')";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$row = mysql_fetch_object($result);
if (!empty($row)){
$herbid = $row->herbariumid;
$haherbid = true;
}
//get number of quadrats
$query = "select id from lcll_quadrat";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
$numQuadrats = mysql_numrows($result);
//get quadrats this species appears in
$query = "select distinct(s.quadrat) as quadrat from lcll_samples as s, lcll_sampledetail as d, lcll_quadrat as q where d.mastersampleid = s.sampleid and s.quadrat = q.id and speciesid = $sSpecies order by q.id asc";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
for($i=0;$i<=$numQuadrats;$i++){
$quadrats[]="";
}
while($row = mysql_fetch_array($result)){
$quadrats[$row[0]] = $row[0];
$inQuadrat = true;
}
//build javascript to preload images
$query = "select imglocation, filename, imgtype, photographer, datetaken, description from lcll_images where keyimage = 1 and (herbariumid = null OR herbariumid = '') and speciesid=$sSpecies";
$result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
/*preload only if the herbarium image is not the only image*/
if (mysql_num_rows($result) > 0) {
$windowStartImg = "window.gif";
$showArrows = true;
$preloadImages = "var slides = new Array(";
$preloadDesc = "var imgDesc = new Array(";
$preloadSource = "var imgSource = new Array(";
$preloadDate = "var imgDate = new Array(";
while ($row = mysql_fetch_object($result)) {
$preloadImages = $preloadImages."'".$imageRoot.cWEbPath($row->imglocation)."m_".$row->filename."',";
($row->imgtype == "Other" || $row->imgtype =="other" ? $preloadDesc = $preloadDesc."'".str_replace("'","\'",$row->description)."'," : $preloadDesc = $preloadDesc."'".$row->imgtype."',");
$preloadSource = $preloadSource."'".$row->photographer."',";
$preloadDate = $preloadDate."'".$row->datetaken."',";
}
$preloadImages = substr($preloadImages,0,strlen($preloadImages)-1).");\n\t";
$preloadDesc = substr($preloadDesc,0,strlen($preloadDesc)-1).");\n\t";
$preloadSource = substr($preloadSource,0,strlen($preloadSource)-1).");\n\t";
$preloadDate = substr($preloadDate,0,strlen($preloadDate)-1).");\n";
} else {
$windowStartImg = "no-image.gif";
}
?>
Herbier de la prairie des herbes hautes [Au fil des paysages] Species Information
">
Généalogie
Nom de l’espèce :
Nom ou noms courant(s) :
Numéro de catalogue LCLL :
Caractéristiques
S’épanouit en :
Monte en graines :
Rythme de croissance :
Origine :
Couleur dominante ou caractéristique :
Type de fruit :
Couleur du fruit :
Hauteur :
Comportement :
Situation
Situation COSEPAC (Comité sur la situation des espèces en péril au Canada):
Situation CDCM (Centre de données sur la conservation du Manitoba) :
Exigences :
Exposition :
Degré d’humidité :
Habitats :
Utilité pour la faune :
Source de nectar pour :
Fruits et graines comestibles pour :
Utilisé(e) comme abri pour :
/*if(empty($herbid)){echo "aucune image disponible";}else{echo " ";}*/?>
échantillon monté ";}?>
";}?>
if($numQuadrats>0){
echo("- Trouvé(e) dans le quadrat :
");
for($i=1;$i<=$numQuadrats;$i++){
if(!empty($quadrats[$i])){
echo "- ".$i."
\n";
}
else {
echo "- ".$i."
\n";
}
}
}
?>