<%@ page contentType="text/html; charset=GBK"%>
<%@ page import="java.sql.*,gbase.db.*" %>
<%@ include file="../checkLogin.jsp" %>
<html>
<head>
<title>
模板管理
</title>
</head>
<LINK href="../css/css.css" rel=stylesheet>
<body leftmargin="0" topmargin="0">
<%
String web_project_id=request.getParameter("web_project_id")==null?"":request.getParameter("web_project_id");
String web_project_name=request.getParameter("web_project_name")==null?"":request.getParameter("web_project_name");
String web_project_sys_account=request.getParameter("web_project_sys_account")==null?"":request.getParameter("web_project_sys_account");
String user_id=(String)session.getAttribute("user_id");
%>
<!--导航-->
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
       <tr>
		<td width="100%" height="20"  bgcolor="#eeeeee" class="p2">您当前所在的位置>>模板管理</td>
	   </tr>
       <tr>
          <td width="100%" height="2"> <img border="0" src="../images/spacer.gif" width="1" height="3"></td>
       </tr>
    </table>
<!--标题-->
  <div align="center">
   <table border="0" width="100%" cellspacing="0" cellpadding="0" height="34">
	<tr>
		<td width="159" background="../images/back_board2.gif" nowrap valign="bottom"><span class="title01">&nbsp;<span class="style1">模板管理列表</span></span></td>
		<td valign="bottom" align="right" width="642"></td>
	</tr>
	<tr>
		<td bgcolor="#2C9CC4" colspan="2"><img border="0" src="../images/bline_3.gif" width="1" height="2"></td>
	</tr>
</table>
</div><br>
<!--正文内容-->
  
  <div align="center">
    <table width="95%" class="p1" border="0" cellSpacing="1" cellPadding="3" align="center" bgColor="#cccccc">
    
    <tr bgColor=#e9f0f4>
      <td align="center" width="25%">
        <b>方案名称</b>
      </td>
      <td align="center" width="25%">
        <b>模板名称</b>
      </td>
      <td align="center" width="25%">
        <b>所属类型</b>
      </td>
      <td align="center" width="25%">
        <b>操作</b>
      </td>
    </tr>
    <%  DBOperation theDBOperation = new DBOperation();
        String sql="";
        sql="select a.id,a.title,a.flag,b.id as web_template_type_id,b.type_name,b.file_name from web_template_type b left join  web_template a on a.web_template_type_id=b.id  and a.web_account='"+web_account+"' and a.web_project_id="+web_project_id+"  order by b.id asc";
        PageManager thePageManager = new PageManager();
        thePageManager.setPageSize(15);
        ResultSet rs = thePageManager.gePageData(request, sql);
        request.setAttribute("LIST_PageManager", thePageManager);
        request.setAttribute("LIST_PAGE", rs);
  while(rs.next()){
  String file_name=rs.getString("file_name");
  String web_template_type_id=rs.getString("web_template_type_id");
  %>
  <tr onmouseover='vbscript:me.bgcolor="#F5F5F5"' onmouseout='vbscript:me.bgcolor="#FFFFFF"' bgColor=#ffffff>
    <td align="center"  height="21" align="center">
      <%=web_project_name%>
    </td>
    <td align="center"  height="21" align="center">
      <%=(rs.getString("title")==null?"":rs.getString("title"))%>
    </td>
    <td align="center">
      <%=(rs.getString("type_name")==null?"":rs.getString("type_name"))%>
    </td>
    <td align="center">
      
      <%if(!(rs.getString("title")==null)){%>
        <a href="web_template_content.jsp?file_name=<%=file_name%>&web_project_id=<%=web_project_id%>&web_project_name=<%=web_project_name%>&web_project_sys_account=<%=web_project_sys_account%>&web_template_type_id=<%=web_template_type_id%>&id=<%=rs.getString("id")%>&action=update">修改</a>&nbsp;&nbsp;
        <a href="web_template_test.jsp?file_name=<%=file_name%>&flag=<%=rs.getString("flag")%>&web_template_type_id=<%=web_template_type_id%>&id=<%=rs.getString("id")%>&action=set&web_project_id=<%=web_project_id%>&web_project_name=<%=web_project_name%>">测试</a>
      <%} else {%>
        <a href="web_template_content.jsp?file_name=<%=file_name%>&web_project_id=<%=web_project_id%>&web_project_name=<%=web_project_name%>&web_project_sys_account=<%=web_project_sys_account%>&web_template_type_id=<%=web_template_type_id%>&id=<%=rs.getString("id")%>&action=add">修改</a>&nbsp;&nbsp;
      <%}%>
    </td>
  </tr>
 <%}%> 
</table>
 <br>
  <%
  request.setAttribute("OLD_URL","web_template_list.jsp?web_project_id="+web_project_id+"&web_project_name="+web_project_name);
  %>
<jsp:include page="../include/page.jsp" flush="true"/>  
</div>
</body>
</html>
