<!--#include file=conn.asp--><!--#include file=../function.asp-->
<%
checkadmin 

qx=conn.execute("select qx from admin where id="&session("userid")&"")(0)
requestTB=LCase(request("tb"))
tbName="TB_"&requestTB&"Content"
TableName="TB_"&requestTB&"Class"

Select Case LCase(requestTB)
Case "news":TipsTitle="新闻"':If InStr(qx,",7,")<=0 Then alertmsg "权限不够","",true
Case "honor":TipsTitle="公司荣誉"':If InStr(qx,",10,")<=0 Then alertmsg "权限不够","",true
Case "case":TipsTitle="案例"':If InStr(qx,",13,")<=0 Then alertmsg "权限不够","",true
Case "product":TipsTitle="产品"':If InStr(qx,",16,")<=0 Then alertmsg "权限不够","",true
End Select 
id=request("id")
If Len(id)<=0 Or Not IsNumeric(id) Then id=0

If request("a")="d" Then 
	
	conn.execute("delete from "&tbName&" where id="&id&"")
	AlertMsg "删除成功","?tb="&requestTB,True
End If 

%>
<!--#include file=top.asp-->
<script language="Javascript">
function openem()
{

var a;
a=window.showModalDialog("UpFile/UpFile.asp?action=add","","dialogWidth:300px;dialogHeight:150px;scroll:no;status:no");
if(a!=undefined)
{
document.all.pic.value=a;
}
}
</Script>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="100" class="tTitle"><div align="center">
        <table width="1000" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><div align="left"><%=TipsTitle%>列表</div>
				<div align="left" class=tTitleTips> 删除<%=TipsTitle%>时,无提示,直接硬删除,请谨慎操作</div>
			</td>
          </tr>
        </table>
      </div></td>
    </tr>
  </table>
  <table width="1000" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="10"></td>
    </tr>
  </table>
  <table width="1000" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="110" align="left" valign="top">
	  
	  
	  <!--#include file=left.asp-->
	  
	  
	  
	  
	  
	  
	  </td>
      <td width="890" align="right" valign="top">
	  
	  
	  
	  
	  
	  
<table width="890" border="0" cellspacing="1" cellpadding="0" bgcolor="#c3e9ff">
  <tr bgcolor="#F6F8F1">
    <td height="30" colspan="5" bgcolor="#FFFFFF" align="left">&nbsp;&nbsp;<span class="fontlv"><%=TipsTitle%>列表</span></td>
  </tr>
  <tr align="center" bgcolor="#e4f5ff">
    <td width="73" height="30">编号</td>
    <td width="90">分类</td>
    <td width="467">标题</td>
    <td width="130">修改</td>
    <td width="130">删除</td>
  </tr>
  
<%
Set rs=getRs
rs.open "select * from "&tbName&" order by id desc",conn,1,1
If Not rs.eof Then 
page=cint(request.querystring("page"))
rs.pagesize=20
if page<1 then
page=1
elseif page>rs.pagecount then
page=rs.pagecount
end if
allcount=rs.recordcount
rs.move (page-1)*rs.pagesize
for i=1 to rs.pagesize:If rs.eof Then Exit For 
%>

  <tr align="center" bgcolor="#ffffff">
    <td  height="30"><%=Rs("id")%></td>
    <td ><span title="<%'=Rs("domain")%>"><%=conn.execute("select classname from "&TableName&" where classid="&Rs("classid")&"")(0)%></span></td>
    <td align=left>&nbsp;<%=Rs("title")%></td>
    <td ><a href=News_Add.asp?id=<%=Rs("id")%>&tb=<%=requestTB%>>修改</a></td>
    <td ><a href=?a=d&id=<%=Rs("id")%>&tb=<%=requestTB%>>删除</a></td>
	
  </tr>
<%
rs.movenext
Next 
End If 
rs.close
%>

  <tr align="center" bgcolor="#FFFFFF">
    <td height="30" colspan="7"><p align=center>
					<%call show_page("?tb="&requestTB&"&amp;",allcount,rs.pagesize,true,true,"条记录")%>
					</p></td>
  </tr>
</table>
      <br />












    </div></td>
  </tr>
</table>
	  
	  
	  
	  
	  </td>
    </tr>
  </table>
  
  <!--#include file=bottom.asp-->