editpoll.asp
来自「top-cms内容管理系统」· ASP 代码 · 共 241 行
ASP
241 行
<%
'###########################################################################################
'* 程序名称: Top-CMS
'*---------------------------------------------------------------------------------------
'* 系统版本: 1.0 0215
'* 版权所有: www.Net-Develop.com
'* 程序设计: 江南行客
'* 联系方式:
'* OICQ:2503086
'* EMAIL:net-oa@sohu.com
'* 网站地址:
'* http://www.net-develop.com
'* http://www.top-cms.com
'*---------------------------------------------------------------------------------------
'* Copyright 2004 www.net-develop.com - All Rights Reserved.
'###########################################################################################
%>
<!--#include file="../common/common.asp" -->
<html>
<head>
<title>:::WWW.NET-DEVELOP.COM:::</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/style.css">
<script language="JavaScript">
function MM_goToURL(ActionUrl) {
myform.action=ActionUrl;
myform.submit();
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<%
Set objCMS = Server.CreateObject("TopCMS.EditPoll")
if objCMS.ChkAdminPower then
aID=objCMS.ChkString(replace(Request("aID")," ",""),"U")
nT=objCMS.ChkString(Request("nT"),"U")
P=objCMS.ChkString(Request("P"),"U")
t=objCMS.ChkString(Request("t"),"U")
X=objCMS.ChkString(Request("X"),"U")
SystemI_Init
objCMS.OpenDB()
If Not objCMS.CheckAdminField("Poll") Then
objCMS.OutInfo "对不起,你不具备管理调查项目的权限。", ""
Response.End
End If
if UCase(t)="DEL" and aID<>"" then objCMS.DelPoll(aID)
if objCMS.ChkString(Request("aT"),"U")="DELA" and objCMS.ChkString(Request("oid"),"U")<>"" then
objCMS.DelPollItem()
end if
If Request.ServerVariables("REQUEST_METHOD")="POST" and X<>"T" Then
objCMS.SavePoll(aID)
end if
if nT="" then
%>
<table width="100%" border="1" cellspacing="0" cellpadding="2" align="center" bordercolor="#999999">
<form name="myform" method="post">
<tr>
<td width="88%" background="../Images/default_nav.gif"><font color="#FFFFFF">在线调查管理
</font></td>
<td width="12%" align="center" background="../Images/default_nav.gif"> <a href="editpoll.asp?nT=ADD"><img src="../images/add.gif" hspace=2 border=0 align="absmiddle" alt="添加新项目"></a><a href="javascript:MM_goToURL('editpoll.asp?nT=edit&P=<%=P%>&X=T');"><img src="../images/edit.gif" hspace=2 border=0 alt="编辑所选项目" align="absmiddle"></a><img src="../images/del.gif" hspace=2 border=0 alt="删除所选项目" onclick="if (confirm('你确定要删除所选的项目吗?\n删除后不能恢复!')){MM_goToURL('editpoll.asp?t=del&P=<%=P%>&X=T');}" style="cursor:hand;" align="absmiddle">
</td>
</tr>
<%
dbSql = "Select * From db_Question Order By qID DESC"
set dbRs=objCMS.MyRs(dbSql,1,1,0)
If dbRs.EOF Then
Response.Write "<tr bgcolor=""#EEEEEE""><td align=""center"" colspan=""2"">[目前还没有调查项目]</td></tr>"
else
objCMS.PagingMain dbRs,16
nPage=objCMS.PNum
Do While not dbRs.eof and nPage>0
if nPage mod 2 <>0 then nBGcolor="#EEEEEE" else nBGcolor="#FFFFFF"
%>
<tr bgcolor="<%= nBGcolor %>">
<td colspan="2">
<input type="checkbox" name="aID" value="<%=dbRs("qID")%>">
<a href="../asp/poll.asp?qID=<%= dbRs("qID") %>" target="_blank"> <%=Trim(dbRs("qTitle"))%></a>
<font color="#999999">[<%= dbRs("qVote") %>] [<%= dbRs("qDate") %>] </font>
</td>
</tr>
<%
dbRs.MoveNext
nPage=nPage-1
Loop
end if
dbRs.close
set dbRs=nothing
%>
</form>
</table>
<div align="right">
<%objCMS.DisplayNavigation("")%>
</div>
<%
else
'修改/添加投票
if UCase(nT)="EDIT" then
'获取编辑信息
if aID="" then
objCMS.OutInfo "请选择你要编辑的调查主题",""
response.end
elseif instr(aID,",")>0 then
objCMS.OutInfo "一次只能编辑一个主题",""
response.end
end if
dbSql="SELECT * FROM db_Question WHERE qID = " & aID
Set Qrs = objCMS.MyRs(dbSql,1,1,1)
If Qrs.EOF Then
objCMS.OutInfo "你要编辑的调查主题不存在",""
response.end
else
%>
<form name="form1" method="post" action="editpoll.asp">
<table width="100%" border="1" bordercolor="#999999" cellspacing="0" cellpadding="2" align="center">
<tr>
<td colspan="2" background="../Images/default_nav.gif"><font color="#FFFFFF">修改投票项目</font> </td>
</tr>
<tr bgcolor="#EEEEEE"><td width="100" align="right">投票主题:</td><td>
<input type="text" name="title" maxlength="50" value="<%= objCMS.ChkString(Qrs("qTitle"),"E") %>">
</td></tr>
<%
dbSql1="SELECT * FROM db_Answer WHERE qID = " & CInt(aID)
Set Ars = objCMS.MyRs(dbSql1,1,1,1)
if not Ars.eof then
i = 0
Do while not Ars.EOF
i = i + 1
%>
<tr><td width="100" align="right">选项<%=i%>:</td><td>
<%Response.Write Ars("aAnswer")%>
<a href="editoption.asp?nT=EDIT&aid=<%= Ars("aID") %>"><img src="../images/edit.gif" hspace=2 border=0></a>
<a href="editpoll.asp?aID=<%= aID %>&nT=edit&P=<%= P %>&aT=DELA&oid=<%= Ars("aID") %>"><img src="../images/del.gif" hspace=2 border=0></a>
</td></tr>
<%
Ars.MoveNext
Loop
end if
Ars.close
Set Ars=Nothing
%>
<tr bgcolor="#EEEEEE"><td width="100" align="right">首页显示?:</td><td>
<input type="radio" name="active" value="1" <%if CBool(Qrs("qActive")) Then response.write " checked"%>>是
<input name="active" type="radio" value="0" <%if not CBool(Qrs("qActive")) Then response.write " checked"%>>否
</td></tr>
<tr bgcolor="#CCCCCC"><td align="center" colspan="2">
<input type="hidden" name="aID" value="<%= aID %>">
<input type="hidden" name="A" value="EditPoll">
<input type="submit" name="Submit" value="更 新">
<input type="button" name="add" value="添加新选项" onClick="window.location.href='editoption.asp?nT=ADD&aid=<%= aID %>';">
</td></tr></table></form>
<%
end if
Qrs.Close
Set Qrs = Nothing
else
'添加
if objCMS.ChkString(Request.Form("pT"),"U")="" or objCMS.ChkString(Request.Form("N"),"U")="" then
%>
<form name="form1" method="post" action="editpoll.asp">
<table width="100%" border="1" bordercolor="#999999" cellspacing="0" cellpadding="2" align="center">
<tr>
<td colspan="2" background="../Images/default_nav.gif"><font color="#FFFFFF">添加投票项目(一)</font> </td>
</tr>
<tr bgcolor="#EEEEEE"><td width="100" align="right">投票主题:</td><td>
<input type="text" name="pT" maxlength="50">
</td></tr>
<tr><td width="100" align="right">选项数:</td><td>
<select name="N">
<%
for i=1 to 50
Response.Write "<option value=""" & i & """>" & i & "</option>"
next
%>
</select>
</td></tr>
<tr bgcolor="#CCCCCC"><td align="center" colspan="2">
<input type="hidden" name="addone" value="T">
<input type="hidden" name="nT" value="ADD">
<input type="submit" name="S1" value=" 下一步 ">
<input type="button" name="S2" value=" 取消 " onclick="history.back();">
</td></tr></table></form>
<% else %>
<form name="form1" method="post" action="editpoll.asp">
<table width="100%" border="1" bordercolor="#999999" cellspacing="0" cellpadding="2" align="center">
<tr>
<td colspan="2" background="../Images/default_nav.gif"><font color="#FFFFFF">添加投票项目(二)</font> </td>
</tr>
<tr bgcolor="#EEEEEE"><td width="100" align="right">投票主题:</td><td>
<input type="text" name="title" maxlength="50" value="<%= objCMS.ChkString(Request.Form("pT"),"U") %>">
</td></tr>
<%
for i=1 to Request.Form("N")
%>
<tr><td width="100" align="right">选项<%= i %>:</td><td>
<input name="o<%= i %>" type="text" size="20" maxlength="50">
</td></tr>
<%
next
%>
<tr bgcolor="#EEEEEE"><td width="100" align="right">首页显示?:</td><td>
<input type="radio" name="active" value="1" checked>是<input name="active" type="radio" value="0" >否
</td></tr>
<tr bgcolor="#CCCCCC"><td align="center" colspan="2">
<input type="hidden" name="A" value="AddPoll">
<input type="hidden" name="N" value="<%= Request.Form("N") %>">
<input type="submit" name="S1" value=" 提交 ">
<input type="button" name="S2" value=" 返回 " onclick="history.back();">
</td></tr></table></form>
<%
end if
end if
end if
objCMS.CloseDB
else
objCMS.OutInfo "对不起,您还没有登录,请先登录","Login"
end if
set objCMS=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?