
<%
/************************************************************@@
  * Program Name	: part_list.jsp
  * Description		: 기관 목록
  * Author				: 강원중
  * Create Date		: 2004-10-29
  * History				:
@@************************************************************/
%>

<%@ page contentType="text/html; charset=UTF-8"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.beans.user.Dept"
	import="kr.co.kihyun.beans.user.PartList"%>

<%
try{
	/********** session내의 userId **********/
	String ptID = HttpSSOLogin.getOrganID(request);
	int sysAuth = HttpSSOLogin.getSysAuth(request);
	
	/************ PartList **************/
	int partCount;
	String[] partIDList;
	String[] partNameList;
	PartList partList  = new PartList();
	if(Moumi.TOTADM == sysAuth || Moumi.TOTPER == sysAuth || Moumi.SYSADM == sysAuth){
		partList.executeQuery();
	}else{
		partList.executeQuery(ptID);
	}
	partCount = partList.getCount();
	partIDList = partList.getIDList();
	partNameList = partList.getNameList();

	/************ PartList View **************/
	final int partColCount = 3;
	int partRowCount;
	int defRowSize = 6;
	int defColSize = 3;
	
	partRowCount = (partCount/partColCount)+1;	
%>
<html>
<head>
<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 language="javascript">
			function toReportFrame(partID, partName, selectType){
				parent.tstate = true;

				var str = '';				
				str = '/servlet/kr.co.kihyun.beans.user.HttpDeptList?partID='+partID+'&selectType='+selectType;
				parent.leftFrame.location.replace(str);
			}
		</script>
</head>

<body style='' bgcolor="#CECECE" text="#000000" leftmargin="0"
	topmargin="0" marginwidth="0" marginheight="0">
<TABLE width="100%" height="<%= ((partRowCount * 20)+10) %>"
	align="center" border="0">
	<TBODY>
		<%
			for(int i=0; i < partRowCount; i++){%>
		<TR valign="top">
			<td width="10">&nbsp;</td>
			<%
				int index = 0;

				for(int j=0; j < defColSize; j++){
					index = (i * defColSize) + j;											
					if(index < partCount){%>
			<TD valign="top" width="<%= (100/defColSize) %>%"><FONT face=돋움
				color=blue size=2 style="cursor: hand;"
				onclick="toReportFrame('<%= partIDList[index] %>', '<%= partNameList[i] %>', 'sin');"><%= partNameList[index] %>(<%= (new Dept()).getCount(partIDList[index])%>)</FONT></TD>
			<%
					}else{%>
			<TD valign="top" width="<%= (100/defColSize) %>%">&nbsp;</TD>
			<%
					}
				}%>
			<td width="10">&nbsp;</td>
		</TR>
		<%
			}%>
	</TBODY>
</TABLE>
</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{	
}
%>
