?? new.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""> <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 + -