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

📄 new.asp

📁 是一个电子商务网站系统,提供前后台交易源码.
💻 ASP
字号:
<!--#include file="inc/Conn.asp" -->
<!--#include file="inc/fyaspcode.asp" -->
<!--#include file="Admin_IsLogin.asp" --><%

m=changechr(request("m"))
dim strtype
Select case m
	  	Case "本站动态"
		  	strtype=1
			  	Case "市场动态"
		  	strtype=2
	  
End Select
if request("action")="alldel" then 
rcID=trim(request("rcID"))
	if instr(rcID,",")>0 then
		dim idarr,i
		idArr=split(rcID)
		for i = 0 to ubound(idArr)
			call DelArticle(clng(idarr(i)))
		next
	else
		call DelArticle(clng(rcID))
	end if
Sub DoDelFile(sPathFile)
	On Error Resume Next
	Dim oFSO
	Set oFSO = Server.CreateObject("Scripting.FileSystemObject")
	oFSO.DeleteFile(Server.MapPath("../"&sPathFile))
	Set oFSO = Nothing
End Sub
sub DelArticle(ID)
sqlDel="select * From qynews where id=" &cint(ID)
Set rsDel= Server.CreateObject("ADODB.Recordset")
rsDel.open sqlDel,conn,1,3
if not rsDel.EOF then
'*********************
strpic=rsDel("D_SavePathFileName")
if strpic<>"" then
aSavePathFileName = Split(strpic, "|")
	' 删除相关的文件,从文件夹中
	For i = 0 To UBound(aSavePathFileName)
		' 按路径文件名删除文件
Call DoDelFile(aSavePathFileName(i))
	Next
end if

'**********************
		rsDel.delete
		rsDel.update
end if
		set rsDel=nothing
