<%@ page import="java.io.*, java.util.*"%>
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ page import="com.eactive.eai.common.usedate.UseDateControlManager"%>
<%@ page import="com.eactive.eai.common.usedate.UseDateControlVO"%>

<%
	UseDateControlManager manager = UseDateControlManager.getInstance();    
    String[] names = manager.getAllKeys();
    String selectedName = request.getParameter("name");
    if(selectedName == null && names.length>0) selectedName = names[0];
    UseDateControlVO vo = manager.get(selectedName);
%>
<html>
    <head>
        <title>
            Use Date Control Manager
        </title>
        <script>
        function doAction() {
            document.frm.submit();
        }
        </script>
    </head>
    <body>
        <p style="font-size:12pt;">
        <b>Use Date Control Configuration</b> <br><br>
        </p>
        <form name="frm" action="">
        <table width="450" border=0 bgcolor='black' cellpadding="1" cellspacing="1">
<%
	if(selectedName!=null) {
%>
        <tr bgcolor='white'>
            <td align='right' width='200' bgcolor="#ccccff">인터페이스명 : &nbsp;</td>
            <td align='left' width='250'>&nbsp;<select name="name" onchange="doAction();">
            <%
            	for(int i=0;i<names.length;i++) {
            %>
                <option value="<%=names[i]%>" <%=(names[i].equals(selectedName)) ? "selected" : ""%>><%=names[i]%>
            <%
            	}
            %></select>
            </td>
        </tr>
        <%
        	if (vo != null){
        %>
        
        <tr bgcolor='white'>            
            <td align='right' bgcolor="#ccccff">인터페이스명 : &nbsp;</td>
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getName()%>"></td>            
        </tr>
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">시작일자 : &nbsp;</td>            
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getStartDateString()%>"></td>
        </tr>
        <tr bgcolor='white'>
            <td align='right' bgcolor="#ccccff">종료일자 : &nbsp;</td>            
            <td align='left'>&nbsp;<input type="text" name="text" size="20" value="<%=vo.getEndDateString()%>"></td>
        </tr>
        <%
        	}
        %>
<% } else { %>
        
<% } %>
        </table>
        <table border='0' width="800" >
        <tr>
        <td align='left'>
            <!-- input type="submit" value="UPDATE"-->
        </td>
        </tr>
        </table><br>
        </form>
    </body>
</html>