/* 
    ETRI IntraPMS Project
    문서 검색조건을 입력받는 Servlet

    
*/
import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

import com.etri.groupware.eda.*;

public class EDASearchInputServlet extends HttpServlet{

/*----------------------------------------------------------------- */
/**
 [메소드이름]: doGet<br>
 [기능]: 문서를검색하기 위한 창을 띄워준다.<br>
 [파라미터]: HttpServletRequest req,HttpServletResponse res<br>
 [호출자] : EDADocumenBoxServlet<br>
 */
/*--------------------------------------------------------------- */	
		
	public void doGet(HttpServletRequest req,HttpServletResponse res) 
	 throws ServletException,IOException{
	 
	 	HttpSession session = req.getSession(true);
	 	
		res.setContentType("text/html;charset=edu-kr");
		PrintWriter out = new PrintWriter( new OutputStreamWriter(
		 res.getOutputStream(),"EUC-KR"));
	
		boolean authentication = false;
		String id = null;
		String name = null;	
		
		if((session.isNew())){
			session.invalidate();
			res.sendRedirect("../Login.html");
		}
		else if( session.getValue("Authentication").equals("true")){
			authentication = true;
			id = (String) session.getValue("Id");
			name = (String) session.getValue("Name");
		}
		else{
			session.invalidate();
			res.sendRedirect("../Login.html");
		}
		
		
		String listID = req.getParameter("listID");
		int oldCount = Integer.parseInt(req.getParameter("count"));
		if(authentication){
			out.println("<html>");
			out.println("<head>");
			out.println("<title>문서 검색</title>");
			out.println("</head>");
	
			out.println("<body bgcolor=\"white\" text=\"black\" "+
			 "link=\"blue\" vlink=\"purple\" alink=\"red\">");
			out.println("<p align=right><img src=\'../image/우측_기안결재.gif\'></p>");

			out.println("<script language=\"JavaScript\">");
			out.println("<!--");
			out.println("var myWin ;");
			out.println("	function EDALineSelection() {");
			out.println("		myWin = window.open ( \"/EDASearchSelection.html\" , \"결재선선택\" , \"width=450,height=350,scrollbars=1,copyHistory=1\" ) ;");	
			out.println("	}");
			out.println("	function result( d ) {");
			out.println("		var allOfficial = arguments[0] ;");
			out.println("		document.form1.docPerson.value = allOfficial ;");
			out.println("		myWin.close();");
			out.println("	}");
	
			out.println("	function Check_Form(form)");
			out.println("	{");
			out.println("		var peopleSel = false ; ");
			out.println("		if(form.listID.value != form.submitBox.value ) ");
			out.println("		{");
			out.println("			if( form.personSel.checked == true ){");
			out.println("				peopleSel = true;");
			out.println("			}");
			out.println("		}");
			out.println("		if( form.itemSel.checked || form.initDay.checked || form.titleSel.checked || form.commSel.checked || peopleSel )");
			out.println("		{");
			out.println("			if( form.docItem.checked == true )");
			out.println("			{");
			out.println("				var numItem = form.docItem.selectedIndex; ");
			out.println("				var valueItem = form.docItem.options[numItem].value;");
			out.println("				if( form.docItem.options[numItem].value == \" \" )");
			out.println("				{");
			out.println("					alert(\"검색을 원하는 문서의 문서 종류를 선택하세요\");");
			out.println("					return;");
			out.println("				}");
			out.println("			}");
			out.println("			if( (form.titleSel.checked == true) && (form.docTitle.value.length == 0 ) )");
			out.println("			{");
			out.println("				alert(\"검색을 원하는 문서의 제목을 입력하세요\");");
			out.println("				return;");
			out.println("			}");
			out.println("			if( (form.commSel.checked == true ) && (form.docComment.value.length == 0 ) )");
			out.println("			{");
			out.println("				alert(\"검색을 원하는 문서의 문서 내용을 입력하세요\");");
			out.println("				return;");
			out.println("			}");
			out.println("			if( (peopleSel == true) && (form.docPerson.value.length==0) )");
			out.println("			{");
			out.println("				alert(\"검색을 원하는 문서의 작성자를 입력하세요.\");");
			out.println("				return;");
			out.println("			}");
			out.println("			if( form.initDay.checked == true ) ");
			out.println("			{");
			out.println("				var numStartYear = form.startYear.selectedIndex;");
			out.println("				var numStartMon = form.startMon.selectedIndex;");
			out.println("				var numStartDay = form.startDay.selectedIndex;");
			out.println("				var numStopYear = form.stopYear.selectedIndex;");
			out.println("				var numStopMon = form.stopMon.selectedIndex;");
			out.println("				var numStopDay = form.stopDay.selectedIndex;");
			out.println("				if( form.startYear.options[numStartYear].value > form.stopYear.options[numStopYear].value )");
			out.println("				{");
			out.println("					alert(\"작성 일자의 검색 조건이 잘못 되었습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if ( (form.startYear.options[numStartYear].value == form.stopYear.options[numStopYear].value) &&(form.startMon.options[numStartMon].value > form.stopMon.options[numStopMon].value) )");
			out.println("				{");
			out.println("					alert(\"작성 일자의 검색 조건이 잘못 되었습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if ( (form.startYear.options[numStartYear].value == form.stopYear.options[numStopYear].value) &&(form.startMon.options[numStartMon].value == form.stopMon.options[numStopMon].value) && ( form.startDay.options[numStartDay].value > form.stopDay.options[numStopDay].value) )");
			out.println("				{");
			out.println("					alert(\"작성 일자의 검색 조건이 잘못 되었습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				if (((( form.startYear.options[numStartYear].value % 4 ) == 0) && (( form.startYear.options[numStartYear].value % 100 ) != 0 ) || (( form.startYear.options[numStartYear].value % 400 ) == 0 )))");
			out.println("				{");
			out.println("					var temp = 1;");
			out.println("				}");
			out.println("				else");
			out.println("				{");
			out.println("					var temp = 2;");
			out.println("				}");
			out.println("				if((form.startMon.options[numStartMon].value == 1) && (( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 1월은 1일에서 31일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 2) && ( temp == 1 ) && ( form.startDay.options[numStartDay].value > 29 ) )");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 2월은 1일에서 29일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 2) && (temp == 2) && ( form.startDay.options[numStartDay].value > 28 ) )");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 2월은 1일에서 28일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 3 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 3월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 4 ) && ( ( form.startDay.options[numStartDay].value > 30 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 4월은 1일에서 30일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 5 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 5월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 6 ) && ( ( form.startDay.options[numStartDay].value > 30 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 6월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 7 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 7월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 8 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 8월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 9 ) && ( ( form.startDay.options[numStartDay].value > 30 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 9월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 10 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 10월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 11 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 11월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.startMon.options[numStartMon].value == 12 ) && ( ( form.startDay.options[numStartDay].value > 31 ) || ( form.startDay.options[numStartDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 12월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");	
	
			out.println("				if (((( form.stopYear.options[numStopYear].value % 4 ) == 0) && (( form.stopYear.options[numStopYear].value % 100 ) != 0 ) || (( form.stopYear.options[numStopYear].value % 400 ) == 0 )))");
			out.println("				{");
			out.println("					temp = 1;");
			out.println("				}");
			out.println("				else");
			out.println("				{");
			out.println("					temp = 2;");
			out.println("				}");
			out.println("				if((form.stopMon.options[numStopMon].value == 1) && (( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 1월은 1일에서 31일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 2) && ( temp == 1 ) && ( form.stopDay.options[numStopDay].value > 29 ) )");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 2월은 1일에서 29일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 2) && (temp == 2) && ( form.stopDay.options[numStopDay].value > 28 ) )");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 2월은 1일에서 28일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 3 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 3월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 4 ) && ( ( form.stopDay.options[numStopDay].value > 30 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 4월은 1일에서 30일 까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 5 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 5월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 6 ) && ( ( form.stopDay.options[numStopDay].value > 30 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 6월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 7 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 7월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 8 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 8월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 9 ) && ( ( form.stopDay.options[numStopDay].value > 30 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 9월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 10 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.startYear.options[numStartYear].value + \"년 10월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 11 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 11월은 1일에서 30일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("				else if((form.stopMon.options[numStopMon].value == 12 ) && ( ( form.stopDay.options[numStopDay].value > 31 ) || ( form.stopDay.options[numStopDay].value < 1 )))");
			out.println("				{");																						
			out.println("					alert( form.stopYear.options[numStopYear].value + \"년 12월은 1일에서 31일까지 있습니다.\");");
			out.println("					return;");
			out.println("				}");
			out.println("			}");
			out.println("			form.submit();");
			out.println("		}");
			out.println("		else");
			out.println("		{");
			out.println("			alert( \" 검색 조건을 하나이상 선택하세요.\");");
			out.println("		}");
			out.println("	}");
			out.println("//-->");
			out.println("</script>");
			
			String docBox = "";
			
			if( listID.equals( Lists.COMPLETEBOX ))			
				docBox = "완료된 문서함";
			else if( listID.equals( Lists.INGBOX))			
				docBox = "결재해야 할 문서함";
			else if( listID.equals( Lists.REJECTBOX))			
				docBox = "반려된 문서함";
			else if( listID.equals( Lists.SUBMITBOX))			
				docBox = "진행중인 문서함";
			else if( listID.equals( Lists.INFORMBOX))			
				docBox = "통보 온 문서함";
			else if( listID.equals( Lists.ABORTBOX))			
				docBox = "취소한 문서함";
			else if( listID.equals( Lists.PUBLICBOX))			
				docBox = "공용 문서함";

			out.println("<p align=\"center\"><font size=\"4\" color=\"gray\"><b>"+ docBox + 
			 "&nbsp;검색 조건 입력</b></font><br></p>");
			out.println("<hr width=600><br>");
			out.println("<div align=\"center\">"+
			 "<table border=\"0\" width=\"600\" cellpading=\"2\">");
			out.println("<form method=\"GET\" name=\"form1\""+
		    	 " action=\"/servlet/EDASearchServlet\">");
			out.println("<tr>");
			out.println("<td width=168 bgcolor=\"#c7e4ff\"><p align=\"center\">검색 조건</td>");
	    		if(! ( listID.equals( Lists.SUBMITBOX ) ) ){			
				out.println("<td width=418>"+"<p>" +
			 	 "<input type=\"checkbox\" name=\"itemSel\" value=\"docSEL\">&nbsp;문서 분류&nbsp;"+
	        	 	 "<input type=\"checkbox\" name=\"initDay\" value=\"initDaySEL\">작성 일자&nbsp;"+
				 "<input type=\"checkbox\" name=\"personSel\" value=\"initPersonSEL\">작 성 자&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+ "</p>" +
			       	 "<input type=\"checkbox\" name=\"titleSel\" value=\"titleSEL\">&nbsp;제 목&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
       	 	        	 "<input type=\"checkbox\" name=\"commSel\" value=\"commSEL\">&nbsp;문서 내용&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
				 "</td>");
			}
			else{
				out.println("<td width=418>"+ "<p>" +
			 	 "<input type=\"checkbox\" name=\"itemSel\" value=\"docSEL\">&nbsp;문서 분류&nbsp;"+
	        	 	 "<input type=\"checkbox\" name=\"initDay\" value=\"initDaySEL\">작성 일자&nbsp;"+"</p>"+
				 "<input type=\"checkbox\" name=\"titleSel\" value=\"titleSEL\">&nbsp;제 목&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
       	 	        	 "<input type=\"checkbox\" name=\"commSel\" value=\"commSEL\">&nbsp;문서 내용&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
				 "</td>");
			}
			out.println("</tr>");
			out.println("<tr>");
	            	
	            	out.println("<input type=hidden name=listID VALUE=" + listID + "> ");
	            	out.println("<input type=hidden name=oldCount VALUE=" + oldCount + "> ");
	            	out.println("<input type=hidden name=doGet VALUE=\"NO\">");
	            	out.println("<input type=hidden name=count VALUE=1>");
	            	out.println("<input type=hidden name=submitBox VALUE=" + Lists.SUBMITBOX + "> ");
	        	out.println("<td width=\"168\" bgcolor=\"#c7e4ff\"><p align=\"center\">문서 종류&nbsp;</td>");
	        	out.println("<td width=\"418\"><p>&nbsp;<select name=\"docItem\">"+
	        	 "<option value=\"교육문서\">교육문서</option>"+
	        	 "<option value=\"복지문서\">복지문서</option>"+
	            	 "<option value=\"인사문서\">인사문서</option>"+
	            	 "<option value=\"일반기안\">일반기안</option>"+
	            	 "<option value=\"총무문서\">총무문서</option>"+
	            	 "<option value=\"회계문서\">회계문서</option></select></td>");
	    		out.println("</tr>");
	    
	    
	    		out.println("<tr>");
	        	out.println("<td width=\"168\" rowspan=\"2\" bgcolor=\"#c7e4ff\">"+
	        	 "<p align=\"center\">작성 일자&nbsp;</td>");
	        	out.println("<td width=\"418\"><p>&nbsp;<select name=\"startYear\">"+
	             	 "<option value=\"1990\">1990</option>"+
	            	 "<option value=\"1991\">1991</option>"+
	            	 "<option value=\"1992\">1992</option>"+
	            	 "<option value=\"1993\">1993</option>"+
	            	 "<option value=\"1994\">1994</option>"+
	            	 "<option value=\"1995\">1995</option>"+
	            	 "<option value=\"1996\">1996</option>"+
	            	 "<option value=\"1997\">1997</option>"+
	            	 "<option value=\"1998\">1998</option>"+
	            	 "<option value=\"1999\">1999</option>"+
	            	 "<option value=\"2000\">2000</option>"+
	            	 "<option value=\"2001\">2001</option>"+
	            	 "<option value=\"2002\">2002</option>"+
	            	 "<option value=\"2003\">2003</option>"+
	            	 "<option value=\"2004\">2004</option>"+
	            	 "<option value=\"2005\">2005</option>"+
	            	 "<option value=\"2006\">2006</option>"+
	            	 "<option value=\"2007\">2007</option>"+
	                 "<option value=\"2008\">2008</option>"+
		         "<option value=\"2009\">2009</option>"+
		         "<option value=\"2010\">2010</option>"+
		         "<option value=\"2011\">2011</option>"+
		         "<option value=\"2012\">2012</option>"+
		         "<option value=\"2013\">2013</option>"+
		         "<option value=\"2014\">2014</option>"+
		         "<option value=\"2015\">2015</option>"+
		         "<option value=\"2016\">2016</option>"+
		         "<option value=\"2017\">2017</option>"+
		         "<option value=\"2018\">2018</option>"+
		         "<option value=\"2019\">2019</option>"+
		         "<option value=\"2020\">2020</option>"+
		         "<option value=\"2021\">2021</option>"+
		         "<option value=\"2022\">2022</option>"+
		         "<option value=\"2023\">2023</option>"+
		         "<option value=\"2024\">2024</option>"+
		         "<option value=\"2025\">2025</option>"+
		         "<option value=\"2026\">2026</option>"+
		         "<option value=\"2027\">2027</option>"+
		         "<option value=\"2028\">2028</option>"+
		         "<option value=\"2029\">2029</option>"+
		         "<option value=\"2030\">2030</option>"+
		         "<option value=\"2031\">2031</option>"+
		         "<option value=\"2032\">2032</option>"+
		         "<option value=\"2033\">2033</option>"+
		         "<option value=\"2034\">2034</option>"+
		         "<option value=\"2035\">2035</option>"+
		         "<option value=\"2036\">2036</option>"+
		         "<option value=\"2037\">2037</option>"+
		         "<option value=\"2038\">2038</option>"+
		         "<option value=\"2039\">2039</option>"+
	            	 "<option value=\"2040\">2040</option>"+
	            	 "</select>년 <select name=\"startMon\">"+
	            	 "<option value=\"01\">1</option>"+
	            	 "<option value=\"02\">2</option>"+
	            	 "<option value=\"03\">3</option>"+
	            	 "<option value=\"04\">4</option>"+
	            	 "<option value=\"05\">5</option>"+
	            	 "<option value=\"06\">6</option>"+
	            	 "<option value=\"07\">7</option>"+
	            	 "<option value=\"08\">8</option>"+
	            	 "<option value=\"09\">9</option>"+
	            	 "<option value=\"10\">10</option>"+
	            	 "<option value=\"11\">11</option>"+
	            	 "<option value=\"12\">12</option>"+
	            	 "</select>월 <select name=\"startDay\">"+
	            	 "<option value=\"01\">1</option>"+
	            	 "<option value=\"02\">2</option>"+
	            	 "<option value=\"03\">3</option>"+
	            	 "<option value=\"04\">4</option>"+
	            	 "<option value=\"05\">5</option>"+
	            	 "<option value=\"06\">6</option>"+
	            	 "<option value=\"07\">7</option>"+
	            	 "<option value=\"08\">8</option>"+
	            	 "<option value=\"09\">9</option>"+
	            	 "<option value=\"10\">10</option>"+
	            	 "<option value=\"11\">11</option>"+
	            	 "<option value=\"12\">12</option>"+
	            	 "<option value=\"13\">13</option>"+
	            	 "<option value=\"14\">14</option>"+
	            	 "<option value=\"15\">15</option>"+
	            	 "<option value=\"16\">16</option>"+
	            	 "<option value=\"17\">17</option>"+
	            	 "<option value=\"18\">18</option>"+
	             	 "<option value=\"19\">19</option>"+
	            	 "<option value=\"20\">20</option>"+
	            	 "<option value=\"21\">21</option>"+
	            	 "<option value=\"22\">22</option>"+
	            	 "<option value=\"23\">23</option>"+
	            	 "<option value=\"24\">24</option>"+
	            	 "<option value=\"25\">25</option>"+
	            	 "<option value=\"26\">26</option>"+
	            	 "<option value=\"27\">27</option>"+
	            	 "<option value=\"28\">28</option>"+
	            	 "<option value=\"29\">29</option>"+
	            	 "<option value=\"30\">30</option>"+
	            	 "<option value=\"31\">31</option></select>일 부터</td>"+
	    		 "</tr>");
	    		out.println("<tr>");
	        	out.println("<td width=\"418\"><p>&nbsp;<select name=\"stopYear\">"+
	             	 "<option value=\"1990\">1990</option>"+
	            	 "<option value=\"1991\">1991</option>"+
	            	 "<option value=\"1992\">1992</option>"+
	            	 "<option value=\"1993\">1993</option>"+
	            	 "<option value=\"1994\">1994</option>"+
	            	 "<option value=\"1995\">1995</option>"+
	            	 "<option value=\"1996\">1996</option>"+
	            	 "<option value=\"1997\">1997</option>"+
	            	 "<option value=\"1998\">1998</option>"+
	            	 "<option value=\"1999\">1999</option>"+
	            	 "<option value=\"2000\">2000</option>"+
	            	 "<option value=\"2001\">2001</option>"+
	            	 "<option value=\"2002\">2002</option>"+
	            	 "<option value=\"2003\">2003</option>"+
	            	 "<option value=\"2004\">2004</option>"+
	            	 "<option value=\"2005\">2005</option>"+
	            	 "<option value=\"2006\">2006</option>"+
	            	 "<option value=\"2007\">2007</option>"+
	                 "<option value=\"2008\">2008</option>"+
		         "<option value=\"2009\">2009</option>"+
		         "<option value=\"2010\">2010</option>"+
		         "<option value=\"2011\">2011</option>"+
		         "<option value=\"2012\">2012</option>"+
		         "<option value=\"2013\">2013</option>"+
		         "<option value=\"2014\">2014</option>"+
		         "<option value=\"2015\">2015</option>"+
		         "<option value=\"2016\">2016</option>"+
		         "<option value=\"2017\">2017</option>"+
		         "<option value=\"2018\">2018</option>"+
		         "<option value=\"2019\">2019</option>"+
		         "<option value=\"2020\">2020</option>"+
		         "<option value=\"2021\">2021</option>"+
		         "<option value=\"2022\">2022</option>"+
		         "<option value=\"2023\">2023</option>"+
		         "<option value=\"2024\">2024</option>"+
		         "<option value=\"2025\">2025</option>"+
		         "<option value=\"2026\">2026</option>"+
		         "<option value=\"2027\">2027</option>"+
		         "<option value=\"2028\">2028</option>"+
		         "<option value=\"2029\">2029</option>"+
		         "<option value=\"2030\">2030</option>"+
		         "<option value=\"2031\">2031</option>"+
		         "<option value=\"2032\">2032</option>"+
		         "<option value=\"2033\">2033</option>"+
		         "<option value=\"2034\">2034</option>"+
		         "<option value=\"2035\">2035</option>"+
		         "<option value=\"2036\">2036</option>"+
		         "<option value=\"2037\">2037</option>"+
		         "<option value=\"2038\">2038</option>"+
		         "<option value=\"2039\">2039</option>"+
	            	 "<option value=\"2040\">2040</option>"+
			 "</select>년 <select name=\"stopMon\">"+
	            	 "<option value=\"01\">1</option>"+
	            	 "<option value=\"02\">2</option>"+
	            	 "<option value=\"03\">3</option>"+
	            	 "<option value=\"04\">4</option>"+
	            	 "<option value=\"05\">5</option>"+
	            	 "<option value=\"06\">6</option>"+
	            	 "<option value=\"07\">7</option>"+
	            	 "<option value=\"08\">8</option>"+
	            	 "<option value=\"09\">9</option>"+
	            	 "<option value=\"10\">10</option>"+
	            	 "<option value=\"11\">11</option>"+
	            	 "<option value=\"12\">12</option>"+
			 "</select>월 <select name=\"stopDay\">"+
	            	 "<option value=\"01\">1</option>"+
	            	 "<option value=\"02\">2</option>"+
	            	 "<option value=\"03\">3</option>"+
	            	 "<option value=\"04\">4</option>"+
	            	 "<option value=\"05\">5</option>"+
	            	 "<option value=\"06\">6</option>"+
	            	 "<option value=\"07\">7</option>"+
	            	 "<option value=\"08\">8</option>"+
	            	 "<option value=\"09\">9</option>"+
	            	 "<option value=\"10\">10</option>"+
	            	 "<option value=\"11\">11</option>"+
	            	 "<option value=\"12\">12</option>"+
	            	 "<option value=\"13\">13</option>"+
	            	 "<option value=\"14\">14</option>"+
	            	 "<option value=\"15\">15</option>"+
	            	 "<option value=\"16\">16</option>"+
	            	 "<option value=\"17\">17</option>"+
	            	 "<option value=\"18\">18</option>"+
	             	 "<option value=\"19\">19</option>"+
	            	 "<option value=\"20\">20</option>"+
	            	 "<option value=\"21\">21</option>"+
	            	 "<option value=\"22\">22</option>"+
	            	 "<option value=\"23\">23</option>"+
	            	 "<option value=\"24\">24</option>"+
	            	 "<option value=\"25\">25</option>"+
	            	 "<option value=\"26\">26</option>"+
	            	 "<option value=\"27\">27</option>"+
	            	 "<option value=\"28\">28</option>"+
	            	 "<option value=\"29\">29</option>"+
	            	 "<option value=\"30\">30</option>"+
	            	 "<option value=\"31\">31</option>"+
	            	 "</select>일 까지&nbsp;</td>");
	    		out.println("</tr>");
	    		if(! ( listID.equals( Lists.SUBMITBOX ) ) ){
	    			out.println("<tr>");
		        	out.println("<td width=\"168\" bgcolor=\"#C7E4ff\"><p align=\"center\">"+
		        	 "작&nbsp;&nbsp;성&nbsp;&nbsp;자&nbsp;</td>");
		        	out.println("<td width=\"418\"><p>&nbsp;"+
		        	 "<input type=\"text\" name=\"docPerson\" size=\"30\">");
		        	out.println("<input type=\"button\" name=\"but1\" value = \"작성자 선택\" onClick=\"EDALineSelection()\"></td>");
		    		out.println("</tr>");
			}
			    
	    		out.println("<tr>");
	        	out.println("<td width=\"168\" bgcolor=\"#c7e4ff\"><p align=\"center\">"+
	        	 "제&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;목&nbsp;</td>");
	        	out.println("<td width=\"418\"><p>&nbsp;"+
	        	 "<input type=\"text\" name=\"docTitle\" size=\"30\"></td>");
	    		out.println("</tr>");
	    
	    		out.println("<tr>");
	        	out.println("<td width=\"168\" bgcolor=\"#c7e4ff\"><p align=\"center\">"+
	        	 "문서 &nbsp;내용&nbsp;</td>");
	        	out.println("<td width=\"418\"><p>&nbsp;"+
	        	 "<input type=\"text\" name=\"docComment\" size=\"30\"></td>");
	    		out.println("</tr>");
		
			out.println("<tr>");
	        	out.println("<td bgcolor=\"#c7e4ff\"><p align=\"center\">조건&nbsp;연결</td>");
	        	out.println("<td><p align=\"left\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+
	        	"<input type=\"radio\" name=\"andSearch\" value=\"AND\" checked>"+"AND &nbsp;&nbsp;&nbsp;"+
	        	 "<input type=\"radio\" name=\"andSearch\" value=\"OR\">OR</td>");
	    		out.println("</tr>");
	
													
	    		out.println("<tr>");
	        	out.println("<td colspan=\"3\"><p align=\"center\">"+
	        	 "&nbsp;<input type=\"BUTTON\" name=\"search\" "+
	             	 "value=\"검색\" OnClick=\"Check_Form(this.form)\"></td>");
	    		out.println("</tr>");
	    		
	    		out.println("</table></div>");
			out.println("</form>");
			out.println("<p>&nbsp;</p>");
			out.println("</body>");
			out.println("</html>");
		}
		else{
			//사용자 인증에 실패하였습니다.
			res.sendRedirect("../Login.html");
		}
		out.close();
	}
}