<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Viriatum / Connections</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

        <!-- css inclusion -->
        <link rel="stylesheet" href="/resources/css/layout.css" type="text/css" />

        <!-- favicon inclusion -->
        <link rel="shortcut icon" href="/resources/images/favicon.ico" />
        <link rel="icon" href="/resources/images/favicon-2x.png" sizes="32x32" type="image/png" />
    </head>
    <body>
        <div id="header-wrapper">
            <div class="header-body">
                <div class="branding simple">
                    <a href="/"></a>
                </div>
            </div>
        </div>
        <div id="content-wrapper">
            <?php $connection = viriatum_connection_info($_GET["id"]) ?>
            <?php if(isset($connection["id"])): ?>
            <table class="table status" cellpadding="0" cellspacing="0">
                <tbody>
                    <tr>
                        <td class="right label" width="50%">id</td>
                        <td class="left value" width="50%"><?php echo($connection["id"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">status</td>
                        <td class="left value" width="50%"><?php echo($connection["status"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">family</td>
                        <td class="left value" width="50%"><?php echo($connection["family"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">protocol</td>
                        <td class="left value" width="50%"><?php echo($connection["protocol"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">uptime</td>
                        <td class="left value" width="50%"><?php echo($connection["uptime"]) ?></td>
                    </tr>
                    <tr>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">host</td>
                        <td class="left value" width="50%"><?php echo($connection["host"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">port</td>
                        <td class="left value" width="50%"><?php echo($connection["port"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">secure</td>
                        <td class="left value" width="50%"><?php echo($connection["secure"] ? "true" : "false") ?></td>
                    </tr>
                    <tr>
                        <td></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">sent</td>
                        <td class="left value" width="50%"><?php echo($connection["sent"]) ?></td>
                    </tr>
                    <tr>
                        <td class="right label" width="50%">received</td>
                        <td class="left value" width="50%"><?php echo($connection["received"]) ?></td>
                    </tr>
                </tbody>
            </table>
            <?php else: ?>
            <p class="info">Connection #<?php echo(htmlspecialchars($_GET["id"])) ?> not found (already closed).</p>
            <?php endif ?>
        </div>
        <div id="footer-wrapper">
            <div class="footer-body">
                <div class="separator-horizontal"></div>
                <ul class="footer-list">
                    <img class="footer-logo" src="/resources/images/logo/steamfire-logo.png" srcset="/resources/images/logo/steamfire-logo-2x.png 2x" />
                </ul>
            </div>
        </div>
    </body>
</html>
