<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*,gbase.db.*" %>
<jsp:useBean id="myEnv" scope="application" class="com.jdon.web.UserEnvFront"/>
<jsp:setProperty name="myEnv" property="*"/>
<LINK href="images/style.css" type=text/css rel=stylesheet>
<%@ page import="java.util.*,gbase.init.*,
                 com.jivesoftware.util.*,
                 com.jivesoftware.forum.*,
                 com.jivesoftware.forum.util.*"
%>
<%String web_account= request.getParameter("web_account")==null?"":request.getParameter("web_account");%>
<%@ include file="workcheck.jsp" %>
<html>
<head>
<title>
图片信息管理
</title>
</head>
<body leftmargin="0" topmargin="0">
<TABLE style="BORDER-RIGHT: #c5cfda 1px solid; BORDER-TOP: #c5cfda 1px solid; BACKGROUND: #ffffff; BORDER-LEFT: #c5cfda 1px solid; BORDER-BOTTOM: #c5cfda 1px solid" cellSpacing=1 cellPadding=0 width="98%" border=0>
  <TBODY>
  <TR bgColor=#ecf3fb>
    <TD class=title background=images/menu1.gif colSpan=8 
    height=29>&nbsp;图片信息管理</TD></TR>
  <TR>
    <TD class=title style="BORDER-BOTTOM: #b8d0f2 1px solid; HEIGHT: 4px" colSpan=8>
<!--正文内容-->
<BR>
  <div align="center">
    <form name="form1" method="post" action="web_imageinfo_list.jsp?web_account=<%=web_account%>">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
        <tr>
          <td width="85%" width="50%"  align="center"> 
	  <%
	  String list_key=request.getParameter("list_key")==null?"":request.getParameter("list_key");
	  String bar_id=request.getParameter("bar_id")==null?"":request.getParameter("bar_id");
	  String special_id=request.getParameter("special_id")==null?"":request.getParameter("special_id");
	  %>
	  <b>关键字</b>：&nbsp;
	  <input type="text" name="list_key" value="<%=list_key%>" size=15> &nbsp;&nbsp;
	  <b>所属栏目</b>：&nbsp;
	              <%
	               DBOperation theSelectDBOperation = new DBOperation();
	               String select_sql = "select * from bar_menu where content_type='3' and web_account='"+web_account+"'";
                       ResultSet select_rs =theSelectDBOperation.getResultSet(select_sql);
	             %>
	             <select name="bar_id">
                        <option value="">全部</option>
                        <%while(select_rs.next()){%>
	                <option value="<%=select_rs.getString("id")%>"><%=select_rs.getString("name")%></option>
	                <%}%>
	             </select>
                     <script>form1.bar_id.value='<%=bar_id%>';</script>
	  &nbsp;&nbsp;
	  <input border="0" type="button" value="查  询" onclick = "document.form1.submit()">
	  </td>
          <td width="30%" align="center">
              <input border="0" type="button" value="新  增" onclick = "window.location='web_imageinfo_content.jsp?web_account=<%=web_account%>'">
          </td>
        </tr>
   </table>
  </form>  
  
    <table width="95%" class="p1" border="0" cellSpacing="1" cellPadding="3" align="center" bgColor="#cccccc">
    
    <tr bgColor=#e9f0f4>
      <td align="center" width="40%">
        <b>标题名称</b>
      </td>
      <td align="center" width="15%">
        <b>图片</b>
      </td>
      <td align="center" width="25%">
        <b>所属栏目</b>
      </td>
      <!--
      <td align="center" width="20%">
        <b>所属专题</b>
      </td>
      -->
      <td align="center" width="20%">
        <b>操作</b>
      </td>
    </tr>
    <%
        String sql="";
        if(bar_id.equals(""))
          sql="select a.*,b.name as bar_name from web_imageinfo a,bar_menu b where a.bar_id=b.id and a.web_account=b.web_account and a.title like '%"+list_key+"%' and a.web_account='"+web_account+"'  and user_account='"+username+"'  order by a.id desc ";
        else 
          sql="select a.*,b.name as bar_name from web_imageinfo a,bar_menu b where a.bar_id="+bar_id+" and a.bar_id=b.id  and a.web_account=b.web_account  and a.title like '%"+list_key+"%' and a.web_account='"+web_account+"'  and user_account='"+username+"'  order by a.id desc ";
       
        PageManager thePageManager = new PageManager();
        thePageManager.setPageSize(10);
        ResultSet rs = thePageManager.gePageData(request, sql);
        request.setAttribute("LIST_PageManager", thePageManager);
        request.setAttribute("LIST_PAGE", rs);
  while(rs.next()){
  %>
  <tr onmouseover='vbscript:me.bgcolor="#F5F5F5"' onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>
    <td height="21" align="center">
      <%=rs.getString("title")%>
    </td>
    <td width="10%" align="center"><img border="0" width=50 src='<%=rs.getString("image_url")%>'></td>
    <td align="center">
      <%=rs.getString("bar_name")%>
    </td>
    <td align="center">
      <a href="web_imageinfo_content.jsp?web_account=<%=web_account%>&id=<%=rs.getString("id")%>&action=update">修改</a>&nbsp;&nbsp;
      <a href='javascript:if(confirm("真的要删除这信息吗？"))window.location="web_imageinfo_save.jsp?web_account=<%=web_account%>&id=<%=rs.getString("id")%>&action=delete";'>删除</a>&nbsp;&nbsp;
    </td>
  </tr>
 <%}%> 
</table>
 <br>
  <%
  request.setAttribute("OLD_URL","web_imageinfo_list.jsp?web_account="+web_account+"&list_key="+list_key+"&bar_id="+bar_id+"&special_id="+special_id);
  %>
<jsp:include page="page.jsp" flush="true"/>  
</div>
</TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
