<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ 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.organize.*" %>
<%@ include file="/sessionInfo.jsp"%>
<% 
  String strLevel = "../../"; 
%> 
<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 sType = SzConvert.toZeroStr(request.getParameter("type"));
    String sPage = SzConvert.toZeroStr(request.getParameter("page"));
    String sSearch = SzConvert.strWriteData(request.getParameter("txtSearch"));
    String sPKEY = SzConvert.toZeroStr(request.getParameter("PKEY"));
    String QXGSID = SzConvert.toZeroStr(request.getParameter("QXGSID"));
    String sTable_type = "SZKC_CPFL";
%>
<%
    SzData szData = null;
    SzDataInfo szDataInfo = null;

    String sOPERATOR = request.getParameter("OPERATOR");
    String sKEY =  SzConvert.toZeroStr(request.getParameter("KEY"));
    String sReadonly = "";
    boolean bReadonly = false;
    if (sOPERATOR.equals("detail")) {
        sReadonly = "readonly";
        bReadonly = true;
    }
    //读取数据
    SzCompanyModuleInfo szCompanyModuleInfo = null;
    SzCompanyModule szCompanyModule = new SzCompanyModule();
    if (!sKEY.equals("0")) {
        szCompanyModuleInfo = (SzCompanyModuleInfo)szCompanyModule.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (szCompanyModuleInfo == null) {
        szCompanyModuleInfo = new SzCompanyModuleInfo();
    } else {
    }
    
    int iGSID = szCompanyModuleInfo.getQXGSID();
    //
    String BH = "";

%>

<body>
<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="PKEY" value="<%=sPKEY%>">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <input type="hidden" name="KEY" value="<%=sKEY%>">
  <input type="hidden" name="QXID" value="<%=szCompanyModuleInfo.getQXID()%>">
  <input type="hidden" name="type" value="<%=sType%>">
<%@ include file="title.jsp"%>
<table width="100%">
  <tr>
    <td>
    <% if (!bReadonly) { %>
      <%=SzPageHelp.saveButton()%>
    <% } %>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="650" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <tr>
    <td class="tdClassTitle">公司名称</td>
    <td colspan="3">
      <%=SzPageHelp.idSelectTreeSubmit("SZXT_JTGS","GSID","GSMC","GSBH", "QXGSID", iGSID, "txtClass2")%>    
    </td>    
  </tr>
  <tr>
    <td class="tdClassTitle">可用的模块</td>
    <td><input type="hidden" name="QXMKID" class="txtClass1" value="<%=szCompanyModuleInfo.getQXMKID()%>" <%=sReadonly%> >
<%
	//读取数据
	SzModule szModule = new SzModule();
    SzModuleInfo szModuleInfo = null;    
    String sCond = "1=1";
    String sSortField = "MKBH";
    int iSortOrder = SzProperties.I_SortOrder_ASC;    
    Iterator iter = szModule.getArrayList(sCond, sSortField, iSortOrder, sSearch).iterator();
    int i = 0;
    while (iter != null && iter.hasNext()) {
        szModuleInfo = (SzModuleInfo)iter.next();
        //s = szModule.getPropertyName(szModuleInfo.getMKQX());
        //s2 = szModule.getPopedomName(szModuleInfo.getMKSX());

        i++;    
%>  
  <input type="checkbox" name="QXMKID" value="<%=szModuleInfo.getMKID()%>" title="<%=i%>">
  <%=SzLevelNumber.getLevelSpace(szModuleInfo.getMKBH())%><%=szModuleInfo.getMKMC()%><br>
<%
    }
%>
    </td>
  </tr>
</table>


</form>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
  <input type="hidden" name="page" value="<%=sPage%>">
  <input type="hidden" name="txtSearch" value="<%=sSearch%>">
  <input type="hidden" name="type" value="<%=sType%>">
</form>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notNum(formName.QXGSID, "公司ID")) {
      return false;
    }
    //检查是否可以保存
    if (!notSpace(formName.QXGSID, "公司名称")) {
      return false;
    }    
    
    //模块不能不选
    if (NumberOfCheck(formName.QXMKID) == 0) {
	  alert("至少选择一个模块");
	  return false;
    }
    formName.action = url;
    formName.submit();
  }
</script>
</body>
