<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" session="true"  %>
<%@ page import = "zr.zrpower.common.web.SelectBox" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.ejb.sys.UserService" %>
<%@ page import = "zr.zrpower.ejb.sys.UdictService" %>
<%@ page import = "zr.zrpower.ejb.sys.UnitService" %>

<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@page import="zr.zrpower.ejb.sys.SecurityService"%>
<html>
<head>
<%
  UIService userUI =new UIService();
  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  UnitService depMgr = new UnitService();
  UserService userMgr = new UserService();
  SecurityService SeService =new SecurityService();
  UdictService dm = new UdictService();
  String strUNITID =  request.getParameter("unitid");
  if (request.getParameter("unitid")==null)
  {
    strUNITID = "";
  }
  if (strUNITID.length()==0)
  {
    //得到最小的单位编号
    strUNITID = depMgr.GetMinUnitID();
  }

  String UnitName = depMgr.GetUnitName(strUNITID) ;

%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></title>
<link REL="stylesheet" type="text/css" href="../zrsysmanage/css/<%=user.getUserCSS()%>">

<LINK href="../zrsysmanage/script/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar.js" type=""></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar-zh.js" type=""></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar-setup.js" type=""></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/validate.js" type=""></SCRIPT>

<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/script/Public.js"></SCRIPT>
<%}%>
<script language="JavaScript" type="text/JavaScript">
<!--
function Save(){
   if(document.form1.LOGINID.value.length<1) {
     
     <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('请输入用户登录名称!', {icon: 7});
      <%}else{%>
       alert("请输入用户登录名称！");
       <%}%>
	 document.form1.LOGINID.focus();
	 return false;
   }
   if(document.form1.NAME.value.length<1) {
     
     <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('请输入用户真实姓名!', {icon: 7});
      <%}else{%>
       alert("请输入用户真实姓名！");
       <%}%>
	 document.form1.NAME.focus();
	 return false;
   }
   if(document.form1.LOGINPW.value.length<1) {
     
     <%if("6".equals(user.getUserWINDOWTYPE())){ %>
        layer.alert('请输入登录密码!', {icon: 7});
      <%}else{%>
       alert("请输入登录密码！");
       <%}%>
	 document.form1.LOGINPW.focus();
	 return false;
   }


   if (!checkdate(document.form1.BIRTHDAY,"出生日期")){
      return false;
   }
    return true;
}
//-->
</script>
</head>
<BODY class="BodyMain">
<form action="../actionuserdata.do" method="post" enctype="multipart/form-data" name="form1">
<input type="hidden" name="Act" id="Act" value="add">
<input name="UNITID" type="hidden" id="UNITID" value="<%=strUNITID%>">
<input name="CREATEPSN" type="hidden" value="<%=user.getUserID()%>">

