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

📄 cp.asp

📁 实现一个用JSP、Servlet技术实现的小型物流网站系统。实现功能如下:管理员通过登录该系统
💻 ASP
字号:
<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla8<>1 then
response.write "<script>alert('操作权限出错,您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if%>
<%if request("action")="del" then

id=replace(request("id")," ","")
id=split(id,",")
for i=0 to ubound(id)

a=split(id(i),"|")
iid=a(0)
files=a(1)
Path="../../co/"&files
conn.execute("Delete From SMT_templet Where SMT_id="&iid&"")
set Fs = Server.CreateObject("Scripting.FileSystemObject")
If Fs.FileExists(server.mappath(Path)) Then
set Os = Fs.GetFile(server.mappath(Path))
Os.Delete
End If

next

end if%>
<script>
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       e.checked = form.chkall.checked; 
   }
  }
</script>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%=citycss%>
<body style="margin:8">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="from1" method="post" action="cp.asp?action=del">
<tr align=center bgcolor=#efefef>
<%sql="select * from SMT_templet order by SMT_id desc"
set rs=server.createobject("adodb.recordset")                     
rs.open sql,conn,1,1                     
if rs.eof and rs.bof then                     
	response.write "暂无内容"
else  
'分页的实现 
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
 <td width="5%" height=22>编 号</td>
 <td width=20%>模版名称<font color=red>(点击查看图片)</font></td>
 <td width="40%">简单说明</td>
 <td width="12%">权限</td>
 <td width="10%">所在文件夹</td>
 <td width="7%">编 辑</td>
 <td width="6%">选 择</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1%>
<tr align=center height=22>
 <td><%=n%></td>
 <td align=left>&nbsp;<a href=# onclick="javascript:window.open('../../co/<%=rs("SMT_files")%>/img/<%=rs("SMT_pic")%>','_n','height=242,width=370')"><%=rs("SMT_templet")%></a></td>
 <td align=left>&nbsp;<%=rs("SMT_others")%></td>
 <td><%if rs("SMT_flag")=0 then%>试用会员及以上<%elseif rs("SMT_flag")=1 then%>普通会员及以上<%else%>VIP会员<%end if%></td>
 <td><%=rs("SMT_files")%></td>
 <td><%if rs("SMT_admin")=1 then%>默 认<%else%><a href="cp_edit.asp?id=<%=rs("SMT_id")%>">编 辑</a><%end if%></td>
 <td><%if rs("SMT_admin")=1 then%>默 认<%else%><input type="checkbox" name="ID" value="<%=rs("SMT_id")&"|"&rs("SMT_files")&"/img/"&rs("SMT_pic")%>" style="border:0"><%end if%></td>
</tr>
<%rs.movenext 
i=i+1 
j=j-1
loop%>
<tr>
<%filename="cp.asp"%>
<td colspan=7 align=right height=25 bgcolor=#cccccc><%=Rs.recordcount%> 个模版&nbsp;&nbsp;<%=listnum%> 个模版/页&nbsp;&nbsp;共 <%=Rs.pagecount%> 页 
      <% if page=1 then %>
      <%else%>
      <a href=<%=filename%>><strong>|<<</strong></a>&nbsp; 
      <a href=<%=filename%>?page=<%=page-1%>><strong><<</strong></a>&nbsp; 
      <a href=<%=filename%>?page=<%=page-1%>><b>[<%=page-1%>]</b></a>&nbsp; 
      <%end if%>
<% if Rs.pagecount=1 then %>
<%else%>
	  <b>[<%=page%>]</b>
<%end if%>
	  <% if Rs.pagecount-page <> 0 then %>
      <a href=<%=filename%>?page=<%=page+1%>><b>[<%=page+1%>]</b></a>&nbsp; 
      <a href=<%=filename%>?page=<%=page+1%>><strong>>></strong></a>&nbsp; 
      <a href=<%=filename%>?page=<%=Rs.pagecount%>><strong>>>|</strong></a>&nbsp; 
	  <%end if%> <input name="chkall" type="checkbox" id="chkall" value="select" onclick="CheckAll(this.form)" style="border:0">全选 <input type="submit" name="Submit" value="删 除">&nbsp;&nbsp;</td>
<%end if%></tr>
</form> 
</table>

⌨️ 快捷键说明

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