<%@ 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.ejb.sys.UdictService" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER" %>
<%@ page import = "zr.zrpower.entity.sys.BPIP_USER_ROLE"%>
<%@ page import = "zr.zrpower.ejb.sys.SecurityService"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.common.util.DateWork" %>

<%@ page  import = "zr.zrpower.entity.sys.BPIP_USER_REMOVE" %>
<%@ page  import = "zr.zrpower.entity.sys.BPIP_UNIT" %>
<%@ page import = "zr.zrpower.ejb.sys.UserRemoveService" %>


<html>
<head>
<%
  String UserID = request.getParameter("SelectedItems");
  String struserid = request.getParameter("SelectedItems");
  UnitService depMgr = new UnitService();
  UserService userMgr = new UserService();
  UdictService dictMgr = new UdictService();
  SecurityService SeService =new SecurityService();
  SessionUser user = (SessionUser)session.getAttribute("userinfo");
  UserRemoveService UserRemove =new UserRemoveService();
  UnitService Unit = new UnitService();

  DateWork dw=new DateWork();
  BPIP_USER_REMOVE[] Remove = null;
  UIService userUI =new UIService();
  BPIP_USER mUser = userMgr.GetUserInfo(UserID);
  String XBname = "";
  if (mUser.getSEX().equals("1"))
  {XBname = "男";}
  else
  {XBname = "女";}
%>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title></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"></SCRIPT>


<script language="JavaScript" type="text/JavaScript">
<!--
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");
}
//-->
</script>
</head>

<BODY class="BodyMain">
<DIV id="div" style='position:absolute;width:100%;height:100%;overflow:auto'>


      <fieldset style="width: 98%">
      <legend>基本信息</legend>

      <table width="498" border="0"  cellpadding="3" style="border-collapse: collapse;">
          <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="11" 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><%=XBname%></td>
            </tr>
          <tr>
            <td align="right">出生日期:</td>
            <td><%=dw.DateToString(mUser.getBIRTHDAY())%></td>
            </tr>
          <tr>
            <td align="right">办公电话:</td>
            <td><%=mUser.getPHONE()%></td>
            </tr>
          <tr>
            <td align="right">手机号码:</td>
            <td><%=mUser.getMOBILE()%></td>
            </tr>
          <tr>
            <td align="right">电子邮件:</td>
            <td><%=mUser.getEMAIL()%></td>
            </tr>

          <tr>
            <td align="right">用户签名:</td>
            <td>

              <table cellspacing="0" cellpadding="0" border='0'><tr>
               <%=userUI.ClickButton("查看签名","JavaScript:showidiograph('"+UserID+"');","buttonBrowse.gif",user.getUserImage())%>
              </tr></table>

           </td>
            <td> </td>
          </tr>
          <tr>
            <td align="right">用户头像:</td>
            <td><img src="../showuserphoto.do?Act=face&userid=<%=mUser.getUSERID()%>&faceid=<%=mUser.getUSERIMAGE()%>" border=0 width="48" height="48"></td>
            <td></td>
          </tr>
          <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>
      <br>

 <%
//得到查询的记录集
     Remove = UserRemove.GetUserRemoveList(struserid);
  %>
<%
if(Remove!=null)
{
  for(int i=0;i<Remove.length;i++)
  {
    %>
    <br>&nbsp;
    <fieldset style="width: 98%">
      <legend>调动信息</legend>
      <table align="left" width="498" border="0" cellpadding="3" style="border-collapse: collapse;">
          <tr>
          <td width="35px">&nbsp;</td>
            <td align="left">调动时间:<%=Remove[i].getMOVETIME().toString().substring(0,10)%></td>

          </tr>
          <tr>
          <td width="35px">&nbsp;</td>
            <td align="left">调动前单位:<%=Remove[i].getBEFOREUNIT()%></td>

          </tr>
          <tr>
          <td width="35px">&nbsp;</td>
            <td align="left">调动后单位:<%=Remove[i].getAFTERUNIT()%></td>

            </tr>
          <tr>
          <td width="35px">&nbsp;</td>
            <td align="left">调动原因:<%=Remove[i].getMOVEREASON()%></td>

            </tr>

          </table>
      </fieldset>
    <%
  }
}
%>
    <br>&nbsp;
    <fieldset style="width: 98%">
      <legend>拥有角色</legend>
      <table align="left" width="498" border="0" cellpadding="3" style="border-collapse: collapse;">
       <%
//得到查询的记录集
    BPIP_USER_ROLE[] rolemenu =SeService.GetUserRoleList(struserid);
     //+++++++++++++++
   if (rolemenu!=null && rolemenu.length>0){
      for(int i=0;i<rolemenu.length;i++){
        String RoleId = String.valueOf(rolemenu[i].getROLEID());
        String RoleName = SeService.GetRoleTrueName(RoleId);
      %>
      <tr valign="bottom">
        <td width="100%" align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=i+1%>、 <%=RoleName%></td>
      </tr>
      <%
      } }%>
         </table>
      </fieldset>

<center><br>
            <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("返 回","JavaScript:self.location='UserList.jsp?nodeId="+mUser.getUNITID()+"';","buttonReturn.gif",user.getUserImage())%>
            </tr></table>
            <br>
      </center>
 <!--HTML Foot显示表单尾-->
  <%=userUI.ShowFootHtml()%>
</div>
</body>

</html>
<%
depMgr = null;
userMgr = null;
dictMgr = null;
SeService = null;
user = null;
UserRemove = null;
Unit = null;
Remove = null;
userUI = null;
mUser = null;
%>
