<%@ page contentType="text/html; charset=GBK"  errorPage="../error.jsp" session="true"  %>
<%@ page import = "zr.zrpower.ejb.sys.UnitService" %>
<%@ page import = "zr.zrpower.ejb.sys.UserService" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER" %>
<%@ page  import = "zr.zrpower.entity.sys.BPIP_USER_REMOVE" %>
<%@ page  import = "zr.zrpower.entity.sys.BPIP_UNIT" %>
<%@ page import = "zr.zrpower.ejb.sys.UserRemoveService" %>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.common.web.SelectBox" %>
<%@ page import = "zr.zrpower.common.util.DateWork" %>

<%@page import="zr.zrpower.ejb.sys.SecurityService"%>


<html>
<head>
<%

  UnitService depMgr = new UnitService();
  UserService userMgr = new UserService();
  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  UIService userUI =new UIService();
  SecurityService SeService =new SecurityService();
  DateWork dw=new DateWork();
  String UserID =user.getUserID() ;
  BPIP_USER mUser = userMgr.GetUserInfo(UserID);
  SelectBox sb=new SelectBox();
  BPIP_USER_REMOVE[] Remove = null;
  UserRemoveService UserRemove =new UserRemoveService();
  UnitService Unit = new UnitService();
  BPIP_UNIT[] UnitID = null;

  int intRowCur=0,intRowCount=0,showcurRow=0,intPage=1,intPageSize;
  int intstart=0,intend=0;
  intPageSize = 1000;

%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title><%=SysPreperty.getProperty().SystemName%><%=SysPreperty.getProperty().Versoin%></title>
<link REL="stylesheet" type="text/css" href="../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT language="JavaScript" src="../zrsysmanage/script/validate.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../zrsysmanage/script/Public.js"  type="text/jscript" ></SCRIPT>
<LINK href="../zrsysmanage/script/calendar-win2k-cold-1.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar-zh.js"></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/calendar-setup.js"></SCRIPT>
<SCRIPT language="JavaScript" src="../zrsysmanage/script/validate.js"></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 type="text/javascript" src="../ZrwebGui/tab/tab.js"></script>
<link rel="stylesheet" type="text/css" href="../ZrwebGui/tab/tab.css">

<STYLE type=text/css>
#con { FONT-SIZE: 12px; MARGIN: 0px auto; WIDTH: 98% }
#tags { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 10px; WIDTH: 98% ; PADDING-TOP: 0px; HEIGHT: 23px }
#tags LI { BACKGROUND: url(../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagleft.gif) no-repeat left bottom; FLOAT: left; MARGIN-RIGHT: 1px; LIST-STYLE-TYPE: none; HEIGHT: 23px }
#tags LI A { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: url(../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagright.gif) no-repeat right bottom; FLOAT: left; PADDING-BOTTOM: 0px; COLOR: #999;
LINE-HEIGHT: 23px; PADDING-TOP: 0px; HEIGHT: 23px; TEXT-DECORATION: none }
.tagContent { PADDING-RIGHT: 10px; DISPLAY: none; PADDING-LEFT: 10px; BACKGROUND: url(../ZrwebGui/tab/skin/<%=user.getUserImage()%>/bg.gif) repeat-x; PADDING-BOTTOM: 10px; WIDTH: 100%; COLOR: #474747;
PADDING-TOP: 10px; HEIGHT: 400 }
</STYLE>


<script language="JavaScript" type="text/JavaScript">
<!--
//登录密码
function Check(theForm)
{
if(trim(theForm.OldPwd.value)=="")
{

  <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('旧密码不能为空，请输入!', {icon: 7});
<%}else{%>
    alert("旧密码不能为空，请输入！");
<%}%>
  SetFocus(theForm.OldPwd);
  return false;
}
if(trim(theForm.NewPwd1.value)=="")
{

  <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('新密码不能空，请输入!', {icon: 7});
<%}else{%>
    alert("新密码不能空，请输入！");
<%}%>
  SetFocus(theForm.NewPwd1);
  return false;
}

