<?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_phytoplankton1 = "SELECT * FROM planktonnew WHERE phytoplankton1 = '1'";
$phytoplankton1 = mysql_query($query_phytoplankton1, $WWF) or die(mysql_error());
$row_phytoplankton1 = mysql_fetch_assoc($phytoplankton1);
$totalRows_phytoplankton1 = mysql_num_rows($phytoplankton1);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton2 = "SELECT * FROM planktonnew WHERE phytoplankton2 = '1'";
$phytoplankton2 = mysql_query($query_phytoplankton2, $WWF) or die(mysql_error());
$row_phytoplankton2 = mysql_fetch_assoc($phytoplankton2);
$totalRows_phytoplankton2 = mysql_num_rows($phytoplankton2);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton3 = "SELECT * FROM planktonnew WHERE phytoplankton3 = '1'";
$phytoplankton3 = mysql_query($query_phytoplankton3, $WWF) or die(mysql_error());
$row_phytoplankton3 = mysql_fetch_assoc($phytoplankton3);
$totalRows_phytoplankton3 = mysql_num_rows($phytoplankton3);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton4 = "SELECT * FROM planktonnew WHERE phytoplankton4 = '1'";
$phytoplankton4 = mysql_query($query_phytoplankton4, $WWF) or die(mysql_error());
$row_phytoplankton4 = mysql_fetch_assoc($phytoplankton4);
$totalRows_phytoplankton4 = mysql_num_rows($phytoplankton4);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton5 = "SELECT * FROM planktonnew WHERE phytoplankton5 = '1'";
$phytoplankton5 = mysql_query($query_phytoplankton5, $WWF) or die(mysql_error());
$row_phytoplankton5 = mysql_fetch_assoc($phytoplankton5);
$totalRows_phytoplankton5 = mysql_num_rows($phytoplankton5);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton6 = "SELECT * FROM planktonnew WHERE phytoplankton6 = '1'";
$phytoplankton6 = mysql_query($query_phytoplankton6, $WWF) or die(mysql_error());
$row_phytoplankton6 = mysql_fetch_assoc($phytoplankton6);
$totalRows_phytoplankton6 = mysql_num_rows($phytoplankton6);

mysql_select_db($database_WWF, $WWF);
$query_phytoplankton7 = "SELECT * FROM planktonnew WHERE phytoplankton7 = '1'";
$phytoplankton7 = mysql_query($query_phytoplankton7, $WWF) or die(mysql_error());
$row_phytoplankton7 = mysql_fetch_assoc($phytoplankton7);
$totalRows_phytoplankton7 = mysql_num_rows($phytoplankton7);

mysql_select_db($database_WWF, $WWF);
$query_plankton1 = "SELECT * FROM planktonnew WHERE plankton1 = '1'";
$plankton1 = mysql_query($query_plankton1, $WWF) or die(mysql_error());
$row_plankton1 = mysql_fetch_assoc($plankton1);
$totalRows_plankton1 = mysql_num_rows($plankton1);

mysql_select_db($database_WWF, $WWF);
$query_plankton2 = "SELECT * FROM planktonnew WHERE plankton2 = '1'";
$plankton2 = mysql_query($query_plankton2, $WWF) or die(mysql_error());
$row_plankton2 = mysql_fetch_assoc($plankton2);
$totalRows_plankton2 = mysql_num_rows($plankton2);

mysql_select_db($database_WWF, $WWF);
$query_plankton3 = "SELECT * FROM planktonnew WHERE plankton3 = '1'";
$plankton3 = mysql_query($query_plankton3, $WWF) or die(mysql_error());
$row_plankton3 = mysql_fetch_assoc($plankton3);
$totalRows_plankton3 = mysql_num_rows($plankton3);

mysql_select_db($database_WWF, $WWF);
$query_plankton4 = "SELECT * FROM planktonnew WHERE plankton4 = '1'";
$plankton4 = mysql_query($query_plankton4, $WWF) or die(mysql_error());
$row_plankton4 = mysql_fetch_assoc($plankton4);
$totalRows_plankton4 = mysql_num_rows($plankton4);

mysql_select_db($database_WWF, $WWF);
$query_plankton5 = "SELECT * FROM planktonnew WHERE plankton5 = '1'";
$plankton5 = mysql_query($query_plankton5, $WWF) or die(mysql_error());
$row_plankton5 = mysql_fetch_assoc($plankton5);
$totalRows_plankton5 = mysql_num_rows($plankton5);

mysql_select_db($database_WWF, $WWF);
$query_plankton6 = "SELECT * FROM planktonnew WHERE plankton6 = '1'";
$plankton6 = mysql_query($query_plankton6, $WWF) or die(mysql_error());
$row_plankton6 = mysql_fetch_assoc($plankton6);
$totalRows_plankton6 = mysql_num_rows($plankton6);

