標題:
20110703投票系統look_vote.php
[打印本頁]
作者:
may
時間:
2011-7-3 11:08
標題:
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"> </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> </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"> </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> <?php?></td>
<td>
<?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> </td>
</tr>
</table></td>
<td width="90" background="images/bg2_06.gif"> </td>
</tr>
<tr>
<td colspan="3"><img src="images/bg2_06 (2).gif" width="1003" height="90"></td>
</tr>
</table>
</body>
</html>
歡迎光臨 種子論壇 | 高雄市資訊培育協會學員討論區 (http://istak.org.tw/seed/)
Powered by Discuz! 7.2