if(trim(theForm.NewPwd2.value)=="")
{

  <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('确认密码不能空，请输入!', {icon: 7});
<%}else{%>
    alert("确认密码不能空，请输入！");
<%}%>
  SetFocus(theForm.NewPwd2);
  return false;
}

if(theForm.NewPwd1.value!=theForm.NewPwd2.value)
{

  <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('两次输入的密码不一致!', {icon: 7});
<%}else{%>
    alert("两次输入的密码不一致!");
<%}%>
   SetFocus(theForm.NewPwd2);
  return false;
}
 RegForm.Type.value="User";
 return true;
}

function showidiograph(P){
  var width  = 150;
  var height = 80;
  var url = "../showuserphoto.do?Act=idiograph&userid=" + P;
  var arr = window.showModalDialog(url, window, "dialogWidth:" + width + "px;dialogHeight:" + height + "px;help:no;scroll:no;status:no");
}

function Save(){

   if (!checkdate(document.RegForm.BIRTHDAY,"出生日期")){
      return false;
   }

   RegForm.Type.value="sedit";
   RegForm.action="../actionuserdata.do";
   RegForm.encoding="multipart/form-data";
   return true;
}


setTimeout("selectTag('tagContent0',document.getElementById('kslink'))",300);
//-->
</script>
</HEAD>
<BODY class="BodyMain">
<FORM name="RegForm" method="post" Action="PwdResult.jsp"  onsubmit="return Check(this);">
<input type="hidden" name="ISSYSTEM" value="0">
<input type="hidden" name="USER_NO" value="<%=user.getUserID()%>">
<input type="hidden" name="USERID" id="USERID" value="<%=user.getUserID()%>">
<input type="hidden" name="Type" value="">
<input type="hidden" name="Act" id="Act" value="sedit">