mysql_select_db($database_WWF, $WWF);
$query_plankton7 = "SELECT * FROM planktonnew WHERE plankton7 = '1'";
$plankton7 = mysql_query($query_plankton7, $WWF) or die(mysql_error());
$row_plankton7 = mysql_fetch_assoc($plankton7);
$totalRows_plankton7 = mysql_num_rows($plankton7);

mysql_select_db($database_WWF, $WWF);
$query_plankton8 = "SELECT * FROM planktonnew WHERE plankton8 = '1'";
$plankton8 = mysql_query($query_plankton8, $WWF) or die(mysql_error());
$row_plankton8 = mysql_fetch_assoc($plankton8);
$totalRows_plankton8 = mysql_num_rows($plankton8);
?>
<html>

<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-Language" content="zh-tw">
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>浮游生物多面睇</title>
<base target="_self">
<style type="text/css">
<!--
.style6 {color: #ECE9D8}
.style12 {	color: #006600;
	font-size: 12pt;
}
.style121 {	color: #006600;
	font-size: 12pt;
	text-align: center;
}
.style2 {	color: #006600;
	font-weight: bold;
	font-size: 16px;
}
.style8 {	color: #006600;
	font-weight: bold;
	font-size: 14pt;
	font-family: "新細明體";
}
-->
</style>
</head>

<body style="background-attachment: fixed" bgcolor="#FFFFCC">
<div align="center">
  <p><img src="plankton_s.jpg" alt="鳥兒逐隻數" width="228" height="113">&nbsp;</p>
  <p class="style121">結果</p>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton1 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span style="text-align: center"><img src="Plankton_new/phytoplankton1.jpg" width="214" height="156" border="0" /></span></td>
        <td width="211" align="center"><span class="style121">角藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton2 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><img src="Plankton_new/phytoplankton2.jpg" width="199" height="164" border="0" /></td>
        <td width="211" align="center"><span class="style121">角藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton3 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><img src="Plankton_new/phytoplankton3.jpg" width="199" height="165" border="0" /></td>
        <td width="211" align="center"><span class="style121">夜光藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton4 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><img src="Plankton_new/phytoplankton4.jpg" width="196" height="162" border="0" /></td>
        <td width="211" align="center"><span class="style121">根管藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton5 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/phytoplankton5.jpg" width="216" height="161" border="0" /></span></td>
        <td width="211" align="center"><span class="style121">盒形藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton6 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/phytoplankton6.jpg" width="204" height="168" border="0" /></span></td>
        <td width="211" align="center"><span class="style121">圓篩藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_phytoplankton7 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/phytoplankton7.jpg" width="208" height="172" border="0" /></span></td>
        <td width="211" align="center"><span class="style121">彎角藻</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton1 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton1.jpg" width="209" height="162" /></span></td>
        <td width="211" align="center"><span class="style121">水母幼體</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton2 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton2.jpg" width="213" height="164" /></span></td>
        <td width="211" align="center"><span class="style121">水蚤</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton3 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton3.jpg" width="205" height="163" /></span></td>
        <td width="211" align="center"><span class="style121">多毛蟲綱</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton4 > 0) { // Show if recordset not empty ?>
  <tr>
    <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton4.jpg" width="209" height="164" /></span></td>
    <td width="211" align="center"><span class="style121">放射蟲</span></td>
  </tr>
  <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton5 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton5.jpg" width="213" height="165" /></span></td>
        <td width="211" align="center"><span class="style121">橈足亞綱</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton6 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton6.jpg" width="220" height="158" /></span></td>
        <td width="211" align="center"><span class="style121">橈足亞綱 </span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton7 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton7.jpg" width="220" height="183" /></span></td>
        <td width="211" align="center"><span class="style121">雙殼綱</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <table width="509" border="1">
    <?php if ($totalRows_plankton8 > 0) { // Show if recordset not empty ?>
      <tr>
        <td width="282" align="center"><span class="style121"><img src="Plankton_new/plankton8.jpg" width="221" height="147" /></span></td>
        <td width="211" align="center"><span class="style121">纖毛蟲</span></td>
      </tr>
      <?php } // Show if recordset not empty ?>
  </table>
  <p>
    <input name="action" type="submit" id="action" onClick="printme();" value="儲存">
  </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>Photos copyright (c) WWF-Hong Kong</p>
</div>
<p align="center">&nbsp;</p>
</body>

</html>
<?php
mysql_free_result($phytoplankton1);

mysql_free_result($phytoplankton2);

mysql_free_result($phytoplankton3);

mysql_free_result($phytoplankton4);

mysql_free_result($phytoplankton5);

mysql_free_result($phytoplankton6);

mysql_free_result($phytoplankton7);

mysql_free_result($plankton1);

mysql_free_result($plankton2);

mysql_free_result($plankton3);

mysql_free_result($plankton4);

mysql_free_result($plankton5);

mysql_free_result($plankton6);

mysql_free_result($plankton7);

mysql_free_result($plankton8);
?>
