<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="java.util.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<%
    //strLevel_SESSION = "../../../";
    //strSkin_SESSION = "../../../images/skin2_blue2";
%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>

<%
		String category = SzConvert.toSpaceStr(request.getParameter("category"));
    BdCategory bdCategory = new BdCategory();
    int i = 0;
    int iLen = 0;
    ArrayList professionList = bdCategory.getProfessionList();
    ArrayList functionList = bdCategory.getFunctionList();
    ArrayList list = null;
    String sTitle = "";
    if (category.equals("profession")) {
    	list = professionList;
    	sTitle = "按行业分类";
    } else if (category.equals("function")) {
    	list = functionList;
    	sTitle = "按功能分类";
    }
    	
%>
<!-----上面的工具栏------>
<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="category" value="<%=category%>" >
  <tr>
    <td>
    <% if (isBarManager_SESSION) { %>
    	新增加分类：<input type="text" class="txtClass" name="name">
      <input type="button" name="btnAdd" class="btnClass" value="保存" OnClick="javascript:FormSubmit(formBar, 'control.jsp?OPERATOR=add');">
    <% } %>
    </td>
  </tr>
  </form>
</table>

<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">

  <tr class="trClassTitle">
    <td width="30">&nbsp;</td>   
    <td><%=sTitle %></td>
    <td width="40">操作</td>
  </tr>
<%
		String temp = "";
		iLen = list.size();
    for (i=0; i<iLen; i++ ) {
    	temp = (String)list.get(i);
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
  	<td width="30" align="center"><%=i + 1%></td>  
    <td><%=temp%>&nbsp;</td>
    <td>
   	<% if (isBarManager_SESSION) { %>
    	<a href="javascript:Delete(formBar,'<%=temp%>');">删除</a>
    <% } %>
    </td>
  </tr>
<%
    }

    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 3));
%>
  </form>
</table>

<!-----下面的工具栏------>
<script language="javascript" src="<%=strLevel_SESSION%>share/js/commonTool.js"></script>
<script language="javascript">
  function Delete(formName, sName) {
  	if (confirm("确定要删除？")) { 
  			formName.name.value = sName; 	
				var url = "control.jsp?OPERATOR=delete";
  	    formName.action = url;
    		formName.submit();
  	}    
  } 
</script>
