<?php require_once('../../Connections/WWF.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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;
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO othermangrove (mangrove1_1, mangrove1_2, mangrove2_1, mangrove2_2, mangrove3_1, mangrove3_2, mangrove4_1, mangrove4_2) VALUES (%s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['mangrove1_1'], "text"),
                       GetSQLValueString($_POST['mangrove1_2'], "text"),
                       GetSQLValueString($_POST['mangrove2_1'], "text"),
                       GetSQLValueString($_POST['mangrove2_2'], "text"),
                       GetSQLValueString($_POST['mangrove3_1'], "text"),
                       GetSQLValueString($_POST['mangrove3_2'], "text"),
                       GetSQLValueString($_POST['mangrove4_1'], "text"),
                       GetSQLValueString($_POST['mangrove4_2'], "text"));

  mysql_select_db($database_WWF, $WWF);
  $Result1 = mysql_query($insertSQL, $WWF) or die(mysql_error());
}

mysql_select_db($database_WWF, $WWF);
$query_othermangrove = "SELECT * FROM othermangrove";
$othermangrove = mysql_query($query_othermangrove, $WWF) or die(mysql_error());
$row_othermangrove = mysql_fetch_assoc($othermangrove);
$totalRows_othermangrove = mysql_num_rows($othermangrove);
?><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">
<!--
.style52 {font-weight: bold; color: #006600;}
.style53 {color: #006600}
.style54 {color: #006500}
.style56 {color: #003000}
.style58 {color: #003300}
.style70 {
	color: #000;
	background-color: #0FF;
}
.style65 {color: #006633; font-weight: bold;}
.style66 {font-size: 14pt}
.style68 {color: #006633; font-size: 12pt; }
.style69 {
	color: #039;
}
.style71 {font-size: 12pt; }
-->
</style>
</head>

<body style="background-attachment: fixed" bgcolor="#FFFFCC">
<p align="center" class="style66"><img src="mangrove2_s.jpg" width="228" height="113"></p>
<table width="826" border="1" align="center">
  <tr>
    <td colspan="2" bgcolor="#E1FFF0" class="style66"><div align="center"><span class="style52">任務</span></div></td>
  </tr>
  <tr>
    <td width="98" bgcolor="#E1FFF0" class="style66"><span class="style53">任務三</span></td>
    <td width="712" bgcolor="#E1FFF0" class="style66"><span class="style54">試找出保護區裡的其他紅樹，並紀錄它們的特徵。 </span></td>
  </tr>
</table>
<form action="<?php echo $editFormAction; ?>" method="POST" name="form1" class="style66">
  <?php if ($totalRows_othermangrove == 0) { // Show if recordset empty ?>
  <table width="802" border="1" align="center">
    <tr>
      <td width="393"><div align="center" class="style71">
          <p><strong>銀葉樹</strong></p>
        <p><img src="mangrove-third/picture1.jpg" width="325" height="246"></p>
        <p>
            <label><span class="style56">特徵1
              <select name="mangrove1_1" id="mangrove1_1">
              <option value="  " selected></option>
              <option value="characteristic1-1">出水通氣根</option>
              <option value="characteristic1-2">板根</option>
              <option value="characteristic1-3">鹽腺</option>
              <option value="characteristic1-4">葉面有蠟質</option>
                    </select>
            </span></label>
            <span class="style56">
            <label>特徵2
              <select name="mangrove1_2" id="mangrove1_2">
                <option value="  " selected> </option>
                <option value="chracteristic2-1">胚軸像雪茄</option>
              <option value="chracteristic2-2">果實為球形</option>
              <option value="chracteristic2-3">果實像似超人臉</option>
              <option value="chracteristic2-4">胚軸像指天椒</option>
                </select>
            </label>
          </span></p>
      </div></td>
      <td width="393"><div align="center" class="style71">
          <p><span class="style56"><strong>桐花樹</strong></span></p>
        <p><img src="mangrove-third/picture4.jpg" width="329" height="247"></p>
        <p>
            <label><span class="style56">特徵1
              <select name="mangrove2_1" id="mangrove2_1">
              <option value="  " selected> </option>
              <option value="characteristic1-1">出水通氣根</option>
              <option value="characteristic1-2">板根</option>
              <option value="characteristic1-3">鹽腺</option>
              <option value="characteristic1-4">葉面有蠟質</option>
                </select>
            </span></label>
            <span class="style56">
            <label>特徵2
              <select name="mangrove2_2" id="select2">
                <option value="  " selected> </option>
                <option value="chracteristic2-1">胚軸像雪茄</option>
              <option value="chracteristic2-2">果實為球形</option>
              <option value="chracteristic2-3">果實像似超人臉</option>
              <option value="chracteristic2-4">胚軸像指天椒</option>
                </select>
            </label>
          </span></p>
      </div></td>
    </tr>
    <tr>
      <td><div align="center" class="style71">
          <p><span class="style58"><strong>白骨壤</strong></span></p>
        <p><img src="mangrove-third/picture3.jpg" width="319" height="243"></p>
        <p><span class="style58">
            <label><span class="style56">特徵1
              <select name="mangrove3_1" id="mangrove3_1">
                <option value="  " selected> </option>
                <option value="characteristic1-1">出水通氣根</option>
              <option value="characteristic1-2">板根</option>
              <option value="characteristic1-3">鹽腺</option>
              <option value="characteristic1-4">葉面有蠟質</option>
                  </select>
            </span></label>
            <span class="style56">
            <label>特徵2
              <select name="mangrove3_2" id="select3">
                <option value="  " selected> </option>
                <option value="chracteristic2-1">胚軸像雪茄</option>
              <option value="chracteristic2-2">果實為球形</option>
              <option value="chracteristic2-3">果實像似超人臉</option>
              <option value="chracteristic2-4">胚軸像指天椒</option>
                </select>
            </label>
            </span></span><br>
          </p>
      </div></td>
      <td><div align="center" class="style71">
          <p><span class="style56"><strong>木欖</strong></span></p>
        <p><img src="mangrove-third/picture2.jpg" width="206" height="303"></p>
        <p><span class="style56">
            <label>特徵1
              <select name="mangrove4_1" id="mangrove4_1">
              <option value="  " selected> </option>
              <option value="characteristic1-1">出水通氣根</option>
              <option value="characteristic1-2">板根</option>
              <option value="characteristic1-3">鹽腺</option>
              <option value="characteristic1-4">葉面有蠟質</option>
                </select>
            </label>
            <label>特徵2
              <select name="mangrove4_2" id="select4">
                <option value="  " selected> </option>
                <option value="chracteristic2-1">胚軸像雪茄</option>
              <option value="chracteristic2-2">果實為球形</option>
              <option value="chracteristic2-3">果實像似超人臉</option>
              <option value="chracteristic2-4">胚軸像指天椒</option>
                </select>
            </label>
          </span></p>
      </div></td>
    </tr>
  </table>
  <p align="center">
    <label>
    <input type="submit" name="Submit" value="儲存">
    </label>
    <input type="hidden" name="MM_insert" value="form1">
  </p>
  <?php } // Show if recordset empty ?></form>
<?php if ($totalRows_othermangrove > 0) { // Show if recordset not empty ?>
  <table width="802" border="1" align="center">
    <tr>
      <td width="393" class="style66"><div align="center" class="style68">
        <p><strong>銀葉樹</strong></p>
        <p><img src="mangrove-third/picture1.jpg" width="325" height="246"><br>
          <span class="style69"><strong>銀葉樹最大特徵是葉背呈銀色。果實內含纖維可浮水，把種子傳播開去。</strong></span><span class="style70"><strong>果實形狀像超人臉</strong></span><span class="style69"><strong>，甚可愛。突出土壤的</strong></span><span class="style70"><strong>板根</strong></span><span class="style69"><strong>，可以增加根部的呼吸面積。</strong></span></p>
          <p><strong>
              
          <label></label>
          </strong><strong>你的答案(正確答案)</strong></p>
        <p><strong>特徵1：<? $mangrove1_1= $row_othermangrove['mangrove1_1'];
If (   $mangrove1_1 == 'characteristic1-1')
{echo '通水通氣根';}
else if ($mangrove1_1 == 'characteristic1-2')
{echo '板根';}
else if ($mangrove1_1 == 'characteristic1-3')
{echo '鹽腺';}
else if ($mangrove1_1 == 'characteristic1-4')
{echo '葉面有蠟質';}
else if ($mangrove1_1 == '  ')
{echo '  ';}
 ?>(板根)<br>
          特徵2：<? $mangrove1_2= $row_othermangrove['mangrove1_2'];
If (   $mangrove1_2 == 'chracteristic2-1')
{echo '胚軸像雪茄';}
else if ($mangrove1_2 == 'chracteristic2-2')
{echo '果實為球形';}
else if ($mangrove1_2 == 'chracteristic2-3')
{echo '果實像似超人臉';}
else if ($mangrove1_2 == 'chracteristic2-4')
{echo '胚軸像指天椒';}
else if ($mangrove1_2 == '  ')
{echo '  ';}
 ?>
 (果實像似超人臉)<br>
          </strong></p>
      </div></td>
      <td width="393" class="style66"><div align="center" class="style68">
        <p><strong>桐花樹</strong></p>
        <p><strong><img src="mangrove-third/picture4.jpg" width="329" height="247"><br>
          <span class="style69">桐花樹成熟的胚軸有點捲曲，呈粉紅色,有人覺得它的</span><span class="style70">胚軸像指天椒</span><span class="style69">。桐花樹還會透過葉子的</span><span class="style70">鹽線</span><span class="style69">把鹽分排泄出來</span></strong>。</p>
        <p class="style65">
          <label></label>
          你的答案(正確答案)</p>
        <p><strong>特徵1：<? $mangrove2_1= $row_othermangrove['mangrove2_1'];
If (   $mangrove2_1 == 'characteristic1-1')
{echo '通水通氣根';}
else if ($mangrove2_1 == 'characteristic1-2')
{echo '板根';}
else if ($mangrove2_1 == 'characteristic1-3')
{echo '鹽腺';}
else if ($mangrove2_1 == 'characteristic1-4')
{echo '葉面有蠟質';}
else if ($mangrove2_1 == '  ')
{echo '  ';}
 ?>(鹽腺)<br>
          特徵2：<?php $mangrove2_2= $row_othermangrove['mangrove2_2'];
If (   $mangrove2_2 == 'chracteristic2-1')
{echo '胚軸像雪茄';}
else if ($mangrove2_2 == 'chracteristic2-2')
{echo '果實為球形';}
else if ($mangrove2_2 == 'chracteristic2-3')
{echo '果實像似超人臉';}
else if ($mangrove2_2 == 'chracteristic2-4')
{echo '胚軸像指天椒';}
else if ($mangrove2_2 == '  ')
{echo '  ';}
 ?>(胚軸像指天椒)</strong></p>
      </div></td>
    </tr>
    <tr>
      <td><div align="center" class="style68">
        <p><strong>白骨壤</strong></p>
        <p><img src="mangrove-third/picture3.jpg" width="319" height="243"><br>
          <strong><span class="style69">白骨壤是較近海的紅樹品種,它的</span><span class="style70">出水通氣根</span><span class="style69">像點陣圖一樣佈滿樹木周圍的泥土上。它的</span><span class="style70">果實扁球形</span><span class="style69">及淡灰黃色。</span></strong></p>
        <p><strong>
          <label></label>
          你的答案(正確答案)</strong></p>
        <p><strong>特徵1：<? $mangrove3_1= $row_othermangrove['mangrove3_1'];
If (   $mangrove3_1 == 'characteristic1-1')
{echo '通水通氣根';}
else if ($mangrove3_1 == 'characteristic1-2')
{echo '板根';}
else if ($mangrove3_1 == 'characteristic1-3')
{echo '鹽腺';}
else if ($mangrove3_1 == 'characteristic1-4')
{echo '葉面有蠟質';}
else if ($mangrove3_1 == '  ')
{echo '  ';}
 ?>(出水通氣根)<br>
          特徵2：<?php $mangrove3_2= $row_othermangrove['mangrove3_2'];
If (   $mangrove3_2 == 'chracteristic2-1')
{echo '胚軸像雪茄';}
else if ($mangrove3_2 == 'chracteristic2-2')
{echo '果實為球形';}
else if ($mangrove3_2 == 'chracteristic2-3')
{echo '果實像似超人臉';}
else if ($mangrove3_2 == 'chracteristic2-4')
{echo '胚軸像指天椒';}
else if ($mangrove3_2 == '  ')
{echo '  ';}
 ?>(果實為球形)<br>
          </strong></p>
      </div></td>
      <td><div align="center" class="style68">
        <p><strong>木欖</strong></p>
        <p><img src="mangrove-third/picture2.jpg" width="206" height="303"><br>
          <strong class="style69">木欖含大量單寧酸,可抽取作紅色之染料。它的<span class="style70">胚軸恰似一根根掛在樹上的雪茄</span>。葉面上有一層<span class="style70">蠟質</span>，防止水份大量蒸發。</strong></p>
        <p><strong>
          <label></label>
          你的答案(正確答案)</strong></p>
        <p><strong>特徵1：<? $mangrove4_1= $row_othermangrove['mangrove4_1'];
If (   $mangrove4_1 == 'characteristic1-1')
{echo '通水通氣根';}
else if ($mangrove4_1 == 'characteristic1-2')
{echo '板根';}
else if ($mangrove4_1 == 'characteristic1-3')
{echo '鹽腺';}
else if ($mangrove4_1 == 'characteristic1-4')
{echo '葉面有蠟質';}
else if ($mangrove4_1 == '  ')
{echo '  ';}
 ?>(葉面有蠟質)<br>
          特徵2：<?php $mangrove4_2= $row_othermangrove['mangrove4_2'];
If (   $mangrove4_2 == 'chracteristic2-1')
{echo '胚軸像雪茄';}
else if ($mangrove4_2 == 'chracteristic2-2')
{echo '果實為球形';}
else if ($mangrove4_2 == 'chracteristic2-3')
{echo '果實像似超人臉';}
else if ($mangrove4_2 == 'chracteristic2-4')
{echo '胚軸像指天椒';}
else if ($mangrove4_2 == '  ')
{echo '  ';}
 ?>(胚軸像雪茄)<br>
          </strong></p>
      </div></td>
    </tr>
      </table>
  <p align="center"><input name="action2" type="submit" id="action2" onClick="printme();" value="儲存">&nbsp;</p>
  <?php } // Show if recordset not empty ?><p align="center">&nbsp;</p>
<p align="center"><a href="activity.html"><img src="back to activity.jpg" width="172" height="56" border="0"></a></p>
<p align="center"><a href="map.html"><img src="main.jpg" width="172" height="56" border="0"></a></p>
</body>

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