<!--#include file="../Include/Char.jsp" -->
<!--#include file="../Include/Conn.jsp" -->
<!--#include file="../Include/const.jsp" -->

<%
   if Request.Cookies("UserID") = ""  THEN
     Response.Redirect("Login.jsp")
	 Response.End()
   end if

 if CheckStr(Request("Type")) = "delet" then
              m_ID =CheckStr(Request("delID"))
		      filename =CheckStr(Request("filename"))
			  
	          delfname=server.mappath("UploadImages") & "\"&filename 
              set TestFileObject=Server.Createobject("Scripting.FileSystemObject")
              if  TestFileObject.FileExists(delfname) then
               set NewFile=TestFileObject.getfile(delfname)
               Newfile.delete
	          end if
			  
      SQL="DELETE FROM citycard_Image WHERE F_ID="&m_ID
      Conn.Execute SQL  
  
 end if




      m_ID = Request.Cookies("UserID")
      pgno=request("pageno")
      if pgno="" or pgno<0 then pgno=1
      response.Cookies("onepage1")=8
 
      SET rs=server.createobject("adodb.recordset")
      SQL="SELECT * FROM  citycard_Image WHERE F_UserName ="&m_ID
      rs.Open SQL,conn,1,1 

 if not rs.eof then
	 
	  rs.movefirst
	 
	   rs.pagesize=request.Cookies("onepage1")
	   maxpage=rs.pagecount
	   
	   if rs.recordcount>0 then
	      rs.movefirst
		  rs.absolutepage=cint(pgno)
		end if
	
		   preno=pgno-1
		   postno=pgno+1
	 
	end if

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=site_info(0)%>-商家管理系统</title>
<link href="../Include/Style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
<!--



function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body onLoad="MM_preloadImages('images/xf_link1b.gif','images/xf_link2b.gif','images/xf_link3b.gif','images/xf_link4b.gif','images/xf_link5b.gif','images/ly_b_2b.gif','images/ly_b_4b.gif','images/ly_b_1b.gif','images/ly_b_3b.gif','images/ly_b_5b.gif')">

<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr> 
    <td width="170" height="500" rowspan="2" valign="top" bgcolor="f5f5f5"> <!--#include file="Left.jsp" --> </td>
    <td width="10" rowspan="2" valign="top"></td>
    <td width="600" height="343" valign="top"> 
      <table width="600" border="1" cellpadding="0" cellspacing="5" bordercolor="e2e2e2" bgcolor="f5f5f5">
        <tr> 
          <td height="25" background="images/about_bj.gif" class="p4">&nbsp;<b>·图片上传　　<a href="#" onClick="MM_openBrWindow('City_upimages.jsp','','top=130,width=453,height=115')"><font color="#FF0000">立刻上传</font></a></b></td>
        </tr>
      </table>
      <table width="600" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td height="5"></td>
        </tr>
        <tr> 
          <td height="1" background="images/line.gif" ></td>
        </tr>
      </table>
      <br> 
      <table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#000000" bgcolor="#FFFFFF">
        <tr> 
          <td width="10%" align="center" bgcolor="#EFEFEF"><strong>ID</strong></td>
          <td width="57%" bgcolor="#EFEFEF"><strong>图片显示</strong></td>
          <td width="20%" align="center" bgcolor="#EFEFEF"><strong>发布时间</strong></td>
          <td width="13%" align="center" bgcolor="#EFEFEF"><strong>管理</strong></td>
        </tr>
        <tr> 
          <td height="1" colspan="4" bgcolor="#CCCCCC"></td>
        </tr>
        <%
j=0
i=0
 do while not rs.eof and j<rs.pagesize
recno=(pgno-1)*rs.pagesize+1
i = i + 1
if i mod 2 <> 0 then
%>
        <tr> 
          <td height="24" align="center"><strong><%=i%></strong></td>
          <td>
		  <%
   		    Response.write "<a href = 'UploadImages/"&rs("F_Image")&"' target='_blank' ><img src='UploadImages/"&rs("F_Image")&"' width='75' height='82' border='0'></a>"
		  %>
		  </td>
          <td align="center"><font color="#999999"><%=rs("F_date")%></font></td>
          <td align="center"><a href='?type=delet&filename=<%=rs("F_image")%>&pageno=<%=pgno%>&delID=<%=rs("F_ID")%>'  onclick="{if(confirm('确定删除选定的纪录吗?')){return true;}return false;}">删除</a></td>
        </tr>
        <%else%>
        <tr> 
          <td align="center" bgcolor="f5f5f5"><strong><%=i%></strong></td>
          <td bgcolor="f5f5f5">
            <%
   		    Response.write "<a href = 'UploadImages/"&rs("F_Image")&"' target='_blank' ><img src='UploadImages/"&rs("F_Image")&"' width='75' height='82' border='0'></a>"
		  %>
          </td>
          <td align="center" bgcolor="f5f5f5"><font color="#999999"><%=rs("F_date")%></font></td>
          <td align="center" bgcolor="f5f5f5"><a href='?type=delet&filename=<%=rs("F_image")%>&pageno=<%=pgno%>&delID=<%=rs("F_ID")%>'  onclick="{if(confirm('确定删除选定的纪录吗?')){return true;}return false;}">删除</a></td>
        </tr>

        <%
  end if
  j=j+1
  rs.movenext
 loop
%>		<% if rs.recordcount =0 then%>
        <tr> 
          <td colspan="4" align="center">暂无图片！</td>
        </tr>
		<%end if%>
      </table></td>
  </tr>
  <tr>
    <td valign="top">
<%
 if rs.recordcount<>0 then
%>	
	<table width="96%" border="0" align="center" cellpadding="3" cellspacing="1" bordercolor="#000000">
     <form name="form1" method="post" action=""> 
	   <tr>
            <td bgcolor="f5f5f5">　共找到 [ <font color=ff0000><%=rs.recordcount%></font> 
              ] 条信息 
              <%
	  response.write "<a href='?pageno=1' title='首页' > 首页</a>"
	  if preno>0 then
	  Response.write "<a href='?pageno="&preno&"'title='上一页' > 上一页</a>"
	else
     response.write " 上一页" 
    end if
	
	if postno<=maxpage then
	  Response.write "<a href='?pageno="&postno&"' title='下一页' > 下一页</a>"
	else
    response.write " 下一页"
	end if
	Response.write "<a href='?pageno="&maxpage&"' title='末页'> 末页</a>"
	%>
              　 转到 
              <input name="pageno" type="text" id="pageno" size="4">
              页 第<font color="#FF0000"><%=pgno%></font>页/共 <font color=ff0000><%=maxpage%></font> 
              页</td>
        </tr>
		 </form>
      </table>
<%end if%>	  
<%
rs.close
set rs = nothing
%>	  
	  </td>
  </tr>
</table>

</body>
</html>
