
<%
/************************************************************@@
  * Program Name	: doc_form_view.jsp
  * Description		: /집계자/내문서함/진행함/양식 보기
  * Author				: 강원중
  * Create Date		: 2004.10.15
  * History				:
@@************************************************************/
%>

<%@ page contentType="text/html; charset=UTF-8"
	import="java.net.URLEncoder"
	import="kr.co.kihyun.beans.user.HttpSSOLogin"
	import="kr.co.kihyun.lang.MLong" import="kr.co.kihyun.moumi.Moumi"
	import="kr.co.kihyun.moumi.doc.MDoc" import="kr.co.kihyun.lang.MString"
	import="kr.co.kihyun.beans.totsys.doc.Doc"
	import="kr.co.kihyun.beans.totsys.report.Report"
	import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction"
	import="kr.co.kihyun.beans.entity.util.*"%>

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

<%
PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
Transaction tx = pm.currentTransaction();
try{
	/********** session내의 userId **********/
	String usID = HttpSSOLogin.getLoginID(request);

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

	/*********** session setup ************/
	session.setAttribute("formConTagetURL", "/totsys/totper/mydocbox/prssbox/doc_form_view.jsp");

	TotDoc totDoc = null;
	totDoc = docID == null ? null : pm.getObjectById(TotDoc.class, docID);
	String docName = totDoc.getName();

	tx.begin();

	String regID = totDoc.getMasterTotDoc().getUser(pm).getId();

	tx.rollback();

	/****** all, send report ******/
	int allReportCount = 0;
	int sendReportCount = 0;
	Report report = new Report();
	allReportCount = report.getAllCount(docID);
	sendReportCount = report.getSendCount(docID);
	Doc doc = new Doc();
	String repDocID = doc.getRepID(docID);
	%>

<%@page import="kr.co.kihyun.beans.entity.TotDoc"%><HTML>
<HEAD>
<TITLE><%=Moumi.getTitle()%></TITLE>
<link rel="stylesheet" href="/totsys/common/css/text.css"
	type="text/css">
<link rel="stylesheet" href="/totsys/common/css/kecttep.css"
	type="text/css">
<script src="/totsys/common/js/rollover.js"></script>
<script language="javascript">
			function formContentModify(){
				if("<%=regID%>" == "<%=usID%>"){
					if(confirm("현재 집계문서에 대한\n제출건수 : <%=sendReportCount%>건\n미제출건수 : <%=(allReportCount-sendReportCount)%>건\n이 있습니다.\n계속 진행하시면 모든 제출완료 문서가 접수 상태로 변경됩니다\n계속 진행하시겠습니까?")){
						location.href="./form_content_modify.jsp?docID=<%=docID%>";
					}else{
						return;
					}
				}else{
					alert("자신이 등록한 문서만 양식수정 가능합니다.");
				}
			}
	
			function docFormModify(){
				if("<%=regID%>" == "<%=usID%>"){
					location.href="./doc_form_modify.jsp?docID=<%= docID %>";
				}else{
					alert("자신이 등록한 문서만 속성수정 가능합니다.");
				}
			}
		</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">
	<jsp:include page="/totsys/common/inc/totper/top/top.jsp" flush="true" />
	<tr>
		<td nowrap width="0"></td>
		<td valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<jsp:include page="/totsys/common/inc/title/title.jsp" flush="true" />
			<tr>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td><a href="./doc_list.jsp"><img
							src="/totsys/common/images/bt_doc_list.gif" border="0"></a></td>
						<td width="3"></td>
						<!-- 정보수정 -->
						<td><a href="./doc_view.jsp?docID=<%= docID %>"><img
							src="/totsys/common/images/info_modify.gif" border="0"></a></td>
						<!--기본정보<td><a href="./doc_view.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_doc_view.gif" border="0"></a></td>-->
						<td width="3"></td>
						<td><a href="./doc_form_view.jsp?docID=<%= docID %>"><img
							src="/totsys/common/images/bt_form_view2.gif" border="0"></a></td>
						<td width="3"></td>
						<td><a href="./reports/report_list.jsp?docID=<%= docID %>"><img
							src="/totsys/common/images/bt_report_list.gif" border="0"></a></td>
						<td width="3"></td>
						<td><a
							href="./tot_reports/total_reports.jsp?docID=<%= docID %>"><img
							src="/totsys/common/images/bt_total_reports.gif" border="0"></a></td>
						<td width="3"></td>
						<td><a
							href="./tot_report/total_report.jsp?docID=<%= docID %>"><img
							src="/totsys/common/images/bt_total_report.gif" border="0"></a></td>
					</tr>
				</table>
				</td>
			</tr>
			<!----  topbar  버튼 끝---->

			<tr>
				<td height="1"></td>
			</tr>
			<tr>
				<td bgcolor="6891cb" height="2" colspan="4"></td>
			</tr>
			<tr>
				<td height="1"></td>
			</tr>

			<!----  subtopbar  버튼 시작---->
			<tr>
				<td>
				<table border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td width="3"></td>
						<!-- 속성수정 속성확인 버튼으로 수정 -->
						<td><!--img src="/totsys/common/images/bt_form_confirm.gif" border="0" onclick="docFormModify()" style="cursor:hand"--></td>
					</tr>
				</table>
				</td>
			</tr>
			<!----  topbar  버튼 끝---->
			<!--------------------------버튼 좌측정렬 끝 ---------------------->



			<!----  topbar  버튼 시작----
							<tr>
							<td>
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td><a href="./doc_list.jsp"><img src="/totsys/common/images/bt_doc_list.gif" border="0"></a></td>
										<td width="15%">&nbsp;</td>
										<td>
											<table border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td><a href="./doc_view.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_doc_view.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./doc_form_view.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_form_view2.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./reports/report_list.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_report_list.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./tot_reports/total_reports.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_total_reports.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./tot_report/total_report.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_total_report.gif" border="0"></a></td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							</tr>
							<!----  topbar  버튼 끝----


<tr>
	<td height="1"></td>
</tr>
<tr>
	<td bgcolor="6891cb" height="2" colspan="4"></td>
</tr>
<tr>
	<td height="1"></td>
</tr>



							<!----  subtopbar  버튼 시작----
							<tr>
							<td>
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<!--td width="537">&nbsp;</td--
										<td align="left">
											<table border="0" cellspacing="0" cellpadding="0">
												<tr>
													<!--td><img src="/totsys/common/images/bt_doctxt_modify.gif" border="0" onclick="formContentModify()" style="cursor:hand"></td--
													<td width="3"></td>

													<td><img src="/totsys/common/images/bt_form_modify.gif" border="0" onclick="docFormModify()" style="cursor:hand"></td>


											</table>
										</td>
									</tr>
								</table>
							</td>
							</tr>
							<!----  topbar  버튼 끝----
문서목록 좌측정렬 나머지 버튼 우측정렬 끝--------------------------------------------->


			<!------------------------------- form view start ------------------------------->
			<jsp:include
				page="/totsys/common/inc/documents/tot_doc/form_view.jsp"
				flush="true">
				<jsp:param name="docID" value="<%= docID %>" />
			</jsp:include>
			<!------------------------------- form view end ------------------------------->
			<tr>
				<td height="10"></td>
			</tr>

			<!-- 파란색 라인 시작 -->
			<tr>
				<td height="1"></td>
			</tr>
			<tr>
				<td bgcolor="6891cb" height="2" colspan="4"></td>
			</tr>
			<tr>
				<td height="1"></td>
			</tr>
			<!-- 파란색 라인 끝 -->

			<!----------------- 버튼 삭제 시작
						<!----  subtopbar  버튼 시작----
						<tr>
							<td>
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<!--td width="537">&nbsp;</td--
										<td align="left">
											<table border="0" cellspacing="0" cellpadding="0">
												<tr>
													<!--td><img src="/totsys/common/images/bt_doctxt_modify.gif" border="0" onclick="formContentModify()" style="cursor:hand"></td--
													<td width="3"></td>

													<td><img src="/totsys/common/images/bt_form_modify.gif" border="0" onclick="docFormModify()" style="cursor:hand"></td>


											</table>
										</td>
									</tr>
								</table>
							</td>
							<!----  topbar  버튼 끝----
						</tr>

<tr>
	<td height="1"></td>
</tr>
<tr>
	<td bgcolor="6891cb" height="2" colspan="4"></td>
</tr>
<tr>
	<td height="1"></td>
</tr>
						<tr>
							<!----  bottom bar  버튼 시작 ----
							<td valign="top">
								<table width="100%" border="0" cellpadding="0" cellspacing="0">
									<tr>
										<td valign="top"><a href="./doc_list.jsp"><img src="/totsys/common/images/bt_doc_list.gif" border="0"></a></td>
										<td width="15%">&nbsp;</td>
										<td>
											<table border="0" cellspacing="0" cellpadding="0">
												<tr>
													<td><a href="./doc_view.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_doc_view.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./doc_form_view.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_form_view2.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./reports/report_list.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_report_list.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./tot_reports/total_reports.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_total_reports.gif" border="0"></a></td>
													<td width="3"></td>
													<td><a href="./tot_report/total_report.jsp?docID=<%= docID %>"><img src="/totsys/common/images/bt_total_report.gif" border="0"></a></td>
												</tr>
											</table>
										</td>
									</tr>
								</table>
							</td>
							<!----  bottom bar  버튼 끝 ----
버튼 삭제 끝 ------------------------------->

			</tr>
		</table>
		</td>
		<td nowrap width="10"></td>
	</tr>

	<tr>
		<td height="31"></td>
	</tr>


	<!------------------------------- top menu start ----------------------------->
	<%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
	<!------------------------------- top menu end ------------------------------->
</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{
	if(tx.isActive())
		tx.rollback();
	pm.close();
}
%>