end sub
Response.Write "信息删除成功..."
Response.write("<script>alert(""信息删除成功!"");location.href=""new.asp?m="&request("m")&""";</script>")
Response.end
end if
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../../css/style.css" type="text/css">
<link href="Images/Style.css" rel="stylesheet" type="text/css">
<style>
.button { color:#000000; background-color: #4455aa; font-size: 9pt; height: 22px; border: 1px #F0F0F0 solid; padding-top: 2px; padding-left: 2px; padding-right: 2px; background-image: url(../../news/admin/image/bg01.gif); cursor: default}
</style>
<SCRIPT language=javascript>
function unselectall()
{
    if(document.del.chkAll.checked){
	document.del.chkAll.checked = document.del.chkAll.checked&0;
    } 	
}

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;
    }
  }
function ConfirmDel()
{
   if(confirm("确定要删除选中的信息吗?一旦删除将不能恢复!"))
     return true;
   else
     return false;	 
}
</SCRIPT>
</head>
<BODY bgcolor="D6DFF7" leftMargin=0 topMargin=0 marginwidth="0" marginheight="0">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>  </td>
  </tr>
</table>
<table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <tr>
		  <td width="50%" height="13">·<%=m%>信息管理</td>
		  <form method="post" action="?" name="Form1">
		  <td width="50%" height="13" align="right">信息主题:<input type="text" name="KeyWord" size="20" value="<% = Request("KeyWord")%>" class="face">
<input type="hidden" name="m" value="<%=m%>"><input type="submit" name="Submit" value="搜" class="button"></td>
		  </form>
		</tr>
	    </table>
<div align="center">
<table class=tableBorder width="98%" border=0 cellpadding=5 cellspacing=1>
  <tbody>
    <tr> 
      <th height=21 sytle="line-height:150%" width="5%">选择</th>
      <th height=21 width="70%" align="left">标题</th>
      <th height=21 width="15%">添加时间</th>
      <th height=21 width="5%">修改</th>
    </tr><%
Dim rdsInfo    '/通告的数据库对象及SQL语句/
Dim sqlInfo
Dim rdsTotalRec   
Dim strKeyWord    '/关键字/
Dim intPage       '/当前页/
Dim intTotalRec	  '/所有记录/
Dim intInfoCot	  '/通告条数/
Dim intInfoCount
Dim n,p,ii	      '/定义一些临时变量/
Dim strState
strKeyWord = Request("KeyWord")
intPage = Trim(Request("Page"))
if intPage = "" then
	intPage = 1
else
	intPage = Clng(intPage)
end if
intInfoCot =20
set rdsInfo = Server.CreateObject("ADODB.Recordset")
if strKeyWord <> "" then
	set rdsTotalRec = Conn.Execute("Select Count(id) From qynews Where tit like '%"& strKeyword &"%' and stype="&strtype&" ")
	intTotalRec = rdsTotalRec(0)
	sqlInfo = "Select * From qynews Where tit like '%"& strKeyword &"%' and stype="&strtype&" Order By id Desc"
else
	set rdsTotalRec = Conn.Execute("Select Count(id) From qynews Where stype="&strtype&"")
	intTotalRec = rdsTotalRec(0)
	sqlInfo = "Select * From qynews Where stype="&strtype&"  Order By id Desc"
end if
rdsInfo.Open sqlInfo,Conn,1,1
if not rdsInfo.EOF then
	if intTotalRec mod intInfoCot = 0 then
		n = intTotalRec \ intInfoCot
	else
		n = intTotalRec \ intInfoCot + 1
	end if
	rdsInfo.MoveFirst
	if intPage > n then intPage = n
	if intPage < 1 then intPage = 1
	rdsInfo.Move (intPage - 1) * intInfoCot
	do while not rdsInfo.EOF and intInfoCount < Clng(intInfoCot)
		intInfoCount = intInfoCount + 1
		%>			  	  
<form name="del" method="Post" action="?action=alldel" onSubmit="return ConfirmDel();">
<tr> 
      <td class=forumRow height=21 sytle="line-height:150%"><input type="hidden" name="m" value="<% =m%>">
		<p align="center"><input name='rcID' type='checkbox' onClick="unselectall()" id="rcID" value='<% = rdsInfo("id")%>'></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="left" width="70%"><a target="_blank" href="../showgq.asp?type=<%=strtype%>&id=<% =session("userid")%>&vid=<% = rdsInfo("id")%>"><% = rdsInfo("tit")%></a><%if rdsInfo("D_SavePathFileName")<>"" then Response.Write"<font color=""#FF0000"">[图]</font>"%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center"><% = rdsInfo("time")%></td>
      <td class=forumRow height=21 sytle="line-height:150%" align="center">
		<a href="modnew.asp?id=<% = rdsInfo("id")%>&m=<% =m%>">修改</a></td></tr><%
		rdsInfo.MoveNext
	loop
else
	Response.Write "<tr><td colspan=""7"" class=""forumRow"">&nbsp;<font color=""#FF0000"">没有符合条件的信息...</font></td></tr>"
end if
rdsInfo.Close
set rdsInfo = nothing

if intPage - 1 mod 10 = 0 then
	p = (intPage - 1) \ 10
else
	p = (intPage - 1) \ 10
end if	
%>
      <tr> 
      <td class=forumRow colspan="4"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
              选中本页显示的所有记录<input name="submit" type='submit' value='删除选定的信息' class="button"></td>
    </tr></form>
      <tr> 
      <td class=forumRow colspan="4"><table border="0" width="96%" cellspacing="0" cellpadding="0" align="center">
	    <form method="post" action="new.asp" name="Form2">
	    <input type="hidden" name="KeyWord" value="<% = strKeyWord%>">
	    <input type="hidden" name="m" value="<% =m%>">
	    <tr>
		  <td width="30%" height="30" valign="middle">页次:<b><%= intPage %></b>/<b><%= n %></b>页 每页<b><%= intInfoCot %></b>条 共<b><%= intTotalRec %></b>条</td>
		  <td width="70%" height="30" valign="middle"><div align="right">分页:
			<%
				if intPage = 1 then
					Response.Write "<font face=webdings>9</font>   "
				else
					Response.Write "<a href='?Page=1&KeyWord="& strKeyWord &"&m="&m&"' title=首页><font face=webdings>9</font></a>   "
				end if
				if p * 10 > 0 then Response.Write "<a href='?Page="&Cstr(p*10)&"&KeyWord="& strKeyWord &"&m="&m&"' title=上十页><font face=webdings>7</font></a>   "
				Response.Write "<b>"
				for ii = p * 10 + 1 to P * 10 + 10
					   if ii = intPage then
				          Response.Write "<font color=""#FF0000"">"+Cstr(ii)+"</font> "
					   else
					      Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"&m="&m&"'>"+Cstr(ii)+"</a>   "
					   end if
					if ii = n then exit for
				next
				Response.Write "</b>"
				if ii < n then Response.Write "<a href='?Page="&Cstr(ii)&"&KeyWord="& strKeyWord &"&m="&m&"' title=下十页><font face=webdings>8</font></a>   "
				if intPage=n then
					Response.Write "<font face=webdings>:</font>   "
				else
					Response.Write "<a href='?Page="&Cstr(n)&"&KeyWord="& strKeyWord &"&m="&m&"' title=尾页><font face=webdings>:</font></a>   "
				end if
			%>
			转到:<input type="text" name="Page" size="2" maxlength="10" value="<%= intPage %>" class="face"> <input type="submit" value="Go" name="submit" class="button">
			</div></td>
		</tr>
		</form>
	  </table>
</td>
    </tr>
  </tbody>
</table>
	</div>
<br>
<br>
<!--#include file="end.asp"-->
</body>
</html>

⌨️ 快捷键说明

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