標題:
20110703投票系統vote.php
[打印本頁]
作者:
may
時間:
2011-7-3 12:13
標題:
20110703投票系統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">
<p>
<a href=vote.php>新增記錄</a>
<p>
<?php
$sql = "SELECT * FROM tb_vote";
$result = mysql_query($sql,$conn);
// 執行 sql 語法 執行結果存到 result 變數(字串陣列)
$row = mysql_fetch_array($result);
// 提取 result 陣列
if($row == 0){
// 如果提取不到投票議題 代表目前沒有投票活動
echo "目前沒有投票議題!!";
}else{
?>
<table width="626" border='1' cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" background="images/bg3.gif" bgcolor="#FFFFFF">
<tr>
<td width='163' height="24" align="center">項</td>
<td width='195' align="center">
投票主旨名稱</td>
<td width='260' align="center">操作</td>
</tr>
<?php
$sql = "SELECT * FROM tb_vote";
$result = mysql_query($sql,$conn);
$i = 0; // 計數
while($rs = mysql_fetch_array($result)){
$i++;
?>
<tr>
<td height="24" align="center">
第<?php echo $i;?>條</td>
<td>
<a href="look_vote.php?id=<?php echo $rs['tb_vote_id'] // 顯示議題編號?>"><?php echo $rs['tb_vote_name'] // 議題主旨?></a>
</td>
<td align="center">
<a href="delete_vote.php?id=<?php echo $rs['tb_vote_id'] // 議題編號?>">刪除</a></td>
</tr>
<?php }?>
</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://seed.istak.org.tw/)
Powered by Discuz! 7.2