📄 info.asp
字号:
<!--#include file="i_login.asp"-->
<%
Response.Expires = 0
keyword=trim(request("keyword"))
page=clng(request("page"))
showclassid=trim(request.QueryString("showclassid"))
select case mode
case "del"
call del_sub(trim(request("id")))
case "time"
call time_sub()
case "Batch"
call Batch_sub()
end select
sub Batch_sub()
dim Submit
Submit=trim(request.Form("Submit"))
select case Submit
case "删 除"
call Batch_delete()
case "移 动"
call Batch_move()
end select
end sub
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Information</title>
<LINK href="images/style.css" type=text/css rel=stylesheet>
<script language="javascript" src="../inc/functions.js"></script>
<script language="javascript">
function chk_delete(id){
if(chk_select(id))
{
if(confirm('确定删除吗?')){return true;}else{return false;}
}
else
{
return false;
}
}
function chk_move(id,classid){
if(chk_select(id)){
if (classid.value=="")
{
alert("未选择目标目录!");
return false;
}
}else
{
return false;
}
return true;
}
</script>
</head>
<body >
<table width="98%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="54%" align="left" nowrap><span class="gray"> CMS >> 信息管理</span>
<select name="showclassid" class="input_200" onChange="window.open('?showclassid='+this.options[this.selectedIndex].value,'_self');">
<%
call site_class_showpid2(0," ")
function site_class_showpid2(byval classid,byval str)
dim rs,request_id
if str=" " then
response.Write("<option value="""">全部信息</option>")
end if
set rs=conn.execute("select id,name from data_Categorys where classid="&classid&" order by orderby,id")
while not rs.eof
response.Write("<option value="""&rs("id")&""">"&str&rs("name")&"</option>")
site_class_showpid2 cint(rs("id")),str & " "
rs.movenext
wend
rs.close
set rs=nothing
end function
%>
</select>
<script>document.getElementById('showclassid').value='<%=showclassid%>';</script>
</td>
<td width="46%" align="right" nowrap><table border="0">
<form name="form" method="get" action="?">
<tr>
<td nowrap class="gray"><a href="?"> 全部 </a></td>
<td nowrap class="gray"><input name="keyword" type="text" id="keyword"
<%
response.write "value="""&keyword&""""
%>
size="25"> </td>
<td nowrap><input name="Search" type="submit" id="Search" value=" 搜 索 "></td>
<td nowrap><span class="gray">(关键字之间用空格分开!)</span></td>
</tr>
</form>
</table></td>
</tr>
</table>
<form name="form1" method="post" action="?keyword=<%=keyword%>&page=<%=page%>&showclassid=<%=showclassid%>">
<input name="mode" type="hidden" value="Batch">
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#C2BDBD">
<tr>
<td width="11%" height="25" align="center" bgcolor="#CCCCCC">ID</td>
<td width="27%" align="center" bgcolor="#CCCCCC">标题</td>
<td width="29%" align="center" bgcolor="#CCCCCC">目录</td>
<td width="16%" align="center" bgcolor="#CCCCCC">更新日期</td>
<td width="17%" align="center" bgcolor="#CCCCCC">操作</td>
</tr>
<%
if showclassid<>"" then
sql_where=" classid in ("&get_sids_c(showclassid)&") and "
end if
sql_where=sql_where & keyword_sousuo("title,classnames,content",keyword)
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select id,title,classnames,link,color,updatetime,img,img_s from data_info where "&sql_where&" order by updatetime desc,id desc"
rs.Open sql,conn,1,2
if rs.eof and rs.bof then
response.Write("无记录")
else
rs.PageSize=15
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page
for j=1 to rs.PageSize
%>
<tr bgcolor="#FFFFFF">
<td height="22" align="center"><input type="checkbox" name="id" value="<%=rs("id")%>"></td>
<td style="cursor:hand;" title="<%
if trim(rs("link"))<>"" then
response.Write(rs("link"))
else
response.Write("文章")
end if
%>" >
<%
if trim(rs("img_s"))<>"" then
response.Write("<a href="""&rs("img")&""" target=""_blank"" ><img src="""&rs("img_s")&""" border=""0"" align=""absmiddle"" width=""20"" height=""20"" onload=""ResizeImage(this, 20, 20);""></a> ")
end if
%>
<%
if trim(rs("link"))<>"" then
response.Write("<a href="""&rs("link")&""" target=""_blank"" style=""color:"&rs("color")&""">"&keyword_tag(rs("title"),keyword)&"</a>")
else
response.Write("<a href=""../show.asp?id="&rs("id")&""" target=""_blank"" style=""color:"&rs("color")&""">"&keyword_tag(rs("title"),keyword)&"</a>")
end if
%></td>
<td align="left"> <a href="?keyword=<%=server.URLEncode(rs("classnames"))%>"><%=keyword_tag(strleft(rs("classnames"),22,".."),keyword)%></a></td>
<td align="center">
<a href="?mode=time&id=<%=rs("id")%>&keyword=<%=keyword%>&page=<%=page%>&showclassid=<%=showclassid%>"><%
if rs("updatetime")<>"" then
if DateDiff("d",rs("updatetime"),now())>0 then
response.Write formatdatetime(rs("updatetime"),2)
else
response.Write formatdatetime(rs("updatetime"),3)
end if
end if
%></a></td>
<td align="center">
<a href="info_edit.asp?id=<%=rs("id")%>&keyword=<%=keyword%>&page=<%=page%>&showclassid=<%=showclassid%>">编辑</a>
<a href="?mode=del&id=<%=rs("id")%>&keyword=<%=keyword%>&page=<%=page%>&showclassid=<%=showclassid%>" onClick="javascript:if(confirm('确定删除吗?')){return true;}else{return false;}">删除</a></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
</table>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="37"><input type="button" name="buttonfx" id="buttonfx2" value=" 反 选 " onClick="checkAll(this.form);" />
<input type="submit" name="Submit" value=" 删 除 " onClick="return chk_delete(this.form.id);">
<select name="classid" >
<%
call site_class_showpid(0," ")
function site_class_showpid(byval classid,byval str)
dim rs,request_id
if str=" " then
response.Write("<option value="""">移动到...</option>")
end if
set rs=conn.execute("select id,name from data_Categorys where classid="&classid&" order by orderby,id")
while not rs.eof
response.Write("<option value="""&rs("id")&""">"&str&rs("name")&"</option>")
site_class_showpid cint(rs("id")),str & " "
rs.movenext
wend
rs.close
set rs=nothing
end function
%>
</select>
<input type="submit" name="Submit" value=" 移 动 " onClick="return chk_move(this.form.id,this.form.classid);"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" align="center">
<%
response.Write("共"&rs.recordcount&"条信息 ")
call showpage_fun(rs.pagecount,page,4)
%> </td>
</tr>
</table>
</form>
<%
end if
rs.close
set rs=nothing
%>
</body>
</html>
<%
conn.close
set conn=nothing
%>
<%
sub Batch_delete()
dim ids,rs
ids=trim(request.Form("id"))
if ids<>"" then
set rs=conn.execute("select id from data_info where id in ("&ids&")")
while not rs.eof
del_sub(rs(0))
rs.movenext
wend
rs.close
set rs=nothing
end if
end sub
sub Batch_move()
dim ids,rs,classid
ids=trim(request.Form("id"))
classid=trim(request.Form("classid"))
if ids<>"" and classid<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open"select id,classid,classnames from data_info where id in ("&ids&")",conn,1,2
while not rs.eof
rs("classid")=classid
rs("classnames")=get_classnames_c(classid)
rs.update
rs.movenext
wend
rs.close
set rs=nothing
end if
end sub
sub del_sub(byval id)
dim rs
if id="" then
response.Write("<script>alert('ERR!');</script>")
end if
set rs=conn.execute("select img,img_s from data_info where id="&id&" and img is not null ")
if not rs.eof then
if trim(rs(0))<>"" then
if localhost(rs(0)) then
call del_file(rs(0))
end if
end if
if trim(rs(1))<>"" then
if localhost(rs(1)) then
call del_file(rs(1))
end if
end if
end if
rs.close
set rs=nothing
conn.execute("delete from data_info where id="&id&"")
end sub
sub time_sub()
dim id
id=trim(request("id"))
if id="" then
response.Write("<script>alert('ERR!');</script>")
end if
conn.execute("update data_info set updatetime=now() where id="&id&"")
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -