?? adminvote_body.asp
字號:
<%sub adminvote_body()
%>
<!--#include file="admintop.asp"-->
<table width="<%=tablewidth%>" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="205" bgcolor="#FFFFFF" valign="top" class="line">
<%call adminmenu()%>
</td>
<td width="565" bgcolor="#FFFFFF" valign="top" align="center" class="linee">
<table width="98%" border="0" cellpadding="0" cellspacing="1" background="images/dh.gif" class="linee">
<tr align="center">
<td width="50%" height="25"><a href="admin_vote.asp?action=newvote">新增投票主題</a></td>
<td width="50%"><a href="admin_vote.asp?action=vote">投票主題管理</a></td>
</tr>
</table>
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="6"></td>
</tr>
</table>
<%
sql="select * from votetopic"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<tr>
<td colspan="3" background="images/dh.gif">
<font color="#333333">投票主題管理</font></td>
</tr>
<tr bgcolor="#FFFFFF" align="center">
<td width="10%">編號</td>
<td width="60%">投票主題</td>
<td width="30%">操作</td>
</tr>
<%do while not rs.eof%>
<tr bgcolor="#FFFFFF">
<td align="center"><%=rs("vt_id")%> </td>
<td><%=rs("vt_name")%> </td>
<td align="center"><a href="admin_vote.asp?action=vote&caction=edit&id=<%=rs("vt_id")%>">edit</a>
<a href="admin_vote.asp?action=vote&caction=del&id=<%=rs("vt_id")%>">del</a></td>
</tr>
<%rs.movenext
loop
if rs.bof and rs.eof then%>
<tr bgcolor="#FFFFFF">
<td colspan="3" align="center">當前沒有投票主題!</td>
</tr>
<%end if%>
</table><br>
<%if request.querystring("action")="newvote" then%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form1" method="post" action="">
<tr>
<td colspan="2" background="images/dh.gif">
<font color="#333333">新增投票主題</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%">主題名稱</td>
<td width="84%">
<input type="text" name="vt_name" size="50" maxlength="50" class="input">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%">開始日期</td>
<td width="84%">
<input type="text" name="vt_startdate" size="30" class="input">
例子:2002-09-30 </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%">過期日期</td>
<td width="84%">
<input type="text" name="vt_expiredate" size="30" class="input">
同上</td>
</tr>
<tr bgcolor="#E8E8E8" align="center">
<td colspan="2" height="30" bgcolor="#F5F5F5">
<input type="submit" name="Submit" value="確定新增" class="button">
<input type="reset" name="Reset" value="清空重填" class="button">
</td>
</tr>
<input type="hidden" name="action" value="newvote">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%end if
if request.querystring("action")="vote" then
sql="select * from votetopic"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if request.querystring("action")="vote" and request.querystring("caction")="edit" then
if request.querystring("id")="" then
errmsg=errmsg+"<br>"+"<li>你必須指定操作的對象!"
call diserror()
response.end
end if
sql="select * from votetopic where vt_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr>
<td colspan="3" background="images/dh.gif">
<font color="#333333">修改投票主題</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">主題名稱</td>
<td colspan="2">
<input type="text" name="vt_name" size="50" maxlength="50" class="input" value="<%=rs("vt_name")%>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">開始日期</td>
<td colspan="2">
<input type="text" name="vt_startdate" size="30" class="input" value="<%=rs("vt_startdate")%>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">過期日期</td>
<td colspan="2">
<input type="text" name="vt_expiredate" size="30" class="input" value="<%=rs("vt_expiredate")%>">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="3" background="images/dh.gif"><a href="admin_vote.asp?action=newitem&id=<%=rs("vt_id")%>">新增投票選項</a></td>
</tr>
<%sql="select * from voteitem where vt_id="&cint(request.querystring("id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<tr bgcolor="#FFFFFF">
<td width="18%">投票選項</td>
<td width="57%"><%=rs2("item_name")%> <%=rs2("item_count")%>票</td>
<td width="25%" align="center"><a href="admin_vote.asp?action=edititem&id=<%=rs2("item_id")%>&vt_id=<%=request.querystring("id")%>">edit</a>
<a href="admin_vote.asp?action=delitem&id=<%=rs2("item_id")%>&vt_id=<%=request.querystring("id")%>">del</a></td>
</tr>
<%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
<tr bgcolor="#FFFFFF">
<td colspan="3">當前沒有投票選項!</td>
</tr>
<%end if
rs2.close
set rs2=nothing%>
<tr align="center">
<td colspan="3" bgcolor="#F5F5F5" height="30">
<input type="submit" name="Submit" value="確定修改" class="button">
<input type="reset" name="Reset" value="清空重填" class="button">
</td>
</tr>
<input type="hidden" name="id" value="<%=rs("vt_id")%>">
<input type="hidden" name="action" value="editvote">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%
rs.close
set rs=nothing
end if
end if
if request.querystring("action")="newitem" then
if request.querystring("id")="" then
errmsg=errmsg+"<br>"+"<li>你必須指定操作的對象!"
call diserror()
response.end
end if
sql="select vt_name,vt_id from votetopic where vt_id="&cint(request.querystring("id"))
set rs=conn.execute(sql)%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form3" method="post" action="">
<tr>
<td colspan="2" background="images/dh.gif">新增投票選項</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">所屬主題</td>
<td width="87%"><%=rs("vt_name")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">選項名稱</td>
<td width="87%">
<input type="text" name="item_name" size="40" maxlength="20" class="input"></td>
</tr>
<tr align="center">
<td colspan="2" bgcolor="#F5F5F5" height="30">
<input type="submit" name="Submit" value="確定新增" class="button">
<input type="reset" name="Reset" value="清空重填" class="button">
</td>
</tr>
<input type="hidden" name="id" value="<%=rs("vt_id")%>">
<input type="hidden" name="action" value="newitem">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%rs.close
set rs=nothing
end if
if request.querystring("action")="edititem" then
if request.querystring("id")="" then
errmsg=errmsg+"<br>"+"<li>你必須指定操作的對象!"
call diserror()
response.end
end if
sql="select vt_name,vt_id from votetopic where vt_id="&cint(request.querystring("vt_id"))
set rs=conn.execute(sql)
sql="select item_id,item_name from voteitem where item_id="&cint(request.querystring("id"))
set rs2=conn.execute(sql)%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form3" method="post" action="">
<tr>
<td colspan="2" background="images/dh.gif">
<font color="#333333">修改投票選項</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">所屬主題</td>
<td width="87%"><%=rs("vt_name")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">選項名稱</td>
<td width="87%">
<input type="text" name="item_name" size="40" maxlength="20" class="input" value="<%=rs2("item_name")%>">
</td>
</tr>
<tr align="center">
<td colspan="2" bgcolor="#F5F5F5" height="30">
<input type="submit" name="Submit" value="確定修改" class="button">
<input type="reset" name="Reset" value="清空重填" class="button">
[<a href="admin_vote.asp?action=vote&caction=edit&id=<%=request.querystring("vt_id")%>">返回</a>]
</td>
</tr>
<input type="hidden" name="vtid" value="<%=rs("vt_id")%>">
<input type="hidden" name="id" value="<%=rs2("item_id")%>">
<input type="hidden" name="action" value="edititem">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%rs2.close
set rs2=nothing
rs.close
set rs=nothing
end if
if request.querystring("action")="delitem" then
if request.querystring("id")="" then
errmsg=errmsg+"<br>"+"<li>你必須指定操作的對象!"
call diserror()
response.end
end if
sql="select vt_name,vt_id from votetopic where vt_id="&cint(request.querystring("vt_id"))
set rs=conn.execute(sql)
sql="select item_id,item_name from voteitem where item_id="&cint(request.querystring("id"))
set rs2=conn.execute(sql)%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form3" method="post" action="">
<tr>
<td colspan="2" background="images/dh.gif">
<font color="#333333">刪除投票選項</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">所屬主題</td>
<td width="87%"><%=rs("vt_name")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="13%">選項名稱</td>
<td width="87%"><%=rs2("item_name")%></td>
</tr>
<tr align="center">
<td colspan="2" bgcolor="#F5F5F5" height="30">
<input type="submit" name="Submit" value="確定刪除" class="button">
[<a href="admin_vote.asp?action=vote&caction=edit&id=<%=request.querystring("vt_id")%>">返回</a>] </td>
</tr>
<input type="hidden" name="vtid" value="<%=rs("vt_id")%>">
<input type="hidden" name="id" value="<%=rs2("item_id")%>">
<input type="hidden" name="action" value="delitem">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%rs2.close
set rs2=nothing
rs.close
set rs=nothing
end if
if request.querystring("action")="vote" and request.querystring("caction")="del" then
if request.querystring("id")="" then
errmsg=errmsg+"<br>"+"<li>你必須指定操作的對象!"
call diserror()
response.end
end if
sql="select * from votetopic where vt_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%>
<table width="98%" border="1" cellspacing="0" cellpadding="4" bordercolor="#09DD77" style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr>
<td colspan="2" background="images/dh.gif">
<font color="#333333">刪除投票主題</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">主題名稱</td>
<td width="82%"><%=rs("vt_name")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">開始日期</td>
<td width="82%"><%=rs("vt_startdate")%></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="18%">過期日期</td>
<td width="82%"><%=rs("vt_expiredate")%></td>
</tr>
<%sql="select * from voteitem where vt_id="&cint(request.querystring("id"))
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
<tr bgcolor="#FFFFFF">
<td width="18%">投票選項</td>
<td width="82%"><%=rs2("item_name")%> <%=rs2("item_count")%>票</td>
</tr>
<%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
<tr bgcolor="#FFFFFF">
<td colspan="2">當前沒有投票選項!</td>
</tr>
<%end if
rs2.close
set rs2=nothing%>
<tr align="center">
<td colspan="2" bgcolor="#F5F5F5" height="30">
<input type="submit" name="Submit" value="確定刪除" class="button">
[<a href="admin_vote.asp?action=vote">返回</a>] </td>
</tr>
<input type="hidden" name="id" value="<%=rs("vt_id")%>">
<input type="hidden" name="action" value="delvote">
<input type="hidden" name="MM_insert" value="true">
</form>
</table>
<%
rs.close
set rs=nothing
end if%>
<br>
</td>
</tr>
</table>
<%
end sub%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -