<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.formCreate.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<%
  String strLevel = "../../../";
%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
<style type="text/css">
  .readClass {
      background:#D4D0C8;
      readonly;
  }
  .selectClass {
      width:70;
  }  
</style>
</head>
<%
    //获取提交的参数
    String name = SzConvert.toSpaceStr(request.getParameter("name"));
    String readonly = "";
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
    
    BdModule bdModule = new BdModule();
    String str[] = bdModule.getModuleInfo(name);
    BdFormHelp formHelp = new BdFormHelp();
		if (sOPERATOR.equals("add")) {
			str[3] = sDLXM_SESSION;
			str[4] = SzDateHelp.getTimeStr();
			str[8] = "V1.0";
		} else if (sOPERATOR.equals("update")) {
			
			//str[0] = formHelp.simpleModuleName(str[0]); 
			str[7] = SzDateHelp.getTimeStr();
		}
   	
%>
<body>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="oldname" value="<%=name%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">

<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">模块名称</td>
    <td><input type="text" name="name" value="<%=formHelp.simpleModuleName(str[0])%>" size="10" <%if (sOPERATOR.equals("update")){%> readonly class="txtClass1R"<%}else {%>class="txtClass1"<%} %>> (可用字母、数字、下划线的组合，10个字以内) <font color="red">*</font></td>
  </tr>
  <tr>
    <td class="tdClassTitle">中文名称</td>
    <td><input type="text" name="desc" class="txtClass1" value="<%=str[1]%>"  size="10">(10个字以内)<font color="red">*</font></td>
  </tr>
  <tr>
    <td class="tdClassTitle">功能描述</td>
    <td>
    	<textarea name="function" class="areaClass2"><%=str[2]%></textarea>
    </td>
  </tr> 
  <tr>
    <td class="tdClassTitle">作者</td>
    <td><input type="text" name="author" class="txtClass2" value="<%=str[3]%>"></td>
  </tr> 
  <tr>
    <td class="tdClassTitle">创建时间</td>
    <td><input type="text" name="createtime" class="txtClass2" value="<%=str[4]%>"></td>
  </tr>
  <tr>
    <td class="tdClassTitle">行业分类</td>
    <td>
    	<%
    		BdCategory bdCategory = new BdCategory();
    		ArrayList list = bdCategory.getProfessionList();
    		String s_name[] = new String[list.size()];
    		list.toArray(s_name);
    		//out.println(SzPageHelp.idSelectArray(s_name, s_name, "cate_pro", str[5], "txtClass2"));
    		out.println(SzPageHelp.idSelectArrayFunc(s_name, s_name, "cate_pro", str[5], "txtClass2", ""));
    	%>
    </td>
  </tr>  
  <tr>
    <td class="tdClassTitle">功能分类</td>
    <td>
    	<%
    		list = bdCategory.getFunctionList();
    		s_name = new String[list.size()];
    		list.toArray(s_name);
    		//out.println(SzPageHelp.idSelectArray(s_name, s_name, "cate_fun", str[6], "txtClass2"));
    		out.println(SzPageHelp.idSelectArrayFunc(s_name, s_name, "cate_fun", str[6], "txtClass2", ""));
    	%>    
    </td>
  </tr>  
  <tr>
    <td class="tdClassTitle">最后修改时间</td>
    <td><input type="text" name="modifytime" class="txtClass2R" value="<%=str[7]%>" readonly></td>
  </tr>  
  <tr>
    <td class="tdClassTitle">版本号</td>
    <td><input type="text" name="version" class="txtClass2" value="<%=str[8]%>"></td>
  </tr>  
  <tr>
    <td class="tdClassTitle">修改描述</td>
    <td>
    	<textarea name="modify_desc" class="areaClass2"><%=str[9]%></textarea>
    </td>
  </tr>         
</table>

</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="../../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {

    //检查是否可以保存
    if (!notSpace(formName.name, "模块名称")) {
      return false;
    }
    if (!notSpace(formName.desc, "模块中文名称")) {
      return false;
    }    
    if (!isLetterOrNumOrLine(formName.name.value)) {
      alert("模块名称有不允许的字符");
      form.moduleName.focus();
      return false;
    }      
    formName.action = "control.jsp";
    formName.submit();
  }
  
 
</script>
</body>
