<?php require_once('../../Connections/WWF.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  }

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

mysql_select_db($database_WWF, $WWF);
$query_Bird = "SELECT * FROM birds WHERE Quantity >= '1'";
$Bird = mysql_query($query_Bird, $WWF) or die(mysql_error());
$row_Bird = mysql_fetch_assoc($Bird);
$totalRows_Bird = mysql_num_rows($Bird);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><style media="print" type="text/css">.no-print{display:None}</style><style media="print" type="text/css">
.no-print{display:None}
</style><script src="print.js" type="text/javascript"></script>
<meta http-equiv="Content-Type" content="text/html; charset=big5" />
<title>看看我的成果</title>
<style type="text/css">
<!--
body {
	background-color: #E7FFF2;
}
#Layer1 {
	position:absolute;
	left:323px;
	top:141px;
	width:208px;
	height:109px;
	z-index:1;
}
.style6 {font-size: 12pt; color: #006600; }
-->
</style></head>

<body>
<center>
  <p><img src="see my result.jpg" width="279" height="139" /></p>
  <table width="733" border="1">
    <?php do { ?>
      <tr>
        <td width="288" bordercolor="#990000" bgcolor="#FFF2EC"><div align="center" class="style6"><img src ="<?php echo $row_Bird['photo']; ?>" ></div></td>
        <td width="429" bordercolor="#990000" bgcolor="#FFF2EC"><p class="style6">雀鳥名稱：
            <?
		  $birdname= $row_Bird['BirdName'];
If ($birdname == '1LittleEgret')
{echo '小白鷺';}
else if ($birdname == '2GreatEgret')
{echo '大白鷺';}
else if($birdname == '3ChinesePond_Heron')
{echo '池鷺';}
else if($birdname == '4LittleGrebe')
{echo '小鷿"虒鳥"';}
else if($birdname == '5CommonMoorhen')
{echo '黑水雞';}
else if($birdname == '6WhiteBreastedWaterhen')
{echo '白胸苦惡鳥';}
else if($birdname == '7WhiteThroatedKingfisher')
{echo '白胸翡翠';}
else if($birdname == '8ComonKingfisher')
{echo '普通翠鳥';}
else if($birdname == '9WhiteWagtail')
{echo '白鶺鴒';}
else if($birdname == '10spotteddove')
{echo '珠頸斑鳩';}
else if($birdname == '11LongTailedShike')
{echo '棕背伯勞';}
else if($birdname == '12MapieRobin')
{echo '鵲鴝';}
else if($birdname == '13BlackKite')
{echo '麻鷹';}
else if($birdname == '14GreatCormorant')
{echo '鸕"茲鳥"';}
else if($birdname == '15BlackFacedSpoonbill')
{echo '黑臉琵鷺';}
else if($birdname == '16EurasianWigeon')
{echo '赤頸鴨';}
else if($birdname == '17NorthernPintail')
{echo '針尾鴨';}
else if($birdname == '18BlackWinged_Stilt')
{echo '黑翅長腳鷸';}
else if($birdname == '19Pied_Avocet')
{echo '反咀鷸';}
else if($birdname == '20BarnSwallow')
{echo '家燕';}
else if($birdname == '21MarshSandpiper')
{echo '澤鷸';}
else if($birdname == '22CommonRedshank')
{echo '紅腳鷸';}
else if($birdname == '23GreyHeron')
{echo '蒼鷺';}
?>
            <br />
            <br />
            數量：        <?php echo $row_Bird['Quantity']; ?></p>
          <p class="style6">
            出沒位置：
            <? $place1= $row_Bird['place1'];
		$place2=$row_Bird['place2'];
		$place3=$row_Bird['place3'];
$place4=$row_Bird['place4'];
$place5=$row_Bird['place5'];

If (  $place1 == Water)
{echo '水面';}  
If($place1==Water && $place2 ==Island)
{echo '/';}
else If($place1==Water && $place3 ==Tree)
{echo'/';}
else If($place1==Water && $place4 ==Sky)
{echo'/';}
else If($place1==Water && $place5 ==Grassland)
{echo'/';}

If($place2 ==Island)				
{echo '小島';}

If($place2==Island && $place3 ==Tree)
{echo'/';}
else If($place2==Island && $place4 ==Sky)
{echo'/';}
else If($place2==Island && $place5 ==Grassland)
{echo'/';}

If($place3== Tree)				
{echo '樹上';}

If($place3==Tree && $place4 == Sky)
{echo'/';}
else If($place3==Tree && $place5 == Grassland)
{echo'/';}

if ($place4 == Sky)
{echo '天空';}

If($place4==Sky && $place5 == Grassland)
{echo'/';}

if ($place5 == Grassland)
{echo '草叢';}

?>
          </p>
          <p class="style6">行為：<? $behaviour1 = $row_Bird['Behaviour1'];
		  								$behaviour2 = $row_Bird['Behaviour2'];
										$behaviour3 = $row_Bird['Behaviour3'];
										$behaviour4 = $row_Bird['Behaviour4'];
If (  $behaviour1 == Eating)
{echo '覓食';}  
If($behaviour1==Eating && $behaviour2 ==Resting)
{echo '/';}
else If($behaviour1==Eating && $behaviour3 ==Flying)
{echo '/';}
else If($behaviour1==Eating && $behaviour4 ==Swimming)
{echo '/';}

If (  $behaviour2 == Resting)
{echo '休息';}  
If($behaviour2==Resting && $behaviour3 ==Flying)
{echo '/';}
else If($behaviour2==Resting && $behaviour4 ==Swimming)
{echo '/';}

If (  $behaviour3 == Flying)
{echo '飛行';}  
If($behaviour3==Flying && $behaviour4 == Swimming)
{echo '/';}
If (  $behaviour4 == Swimming)
{echo '游泳';}  

		  ?></p>
          <p class="style6">我的喜愛指數：<?php echo $row_Bird['Score']; ?></p>
        </td>
      </tr>
      <?php } while ($row_Bird = mysql_fetch_assoc($Bird)); ?>
  </table>
  <p> <input name="action2" type="submit" id="action2" onClick="printme();" value="儲存">&nbsp;</p>
  <p><a href="activity.html"><img src="back to activity.jpg" width="172" height="56" border="0" /></a></p>
  <p><a href="map.html"><img src="main.jpg" width="172" height="56" border="0" /></a> </p>
  <p>
   
  </p>
  <p>&nbsp;    </p>
</center>
</body>
</html>
<?php
mysql_free_result($Bird);
?>

     