⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_tp2.asp

📁 Art2008 CMS是一款具有强大的功能的基于ASP语言的网站管理软件
💻 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>
<%
id=trim(Request("id"))
up=trim(Request("up"))
down=trim(Request("down"))
tpid=trim(Request("tpid"))
delid=trim(Request("delid"))
editid=trim(Request("editid"))
saveid=trim(Request("saveid"))
tpxx=trim(Request("tpxx"))
endtime=trim(Request("endtime"))
DD=trim(Request("DD"))
sj=now()
eendtime=date()

sql="select * from [tp] where id="&tpid&" order by id desc"
set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open sql,conn,1,1
if rs.recordcount<>0 then
	title=rs("title")
	endtime=rs("endtime")
end if
rs.close:set rs=nothing

if delid<>"" then
	conn.Execute "delete from [tptitle] where ID="&CInt(delid)
end if

if editid="" and saveid="" and tpxx<>"" then
	conn.Execute "insert into [tptitle] ([tpxx],[tpid],[tps]) values('"&tpxx&"',"&tpid&",0)"
	Response.Redirect "admin_tp2.asp?tpid="&tpid
elseif editid<>"" and saveid="" and tpxx="" then
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "select * from [tptitle] where id="&editid&" order by id desc",conn,1,1
	if rs.recordcount<>0 then
		etpxx=rs("tpxx")
	end if
	rs.close:set rs=nothing
elseif saveid<>"" and tpxx<>"" then
	conn.Execute "update [tptitle] set [tpxx]='"&tpxx&"' where id="&clng(saveid)
	Response.Redirect "admin_tp2.asp?tpid="&tpid
elseif id<>"" and up="1" then
	conn.Execute "update [tptitle] set [tps]=tps+1 where id="&clng(id)
elseif id<>"" and down="1" then
	conn.Execute "update [tptitle] set [tps]=tps-1 where id="&clng(id)
	set rs = Server.CreateObject("ADODB.RecordSet")
	rs.Open "select * from [tptitle] where id="&id&" order by id desc",conn,1,3
	if rs.recordcount<>0 then
		if rs("tps")<0 then
			rs("tps")=0
			rs.update
		end if
	end if
	rs.close:set rs=nothing
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" cellpadding="5" cellspacing="2" bordercolorlight="#CEE7FF" bordercolordark="#CEE7FF" style="border-collapse: collapse"> 
<form method="POST" action="admin_tp2.asp?tpid=<%=tpid%>&saveid=<%=editid%>">
<tr><td width="16%" class="Forumrow"><b>  选  项:</b></td>
<td width="84%" class="Forumrow"><input type="text" name="tpxx" size="40" value='<%=etpxx%>'> <input type="submit" value="保存" name="B1"></td>
</tr>
</form>
<tr>
<td class="Forumrow"><b>  结束时间:</b></td>
<td class="Forumrow"><font color="red"><%=endtime%></font></td>
</tr>
</table>
	<TABLE width="100%" border="1"  cellspacing="0" cellpadding="3"  style="border-collapse: collapse" bordercolor="#C0C0C0"  bgcolor="#FFFFFF">
		<tr>
			<td height="25" background="../images/bj3.jpg" align="center" width="460"><a href=admin_tp.asp><%=title%></a></td>
			<td height="25" background="../images/bj3.jpg" align="center" width="131">投票数</td>
			<td height="25" background="../images/bj3.jpg" align="center" width="161">操作</td>
		</tr>
<%

set rs = Server.CreateObject("ADODB.RecordSet")
rs.Open "select * from [tptitle] where tpid="&tpid&" order by id asc",conn,1,1
while not rs.eof
%>
		<tr>
			<td width="460">&nbsp;&nbsp;<%=rs("tpxx")%></td>
			<td width="131" align="center"> <a href="admin_tp2.asp?tpid=<%=tpid%>&id=<%=rs("id")%>&up=1" title='加一个投票数'>↑</a><a href="admin_tp2.asp?tpid=<%=tpid%>&id=<%=rs("id")%>&down=1" title='减一个投票数'>↓</a> <%=rs("tps")%></td>
			<td align=center width="161" align="center">
			<a href="admin_tp2.asp?editid=<%=rs("id")%>&tpid=<%=tpid%>">修改</a> <a onclick='{if(confirm("您确定删除吗?此操作将不能恢复!")){return true;}return false;}' href="admin_tp2.asp?delid=<%=rs("id")%>&tpid=<%=tpid%>">删除</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 + -