
<%
/************************************************************@@
  * Program Name	: doc_list.jsp
  * Description		: /집계자/내문서함/등록함/문서 목록
  * Author				: 강원중
  * Create Date		: 2004.10.11
  * History				:
@@************************************************************/
%>

<%@ page contentType="text/html; charset=UTF-8" import="java.util.Date"
	import="java.text.SimpleDateFormat" import="java.net.URLEncoder"
	import="kr.co.kihyun.moumi.MoumiConfig"
	import="kr.co.kihyun.moumi.doc.MDoc"
	import="kr.co.kihyun.moumi.report.MReport"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.moumi.doc.table.MTable"
	import="kr.co.kihyun.beans.totsys.report.Report"
	import="kr.co.kihyun.lang.MInteger" import="kr.co.kihyun.lang.MLong"
	import="kr.co.kihyun.util.MDate" import="javax.jdo.PersistenceManager"
	import="javax.jdo.Transaction"
	import="kr.co.kihyun.beans.entity.util.*"
	import="kr.co.kihyun.beans.entity.*"%>
<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%
PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
try{
	/********** session내의 userId **********/
	String usID = HttpSSOLogin.getLoginID(request);
	int sysAuth = HttpSSOLogin.getSysAuth(request);

	/******* Parameter *********/
	Long docID = MLong.parseLong(request.getParameter("docID"),null);
	Long deptID = MLong.parseLong(request.getParameter("deptID"),null);
	String deptListView = clearXSS(request.getParameter("deptListView"),"");

	/****** Doc values ******/
	String selectType = "";

	TotDoc totDoc = pm.getObjectById(TotDoc.class, docID);
	String docName = totDoc.getName();
	Date stDate = totDoc.getStartDate();
	Date edDate = totDoc.getEndDate();
	AccessAuth accAuth = totDoc.getAccessAuth();
	String handyName = totDoc.getHandyName();

	/******** 보고서 제출 현황 ********/		
	int allReportCount = 0;
	int sendReportCount = 0;

	Report report = new Report();
	allReportCount = report.getAllCount(docID);
	sendReportCount = report.getSendCount(docID);	
	%>

<tr width="100%">
	<td colspan="4">
	<table border="0" width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td style="width: 14"><img src="/totsys/common/images/ico_1.gif"></td>
			<td class="kecttep_title" style="padding-left: 5" align="left"
				width="100%">기본정보</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td height="3"></td>
		</tr>
	</table>
	</td>
</tr>


<!------------------------------- 문서 정보 시작 ------------------------------->
<tr width="100%">
	<td colspan="4">
	<table border="1px" bordercolor="#e3e3e3" class="kecttep_list_table"
		width="100%" cellpadding="0" cellspacing="0">
		<tr>
			<td width="120" nowrap class="kecttep_tdmenu"><img
				src="/totsys/common/images/reg_icon.gif" align="absmiddle"><%=MoumiConfig.getMessageBundle().getString("moumi.message.doc") %>명</td>
			<td class="kecttep_top_graytd" width="300" nowrap
				style="padding-left: 15; padding-top: 4;" class="kecttep_table"><%= docName %>&nbsp;</td>
			<td width="120" nowrap class="kecttep_tdmenu"><img
				src="/totsys/common/images/reg_icon.gif" align="absmiddle">시작일</td>
			<td class="kecttep_top2_graytd"
				style="padding-left: 15; padding-top: 4;" class="kecttep_table"><%= stDate == null ? "&nbsp;" : new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(stDate) %>&nbsp;</td>
		</tr>

		<tr>
			<td width="120" nowrap class="kecttep_list_tdmenu"><img
				src="/totsys/common/images/reg_icon.gif" align="absmiddle"><%=MoumiConfig.getMessageBundle().getString("moumi.message.doc") %>공개
			여부</td>
			<td class="kecttep_list_graytd" width="300"
				style="padding-left: 15; padding-top: 4;" class="kecttep_table">
			<%if(accAuth==AccessAuth.PER){ %>비공개<%}else{%>공개<%}%>
			</td>
			<td width="120" class="kecttep_list_tdmenu"><img
				src="/totsys/common/images/reg_icon.gif" align="absmiddle">종료일</td>
			<td class="kecttep_list_graytd"
				style="padding-left: 15; padding-top: 4;"><%= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(edDate) %>&nbsp;</td>
		</tr>

		<!--tr>												
					<td width="120" nowrap class="kecttep_tdmenu"><img src="/totsys/common/images/reg_icon.gif" align="absmiddle" >집계 범위</td>
					<td width="300" style="padding-left:15; padding-top:4;" class="kecttep_table">
					<%--if(totRange==TotDoc.TotRange.EXTERNAL){--%>
						기관(학교)집계
					<%--}else{--%>
						내부집계
					<%--}--%>
					</td>
					<td width="120" class="kecttep_tdmenu"><img src="/totsys/common/images/reg_icon.gif" align="absmiddle" >문서번호</td>
					<td style="padding-left:15; padding-top:4;" class="kecttep_table"><%--= handyName --%>&nbsp;</td>
				</tr-->

		<%if(!deptListView.equals("false")){%>
		<tr>
			<td class="kecttep_list_tdmenu" width="120" nowrap><img
				src="/totsys/common/images/reg_icon.gif" align="absmiddle">제출부서</td>
			<td class="kecttep_list_graytd" style="padding-left: 15;" colspan=3
				nowrap>
			<table border=0 cellpadding=0 cellspacing=0>
				<tr valign="middle">
					<td width="110" height="27"><a href="#"><img
						src="/totsys/common/images/dept_select.gif"
						onClick="javascript:alert('집계중인 문서만 제출부서를 변경할수 있습니다.');"
						align="absmiddle"></a></td>
					<td><input name="deptCountText" type="text"
						style="width: 200; border: 0; color: black; padding-top: 3px"
						align="absmiddle" value='<%= allReportCount%>개의 부서가 지정되었습니다'>
					</td>
				</tr>
			</table>
			</td>
		</tr>
		<%}%>
	</table>
	</td>
</tr>
<!------------------------------- 문서 정보 끝 ------------------------------->
<%
}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{
	pm.close();
}
%>
