<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.sql.ResultSet" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.database.SzDataReader" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.online.*" %>
<%@ include file="/sessionInfo.jsp"%>
<% 
  String strLevel = "../../"; 
%> 
<%
    //多部门，多员工，多职务

    //type=all没有限制，same同一部门，tree树下的子部门
    String type = SzConvert.toSpaceStr(request.getParameter("type"));
    if (type.equals("")) {
        type = "all"; //默认是全部
    }
    String objId = SzConvert.toSpaceStr(request.getParameter("objId"));
    String objName = SzConvert.toSpaceStr(request.getParameter("objName"));
    String objDesc = SzConvert.toSpaceStr(request.getParameter("objDesc"));
    String objDescName = SzConvert.toSpaceStr(request.getParameter("objDescName"));
    String objPostId = SzConvert.toSpaceStr(request.getParameter("objPostId"));
    String objPostName = SzConvert.toSpaceStr(request.getParameter("objPostName"));

    String s = "";

    s = "";
      //+ "<input type='radio' name='DepartSelecting' value='' OnClick='ShowAllLogin2();'>显示全体员工"
      //+ "<input type='radio' name='DepartSelecting' value='0' OnClick='ClickDepart();'>显示没有部门的员工";    
%>
<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">
<%@ include file="/share/organize/user_js_include.jsp"%>
</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 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;
    }
    //读取数据
    OlSmsInfo olSmsInfo = null;
    OlSms olSms = new OlSms();
    if (!sKEY.equals("0")) {
        olSmsInfo = (OlSmsInfo)olSms.getInfoByKey(Integer.parseInt(sKEY));
    }
    if (olSmsInfo == null) {
        olSmsInfo = new OlSmsInfo();
        olSmsInfo.setFSDLXM(szLoginInfo_SESSION.getDLXM());
        olSmsInfo.setFSDLID(szLoginInfo_SESSION.getDLID());
    } else {
    }

%>

<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="FSID" value="<%=olSmsInfo.getFSID()%>">
  <input type="hidden" name="FSDLID" value="<%=olSmsInfo.getFSDLID()%>">
  <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>
        <!-- 2012-01-09增加 
        <input type="text" name="FSBT" class="txtClass2"  maxlength="40">
         -->
        <textarea name="FSBT" class="areaClass2"></textarea>
    </td>
  </tr>  
  <tr>
    <td class="tdClassTitle">
    	<span class="trClassTitle_c" id="span1"><a href="#" OnClick="javascript:over(1);" onfocus="javascript:blur();">输入接收号码</a></span><br>
    	<span id="span2"><a href="#" OnClick="javascript:over(2);" onfocus="javascript:blur();">选择内部员工</a></span><br>
    	<span id="span3"><a href="#" OnClick="javascript:over(3);" onfocus="javascript:blur();">选择个人通讯录</a></span>
    </td>
    <td valign="top">
    	<div id="div1">
    		<textarea name="JSJSHM" class="areaClass2" <%=sReadonly%> ></textarea>
    		<br>分号;隔开
    	</div>
    	<div id="div2" style="display:none;">
				<!----这里列出可以选择的用户---->
				<%
    			String sDLID_selected = "0";
				%>
				<%@ include file="/share/organize/login_mult_include2.jsp"%>    		
    	</div>  
    	<div id="div3" style="display:none;" >
				<%@ include file="/share/organize/address_mult_include2.jsp"%>     		
    	</div>
    	<div id="div4" style="display:none;" >
				<//%@ include file="/share/organize/customer_mult_include2.jsp"%>     		
    	</div>    	
    	<script language="javascript">
    		function over(id) {
    			//alert(id);
    			if (id == "1") {
    				document.getElementById("div1").style.display = "";
    				document.getElementById("div2").style.display = "none";
    				document.getElementById("div3").style.display = "none";

    				document.getElementById("span1").className = "trClassTitle_c";
    				document.getElementById("span2").className = "";
    				document.getElementById("span3").className = "";
    				//document.getElementById("div4").style.display = "none";
    			} else if (id == "2") {
    				document.getElementById("div1").style.display = "none";
    				document.getElementById("div2").style.display = "";
    				document.getElementById("div3").style.display = "none";

    				document.getElementById("span1").className = "";
    				document.getElementById("span2").className = "trClassTitle_c";
    				document.getElementById("span3").className = "";    				
    				//document.getElementById("div4").style.display = "none";
    			} else if (id == "3") {
    				document.getElementById("div1").style.display = "none";
    				document.getElementById("div2").style.display = "none";
    				document.getElementById("div3").style.display = "";
    				
    				document.getElementById("span1").className = "";
    				document.getElementById("span2").className = "";
    				document.getElementById("span3").className = "trClassTitle_c";       				
    				//document.getElementById("div4").style.display = "none";  
    			} else if (id == "4") {
    				document.getElementById("div1").style.display = "none";
    				document.getElementById("div2").style.display = "none";
    				document.getElementById("div3").style.display = "none";
    				//document.getElementById("div4").style.display = "";    				
    			}
    		}
    	</script>     	  	
    </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" src="../../share/js/selectTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.FSBT, "短信内容")) {
      return false;
    }
    //至少选择人员/部门/职务中的一个
    if ( formName.LoginSelected.length == 0
      && formName.LoginSelected_ADDRESS.length == 0
      && isSpace(formName.JSJSHM.value) ) {
      alert("请填写号码或者选择人员");
      return;
    } 
    //2012-01-05注释，放到类中修改，确保其他模块的提醒也有   
    //formName.FSBT.value = formName.FSBT.value + "[临安市信用联社]";
    SelectAllOption(formName.LoginSelected);
		SelectAllOption(formName.LoginSelected_ADDRESS);
    formName.action = url;
    formName.submit();
  }
</script>
</body>
