<%@ page contentType="text/html; charset=UTF-8"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.text.html.ServletUtil"
	import="kr.co.kihyun.beans.user.UserView"
	import="kr.co.kihyun.beans.user.RepoAdmUser"
	import="kr.co.kihyun.moumi.MoumiConfig" import="kr.co.kihyun.lang.MLong"
	import="kr.co.kihyun.lang.Encoder"%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>

<%
try{
	/*********** User HttpSSOLogin check ***********/
	if(!HttpSSOLogin.isLogin(request)){
		//login 성공후 되돌아올 주소
		String connURL="opener.location='/totsys/login/login.jsp';";		
		out.println(ServletUtil.getJavaScript(connURL));
		out.println(ServletUtil.getJavaScript("window.close();"));
		return;
	}

	/********** session내의 userId **********/		
	String usID = HttpSSOLogin.getLoginID(request);

	/****** Parameter ******/
	Long docID = MLong.parseLong(request.getParameter("docID"),null);
	Long deptID = MLong.parseLong(request.getParameter("deptID"),null);
	String userID = clearXSS(request.getParameter("userID"),"");
	String isRecog = MString.checkNull(request.getParameter("isRecog"));
    String reportID = MString.checkNull(request.getParameter("reportID"));

	/******* 집계자 정보 *********/	
	UserView userView = new UserView();
	userView.executeQuery(usID);

	String deptName = userView.getDeptName();
	String userName = userView.getName();
	String phone = userView.getPhone();
	String email = userView.getEmail();

	/******* 재보고/재배정 구분 *********/
	String groupID = "555";

	/******* 보고관리자 정보 ********/
	int sys_auth = 5;
	RepoAdmUser admUser = new RepoAdmUser();
	String admUserID = admUser.getID(deptID, sys_auth);
%>
<%@page import="kr.co.kihyun.lang.MString"%><html>
<head>
<title><%=MoumiConfig.getTitle()%></title>
<link rel="stylesheet" href="/totsys/common/css/text.css"
	type="text/css">
<script src="/totsys/common/js/rollover.js"></script>
<script language="javascript">
			
		function checkForm(){
				var frm = document.rereport;
				if(frm.contents.value == ""){
					alert("<%=MoumiConfig.getMessageBundle().getString("moumi.message.popup.inputContent")%>");
					frm.contents.focus();
					return;
				}else{				
				 	    opener.dform3.contents.value = frm.contents.value;
                        opener.dform3.reportID.value = <%=reportID%>
                        opener.dform3.setGubun.value = 2;
                        opener.dform3.submit();
					 	self.close();
			}
		}
        
	</script>
</head>
<body style='' bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="rereport.contents.focus();">
<FORM name="rereport" action="/servlet/kr.co.kihyun.beans.totsys.memo.HttpReReport" method="post">
    <INPUT type="hidden" name="docID" value="<%= docID %>">
    <INPUT type="hidden" name="reportID">
    <INPUT type="hidden" name="groupID" value="<%= groupID%>">
    <INPUT type="hidden" name="userID" 	value="<%= Encoder.toJava(usID)%>">
    <INPUT type="hidden" name="deptID" value="<%= deptID %>">
    <INPUT type="hidden" name="admUserID" value="<%= admUserID %>">
    <INPUT type="hidden" name="approveUserID" value="<%= Encoder.toJava(userID) %>">
  <table width="600" border="0" cellspacing="0" cellpadding="0"height="350">
    <tr>  
      <td valign="top"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <!--스타일시트-->
          <link rel="stylesheet" href="/totsys/common/css/kecttep.css" type="text/css">
          <!--타이틀-->
          <tr> 
            <td style="padding: 10px"> <table width="100%" height="35" border="0" cellpadding="0" cellspacing="0">
                <tr>                   
                  <td bgcolor="728ab5" class="kecttep_title" style="padding-left:20px">
                   <font color="#FFFFFF">
                    <%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.giveBack")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.inputRestore")%>
                   </font>
                  </td>                 
                </tr>
              </table></td>
          </tr>
          <!--타이틀 끝-->
          <tr> 
            <td height="66" align="center" valign="top" style="padding-left: 10; padding-right: 10;">
             <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr> 
                  <td height="3"></td>
                </tr>
                <tr> 
                  <td height="150" colspan="4" align="center" valign="top"><textarea name="contents" cols="80" rows="11" STYLE="ime-mode: active"></textarea>
                  </td>
                </tr>
                <!---- 요청사유 끝 ---->
              </table></td>
          </tr>
        </table>
        <!---- 확인,취소버튼 테이블 시작 ---->
        <table border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> <br>
            <td><a href="#" onclick="javascript:checkForm();"
					onMouseOut="MM_swapImgRestore()"
					onMouseOver="MM_swapImage('bt_enter','','images/bt_enter.gif',1)"><img src="/totsys/common/images/bt_ok.gif"  border="0" align="absmiddle"></a></td>
            <td width="10">&nbsp;</td>
            <td><a href="#" onclick="javascript:window.close();"
					onMouseOut="MM_swapImgRestore()"
					onMouseOver="MM_swapImage('bt_cancel3','','images/bt_cancel3.gif',1)"><img src="/totsys/common/images/bt_cancle.gif" border="0" align="absmiddle"></a></td>
          </tr>
        </table>
        <!---- 확인,취소버튼 테이블  끝 ---->
      </td>
     
    </tr>
    
  </table>
</FORM>
</body>
</html>
<%
}catch(Exception ex){ex.printStackTrace();
	out.println(kr.co.kihyun.text.html.ServletUtil.getJavaScript("location='/servlet/kr.co.kihyun.beans.user.HttpSSOLogin?mode=logout';"));
}finally{	
}
%>
