OUR MISSION: ACER ACER supports communities, government agencies and corporations in taking action to reduce biodiversity loss and strengthen climate resilience by increasing and monitoring urban and riparian zone forest canopy.

Tree Info

[insert_php]

$webcodeurl = explode(‘?’,$_SERVER[‘REQUEST_URI’],2);

$con=mysqli_connect(“localhost”,”1009902_xy50386″,”,m,4xw@U16KB”,”1009902-climatesake1″);
//check connection
if(mysqli_connect_errno())
{
echo “Failed to connect to MySQL: ” . mysqli_connect_error();
}

$sqlquery = “SELECT a.WebCode, a.Location, a.TreeCode, a.CommonName, a.DBH, a.CW1, a.CW2, a.Height, a.Year, a.Comment, a.UTMN, a.UTME, a.Lat, a.Long, a.KgC, a.KgCO2, a.Webpages, b.ScientificName, b.OtherNames, b.Leaf, b.Flower, b.Fruit, b.Twig, b.Bark, b.Wood, b.Facts, b.Reference, b.Images, b.ImageDescription, b.spcode, b.Footer, c.Weblink, c.Logo, c.LogoDesc FROM treeinfo AS a JOIN speciesinfo AS b ON a.CommonName = b.CommonName JOIN locationinfo AS c ON a.Location = c.Location WHERE a.TreeCode LIKE ‘$webcodeurl[1]’ ORDER BY a.Year DESC LIMIT 1”;

$result = mysqli_query($con, $sqlquery);

if(mysqli_num_rows($result)==0){
echo ‘Information on this tree has not been created yet. We will upload the information as soon as we can. Thank you for your patience!’;
}

while($row = mysqli_fetch_array($result))
{
echo ‘

‘ . $row[‘CommonName’] . ‘ (‘ . $row[‘ScientificName’] . ‘)

‘;
echo ”
“;
echo ”
“;
echo ‘Location: ‘ . $row[‘Location’] . ‘
‘;
echo ‘Lat, Long: ‘ . $row[‘Lat’] . ‘ ,’ . $row[‘Long’] . ‘
‘;
echo ‘TreeCode: ‘ . $row[‘TreeCode’] . ‘
‘;
echo ‘Diameter (DBH): ‘ . $row[‘DBH’] . ‘cm
‘;
echo ‘Last Year Modified: ‘ . $row[‘Year’] . ‘
‘;
echo ‘Carbon Stored in this Tree:‘;
if($row[‘KgC’] == 0)
{echo ‘ No Data
‘;
}
else
{echo ‘ ‘ . $row[‘KgC’] . ‘kg of C
‘;
}
echo ‘Equivalent CO2:‘;
if($row[‘KgCO2’] == 0)
{echo ‘ No Data
‘;
}
else
{echo ‘ ‘ . $row[‘KgCO2’] . ‘kg of C
‘;
}

$img_urls = unserialize($row[‘Images’]);
$img_dsc = unserialize($row[‘ImageDescription’]);
$i=0;
while($i<= (count($img_urls)-1))
{
echo ‘' . $img_dsc[$i] . '‘;
$i++;
}

$speciescode = str_replace(” “,””,$row[‘ScientificName’]);

echo ”
“;
echo ”
“;
echo ‘Common Name: ‘ . $row[‘CommonName’] . ‘
‘;
echo ‘Scientific Name: ‘ . $row[‘ScientificName’] . ‘
‘;
echo ‘Other Names: ‘ . $row[‘OtherNames’] . ‘
‘;
echo ‘
‘;
echo ‘Leaf: ‘ . $row[‘Leaf’] . ‘
‘;
echo ‘Flower: ‘ . $row[‘Flower’] . ‘
‘;
echo ‘Fruit: ‘ . $row[‘Fruit’] . ‘
‘;
echo ‘Twig: ‘ . $row[‘Twig’] . ‘
‘;
echo ‘Bark: ‘ . $row[‘Bark’] . ‘
‘;
echo ‘Wood: ‘ . $row[‘Wood’] . ‘
‘;
echo ‘
‘;

echo ‘Did you know?
‘;
$b=unserialize($row[‘Facts’]);
$z=0;
while($z<=(count($b)-1))
{
$item_nbr = $z+1;
echo ‘‘ . $item_nbr . ‘. ‘ . $b[$z] . ‘
‘;
$z++;
}

//loading the “Find More Trees” link
echo ‘
‘;
echo ‘
‘;
echo ‘‘;

echo ‘
‘;
echo ‘
‘;

//loading links to sponsors and location information.

$logo_urls = unserialize($row[‘Logo’]);
$logo_link = unserialize($row[‘Weblink’]);
$logo_desc = unserialize($row[‘LogoDesc’]);
$j=0;
while($j<= (count($logo_urls)-1))
{
echo ‘‘;
$j++;
}

echo ‘
‘;
echo ‘
‘;
echo ‘Return to treepedia‘;
echo ‘
‘;
echo ‘
‘;

echo ‘Tree Biomass Calculator‘;
echo ‘
‘;
echo ‘
‘;

echo ‘Reference
‘;
$r1=unserialize($row[‘Reference’]);
$r2=0;
while($r2<=(count($r1)-1))
{
$item_nbr = $r2+1;
echo ‘‘ . $item_nbr . ‘. ‘ . $r1[$r2] . ‘
‘;
$r2++;
}

echo ‘
‘;
echo ‘
‘;

$f1=unserialize($row[‘Footer’]);
$f2=0;
while($f2<=(count($f1)-1))
{
echo ‘‘ . $f1[$f2] . ‘
‘;
$f2++;

}

//query to insert page view info into MySQL.
$Location = $row[‘Location’];
$CommonName = $row[‘CommonName’];
date_default_timezone_set(“America/New_York”);
$Date = date(“Y/m/d”);
$Time = date(“H:i:s”);
$Lat = $row[‘Lat’];
$Lon = $row[‘Long’];
$IP = $_SERVER[“REMOTE_ADDR”];

$sqlquery2 = “INSERT INTO CountTreeCaching (TreeCode, Location, CommonName, Lat, Lon, Date, Time, IP) VALUES (‘$webcodeurl[1]’,’$Location’,’$CommonName’, ‘$Lat’, ‘$Lon’, ‘$Date’, ‘$Time’, ‘$IP’)”;

if (mysqli_multi_query($con, $sqlquery2)) {
} else {
echo “Error: ” . $sqlquery2 . ”
” . mysqli_error($con);
}

}
mysqli_close($con);

[/insert_php]