<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<jsp:include page="head.jsp"/>

<body>

<div class="container" align="center">
    <jsp:include page="header.jsp"/>
    <jsp:include page="menu.jsp"/>

    <div class="content">
        <table border="0" cellpadding="10" cellspacing="0" width="100%" style="font-weight: bold;font-family:tahoma;font-size:14pt;color:#808080;border-color:#6a5acd" >
            <tr><td>
                <fieldset><legend> Controller Information </legend>
                    <table align="center" border="1" cellpadding="1" cellspacing="0" style="border: 1px solid;font-weight: normal;font-family:tahoma;font-size:12pt;">
                        <thead>
                        <tr style="background-color: antiquewhite;">
                            <th>관리번호</th>
                            <th>제어기 ID</th>
                            <th>제어기 명칭</th>
                            <th>IP Address</th>
                            <th>상태</th>
                            <th>마지막 연결 시간</th>
                            <th>마지막 해제 시간</th>
                            <th>접속횟수</th>
                            <th>명령</th>
                        </tr>
                        </thead>
                        <c:forEach var="entry" items="${list}" varStatus="status">
                            <tr>
                                <td align="center">${entry.value.vmsCtlrNmbr}</td>
                                <td align="center">${entry.value.ctlrId}</td>
                                <td>${entry.value.name}</td>
                                <td>&nbsp;${entry.value.ctlrIp}&nbsp;</td>
                                <td align="center">
                                    <c:choose>
                                        <c:when test="${entry.value.netState eq '0'}">
                                            -
                                        </c:when>
                                        <c:otherwise>
                                            &nbsp;연결&nbsp;
                                        </c:otherwise>
                                    </c:choose>
                                </td>
                                <td align="center">&nbsp;${entry.value.connectTm}&nbsp;</td>
                                <td align="center">&nbsp;${entry.value.disConnectTm}&nbsp;</td>
                                <td align="center">${entry.value.connectCount}</td>
                                <td align="center">
                                    &nbsp;<a href=javascript:disconnectController('${entry.value.vmsCtlrNmbr}')>연결해제</a>&nbsp;&nbsp;
                                    <!--<a href=javascript:resetController('${entry.value.vmsCtlrNmbr}')>제어기리셋</a>&nbsp;&nbsp;-->
                                    <a href=javascript:resetConnCount('${entry.value.vmsCtlrNmbr}')>접속횟수초기화</a>&nbsp;</td>
                            </tr>
                        </c:forEach>
                    </table>
                    <table align="center" border="0" cellpadding="1" cellspacing="0" style="font-weight: normal;font-family:tahoma;font-size:12pt;">
                    <tr>
                        <td><button type="button" onclick="allDisconnectController()">전체 연결해제</button></td>
                        <td><button type="button" onclick="allResetConnCount()">전체 접속횟수초기화</button></td>
                        </tr>
                    </table>

            </fieldset>
            </td></tr>
        </table>
    </div>
</div>

</body>
</html>
