📄 admin_tp.asp
字号:
<!--#include file = admin_chk.asp -->
<%
If Not ChkAdmin("Vote") Then
Call ArtErr("","")
End If
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<title></title>
<link rel="stylesheet" type="text/css" href="../images/admin/style.css">
</head>
<script src="Include/Common.js" type="text/javascript"></script>
<%
delid=trim(Request("delid"))
editid=trim(Request("editid"))
saveid=trim(Request("saveid"))
title=trim(Request("title"))
endtime=trim(Request("endtime"))
DD=trim(Request("DD"))
sj=now()
eendtime=date()+7
if delid<>"" then
conn.Execute "delete from [tp] where ID="&CInt(delid)
conn.Execute "delete from [tptitle] where tpID="&CInt(delid)
end if
if editid="" and saveid="" and title<>"" and DD<>"" then
conn.Execute "insert into [tp] ([title],[dd],[addtime],[endtime]) values('"&title&"','"&dd&"','"&sj&"','"&endtime&"')"
elseif editid<>"" and saveid="" and title="" and dd="" then
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [tp] where id="&editid&" order by id desc",conn,1,1
if rs.recordcount<>0 then
etitle=rs("title")
eendtime=rs("endtime")
DD=rs("DD")
end if
rs.close:set rs=nothing
elseif saveid<>"" and title<>"" and DD<>"" then
conn.Execute "update [tp] set [title]='"&title&"',[DD]='"&DD&"',endtime='"&endtime&"' where id="&clng(saveid)
end if
%>
<TABLE width="100%" border="0" align=center cellpadding="0" cellspacing="1" class="tableBorder">
<tr>
<th height=25 colspan="3" >投票管理</th>
</tr>
<TR ALIGN="center">
<TD>
<table width="100%" border="0" align=center cellpadding="3" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#C4D8ED">
<form method="POST" action="admin_tp.asp?saveid=<%=editid%>" name="tp">
<tr>
<td width="14%" class="Forumrow" ><b>标 题:</b></td>
<td width="86%" class="Forumrow">
<input type="text" name="title" size="40" value='<%=etitle%>'>
<select size="1" name="DD">
<option value="1">单项选择</option>
<option value="2">多项选择</option>
</select>
</td>
</tr>
<tr>
<td class="Forumrow" ><b>结束时间:</b></td>
<td class="Forumrow">
<input type="text" name="endtime" value='<%=eendtime%>' size="20" > <a href='#' onClick="OpenThenSetValue('Include/DateDialog.asp',160,180,window,document.tp.endtime);document.tp.endtime.focus();"> <img src='../Images/date.gif' border='0' align='absmiddle' title='选择日期'></a> <input type="submit" value="保存后再增加选项" name="B1">
</td>
</tr>
</form>
</table><br>
<TABLE width="100%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolordark="#FFFFFF" bordercolorlight="#658BD8" bgcolor="#FFFFFF">
<tr>
<td height="25" background="../images/bg1.gif" align="center" width="467"><font color="#FFFFFF">投票标题</font></td>
<td height="25" background="../images/bg1.gif" align="center" width="76"><font color="#FFFFFF">投票数</font></td>
<td height="25" background="../images/bg1.gif" align="center" width="141"><font color="#FFFFFF">操作</font></td>
</tr>
<%
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [tp] order by id asc",conn,1,1
while not rs.eof
%>
<tr>
<td width="467"><font color="#666666">(编号:<%=rs("id")%>)</font>
<%
DD=rs("DD")
if DD=1 then
Response.Write "[单项选择]"
else
Response.Write "[多项选择]"
end if
%>
<%=rs("title")%><br></td>
<td width="76" align=center>
<%
set rssum = Server.CreateObject("ADODB.RecordSet")
rssum.Open "select sum(tps) as f_sum from [tptitle] where tpid="&rs("id")&" ",conn,1,1
Response.Write rssum(0)
rssum.close:set rssum=nothing
%>
</td>
<td align=center width="141">
<a href="admin_tp2.asp?tpid=<%=rs("id")%>">可选择项</a> <a href="admin_tp.asp?editid=<%=rs("id")%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="admin_tp.asp?delid=<%=rs("id")%>">删除</a></td>
</tr>
<%
rs.movenext
wend
rs.close:set rs=nothing
%>
</table>
</td></tr></table>
<%
conn.close:set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -