<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/char.asp"-->
<!--#include file="../inc/setup.asp"-->
<!--#include file="../inc/sql.asp"-->
<%
	End If
	if Trim(Request.QueryString("action"))="del" then
		url=Trim(Request.QueryString("url"))
		sql_up="delete from school_photo where id="&ReplaceBadChar(Trim(Request.QueryString("id")))&" and sid="&ReplaceBadChar(Request.Cookies("admin_school_id"))&""
		conn.execute sql_up
		
		call del("../upimages/school/"&url)
		
		response.write"<SCRIPT language=JavaScript>alert('图片删除成功，现在为您返回');"
		response.write"this.location.href='picture_all.asp';</SCRIPT>"
		response.end
		conn.close
		set conn=nothing
	end if
%>
<HTML>
<head>
<title><%= homename %>--院校会员中心</title>
<meta http-equiv=Content-Language content=zh-cn>
<meta http-equiv=Content-Type content=text/html; charset=gb2312>
<link href="images/1.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<link href="images/2.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
</head>
<body topmargin="0">
<table width="550"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/m_11.gif" width="550" height="9"></td>
  </tr>
  <tr>
    <td background="images/m_13.gif"><div align="left">
      <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="left"><img src="images/jianli-12.gif" width="136" height="33"></div>
            <TABLE width="100%" border=0 cellPadding=0 cellSpacing=1 bgColor=#83b629 align="center">
              <TBODY>
                <TR>
                  <TD height="116" vAlign=top bgColor=#ffffff>
				  <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                    <TBODY>
                      <TR>
                        <TD vAlign=top width="100%" height="116">
						<TABLE height=24 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                            <TBODY>
                              <TR>
                                <TD bgColor=#83b629 height=21><FONT style="FONT-SIZE: 13px" face=Verdana color=#ffffff><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;图片管理</STRONG></FONT></TD>
                              </TR>
                              <TR>
                                <TD bgColor=#e2e2e2 height=2></TD>
                              </TR>
                            </TBODY>
                          </TABLE>
                            <DIV align=center>
                              <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table2">
                                <tr>
                                  <td valign="top">
                                        <table width="100%" border="0" align="center" cellpadding="6" cellspacing="0">
                                          <tr>
                                            <td width="10%" height="30" align="center" bgcolor="#efefef">编号</td>
                                            <td width="29%" align="center" bgcolor="#efefef">图片名称</td>
                                            <td width="19%" align="center" bgcolor="#efefef">图片缩略图</td>
                                            <td width="25%" align="center" bgcolor="#efefef">上传时间</td>
                                            <td width="9%" align="center" bgcolor="#efefef">状态</td>
                                            <td width="8%" align="center" bgcolor="#efefef">操作</td>
                                          </tr>
<%
	dim i,intPage,page,pre,last,filepath,searchtype '定义变量
	set rs = server.CreateObject("adodb.recordset")'创建对象
	
	searchtype="where sid="&Request.Cookies("admin_school_id")&" "
	
	if Trim(Request("action"))="search" then
	
		if Trim(Request("keyword"))<>"" and Trim(Request("keyword"))<>"请输入图片名称" then searchtype=searchtype&" and pname like '%"&Trim(Request("keyword"))&"%'"
		
	end if
	
	sql="select * from school_photo "&searchtype&" order by id desc"'定义SQL语句
	rs.PageSize = 5 '这里设定每页显示的记录数
	rs.CursorLocation = 3
	rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
	pre = true
	last = true
	page = trim(Request.QueryString("page"))'变量是跳转页面时的值

	if len(page) = 0 then
		intpage = 1
		pre = false
	else
		if cint(page) =< 1 then
			intpage = 1
			pre = false
		else
			if cint(page) >= rs.PageCount then
				intpage = rs.PageCount
				last = false
			else
				intpage = cint(page)
			end if
		end if
	end if
	if not rs.eof then
		rs.AbsolutePage = intpage
	end if
	if rs.eof then
%>
		<tr>
               <td height="30" align="center" bgcolor="#f9f9f9" colspan="6">暂时还没有贵校的图片展示信息</td>
           </tr>
<%
	else
		for i=1 to rs.PageSize
		if rs.EOF or rs.BOF then exit for
%>                                          <tr>
                                            <td height="30" align="center" bgcolor="#f9f9f9"><%= rs("id") %></td>
                                            <td align="center" bgcolor="#f9f9f9"><%= left(rs("pname"),10) %></td>
                                            <td align="center" bgcolor="#f9f9f9"><a href="../getphoto.asp?id=<%= rs("id") %>&folder=school" rel="lightbox" title="<%= rs("pname") %>">
<img src="../getphoto.asp?id=<%= rs("id") %>&folder=school" width="32" height="32" alt="<%= rs("pname") %>" border="0"></a></td>
                                            <td align="center" bgcolor="#f9f9f9"><%= rs("stime") %></td>
                                            <td align="center" bgcolor="#f9f9f9"><% If rs("lock")=1 Then Response.Write("<font color='#FF0000'>已审核</font>") else Response.Write("<font color='#FF0000'>未审核</font>")%></td>
                                            <td align="center" bgcolor="#f9f9f9"><a href="?action=del&id=<%= rs("id") %>&url=<%= rs("url") %>" onclick='{if(confirm("删除后将无法恢复，您真的要删除么？")){return true;}return false;}'>删除</a></td>
                                          </tr>
<%
		rs.movenext
		next
	End If
%>
                                          <tr bgcolor="#f9f9f9">
                                            <td height=30 colspan=6 valign=bottom><table width="99%" border="0" cellpadding="2" cellspacing="2" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td width="41%" align="left">当前页0/0</td><%end if%>
<td width="46%" align="right"> <a href="?page=1&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>">首页</a>|
<%if pre then%>
<a href="?page=<%=intpage -1%>&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>">上页</a>| <%end if%>
<%if last then%>
<a href="?page=<%=intpage +1%>&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>">下页</a> |<%end if%>
<a href="?page=<%=rs.PageCount%>&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>">尾页</a>|转到第
<select name="sel_page" onchange=javascript:location.href=this.options[this.selectedIndex].value>
<%
	for i = 1 to rs.PageCount
	if i = intpage then
%>
<option value="?page=<%=i%>&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>" selected><%=i%></option>
<%else%> 
<option value="?page=<%=i%>&action=<%= Trim(Request("action")) %>&keyword=<%= Trim(Request("keyword")) %>"><%=i%></option>
<%
	end if
	next
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
%>
</select>页</font></td>
</tr>
</table></td>
                                          </tr>
                                        </table>
									</td>
                                </tr>
                             </table>
                           </DIV>
						</TD>
                      </TR>
                    </TBODY>
                  </TABLE>
				  </TD>
                </TR>
              </TBODY>
            </TABLE>
			<br>
            <TABLE width="100%" border=0 cellPadding=0 cellSpacing=1 bgColor=#83b629 align="center">
              <TBODY>
                <TR>
                  <TD height="65" vAlign=top bgColor=#ffffff>
				  <form name="form1" method="post" action="?action=search">
				  <TABLE style="BORDER-COLLAPSE: collapse" borderColor=#111111 cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
                      <TBODY>
                        <TR>
                          <TD height="31" colspan="3" vAlign=middle bgcolor="#83B629"><font style="FONT-SIZE: 13px" face=Verdana color=#ffffff><strong>&nbsp;&nbsp;&nbsp;图片搜索</strong></font></TD>
                        </TR>
                        <TR>
                          <TD width="23%" height="28" align="center" vAlign=bottom>图片名称:</TD>
                          <TD width="48%" align="center" vAlign=bottom><input name="keyword" type="text" class="INPUT_index" size="40" onBlur="if(this.value=='') this.value='请输入图片名称';" onFocus="if(this.value=='请输入图片名称') this.value='';" value="请输入图片名称"></TD>
                          <TD width="29%" align="center" vAlign=bottom><input name="Submit" type="submit" value="搜索"></TD>
                        </TR>
                      </TBODY>
                  </TABLE>
				  </form>
				  </TD>
                </TR>
              </TBODY>
            </TABLE>
			</td>
        </tr>
      </table>
    </div>
	</td>
  </tr>
  <tr>
    <td background="images/m_13.gif"></td>
  </tr>
  <tr>
    <td><img src="images/m_12.gif" width="550" height="9"></td>
  </tr>
</table>
</body>
</html>