<%@ page import="java.util.*"%>
<%!String functionNo=null;%>
<jsp:useBean id="createGroup" class="com.gdcn.admin.Group" scope="request">
<jsp:setProperty name="createGroup" property="*"/>
</jsp:useBean>
<%
int groupLayer =ParamUtils.getIntParameter(request,"groupLayer",0);
long parentID = ParamUtils.getIntParameter(request,"parentID",0);
boolean insert = ParamUtils.getBooleanParameter(request,"insert",false);
String ref = request.getHeader("REFERER");
Group group = new Group();
if(insert){
   createGroup.setParentID(parentID);
GroupMana.createGroup(createGroup);
response.sendRedirect("group2.jsp?groupID=1");
}
%>
<html>
<head>
<title>创建单位</title>
<script language="javascript" type="text/javascript">

function checkdata(){
var groupname=document.getElementById("groupName").value;
if(groupname ==""){
alert("单位/组织名称不能为空!");
return false;
}else{
document.getElementById("insert").value="true";
     form1.submit();
     }
}
</script>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
</head>
<link href="../css.css" rel="stylesheet" type="text/css">
<body topmargin="0" leftmargin="0"> 
<br> 
<form name="form1" method="post" action=""> 
  <table border="0" width="90%" cellspacing="0" cellpadding="0" align=center> 
    <tr> 
      <td height="22" valign=top background="" colspan="2" nowrap >
       创建新<font color="blue"><%=GroupMana.getLayerName(groupLayer)%></font>,红星(<font color="#FF0000">*</font>)是必填。 </td> 
    </tr> 
    <tr> 
      <td  nowrap  align="right"  height="22" valign=top background="">
       <font color="red">*</font><font color="blue"><%=GroupMana.getLayerName(groupLayer)%></font>名称:</td> 
      <td nowrap align="left"  height="22" valign=top background=""> 
      <input name="groupName" type="text" id="groupName" value=""/> </td> 
    </tr> 
    <tr> 
      <td  align="right" valign="top" nowrap height="22" background="">组织类型:</td> 
      <td  align="left" height="22" valign=top background="">
      <select name="typeID">
          <% for (int i=0;i<ConstantManager.getGroupType().length;i++){ 
          %> 
          <option value="<%=i%>" <%=group.getTypeID()==i ? "selected":""%>>
           <%=ConstantManager.getGroupType(i)%>
          </option> 
          <% } %> 
        </select></td> 
    </tr>     <tr> 
      <td height="45" colspan="2" align="center" bgcolor="#ffffff"> <br> 
        <input type="button" value="创建" onclick="javascript:checkdata()"/>&nbsp; &nbsp;&nbsp; &nbsp;  
        <input type="reset" name="Submit2" value=" 重置 " class="newinput"/> &nbsp;&nbsp; 
        <input type="button" name="Submit3" value=" 返回 " class="newinput" onclick="javascript:window.location='<%=ref%>'"/>  
       </td> 
    </tr> 
  </table> 
<input type="hidden" name="groupLayer" value="<%=groupLayer%>"/> 
<input type="hidden" name="parentID" value="<%=parentID%>"/> 
<input type="hidden" name="insert" value="false"/> 
</form> 
</body>
</html>