
<%    /**
     * **********************************************************@@ Program Name
     * : doc_regist.jsp Description	: /집계자/내문서함/등록함/문서 등록 Author	: 강원중 Create
     * Date	: 2004.10.11 History	:
     * @@***********************************************************
     */
%>
<%@ page contentType="text/html; charset=UTF-8"
         import="java.net.URLEncoder" import="java.net.URLDecoder"
         import="kr.co.kihyun.beans.user.HttpSSOLogin" import="java.util.*"
         import="java.io.StringReader"
         import="javax.swing.text.html.parser.ParserDelegator"
         import="kr.co.kihyun.lang.Encoder" import="kr.co.kihyun.util.Stopwatch"
         import="kr.co.kihyun.text.html.TagFilter"
         import="kr.co.kihyun.text.html.ServletUtil"
         import="kr.co.kihyun.text.html.CallbackHandler"
         import="kr.co.kihyun.moumi.Moumi" import="kr.co.kihyun.moumi.doc.MDoc"
         import="kr.co.kihyun.moumi.doc.table.MTable"
         import="kr.co.kihyun.moumi.doc.table.TableDefine"
         import="kr.co.kihyun.moumi.doc.table.TableCreation"
         import="kr.co.kihyun.moumi.doc.table.item.MItem"
         import="kr.co.kihyun.lang.MInteger" import="kr.co.kihyun.lang.MLong"
         import="kr.co.kihyun.lang.MString"
         import="javax.jdo.PersistenceManager" import="javax.jdo.Transaction"
         import="kr.co.kihyun.beans.entity.util.*"%>
<%@page import="kr.co.kihyun.beans.entity.TotDoc"%>
<%@page import="kr.co.kihyun.beans.entity.TotDocType"%>

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

<%    PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
    Transaction tx = pm.currentTransaction();
    try {
        /**
         * ********* 소요시간 체크 **********
         */
        Stopwatch stopwatch = new Stopwatch();
        long startTime = stopwatch.start();

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

        /**
         * ******** parameter *********
         */
        String docForm = clearXSS(request.getParameter("docForm"), "");
        Long docID = MLong.parseLong(request.getParameter("docID"), null);
        String url = "form";

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


<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">
<link rel="stylesheet" href="/totsys/common/css/tabs.css" type="text/css">
<link rel="stylesheet" href="/totsys/common/css/SquareButtons.css" type="text/css">

<script language="javascript">
    function docDel() {
    	//오타수정
        var frm = document.Del;
                if (confirm('<%=TotDocType.FORM_DOC%>을 삭제 하시겠습니까?')) {
                    frm.submit();
                }
            }

    function formView() {
                location.href = "/totsys/totper/mydocbox/formbox/doc_view.jsp?docID=<%= docID%>";
            }

    function reg_use() {
                location.href = "/totsys/totper/mydocbox/regbox/doc_regist.jsp?reuseDocID=<%= docID%>&reuseDocName=<%= docName%>&isFromFormBox=true";
            }

    function propertiesUpdate() {
                location.href = "/totsys/totper/mydocbox/formbox/doc_form_modify.jsp?docID=<%= docID%>";
            }

</script>
</HEAD>

<body style='' BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
<%--
    <div>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <!------------------------------- top menu start ------------------------------->
            <jsp:include page="/totsys/common/inc/title/title.jsp" flush="true" />
            <!------------------------------- top menu end ------------------------------->
    </table>
    </div>

        <div id="header">
            <ul id="primary">
                    <!--<li><a href="#" onclick="formView();"><%=TotDocType.FORM_DOC%>정보</a></li>-->
                    <!--<li><span class="kecttep_menu_focous"><%=TotDocType.FORM_DOC%>수정</span></li>-->
                <!--<li><a href="#" onclick="propertiesUpdate();">속성수정</a></li>-->
            </ul>
        </div>
 --%>
        <div id="main">
            <div id="contents">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">

                    <!------------------------------- form config start ------------------------------->
                    <jsp:include page="./form_re_config2.jsp" flush="true">
                        <jsp:param name="docName" value='<%= URLEncoder.encode(docName, "UTF-8")%>' />
                        <jsp:param name="docForm" value="<%= docForm%>" />
                        <jsp:param name="docID" value="<%= docID%>" />
                        <jsp:param name="pageName" value="doc_reform_config" />
                    </jsp:include>

                    <!------------------------------- form config end ------------------------------->
                </table>
            </div>
        </div>
        <script type="text/javascript">
        	//테두리 사라지는 문제 해결
            $('#formDiv > table').attr({'border':'1','bo':'true'}).css('border','1px solid #000')
	        	.find('td').each(function(i,o){
					if($(o).closest('table').attr('bo')=='true'){
						$(this).css('border','1px solid #000');
					}
	      		});
        </script>
        <!------------------------------- top menu start ------------------------------->
        <%@ include file="/totsys/common/inc/buttom/buttom.jsp"%>
        <!------------------------------- top menu end ------------------------------->
        <FORM name="Del" action="/servlet/kr.co.kihyun.beans.totsys.doc.HttpDocDeleter"	method="post">
            <INPUT type="hidden" name="docID" value="<%= docID%>">
            <INPUT type="hidden" name="userID" value="<%= usID%>">
            <INPUT type="hidden" name="url" value="<%= url%>">
        </FORM>
</BODY>
    <div id="SetWin" style="position: absolute; Visibility : 'hidden'; width : '100'; background: silver; border: 0 #333333 solid; line-height: 1.4em; padding: 3 3"></div>
</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();
    }
%>
