📄 admin_vote.asp
字号:
<!--#include file="mdb.asp"-->
<%Admin="vote"%>
<!--#include file="check.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/FORMAT.asp"-->
<HTML><HEAD><TITLE>管理中心——投票管理</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="inc/admin.css" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >
<%
'****************************************************
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.top.location.href='admin.asp';</script>")
response.end
else
if request.form("MM_insert") then
if request.form("action")="newvote" then
dim vtname,startdate,expiredate
vtname=trim(replace(request.form("vt_name"),"'",""))
startdate=request.form("vt_startdate")
expiredate=request.form("vt_expiredate")
if vtname="" then
Response.Write("<script language=javascript>alert('你必须填写投票主题!');history.back(1);</script>")
response.end
end if
if startdate="" then
startdate=formatdatetime(now(),2)
else
startdate=formatdatetime(startdate,2)
end if
if expiredate="" then
Response.Write("<script language=javascript>alert('你必须填写该投票主题的过期日期!');history.back(1);</script>")
response.end
else
expiredate=formatdatetime(expiredate,2)
end if
conn.Execute ("Insert Into votetopic(vt_name,vt_startdate,vt_expiredate) Values('"&vtname&"','"&startdate&"','"&expiredate&"')")
response.redirect "admin_vote.asp?action=vote"
end if
'================www.ynsky.com.cn===============
if request.form("action")="editvote" then
dim vtid
vtname=trim(replace(request.form("vt_name"),"'",""))
startdate=request.form("vt_startdate")
expiredate=request.form("vt_expiredate")
if request.form("id")="" then
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
response.end
else
vtid=cint(request.form("id"))
end if
if vtname="" then
Response.Write("<script language=javascript>alert('你必须填写投票主题!');history.back(1);</script>")
response.end
end if
if startdate="" then
startdate=formatdatetime(now(),2)
else
startdate=formatdatetime(startdate,2)
end if
if expiredate="" then
Response.Write("<script language=javascript>alert('你必须填写该投票主题的过期日期!');history.back(1);</script>")
response.end
else
expiredate=formatdatetime(expiredate,2)
end if
conn.execute ("UPDATE votetopic SET vt_name='"&vtname&"',vt_startdate='"&startdate&"',vt_expiredate='"&expiredate&"' where vt_id="&vtid&"")
response.redirect "admin_vote.asp?action=vote"
end if
'================www.ynsky.com.cn===============
if request.form("action")="delvote" then
if request.form("id")="" then
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
response.end
else
vtid=clng(request.form("id"))
end if
Conn.Execute "DELETE * FROM votetopic WHERE vt_id="&vtid
response.redirect "admin_vote.asp?action=vote"
end if
'================www.ynsky.com.cn===============
if request.form("action")="newitem" then
dim itemname
vtid=cint(request.form("id"))
itemname=trim(replace(request.form("item_name"),"'",""))
if vtid<1 then
Response.Write("<script language=javascript>alert('非法的对象参数!');history.back(1);</script>")
response.end
end if
if itemname="" then
Response.Write("<script language=javascript>alert('你必须填写选项名称!');history.back(1);</script>")
response.end
end if
conn.Execute ("Insert Into voteitem(vt_id,item_name) Values("&vtid&",'"&itemname&"')")
response.redirect "admin_vote.asp?action=vote&caction=edit&id="&vtid
end if
'================www.ynsky.com.cn===============
if request.form("action")="edititem" then
dim itemid
itemid=cint(request.form("id"))
itemname=trim(replace(request.form("item_name"),"'",""))
if itemid<1 then
Response.Write("<script language=javascript>alert('非法的对象参数!');history.back(1);</script>")
response.end
end if
if itemname="" then
Response.Write("<script language=javascript>alert('你必须填写选项名称!');history.back(1);</script>")
response.end
end if
conn.execute ("UPDATE voteitem SET item_name='"&itemname&"' where item_id="&itemid&"")
response.redirect "admin_vote.asp?action=vote&caction=edit&id="&request.form("vtid")
end if
'================www.ynsky.com.cn===============
if request.form("action")="delitem" then
itemid=cint(request.form("id"))
if itemid<1 then
Response.Write("<script language=javascript>alert('非法的对象参数!');history.back(1);</script>")
response.end
end if
Conn.Execute "DELETE * FROM voteitem WHERE item_id="&itemid
response.redirect "admin_vote.asp?action=vote&caction=edit&id="&request.form("vtid")
end if
end if
'================www.ynsky.com.cn===============
if request.querystring("action")="newvote" then
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<form name="form1" method="post" action="">
<tr class=Hxcmsss>
<td colspan="2">新增投票主题</td>
</tr>
<tr class=Hxcmsds>
<td width="16%">主题名称</td>
<td width="84%">
<input type="text" name="vt_name" size="50" maxlength="50" class="textarea">
</td>
</tr>
<tr class=Hxcmsds>
<td>开始日期</td>
<td>
<input type="text" name="vt_startdate" size="30" class="textarea"> 格式:2006-09-30 </td>
</tr>
<tr class=Hxcmsds>
<td>过期日期</td>
<td><input type="text" name="vt_expiredate" size="30" class="textarea"> 同上</td>
</tr>
<tr class=Hxcmsqs 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
'================www.ynsky.com.cn===============
if request.querystring("action")="vote" then
sql="select * from votetopic"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<tr class=Hxcmsss>
<td colspan="3">投票主题管理</td>
</tr>
<tr class=Hxcmsqs align="center">
<td width="10%">编号</td>
<td width="60%">投票主题</td>
<td width="30%">操作</td>
</tr>
<%do while not rs.eof%>
<tr class=Hxcmsds>
<td align="center"><%=rs("vt_id")%></td>
<td><%=rs("vt_name")%></td>
<td align="center"><a href="admin_vote.asp?action=vote&caction=ipdel">清空投票IP</a>
<a href="admin_vote.asp?action=vote&caction=edit&id=<%=rs("vt_id")%>">编辑</a>
<a href="admin_vote.asp?action=vote&caction=del&id=<%=rs("vt_id")%>">删除</a></td>
</tr>
<%rs.movenext
loop
if rs.bof and rs.eof then%>
<tr class=Hxcmsds>
<td colspan="3" align="center">当前没有投票主题!</td>
</tr>
<%end if%>
</table>
<%
rs.close
set rs=nothing
end if
'================www.ynsky.com.cn===============
if request.querystring("action")="vote" and request.querystring("caction")="edit" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
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 align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
<form name="form2" method="post" action="">
<tr class=Hxcmsss>
<td colspan="3">
修改投票主题</td>
</tr>
<tr class=Hxcmsds>
<td width="18%">主题名称</td>
<td colspan="2">
<input type="text" name="vt_name" size="50" maxlength="50" class="textarea" value="<%=rs("vt_name")%>">
</td>
</tr>
<tr class=Hxcmsds>
<td>开始日期</td>
<td colspan="2">
<input type="text" name="vt_startdate" size="30" class="textarea" value="<%=rs("vt_startdate")%>">
</td>
</tr>
<tr class=Hxcmsds>
<td>过期日期</td>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -