返回列表 發帖

20110703投票系統look_vote.php

<?php
    include("conn/conn.php");
?>
<html>
<head>
<title>投票程式——顯示投票項</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style></head>
<body>
<table width="1003" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="3"><img src="images/bg2_06 (3).gif" width="1003" height="160"></td>
  </tr>
  <tr>
    <td width="101" align="right" background="images/b_02.gif">&nbsp;</td>
    <td width="812" valign="top"><table width="812" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="626" height="97"><img src="images/bg2_06 (5).gif" width="626" height="97"></td>
        <td rowspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td><img src="images/bg2_06 (6).gif" width="186" height="244"></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td align="center" valign="middle">
         
    <center>
<?php

    $sql = "SELECT * FROM tb_vote WHERE tb_vote_id = {$_GET['id']}";
    $result = mysql_query($sql,$conn);
    $row = mysql_fetch_array($result);
    $s = $row['tb_vote_num'];   // 儲存選擇項目有幾個
    echo "<h1>".$row['tb_vote_name']."</h1>";  // 顯示議題主旨
?>

<table width="626" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" background="images/bg3.gif" bgcolor="#FFFFFF">
<form action=look_vote_ok.php method=post>
<input type=hidden name=id value="<?php echo $row['tb_vote_id']?>">
<input type=hidden name=v_type value="<?php echo $row['tb_vote_type']?>">
<tr>
<td width="163" height="25" align="center">&nbsp;</td>
<td width="195" align="center">選項</td>
<td width="260" align="center">投票結果</td>
</tr>
<?php
     
    $sql = "select * from tb_vote_record where tb_vote_id='$_GET[id]'";
    $result = mysql_query($sql,$conn);
    while($rows=mysql_fetch_array($result)){
?>
<tr>
<td height="25" align="center">
<?php
    // 判斷選單的形式, 0 : 單選 1 : 複選
    if($row['tb_vote_type'] == 0){ // 單選
        echo "<input type='radio' name='r' value = {$row['tb_record_id']}>";
    }else{  // 複選
        echo "<input type='checkbox' name='r[]'  value = {$row['tb_record_id']}>";
    }


?></td>
<td>&nbsp;<?php?></td>
<td>&nbsp;
<?php?>
</td>
</tr>
<?php } ?>

<tr><td height="25" colspan=3><center>
  <input type=submit value="確認提交"></center></td></tr>
</form>
</table>
<?php
?>
     



</td>
      </tr>
      <tr>
        <td height="59"><img src="images/bg2_06 (1).gif" width="626" height="59"></td>
        <td>&nbsp;</td>
      </tr>
    </table></td>
    <td width="90" background="images/bg2_06.gif">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3"><img src="images/bg2_06 (2).gif" width="1003" height="90"></td>
  </tr>
</table>

</body>
</html>
May

返回列表