<table width="100%">
  <tr>
    <td height="510" valign="top">

    <DIV id="con">
  <%if("6".equals(user.getUserWINDOWTYPE())){ %>
<UL id="tags">
    <LI class="selectTag">
      <A id="kslink" onClick="selectTag('tagContent0',this)" href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius">基本信息
      </A>
    </LI>
     <LI>
       <A onClick="selectTag('tagContent1',this)" href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius">调动信息
       </A>
     </LI>
     <LI>
       <A onClick="selectTag('tagContent2',this)" href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius">其它信息
       </A>
     </LI>
     <LI>
       <A onClick="selectTag('tagContent3',this)" href="javascript:void(0)" class="btn1 btn-medium btn-blue btn-radius"> 修改密码
       </A>
     </LI>
 </UL>
<%}else{ %>
  <UL id="tags">
    <LI class="selectTag">
      <A id="kslink" onClick="selectTag('tagContent0',this)"  href="javascript:void(0)">
      <IMG src="../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
      基本信息
      </A>
    </LI>
     <LI>
       <A onClick="selectTag('tagContent1',this)" href="javascript:void(0)">
       <IMG src="../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         调动信息
       </A>
     </LI>
     <LI>
       <A onClick="selectTag('tagContent2',this)" href="javascript:void(0)">
       <IMG src="../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         其它信息
       </A>
     </LI>
     <LI>
       <A onClick="selectTag('tagContent3',this)" href="javascript:void(0)">
       <IMG src="../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         修改密码
       </A>
     </LI>
  </UL>
  <%}%>
  <DIV id="tagContent" style="height: 525px;">
    <DIV style="width:758px" class="tagContent selectTag" id="tagContent0">
      &nbsp;
      <fieldset style="width: 98%">
      <legend>用户基本信息</legend>
           <table style="width:698px" border="0" cellpadding="3" style="border-collapse: collapse;" class="inputTable">
             <tr>
            <td align="right">所在单位:</td>
            <td colspan="2"><%=depMgr.GetUnitName(mUser.getUNITID())%></td>

          </tr>
          <tr>
            <td align="right">用户编号:</td>
            <td width="168"><%=mUser.getUSERID()%></td>
            <td width="170" rowspan="9" valign="top"><img src="../showuserphoto.do?Act=photo&userid=<%=mUser.getUSERID()%>" border=1 width="94" height="120"></td>
          </tr>
          <tr>
            <td align="right">登录名:</td>
            <td><%=mUser.getLOGINID()%></td>
          </tr>

          <tr>
            <td align="right">真实姓名:</td>
            <td><%=mUser.getNAME()%></td>
            </tr>
          <tr>
            <td align="right">内部编号:</td>
            <td><%=mUser.getLCODE()%></td>
            </tr>
             <tr>
            <td align="right">排序号:</td>
            <td><%=mUser.getORBERCODE()%></td>
            </tr>
          <tr>
            <td align="right">性别:</td>
            <td>

            <select name="SEX" id="SEX" class="selectlist">
            <%
              String[][] saSex = {{"1","男"},{"2","女"}};
              sb.setDictStringArrary(saSex);
              sb.setSelected(mUser.getSEX());
            %>
            <%=sb.show()%>
        </select>
            </td>
            </tr>
          <tr>
            <td align="right">出生日期:</td>
            <td><input name="BIRTHDAY" type="text" class="text" id="BIRTHDAY" size="15" maxlength="10" onBlur=checkdate1(this) value="<%=dw.DateToString(mUser.getBIRTHDAY())%>"><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><input name="PHONE" type="text" class="text" id="PHONE" size="30" maxlength="30" value="<%=mUser.getPHONE()%>"></td>
            </tr>
          <tr>
            <td align="right">手机号码:</td>
            <td><input name="MOBILE" type="text" class="text" id="MOBILE" size="30" maxlength="100" value="<%=mUser.getMOBILE()%>"></td>
            </tr>
          <tr>
            <td align="right">电子邮件:</td>
            <td><input name="EMAIL" type="text" class="text" id="EMAIL" size="30" maxlength="50" value="<%=mUser.getEMAIL()%>"></td>
            </tr>
         <tr>
            <td align="right">用户照片:</td>
            <td><input name="USERPHOTO" type="file" id="USERPHOTO" class="text"></td>
            </tr>
          <tr>
          <tr>
            <td align="right">用户签名:</td>
            <td>
              <input name="IDIOGRAPH" type="file" id="IDIOGRAPH" class="text">

           </td>
            <td align="left"> <table cellspacing="0" cellpadding="0" border='0'><tr>
               <%=userUI.ClickButton("查看签名","JavaScript:showidiograph('"+UserID+"');","buttonBrowse.gif",user.getUserImage())%>
              </tr></table> </td>
          </tr>
          <tr>
            <td align="right">用户头像:</td>
            <td><script>function showimage(){document.images.tus.src="../zrsysmanage/images/face/"+document.RegForm.USERIMAGE.options[document.RegForm.USERIMAGE.selectedIndex].value+".JPG";}
             facetol=124;
             temp = <%=mUser.getUSERIMAGE()%>;
             document.write("<img width=48 height=48 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"><Font class="WriteSign">说明：多个手机号码用,号分隔。</Font></td>
           </tr>


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


        </DIV>
    <DIV style="width:758px" class="tagContent selectTag" id="tagContent1">

          <br>
           <table border="1" class="inputTable" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF" align="center">
            <tr valign="middle" class="Window_TbT">
               <td width="10%" align="center" class="Window_TbT" nowrap style="text-align:center;cursor:pointer;">用户编号</td>
               <td width="18%" align="center" class="Window_TbT" nowrap style="text-align:center;cursor:pointer;">调动时间</td>
               <td width="24%" align="center" class="Window_TbT" nowrap style="text-align:center;cursor:pointer;">调动前单位</td>
               <td width="24%" align="center" class="Window_TbT" nowrap style="text-align:center;cursor:pointer;">调动后单位</td>
               <td width="24%" align="center" class="Window_TbT" nowrap style="text-align:center;cursor:pointer;">调动原因</td>
            </tr>
          <%
        //得到查询的记录集
            Remove = UserRemove.GetUserRemoveList(UserID);
            if (Remove != null)
              {//有记录记录集的长度
              intRowCount = Remove.length;
              }
              //计算开始记录和结束记录
              intstart=intPage*intPageSize-intPageSize;
              intend=intPage*intPageSize;
              if (intRowCount<intend)
              {intend=intRowCount;}
              //当前页显示的记录数
              intRowCur=intend - intstart;
              showcurRow=0;
              for (int i = intstart; i < intend; i++) {
                   BPIP_USER_REMOVE file =Remove[i];
                   showcurRow=showcurRow+1;
                   String MoveTime = file.getMOVETIME().toString().substring(0,10);
             %>
            <tr valign="bottom">
                 <td width="10%" align="center" class="Window_TbB" nowrap style="text-align:center;cursor:pointer;"><%=file.getUSERID()%></td>
                 <td width="18%" align="center" class="Window_TbB" nowrap style="text-align:center;cursor:pointer;"><%=MoveTime%></td>
                 <td width="24%" align="center" class="Window_TbB" nowrap style="text-align:center;cursor:pointer;"><%=file.getBEFOREUNIT()%></td>
                 <td width="24%" align="center" class="Window_TbB" nowrap style="text-align:center;cursor:pointer;"><%=file.getAFTERUNIT()%></td>
                 <td width="24%" align="center" class="Window_TbB" nowrap style="text-align:center;cursor:pointer;"><%=file.getMOVEREASON()%></td>

            </tr>
             <%
             }%>
          </table>

        </DIV>
        <DIV style="width:758px" class="tagContent selectTag" id="tagContent2">

         <br>&nbsp;
      <fieldset style="width: 98%">
      <legend>用户其他信息</legend>
           <table width="498" border="0" cellpadding="3" style="border-collapse: collapse;">
            <tr>
            <td align="right">登录次数:</td>
            <td><%=Integer.toString(mUser.getLOGINTIME())%></td>
            <td>　</td>
          </tr>

		  <tr>
            <td align="right">用户状态:</td>
            <td><%=userMgr.GetUserState(mUser.getUSERSTATE())%></td>
            <td>　</td>
          </tr>

           </table>
            </fieldset>

        </DIV>

        <DIV style="width:758px" class="tagContent selectTag" id="tagContent3">

   <br>&nbsp;
           <fieldset style="width: 98%">
           <legend>修改密码</legend>
  <TABLE border='0' width="100%" cellspacing="0" cellpadding="0" align="center">

    <TR>
      <TD class="PutdSet" width="30%">旧密码：</TD>
      <TD class="inputTd">
        <input class="text" type="password" name="OldPwd" size="56" maxlength="32"><Font class="WriteSign">*</Font>
      </TD>
    </TR>
    <TR>
      <TD class="PutdSet" width="30%">新密码：</TD>
      <TD >
        <input class="text" type="password" name="NewPwd1" size="56" maxlength="32"><Font class="WriteSign">*</Font>
      </TD>
    </TR>
    <TR>
      <TD class="PutdSet" width="30%">确认密码：</TD>
      <TD>
        <input  class="text" type="password" name="NewPwd2" size="56" maxlength="32"><Font class="WriteSign">*</Font>
      </TD>
    </TR>

  </TABLE>
    <br>

                 <center><br>
                 <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("修 改","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>
                 <%=userUI.ClickButton("重 填","JavaScript:document.RegForm.reset();","buttonReset.gif",user.getUserImage())%>
                 </tr></table>
                 </center>
                 <br>
  </fieldset>
</DIV>
</DIV>
</DIV>

    </td>
  </tr>

</table>

 </FORM>
</BODY>
</HTML>
<%
depMgr = null;
userMgr = null;
user = null;
userUI = null;
mUser = null;
UserRemove = null;
Unit = null;
UnitID = null;
%>
