www.pudn.com > Zhwebcode.rar > Admin_Honor.asp, change:2008-11-13,size:6367b


<!--#include file="conn.asp"--> 
<!--#include file="admin.asp"--> 
<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> 
 
<%if Request.QueryString("mark")="southidc" then 
dim SQL, Rs, contentID,CurrentPage 
CurrentPage = request("Page") 
ID=request("ID") 
set rss=server.CreateObject("adodb.recordset") 
sql="select * from CompHonor where Id="&ID 
rss.open sql,conn,1,1 
img=rss("Pic") 
  '*************开始删除物理文件************** 
	set fs=createobject("scripting.filesystemobject")     
	path=Server.Mappath(img) 
	response.write path 
	if fs.FileExists(path) then 
		fs.DeleteFile path,true 
	end if 
'******************************************* 
	 
rss.close 
set rss=nothing 
set rs=server.createobject("adodb.recordset") 
sql="delete from CompHonor where Id="&ID 
rs.open sql,conn,3,3 
set rs=nothing 
conn.close 
response.redirect "Admin_Honor.asp" 
end if 
%> 
 
<% 
BigClass=Request("BigClass") 
set rs=server.createobject("adodb.recordset") 
sql="select * from CompHonor" 
if BigClass<>"" then 
sql=sql&" where BigClass='"&BigClass&"'" 
end if 
sql=sql&" order by id desc" 
rs.open sql,conn,1,1 
 
dim MaxPerPage,Thispage 
MaxPerPage=6 
Thispage="Admin_Honor.asp?BigClass="&BigClass 
dim text,checkpage 
text="0123456789" 
Rs.PageSize=MaxPerPage 
for i=1 to len(request("page")) 
checkpage=instr(1,text,mid(request("page"),i,1)) 
if checkpage=0 then 
exit for 
end if 
next 
 
If checkpage<>0 then 
If NOT IsEmpty(request("page")) Then 
CurrentPage=Cint(request("page")) 
If CurrentPage < 1 Then CurrentPage = 1 
If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount 
Else 
CurrentPage= 1 
End If 
If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if 
Else 
CurrentPage=1 
End if 
 
call list 
 
'显示帖子的子程序 
Sub list()%> 
<!-- #include file="Inc/Head.asp" --> 
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0"> 
  <tr>  
    <td align="center" valign="top"><br>  
    <table width="760" border="0" cellpadding="0" cellspacing="1" class="table_southidc"> 
        <tr><td bgcolor="#EFEFEF" height="22">  <a href="Admin_Honor.asp?BigClass=产品展示">产品展示</a> | <a href="Admin_Honor.asp?BigClass=成功案例">成功案例</a></td></tr> 
          </table> 
           <br>  
    <table width="760" border="0" cellpadding="0" cellspacing="1" class="table_southidc"> 
        <tr>  
          <td class="back_southidc" height="25"> <div align="center"><strong>图片管理<br> 
              </strong></div></td> 
        </tr> 
        <tr>  
          <td><div align="center">  
              <table width="100%" border="0" cellspacing="1" cellpadding="0"> 
                <tr bgcolor="#EFEFEF">  
                  <td width="10%" height="25">  
                    <div align="center">ID</div></td> 
                  <td width="15%">  
                    <div align="center">图片类别</div></td> 
                  <td width="15%">  
                    <div align="center">图片名称</div></td> 
                  <td width="40%">  
                    <div align="center">图片</div></td> 
                  <td width="10%">  
                    <div align="center">操作</div></td> 
                  <td width="10%">  
                    <div align="center">操作</div></td> 
                </tr> 
                <% 
if not rs.eof then 
i=0 
do while not rs.eof 
%> 
                <tr bgcolor="#FCFCFC">  
                  <td height="22">  
                    <div align="center"><%=rs("id")%></div></td> 
                  <td>  <%=rs("BigClass")%></td> 
                  <td>  <%=rs("explain")%></td> 
                  <td> 
				  <div align="center"> 
				  <%if rs("Pic")<>"" then%> 
				  <img src="<%=rs("Pic")%>" width="250" height="130"> 
				  <%else%> 
				  暂无图片 
				  <%end if%> 
				  </div> 
				  </td> 
                  <td>  
                    <div align="center"><a href="Admin_HonorEdit.asp?id=<%=rs("id")%>">修改</a></div></td> 
                  <td>  
                    <div align="center"><a href="<%=Thispage%>&id=<%=rs("id")%>&mark=southidc" onClick="return ConfirmDel();">删除</a></div></td> 
                </tr> 
                <%  
i=i+1  
if i >= MaxPerpage then exit do  
rs.movenext  
loop  
end if  
%> 
                <tr bgcolor="#EFEFEF">  
                  <td height="25" colspan="6"> <div align="right"> 
                      <% 
Response.write "全部" 
Response.write "共" & Cstr(Rs.RecordCount) & "条图片          " 
Response.write "第" & Cstr(CurrentPage) &  "/" & Cstr(rs.pagecount) & " " 
If currentpage > 1 Then 
response.write "<a href='"&Thispage&"&page="+cstr(1)+"'> 首页 </a>" 
Response.write "<a href='"&Thispage&"&page="+Cstr(currentpage-1)+"'> 上一页 </a>" 
Else 
Response.write " 上一页 " 
End if 
If currentpage < Rs.PageCount Then 
Response.write "<a href='"&Thispage&"&page="+Cstr(currentPage+1)+"'> 下一页 </a>" 
Response.write "<a href='"&Thispage&"&page="+Cstr(Rs.PageCount)+"'> 尾页 </a>" 
Else 
Response.write "" 
Response.write " 下一页 " 
End if 
Response.write "转到第" 
response.write"<select name='sel_page' onChange='javascript:location=this.options[this.selectedIndex].value;'>" 
    for i = 1 to Rs.PageCount 
       if i = currentpage then  
          response.write"<option value='"&Thispage&"&page="&i&"&id="&id&"' selected>"&i&"</option>" 
       else 
          response.write"<option value='"&Thispage&"&page="&i&"&id="&id&"'>"&i&"</option>" 
       end if 
    next 
response.write"</select>页" 
%> 
                    </div></td> 
                </tr> 
              </table> 
<div align="right"> 
                <% 
End sub 
rs.close 
%> 
              </div> 
            </div></td> 
        </tr> 
      </table> 
      <br> <br> </td> 
  </tr> 
</table> 
<!-- #include file="Inc/Foot.asp" -->