<DIV id="divMessage" style='padding-left:0;padding-top:0;width:100%;height:90%;overflow:auto'>

      <fieldset style="width: 98%">
      <legend>增加用户信息</legend>

      <table width="458" class="inputTable" border="0" cellpadding="3" style="border-collapse: collapse;">
          <tr>
            <td width="100" align="right">所在单位:</td>
            <td width="340" colspan="2"><%=UnitName%></td>
          </tr>
          <tr>
            <td align="right">登录名:</td>
            <td colspan="2"><input name="LOGINID" type="text" class="text" id="LOGINID" size="50" maxlength="30">
            <Font class="WriteSign">*</Font></td>
          </tr>
          <tr>
            <td align="right">登录密码:</td>
            <td colspan="2"><input name="LOGINPW" type="password" class="text" id="LOGINPW" size="50" maxlength="30">
            <Font class="WriteSign">*</Font></td>
          </tr>


          <tr>
            <td align="right">真实姓名:</td>
            <td colspan="2"><input name="NAME" type="text" class="text" id="NAME" size="50" maxlength="30">
            <Font class="WriteSign">*</Font></td>
          </tr>

          <tr>
            <td align="right">内部编号:</td>
            <td colspan="2"><input name="LCODE" type="text" class="text" id="LCODE" size="6" maxlength="6">
            <Font class="WriteSign">*</Font>

            &nbsp;&nbsp;排序号:<input name="ORBERCODE" type="text" class="text" id="ORBERCODE" size="6" maxlength="6">
            </td>

          <tr>
            <td align="right">性别:</td>
            <td colspan="2"><select name="SEX" id="SEX">
          <option value="1" selected>男</option>
          <option value="2">女</option>
        </select>
            &nbsp;&nbsp;出生日期:
            <input name="BIRTHDAY" type="text" class="text" id="BIRTHDAY" size="10" maxlength="10" onBlur=checkdate1(this)><img src="../zrsysmanage/images/datecal.gif" onClick="return showCalendar('BIRTHDAY', 'Y-MM-DD');" style="margin:0px 2px -3px 5px;cursor:pointer;">
            </td>
          </tr>

          <tr>
            <td align="right">办公电话:</td>
            <td colspan="2"><input name="PHONE" type="text" class="text" id="PHONE" size="50" maxlength="30"></td>
          </tr>
          <tr>
            <td align="right">手机号码:</td>
            <td colspan="2"><input name="MOBILE" type="text" class="text" id="MOBILE" size="50" maxlength="100"></td>
          </tr>
          <tr>
            <td align="right">电子邮件:</td>
            <td colspan="2"><input name="EMAIL" type="text" class="text" id="EMAIL" size="50" maxlength="50"></td>
          </tr>

          <tr>
            <td align="right">用户照片:</td>
            <td colspan="2"><input name="USERPHOTO" type="file" id="USERPHOTO" class="text"></td>
          </tr>
          <tr>
            <td align="right">用户签名:</td>
            <td colspan="2"><input name="IDIOGRAPH" type="file" id="IDIOGRAPH" class="text"></td>
          </tr>
          <tr>
            <td align="right">用户头像:</td>
            <td><script>
            function showimage(){
              document.images.tus.src="../zrsysmanage/images/face/"+document.form1.USERIMAGE.options[document.form1.USERIMAGE.selectedIndex].value+".JPG";
              }
              facetol=124;
              temp = Math.floor(Math.random() * facetol+1);
              document.write("<img src=../zrsysmanage/images/face/"+temp+".JPG name=tus id=tus> ")
              document.write("<select name=USERIMAGE id=USERIMAGE size=1 onChange=showimage()>")
              for(i=1;i<=facetol;i=i+1) {
                 if (i==temp) ii="selected";else ii=""
                 document.write("<option value='"+i+"' "+ii+">"+i+"</option>")
              }
             </script></td>
            <td><!--
              
               --><table cellspacing="0" cellpadding="0" border='0'><tr>
               <%if("html5.css".equals(user.getUserCSS())){ %>
               <%=userUI.ClickButton1("查看所有头像","openLaoadUrl('Face.jsp','500px','500px');","buttonBrowse.gif",user.getUserImage())%>
               <%}else{ %>
               <%=userUI.ClickButton1("查看所有头像","open('Face.htm','','width=500,height=500,resizable,scrollbars');","buttonBrowse.gif",user.getUserImage())%>
              <%} %>
              </tr></table>

            </td></tr>
          <tr>
            <td align="right">部门内勤:</td>
            <td colspan="2">
              <input type="radio" name="DEPTINSIDE" value='1' onclick="document.form1.DEPTINSIDE.value='1'" >是　
	      <input type="radio" name="DEPTINSIDE" value='0' onclick="document.form1.DEPTINSIDE.value='0'" checked>否
            </td>
          </tr>
           <tr>
            <td align="right"></td>
            <td colspan="2"><Font class="WriteSign">说明：多个手机号码用,号分隔。</Font></td>
           </tr>
      </table>
      </fieldset>

      <center><br>
         <table cellspacing="0" cellpadding="0" border='0'><tr>
            <%=userUI.ClickButton("保 存","JavaScript:if(Save()){document.form1.submit();}","buttonSave.gif",user.getUserImage())%>
            <%=userUI.ClickButton("返 回","JavaScript:history.back();","buttonReturn.gif",user.getUserImage())%>
            </tr></table>
      </center>
      <br>

</div>

 </form>
</BODY>
</HTML>
<%
user = null;
userUI = null;
depMgr = null;
userMgr = null;
%>
