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

📄 admin_info_type.asp

📁 CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。
💻 ASP
字号:
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="admin_admininfo.asp"-->
<!--#include file="sub_change.asp" -->
<%
if session("adminname")<>adminname or session("adminpwd")<>adminpwd then
  response.Redirect("admin_login.asp")
end if

Dim order,updata,errormax,msg
order=trim(request.QueryString("order"))
updata=trim(request.QueryString("updata"))

if updata="ok" then
  dim id,typeid,name,pic,location,pass
  
  id=trim(request.QueryString("id"))
  if len(id)=0 or IsNumeric(id)=flase then errormax=errormax&"编号错误,请刷新本页面后操作!<br>" end if
  
  typeid=strchange(trim(request.form("typeid")))
  if len(typeid)=0 or IsNumeric(typeid)=flase then errormax=errormax&"资讯编号不能为空或者大于4个字符!<br>" end if
  
  name=trim(request.form("name"))
  if len(name)=0 or len(name)>8 then errormax=errormax&"资讯名不能为空或者大于8个字符!<br>" end if
  
  pic=strchange(trim(request.form("pic")))
  if len(pic)=0 or len(pic)>200 then errormax=errormax&"图片不能为空或者大于200个字符!<br>" end if
  
  location=strchange(trim(request.form("location")))
  if location="" then errormax=errormax&"排名不能为空!<br>" end if
  
  pass=strchange(trim(request.form("pass")))
  if pass<>1 then pass=0 end if
  
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") 
  
  if len(errormax)>0 then 
    errormax="<br><br><font style='color: #FF0000; font-size: 10pt'>抱歉:以下字段数据需要修改。<br>" & errormax &"</font>"
  else
    set rs_updata=server.CreateObject("adodb.recordset")
    rs_updata.open "select * from 资讯类别 where 编号="&id,conn,3,3
    rs_updata("类别编号")=typeid
    rs_updata("类别名")=name
    rs_updata("图片")=pic
    rs_updata("排名")=location
    rs_updata("审核")=pass
    rs_updata("修改")=now()&"|"&userip
    rs_updata.update
    rs_updata.close
    set rs_updata=nothing
  end if
end if

if updata="reset" then
  dim rs_reset,i
 
  userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR") 
  If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR") 
  
  set rs_reset=server.CreateObject("adodb.recordset")
  rs_reset.open "select * from 资讯类别 order by 排名 asc",conn,3,3
  i=1
  Do while Not rs_reset.eof and not rs_reset.bof
    rs_reset("排名")=i
    rs_reset("修改")=now()&"|"&userip
    rs_reset.update
    i=i+1
  rs_reset.MoveNext 
  Loop
  rs_reset.close
  set rs_reset=nothing
end if

set rs=server.CreateObject("adodb.recordset")
select case order
  case "notype"
    rs.open "select * from 资讯类别 where 审核=0 order by 排名 desc",conn,1,1
    msg="未审核资讯类别"
  case "yestype"
    rs.open "select * from 资讯类别 where 审核=1 order by 排名 desc",conn,1,1
    msg="已审核资讯类别"
  case else
   rs.open "select * from 资讯类别 order by 排名 desc",conn,1,1
   msg="<b>所有资讯类别</b>"
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>【后台管理】资讯类别管理 - <%=sitename%></title>
<link href="admin.css" rel="stylesheet" type="text/css">
<SCRIPT language='javascript' src='inc/pop.js'></SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<div align="center">
<!--#include file="admin_top_info.asp" -->
<br>
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr>
    <td height="40" align="center" style="line-height: 16pt"><b>资讯类别管理</b></td>
  </tr>
</table>
<table width="90%" border="0" cellpadding="5" cellspacing="1" bgcolor="#DFEAF2">
  <tr bgcolor="#333333"> 
    <td height="20" bgcolor="#FFFFFF" colspan="2">选择:
      <a href="?">所有资讯类别</a> ※ 
      <a href="?order=yestype">已审核资讯类别</a>|<a href="?order=notype">未审核资讯类别</a> ※
	  <a href="?updata=reset">重新计算</a>
	</td>
  </tr>
  <tr bgcolor="#333333"> 
    <td bgcolor="#FFFFFF" colspan="2" height="25"><%response.write msg&"&nbsp;&nbsp;&nbsp;&nbsp;共有<font color='red'>"&rs.recordcount& "</font>条记录"&errormax%></td>
  </tr>
</table>
<hr color="#000000" width="90%">
<table border="0" cellpadding="3" width="90%" bgcolor="#99CCFF" height="35" style="border: 1px solid #3399FF">
  <tr>
    <td width="50" align="center">编号</td>
    <td width="50" align="center">类别编号</td>
    <td width="100" align="center">类别名</td>
    <td width="150" align="center">图片</td>
    <td width="70" align="center">排名</td>
    <td width="30" align="center">审核</td>
    <td width="50" align="center">提交</td>
    <td width="220" align="center">修改</td>
    <td width="*" align="center">常用选项</td>
  </tr>
</table>
<%Do while Not rs.eof and not rs.bof%>
<table border="0" cellpadding="3" width="90%" onMouseOver='this.style.backgroundColor="#DFEAF2"' onMouseOut='this.style.backgroundColor=""' <%if cint(rs("编号"))=cint(id) then response.write "style='border: 1px solid #FF0000'" end if%>>
  <form method="POST" action="?updata=ok&id=<%=rs("编号")%>" name="pro">
  <tr>
    <td width="50" align="center">【<%=rs("编号")%>】</td>
    <td width="50" align="center"><input type="text" name="typeid" size="5" value="<%=rs("类别编号")%>"></td>
    <td width="100" align="center"><input type="text" name="name" size="12" value="<%=rs("类别名")%>"></td>
    <td width="150" align="center"><input type="text" name="pic" size="12" value="<%=rs("图片")%>"><img border="0" src="images/<%=rs("图片")%>"></td>
    <td width="70" align="center"><input type="text" name="location" size="8" value="<%=rs("排名")%>"></td>
    <td width="30" align="center"><input type="checkbox" name="pass" value="1" <%if rs("审核")=1 then response.write "checked"%>></td>
    <td width="50" align="center"><input type="submit" value="提交" name="sub"></td>
    <td width="220"><%=rs("修改")%></td>
    <td width="*">&nbsp;<a href="admin_info.asp?order=itype&itype=<%=rs("类别编号")%>&name=<%=rs("类别名")%>">所有<%=rs("类别名")%>资讯</a></td>
  </tr>
  </form>
</table>
<%
rs.MoveNext 
Loop
rs.close
set rs=nothing
%>
<hr color="#000000" width="90%">
<table width="90%" border="0" cellpadding="10" cellspacing="0">
  <tr>
    <td align="right" style="line-height: 16pt"><a href="#">&gt;&gt;<span lang="zh-cn">返回</span>TOP&lt;&lt;</a></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -