<% /**
     * **********************************************************
     * @@ Program Name : popup_doc_report_list.jsp
     * @@ Description  : 인사이동 후 담당자 일괄변경
     * @@ Author       : KWON,HAN
     * @@ Create Date  : 2014.09.22
     * @@ History      :
     * @@***********************************************************
     */
%>
<%@ page contentType="text/html; charset=UTF-8"
         import="java.net.URLEncoder"
         import="java.net.URLDecoder"
         import="java.util.Date"
         import="java.util.List"
         import="java.util.Map"
         import="java.util.HashMap"
         import="java.text.SimpleDateFormat"
         import="javax.jdo.PersistenceManager"
         import="javax.jdo.Transaction"
         import="kr.co.kihyun.beans.user.HttpSSOLogin"
         import="kr.co.kihyun.lang.Encoder"
         import="kr.co.kihyun.lang.MInteger"
         import="kr.co.kihyun.lang.MString"
         import="kr.co.kihyun.moumi.Moumi"
         import="org.slf4j.Logger"
         import="org.slf4j.LoggerFactory"
         import="kr.co.kihyun.beans.entity.util.*"
         import="kr.co.kihyun.moumi.MoumiConfig"
         import="kr.co.kihyun.service.vo.TotDocReportVO"
         import="kr.co.kihyun.service.TotDocReportService"
         import="kr.co.kihyun.beans.user.MultiCheck"%>

<%@ include file="/totsys/common/inc/sec/secure.inc.jsp"%>
<%    PersistenceManager pm = new MPersistenceManager(PMF.get().getPersistenceManager());
    Transaction tx = pm.currentTransaction();
    try {
        Logger LOG = LoggerFactory.getLogger(this.getClass());

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

        /**
         * **** Parameter *****
         */
        String docType = clearXSS(request.getParameter("docType"), null);
        String exeType = clearXSS(request.getParameter("exeType"), null);
        String findOption = clearXSS(request.getParameter("findOption"), null);
        String findWord = clearXSS(Encoder.toJava(request.getParameter("findWord")), null);
        if("".equals(findOption) || "all".equals(findOption)) {
            findWord = "";
        }
        String procMode = MString.checkNull(request.getParameter("proc_mode"));

        int wordLengthLimit = 18;  //문자열을 클 경우 짜르는 범위
        int count = 0;

        tx.begin();

        //검색조건파라미터 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
        Map params = new HashMap();
        params.put("userId",        usID);
        params.put("deptId",        dpID);
        params.put("findOption",    findOption);
        params.put("filterValue",   findWord);

        TotDocReportService docReport = new TotDocReportService(pm);

        //검색메인쿼리와 레코드갯수조회쿼리를 생성 후 멤버변수로 저장
        docReport.createDocReportListSearchQuery(params, docType, exeType);

        List<TotDocReportVO> list = null;

        //만족하는 레코드가 존재하면 조회
        list = docReport.executeQuery(TotDocReportVO.class);

        count = list.size();

        tx.rollback();

        //처음으로 이 화면이 호출된 경우이고 검색된 데이터가 없다면 인사이동 후 이관여부를 'N'으로 변경한다.
        if (MString.isNull(procMode)) {
            if(count <= 0) {
                tx.begin();

                MultiCheck mc = new MultiCheck();

                int tmpCount = mc.updateModYnOfMuser(usID, "N");
                if(tmpCount != 1) {
    %>
            <script>
                    //인사이동 후 이관여부를 변경하는 도중에 오류가 발생하였습니다.\\n\\n 관리자에게 문의 하십시오.
                    alert("<%= MoumiConfig.getMessageBundle().getString("moumi.message.popup.errorModYnAdmin")%>");
            </script>
    <%
                    tx.rollback();
                } else {
                    tx.commit();
                }
            }
        }

	Date nowDate = new Date();
        String paramTitle = URLEncoder.encode("<span class='trail'>"+MoumiConfig.getMessageBundle().getString("moumi.message.totsys.sysadm.user.user_view_jsp.mod_yn")+"</span>","UTF-8");    //인사이동 자료이관
%>
<HTML>
    <HEAD>
        <TITLE><%=MoumiConfig.getMessageBundle().getString("moumi.message.totsys.sysadm.user.user_view_jsp.mod_yn")%></TITLE>
        <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
        <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/SquareButtons.css" type="text/css">
        <script src="/totsys/common/js/rollover.js"></script>
        <script src="/totsys/common/js/popup.js"></script>
        <script src="/totsys/common/js/find.js"></script>
        <script src="/totsys/common/js/mouse.js"></script>
        <script type="text/javascript" src="/totsys/common/js/jquery-1.12.4.min.js"></script>

        <script Language="javascript">
//            function leftAnc() {
//                for (var i = 1; i <= 6; i++) {
//                    top.frames['left'].document.all["link" + i].style.fontWeight = "";
//                }
//                top.frames['left'].link2.style.fontWeight = "bold";
//            }
//
//            function leftIncReload() {
//                top.left.incFrame.location.reload();
//            }

//            function selectAll() {
//                var obj = document.getElementsByName("check");
//                for (var i = 0; i < obj.length; i++) {
//                    obj[i].checked = true;
//                }
//            }
//
//            function cancelAll() {
//                var obj = document.getElementsByName("check");
//                for (var i = 0; i < obj.length; i++) {
//                    obj[i].checked = false;
//                }
//            }
//
            /*
             * 현재페이지의 검색조건을 갖고 Relead하는 함수
             */
            function fn_reload() {
                document.searchForm.submit();
            }

            /**
             *체크박스 전체선택 해제 스크립트 추가
             **/
            function checkALL(checkYn) {
                var checklist = document.getElementsByName("check");
                if (checklist.length > 0) {
                    for (var i = 0; i < checklist.length; i++) {
                        checklist[i].checked = checkYn;
                    }
                }
            }

            //자료 를 선택함에 따라 상태를 활성화/비활성화 한다.
            function fn_selDocOption(sVal) {
                $('#exeType').val(sVal);
                var idxDoc  = searchForm.docOption.selectedIndex;
                var idxFind = searchForm.findOption.selectedIndex;

                $("[name=docOption]").each(function() {
                    $(this).children().attr("disabled", false);
                });
                $("[name=findOption]").each(function() {
                    $(this).children().attr("disabled", false);
                });
                searchForm.docOption.selectedIndex = 0;
                searchForm.findOption.selectedIndex = 0;

	        switch(sVal){
                    case "A":
                        //@@@ searchForm.docOption.selectedIndex = 0;
                        break;

                    case "D":
                        $("[name=docOption]").children("[value='RETURN']").attr("disabled", true);
                        $("[name=docOption]").children("[value='TEMP']").attr("disabled", true);
                        $("[name=docOption]").children("[value='COMP']").attr("disabled", true);
                        //@@@ if(idxDoc == 0 || idxDoc >= 4) {
                        //@@@     searchForm.docOption.selectedIndex = 1;
                        //@@@ }
                        $("[name=findOption]").children("[value='totDoc.mUser.name2']").attr("disabled", true);
                        //@@@ if(idxFind == 0 || idxFind >= 3) {
                        //@@@     searchForm.findOption.selectedIndex = 1;
                        //@@@ }
                        break;

                    case "R":
                        $("[name=docOption]").children("[value='PRSS']").attr("disabled", true);
                        $("[name=docOption]").children("[value='REG']").attr("disabled", true);
                        $("[name=docOption]").children("[value='END']").attr("disabled", true);
                        //@@@ if(idxDoc >= 0 && idxDoc <= 3) {
                        //@@@     searchForm.docOption.selectedIndex = 4;
                        //@@@ }
                        //@@@ //if(idxFind >= 0 || idxFind >= 2) {
                        //@@@ //    searchForm.findOption.selectedIndex = 3;
                        //@@@ //}
                        break;

                    default:
                        alert("Select Error !!!")
                        //@@@ searchForm.docOption.selectedIndex = 0;
		}

                var docType = searchForm.docOption[searchForm.docOption.selectedIndex].value;
                $('#docType').val(docType);
            }


            function changeDam() {
                var nnn = $("input:checkbox[name=check]:checked").length;
                if (nnn == 0) {
                    alert('<%=Moumi.getMessageBundle().getString("moumi.message.popup.tot_docTransferBtn")%>');  //먼저 자료를 선택을 하신 후, 담당변경 버튼을 클릭하세요.
                    return;
                }

                var val = '';
                var docReportType = '';
                var rptDocID = new Array();
                var rptReportID = new Array();
                $("input:checkbox[name=check]:checked").each(function() {
                    val = $(this).val();
                    docReportType = document.getElementById("rt" + val).value;

                    if(docReportType == "D") {
                        rptDocID.push($(this).val());
                    } else if(docReportType == "R") {
                        rptReportID.push($(this).val());
                    }
                });
                var height = screen.height;
                var width = screen.width;
                var leftpos = width / 2 - 350;
                var toppos = height / 2 - 350;
                var frm = document.damdangForm;
                frm.docID.value="";
                frm.rptDocID.value=rptDocID;
                frm.reportID.value="";
                frm.rptReportID.value=rptReportID;
                frm.action = "/totsys/repoper/mydocbox/returnbox/popup_rep_transfer9.jsp";
                frm.target = 'damdangForm';
                frm.method = 'post';
                var win = window.open('', "damdangForm", "width=572, height=725, toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=" + leftpos + ",top=" + toppos);
                win.focus();
                frm.submit();
            }

        </script>
    </HEAD>
    <body style='' BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">
        <form name="damdangForm" method="post" >
            <input type="hidden" name="docReportType" value="A">
            <input type="hidden" name="exeFlag"       value="list">
            <input type="hidden" name="docID"         value="">
            <input type="hidden" name="rptDocID"      value="">
            <input type="hidden" name="reportID"      value="">
            <input type="hidden" name="rptReportID"   value="">
            <input type="hidden" name="boxName"       value="returnbox">
            <input type="hidden" name="hideUser"      value="false">
            <input type="hidden" name="callbackFunc"  value="fn_reload()">
        </form>
        <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>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <jsp:include page="/totsys/common/inc/title/title.jsp" flush="true">
                            <jsp:param name="title" value="<%= paramTitle %>" />
                            <jsp:param name="desc"  value="" />
                            <jsp:param name="flag"  value="99" />
                        </jsp:include>

                        <!-- // Begin : 검색 & 버튼영역 -->
                        <tr class="toolbar">
                            <td valign="top">
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <!----// 검색 시작 ---->
                                        <td valign="top">
                                            <form name="searchForm" method="post" action="./popup_doc_report_transfer.jsp" onsubmit="if(searchForm.findOption.selectedIndex != 0) { return findCheck(this); }" style="margin: 0px">
                                                <span style="width: 850px;">
                                                    &nbsp;&nbsp;<%=Moumi.getMessageBundle().getString("moumi.message.doc")%>&nbsp;
                                                    <select name="exeOption" class="inputtxt" onchange="fn_selDocOption(this.options[this.selectedIndex].value); showMSG(this.options[this.selectedIndex].value, msg)">
                                                        <option value="A"<%= "A".equals(exeType) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.all")%>&nbsp;</option>
                                                        <option value="D"<%= "D".equals(exeType) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.tot_doc")%>&nbsp;</option>
                                                        <option value="R"<%= "R".equals(exeType) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.menu.submit")%>&nbsp;</option>
                                                    </select>
                                                    &nbsp;&nbsp;<%=Moumi.getMessageBundle().getString("moumi.message.tot_report.status")%>&nbsp;
                                                    <select name="docOption" class="inputtxt" onchange="$('#docType').val(searchForm.docOption.value); showMSG(this.options[this.selectedIndex].value, msg)">
                                                        <option value="ALL"<%= "A".equals(docType) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.all")%>&nbsp;</option>
                                                        <option value="PRSS"<%= "PRSS".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "D".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.menu.prss")%>&nbsp;</option>
                                                        <option value="REG"<%= "REG".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "D".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.reg")%>&nbsp;</option>
                                                        <option value="END"<%= "END".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "D".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.menu.end")%>&nbsp;</option>
                                                        <option value="RETURN"<%= "RETURN".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "R".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.totsys.repoper.mydocbox.returnbox.report_list_jsp")%>&nbsp;</option>
                                                        <option value="TEMP"<%= "TEMP".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "R".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.process.temp")%>&nbsp;</option>
                                                        <option value="COMP"<%= "COMP".equals(docType) ? " selected" : ""%> <%= "A".equals(exeType) || "R".equals(exeType) ? "" : "disabled"%>><%=Moumi.getMessageBundle().getString("moumi.message.menu.mySubmit")%>&nbsp;</option>
                                                    </select>
                                                    &nbsp;&nbsp;<%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.search")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.section")%>&nbsp;
                                                    <select name="findOption" class="inputtxt" onchange="if(searchForm.findOption.selectedIndex == 0) { $('#findWord').val(''); } showMSG(this.options[this.selectedIndex].value, msg)">
                                                        <option value="all"<%= "all".equals(findOption) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.all")%></option>
                                                        <option value="name"<%= "name".equals(findOption) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.doc")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.name")%></option>  <!--//자료명//-->
                                                        <option value="executionCode"<%= "executionCode".equals(findOption) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.executionCode")%></option>       <!--//시행번호//-->
                                                        <option value="totDoc.mUser.name"<%= "totDoc.mUser.name".equals(findOption) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.requester")%></option>   <!--//요청자//-->
                                                        <option value="totDoc.mUser.name2"<%= "totDoc.mUser.name2".equals(findOption) ? " selected" : ""%>><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.sender")%></option> <!--//제출자//-->
                                                    </select>
                                                    <input id="exeType" name="exeType" value="<%=MString.checkNull(exeType)%>" type="hidden" />
                                                    <input id="docType" name="docType" value="<%=MString.checkNull(docType)%>" type="hidden" />
                                                    <input id="findWord" name="findWord" value="<%=MString.checkNull(findWord)%>" type="text" class="inputtxt" size="30" maxlength="30" />
                                                    <INPUT type="hidden" name="proc_mode"     value="change_owner">
                                                    <input type="image"  src="/totsys/common/images/bt_search_inquiry2.gif" border="0" align="middle" style="margin: 0px 0px 0px 0px" />
                                                </span>
                                            </form>
                                        </td>
                                        <!---- 검색 끝 //---->
                                        <font color="red"> [참고] 자료이관을 완료한 후에도 계속해서 팝업이 보이시면 관리자에게 조직도관리메뉴에서 "자료이관 대상자아님"으로 변경해 달라고 요청하시면 됩니다.</font><br><br>
                                        <td class="kecttep_button_td" align="right" valign="top" width="*">
                                            <!-- 담당변경 -->
                                            <a href="javascript:changeDam();" ><img src="/totsys/common/images/bt_damdang.gif" alt="<%=Moumi.getMessageBundle().getString("moumi.message.button.trans")%>" /></a>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <!-- // End : 검색 & 버튼영역 -->

                        <tr>
                            <td height="31" valign="top">
                                <div id="div_scroll" style="width:1300; height:490; overflow:auto;">
                                    <table border="1px" class="kecttep_list_table" width="100%" padding="0" cellspacing="0" table-layout="fixed">

                                        <!--  리스트 헤더 : 시작 -->
                                        <tr valign="middle" style="padding-top: 3">
                                            <td width="15"  align="center" class="kecttep_tdmenu" nowrap>No.</td>
                                            <td width="30"  align="center" class="kecttep_tdmenu" nowrap>
                                                <input type="checkbox" name="check0" onclick="javascript:checkALL(this.checked)"/>
                                            </td>
                                            <td width="35"  align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.doc")%></td>
                                            <td width="60"  align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.status")%></td>
                                            <td width="65"  align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.section")%></td>
                                            <td width="135" align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.executionCode")%></td>
                                            <td width="*"   align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.doc")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.name")%></td>
                                            <td width="110" align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.totsys.sysadm.part.part_list_jsp")%></td>
                                            <td width="80"  align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.request")%><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.person")%></td>
                                            <td width="125" align="center" class="kecttep_tdmenu" nowrap><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.compSnd")%>/<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.all")%>(<%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.noteRecall")%>)
                                                                                                    </br><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.submit")%><%=Moumi.getMessageBundle().getString("moumi.message.totsys.sysadm.part.part_list_jsp")%>
                                            </td>
                                            <td width="80"  align="center" class="kecttep_tdmenu" rowspan="1"><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_report.submit")%><%=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.person")%></td>
                                            <td width="75"  align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.startDate")%></td>
                                            <td width="130" align="center" class="kecttep_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endMethod")%></td>
                                            <td width="97"  align="center" class="kecttep_last_tdmenu" nowrap><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.remark")%></td>
                                        </tr>
                                        <!--  리스트 헤더 : 끝 -->

                                        <!--  리스트 내용 : 시작 -->
                                        <%
                                            int index = 0;     //배열에서 값을 꺼내오는 키값

                                            for (int i = 0; i < count; i++) {
                                                index = i + 1;
                                                TotDocReportVO docReportVO = (TotDocReportVO) list.get(i);

                                                String docName = docReportVO.getName();
                                                String userId  = MString.checkNull(docReportVO.getUserId());
                                        %>
                                        <tr style="padding-top: 3" valign="middle">
                                            <td width="15" align="right" class="kecttep_graytd" nowrap><%=index%></td>
                                            <td width="30" align="center" class="kecttep_graytd" nowrap>
                                                <input type="checkbox" name="check" id="checkBox" value=<%= docReportVO.getId() %> <% if (docReportVO.getUserId() == null || !docReportVO.getUserId().equals(usID)) {%>disabled<%} %> />
                                                <input type="hidden" id="rt<%=docReportVO.getId()%>" name="docReportType<%=index%>" value="<%= docReportVO.getDocReportType() %>">
                                            </td>
                                            <!-- 자료 -->
                                            <td width="35" align="center" class="kecttep_graytd" nowrap>
                                                <%
                                                if ("D".equals(docReportVO.getDocReportType())) {%>  <!-- 집계 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.tot_doc")%></span>
                                                <%} else if ("R".equals(docReportVO.getDocReportType())) {%>  <!-- 제출 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.menu.submit")%></span>
                                                <%} else {%>
                                                <span><%=docReportVO.getDocReportType()%></span>
                                                <%}%>
                                            </td>
                                            <!-- 상태 -->
                                            <td width="60" align="center" class="kecttep_graytd" nowrap>
                                                <%
                                                if ("1.1.PRSS".equals(docReportVO.getDocReportSatus())) {%>  <!-- 집계진행 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.menu.prss")%></span>
                                                <%} else if ("1.2.REG".equals(docReportVO.getDocReportSatus())) {%>  <!-- 미진행 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.reg")%></span>
                                                <%} else if ("1.3.END".equals(docReportVO.getDocReportSatus())) {%>  <!-- 종료 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.menu.end")%></span>
                                                <%} else if ("2.1.RETURN".equals(docReportVO.getDocReportSatus())) {%>   <!-- 접수자료 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.totsys.repoper.mydocbox.returnbox.report_list_jsp")%></span>
                                                <%} else if ("2.2.TEMP".equals(docReportVO.getDocReportSatus())) {%>   <!-- 제출진행 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.tot_report.process.temp")%></span>
                                                <%} else if ("2.3.COMP".equals(docReportVO.getDocReportSatus())) {%>  <!-- 내제출 -->
                                                <span><%=Moumi.getMessageBundle().getString("moumi.message.menu.mySubmit")%></span>
                                                 <%} else {%>
                                                <span><%= docReportVO.getDocReportSatus() %></span>
                                                <%}%>
                                            </td>
                                            <!-- 구분 -->
                                            <td width="65" align="center" class="kecttep_graytd" nowrap>
                                                <%
                                                if (docReportVO.isPeriodicalDoc() && docReportVO.isDocCollection()) {%>
                                                <span class="kecttep_doc_append_type kecttep_doc_append_type_periodical_collection"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.periodical") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.collection")%></span>  <!-- 정기/취합 -->
                                                <%} else if (docReportVO.isPeriodicalDoc() && !docReportVO.isDocCollection()) { %>
                                                <span class="kecttep_doc_append_type kecttep_doc_append_type_periodical_file"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.periodical") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%></span>  <!-- 정기/파일 -->
                                                <%} else if (!docReportVO.isPeriodicalDoc() && docReportVO.isDocCollection()) { %>
                                                <span class="kecttep_doc_append_type kecttep_doc_append_type_random_collection"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.random") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.collection")%></span>   <!-- 수시/취합 -->
                                                <%} else if (!docReportVO.isPeriodicalDoc() && !docReportVO.isDocCollection()) { %>
                                                <span class="kecttep_doc_append_type kecttep_doc_append_type_random_file"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.create.random") + "/" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.file")%></span>   <!-- 수시/파일 -->
                                                <%}%>
                                            </td>
                                            <!-- 시행번호 -->
                                            <td width="135" align="center" class="kecttep_graytd" nowrap><%= docReportVO.getExecCode() %>&nbsp;</td>
                                            <td class="kecttep_graytd" nowrap><a onmouseover="balloon_on('<%= docName %>',this,10,4)"  onmouseout="balloon_off()" href="#" <%if(!usID.equals(userId)){%>style="color: red;"<%}%> ><%= MString.getEllipsis(docReportVO.getName(), wordLengthLimit) %></a></td>
                                            <td width="110" align="center" class="kecttep_graytd" nowrap><%= MString.checkNull(docReportVO.getDeptName()) %>&nbsp;</td>
                                            <td width="80"  align="center" class="kecttep_graytd" nowrap><%= docReportVO.getOwnerName() %></td>        <!-- 요청자 -->
                                            <td width="110" align="center" class="kecttep_graytd" nowrap><%= docReportVO.getReportDeptName() %></td>
                                            <td width="80"  align="center" class="kecttep_graytd" nowrap><%= docReportVO.getReportUserName() %></td>   <!-- 제출자 -->
                                            <td width="75"  align="center" class="kecttep_graytd" nowrap><%= new SimpleDateFormat("yyyy-MM-dd").format(docReportVO.getStartDate()) %></td>
                                            <!-- 집계종료방법 -->
                                            <%
                                                String sDocReportType = docReportVO.getDocReportType();
                                                String tmpMoumiAcptLimitStrategy = Integer.toString(docReportVO.getSubmitLimitCnt());
                                                String tmp2 = null;
                                                String tstr = "시 종료";
                                                if("R".equals(sDocReportType)) { tstr = "시"; }
                                                String tcnt;

                                                tcnt = "(" + Integer.toString(docReportVO.getSubmitLimitCnt()) + "개 기관)";
                                                if (tmpMoumiAcptLimitStrategy.equals("0")) {
                                                    tmp2 = new SimpleDateFormat("yyyy-MM-dd HH").format(docReportVO.getEndDate());
                                                    tcnt = "";
                                                } else {
                                                    tmp2 = Moumi.getMessageBundle().getString("moumi.message.tot_doc.endBySubmitTotal");
                                                    tstr = "";
                                                }
                                                if("D".equals(sDocReportType)) {
                                                    if (tmp2.contains("9999-12-30")) { tmp2 = Moumi.getMessageBundle().getString("moumi.message.tot_doc.docGethering"); }
                                                    if (tmp2.equals(Moumi.getMessageBundle().getString("moumi.message.tot_doc.docGethering"))) { tstr = ""; }
                                                } else if("R".equals(sDocReportType)) {
                                                    if("2.1.RETURN".equals(docReportVO.getDocReportSatus())) {
                                                        if(tmp2.contains("9999-12-30")) tmp2=Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually");
                                                        if(tmp2.equals(Moumi.getMessageBundle().getString("moumi.message.tot_doc.endManually"))) tstr = "";
                                                    } else if("2.2.TEMP".equals(docReportVO.getDocReportSatus())) {
                                                        if(tmp2.contains("9999-12-30")) tmp2=Moumi.getMessageBundle().getString("moumi.message.tot_doc.docGethering");
                                                        if(tmp2.equals(Moumi.getMessageBundle().getString("moumi.message.tot_doc.docGethering"))) tstr = "";
                                                    } else if("2.3.COMP".equals(docReportVO.getDocReportSatus())) {
                                                        if(tmp2.contains("9999-12-30")) tmp2=MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endManually");
                                                        if(tmp2.equals(MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.endManually"))) tstr = "";
                                                    }
                                                }
                                            %>
                                            <td width="130" align="center" class="kecttep_graytd" nowrap  <%if(!usID.equals(docReportVO.getUserId())) {%> style="color: red;" <%}%>>
                                            <%
                                                out.write(tmp2 + tstr + tcnt);
                                            %>
                                            </td>
                                            <!-- 비고 -->
                                            <td width="97" align="center" class="kecttep_graytd" nowrap>
                                                <span style="padding-left:inherit">
                                                    <%
                                                        if("D".equals(sDocReportType)) {
                                                            if (docReportVO.getRepId() != null && docReportVO.getRepId() != 0) {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.tot_doc.subDoc")); //연계등록자료
                                                                                                                        }
                                                        } else if("R".equals(sDocReportType)) {
                                                            // /tempbox/report_list.jsp 참조
                                                            if("2.1.RETURN".equals(docReportVO.getDocReportSatus())) {
                                                                if(docReportVO.getDownDocId() == 0) {
                                                                    if(docReportVO.getReportPrss() == 3) {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.tot_report.returnStatus")); //재입력요청
                                                                    }
                                                                } else {
                                                                    if(docReportVO.getReportPrss() == 3) {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.tot_report.returnStatus")); //재입력요청
                                                                    }
                                                                }

                                                            // /endbox/report_list.jsp 참조
                                                            } else if("2.2.TEMP".equals(docReportVO.getDocReportSatus())) {
                                                                if(docReportVO.getReportPrss() == 4) {
                                                                    if((docReportVO.getEndDate().getTime() < nowDate.getTime()) && (docReportVO.getReportPrss() == 2 || docReportVO.getReportPrss() != 2)) {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.menu.end")); //종료
                                                                    } else {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.menu.prss")); //집계진행
                                                                    }
                                                                } else {
                                                                        out.print(Moumi.getMessageBundle().getString("moumi.message.tot_report.recogWaitDuring")); //결재대기중
                                                                }
                                                                if(docReportVO.getDownDocId() != 0) {
                                                                        out.print("</br> [" + Moumi.getMessageBundle().getString("moumi.message.tot_doc.subDoc") + "]"); //연계등록자료
                                                                }

                                                            // /endbox/report_list.jsp 참조
                                                            } else if("2.3.COMP".equals(docReportVO.getDocReportSatus())) {
                                                                if(docReportVO.getAppro() == 1) {
                                                                        out.println(MoumiConfig.getMessageBundle().getString("moumi.message.tot_doc.approOpenData"));  //공람자료
                                                                } else if(docReportVO.getReportPrss() == 12) {
                                                                        out.println(MoumiConfig.getMessageBundle().getString("moumi.message.button.not"));    //해당없음
                                                                }
                                                            }
                                                        }
                                                    %>&nbsp;
                                                </span>
                                            </td>
                                        </tr>
                                        <%
                                            } //for
                                        %>
                                        <!--  리스트 내용 : 끝 -->
                                    </table>
                                </div>
                            </td>
                        </tr>

                        <%if (count > 0) {%>
                        <tr style="padding-top: 3" valign="middle">
                            <td height="25" colspan="8" align="center" class="kecttep_board">
                                <!------------------------------- 페이지수 나오는 부분 시작 ------------------------------->
                                <!------------------------------- 페이지수 나오는 부분 끝 --------------------------------->
                            </td>
                        </tr>
                        <%} else {%>
                        <tr>
                            <td class="kecttep_none_tdmenu" colspan="14" height="25" align="center"><%=Moumi.getMessageBundle().getString("moumi.message.tot_doc.notDoc")%></td>
                        </tr>
                        <%}%>

                        <input type="hidden" name="tmpExe"    value="<%=MString.checkNull(exeType)%>">
                        <input type="hidden" name="tmpDoc"    value="<%=MString.checkNull(docType)%>">
                        <input type="hidden" name="tmpFind"   value="<%=MString.checkNull(findOption)%>">
                        <script>
                            if (tmpExe.value == "A" ||) {
                                searchForm.exeOption.selectedIndex = 0;
                            } else if (tmpExe.value == "D") {
                                searchForm.exeOption.selectedIndex = 1;
                            } else if (tmpExe.value == "R") {
                                searchForm.exeOption.selectedIndex = 2;
                            }
                            if (tmpDoc.value == "ALL" ||) {
                                searchForm.docOption.selectedIndex = 0;
                            } else if (tmpDoc.value == "PRSS") {
                                searchForm.docOption.selectedIndex = 1;
                            } else if (tmpDoc.value == "REG") {
                                searchForm.docOption.selectedIndex = 2;
                            } else if (tmpDoc.value == "END") {
                                searchForm.docOption.selectedIndex = 3;
                            } else if (tmpDoc.value == "RETURN") {
                                searchForm.docOption.selectedIndex = 4;
                            } else if (tmpDoc.value == "TEMP") {
                                searchForm.docOption.selectedIndex = 5;
                            } else if (tmpDoc.value == "COMP") {
                                searchForm.docOption.selectedIndex = 6;
                            }

                            if (tmpFind.value == "" || tmpFind.value == "all") {
                                searchForm.findOption.selectedIndex = 0;
                            } else if (tmpFind.value == "name") {
                                searchForm.findOption.selectedIndex = 1;
                            } else if (tmpFind.value == "executionCode") {
                                searchForm.findOption.selectedIndex = 2;
                            } else if (tmpFind.value == "totDoc.mUser.name") {
                                searchForm.findOption.selectedIndex = 3;
                            } else if (tmpFind.value == "totDoc.mUser.name2") {
                                searchForm.findOption.selectedIndex = 4;
                            }
                        </script>
                    </table>
                </td>
                <td nowrap width="10"></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();
    }
%>

