
<%
/**********************************************************************************
	프로그램명		: part_view.jsp
	프로그램설명	:
	작 성 자			: 조용준
	작 성 일			: 04.06.10
	최신변경일		:
***********************************************************************************/
%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="kr.co.kihyun.beans.user.HttpSSOLogin"%>
<%@ page import="kr.co.kihyun.beans.totsys.sysadm.part.PartUtil"%>
<%@ page import="kr.co.kihyun.beans.totsys.sysadm.part.PartView"%>
<%@ page import="kr.co.kihyun.text.html.ServletUtil"%>
<%@ page import="kr.co.kihyun.lang.Encoder"%>
<%@ page import="kr.co.kihyun.moumi.Moumi"%>
<%@ page import="kr.co.kihyun.lang.MString"%>
<%@ page import="java.net.URLEncoder"%>

<jsp:useBean id="partRegist"
	class="kr.co.kihyun.beans.totsys.sysadm.part.PartRegist" scope="page" />

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

<%
	try{
        /***** user Login check *****************/
		if(!HttpSSOLogin.isLogin(request)){
			String connURL="parent.location='/totsys/login/login.jsp';";
			out.println(ServletUtil.getJavaScript(connURL));
			return;
		}

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

		/****** Parameter ******/
		String partID = "";
		String findOption = "";
		String findWord = "";
		String dirPath = URLEncoder.encode("<a href=\"/totsys/sysadm/part/part_list.jsp\" class=\"d11_blue\">기관관리</a>", "UTF-8");
		String uri = URLEncoder.encode("./part_list.jsp?findOption="+findOption+"&findWord="+findWord, "UTF-8");

		partID = clearXSS(request.getParameter("partID"),"");



		/****** part view data get ******/
		String name = "";
		String sysAuth = "";
		String des = "";
		String upperID = "";

		String[] distIDList = null;

		PartView partView = new PartView();
		partView.executeQuery(partID);
		name = partView.getName();
		sysAuth = partView.getSysAuth();
		//des = MString.replaceString(partView.getDes(),"\r\n","\\n");
		des = partView.getDes();
		upperID = partView.getUpperID();

		partRegist.executeQuery();
		distIDList = partRegist.getDistIDList();


%>

<HTML>
<HEAD>
<TITLE><%=Moumi.getTitle()%></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<link rel="stylesheet" href="/totsys/common/css/text.css"
	type="text/css">
<script src="/totsys/common/js/rollover.js"></script>
<SCRIPT langusge="javascript">
			function initSetting(){
				partForm.name.value='<%=MString.checkNull(name)%>';
				partForm.des.value='<%=MString.checkNull(des)%>';
				//partForm.sysAuth.value='<%//= sysAuth %>';
				partForm.upperID.value='<%=MString.checkNull(upperID)%>';
			}

			function formSubmit(){
				if(partForm.name.value == ''){
					alert('기관명을 넣어 주십시요!');
					partForm.name.focus();
				}else{
					partForm.submit();
				}
			}
		</SCRIPT>
</HEAD>

<body style='' BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0
	MARGINHEIGHT=0>
<table width="100%" height="70" border="0" cellpadding="0"
	cellspacing="0">

	<!---- top menu 시작 --->
	<jsp:include page="/totsys/common/inc/sysadm/top/top.jsp" flush="true">
		<jsp:param name="dirPath" value="<%= dirPath %>" />
	</jsp:include>
	<!---- top menu  끝 ---->

	<tr>
		<td nowrap width="0"></td>
		<td valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">

			<!--스타일시트-->
			<link rel="stylesheet" href="/totsys/common/css/kecttep.css"
				type="text/css">

			<!-- 뉴타이틀 -->
			<jsp:include page="/totsys/common/inc/title/title.jsp" flush="true" />
			<!-- 뉴타이틀 -->




			<tr>
				<td height="31" valign="top">
				<table border="1px" class="kecttep_list_table" bordercolor="#e3e3e3"
					width="100%" cellpadding="0" cellspacing="0">
					<FORM name="partForm"
						action="/servlet/kr.co.kihyun.beans.totsys.sysadm.part.HttpPartModifier"
						method="post"><!----  기관 ID  ---->
					<tr>
						<td nowrap width="150" height="31" class="kecttep_tdmenu"
							style="padding-left: 10;"><img
							src="/totsys/common/images/icon.gif" align="absmiddle">&nbsp;&nbsp;<b>기관
						ID</b></td>
						<td class="kecttep_last_graytd"
							style="padding-left: 10; padding-top: 4;"><%=partID%></td>
						<input type="hidden" name="id" value="<%=partID%>">
					</tr>
					<!----  기관명  ---->
					<tr>
						<td width="150" height="31" class="kecttep_tdmenu"
							style="padding-left: 10;"><img
							src="/totsys/common/images/icon.gif" align="absmiddle">&nbsp;&nbsp;<b>기관명</b></td>
						<td class="kecttep_last_graytd" style="padding-left: 10;"><input
							name="name" type="text" class="inputtxt"></td>
					</tr>
					<!---- 기관권한 ----> <input type="hidden" name="sysAuth"
						value="<%=sysAuth%>" /> <!-- START DEL 기관권한 변경 --> <!--
									<tr>
										<td width="150" height="31" class="kecttep_tdmenu" style="padding-left:10;"><img src="/totsys/common/images/icon.gif" align="absmiddle">&nbsp;&nbsp;<b>기관권한</b></td>
										<td class="kecttep_last_graytd" style="padding-left:10;">
											<select name="sysAuth">
												<%/*
													for(int i=(PartUtil.partAuth.length)-1; i>=0; i--){
														if(!(PartUtil.partAuth[i] == null || PartUtil.partAuth[i].equals("")) && i < Moumi.PART_REPOADM){
												*/
												%>
															<option value="<%//=i%>"><%//=PartUtil.partAuth[i]%></option>
												<%//	}
												//	}
												
												%>
											</select>
										</td>
									</tr>
									<tr height="1">
										<td height="1" colspan="2" bgcolor="D6D6D6"></td>
									</tr>
									--> <!-- END DEL 기관권한 변경 --> <!---- 상위참조 부서 ---->
					<tr>
						<td width="150" height="31" class="kecttep_tdmenu"
							style="padding-left: 10;"><img
							src="/totsys/common/images/icon.gif" align="absmiddle">&nbsp;&nbsp;<b>상위부서</b></td>
						<td class="kecttep_last_graytd" style="padding-left: 10;"><select
							name="upperID">
							<%	for(int i=0; i<distIDList.length; i++){	%>
							<option value="<%=distIDList[i]%>"><%=new PartView().getUpperName(distIDList[i])%></option>
							<%	}	%>
						</select></td>
					</tr>
					<!---- 설명 ---->
					<tr>
						<td width="150" valign="top" class="kecttep_tdmenu"
							style="padding-left: 10; padding-top: 10;"><img
							src="/totsys/common/images/icon.gif" align="absmiddle">&nbsp;&nbsp;<b>설명</b></td>
						<td class="kecttep_last_graytd"
							style="padding-left: 10; padding-top: 10; padding-bottom: 10;">
						<textarea name="des" cols="95" class="inputtxt"
							STYLE="ime-mode: active"></textarea></td>
					</tr>
					</FORM>
				</table>
			<tr style="padding-top: 10px; padding-left: 180px;">
				<td>
				<table border="0" cellspacing="0" cellpadding="0" align="center">
					<!----  버튼 (확인, 취소) ---->
					<tr>
						<td height="10"><a href="#" onclick="formSubmit();"
							onMouseOut="MM_swapImgRestore()"
							onMouseOver="MM_swapImage('bt_enter','','./images/bt_enter.gif',1)"><img
							name="bt_enter" border="0" src="./images/bt_enter.gif"></a></td>
						<td width="10">&nbsp;</td>
						<td height="10"><a href="#"
							onclick="javascript:history.go(-1);"
							onMouseOut="MM_swapImgRestore()"
							onMouseOver="MM_swapImage('bt_cancel3','','./images/bt_cancel3.gif',1)"><img
							name="bt_cancel3" border="0" src="./images/bt_cancel3.gif"></a></td>
						<td width="220">&nbsp;</td>
					</tr>
				</table>
				</td>
			</tr>
			</td>
			</tr>


		</table>
		</td>
		<td nowrap width="10"></td>
	</tr>
	<!------------------------------- top menu start ------------------------------->
	<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
	<!------------------------------- top menu end ------------------------------->
	<SCRIPT language="javascript">initSetting();</SCRIPT>
</table>
</BODY>
</HTML>
<%
	}catch(Exception ex){
                //38.오류메세지를 통한 정보 노출(getMessage)_CWE-209 : Update by YOUNGJUN,CHO
                ex.printStackTrace();
		//out.println(ex);
		//out.println("<html><body style='overflow=auto' bgcolor='white'><h1>Can't contact servlet runner</h1><br><br> Message : "+ex.getMessage()+"</body></html>");
		//out.println("<META HTTP-EQUIV='refresh' CONTENT='0.1 URL=/error/exception.jsp'>");
                //================================================
	}finally{
	}
%>
