<?php
include_once 'display.php';
?>
<!DOCTYPE html>
<html lang="cs">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- <link rel="stylesheet" type="text/css" href="../static/css.css"> -->

    <link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css.css')}}"> 

    <link rel="preconnect" href="https://fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&display=swap" rel="stylesheet">

    <title>Nemocniční Cedulka</title>
    <link rel="icon" href="{{url_for('static', filename='ikona.svg')}}">

    <script>
        function startTime() {
            var today = new Date();
            var h = today.getHours();
            var m = today.getMinutes();
            var s = today.getSeconds();
            m = checkTime(m);
            s = checkTime(s);
            document.getElementById('cas').innerHTML = h + ":" + m + ":" + s;
            var t = setTimeout(startTime, 500);

            var den = ['Neděle', 'Pondělí', 'Úterý', 'Středa', 'Čtvrtek', 'Pátek', 'Sobota'];
            var mesic = ["Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Záři", "Říjen",
                "Listopad", "Prosinec"
            ];

            var d = den[today.getDay()];
            var dat = today.getDate();
            var m = mesic[today.getMonth()];
            var r = today.getFullYear();
            document.getElementById('datum').innerHTML = d + ", " + dat + ". " + m + " " + r;
        }

        function checkTime(i) {
            if (i < 10) {
                i = "0" + i
            };
            return i;
        }
    </script>

</head>

<body onload="startTime()">

    <div class="container">
        <div id="sloupec-1" class="sloupec">
            <div id="zobcas">
                <p id="cas"></p>
                <p id="datum"></p>
                <p id="tyden"></p>
            </div>
            <div id="zoblogo">
                <img id="logo" src="../static/logo.svg" alt="logo">
            </div>
            <div id="formular2">
                <form action="/uploadPanel" method="POST">
                    <label>Název panelu<input type="text" name="panelN"></label>
                    <label>IP panelu<input type="text" name="panelIP"></label>
                    <input name="submitPANEL" type="submit" value="Přidat panel">
                </form>
            </div>
        </div>
        <div id="sloupec-2" class="sloupec">
            <div id="formular">
                <span id="cedulka">
                    <form method="POST">
                        <div>
                            <label>Výběr panelu
                                <select name="panel">
                                {% for x in panels %}
          			<option value= '{{ x }}'>{{x}}</option>
        			{% endfor %}
                                </select>
                            </label>
                        </div>
                        <div><label>Jméno a příjmení<input type="text" name="name"></label></div>
                        <div>
                            <label>Krevní skupina
                                <select name="krev_sk">
                                    <option value="A+">A+</option>
                                    <option value="A-">A-</option>
                                    <option value="B+">B+</option>
                                    <option value="B-">B-</option>
                                    <option value="AB+">AB+</option>
                                    <option value="AB-">AB-</option>
                                    <option value="0+">0+</option>
                                    <option value="0-">0-</option>
                                </select>
                            </label>
                        </div>
                        <div><label>Alergie<input type="text" name="alergie" maxlength="50"></label></div>
                        <div><label>Stav<textarea type="text" name="stav" maxlength="75"></textarea></div>
                        <div id="zprava">
                            {% with messages = get_flashed_messages() %}
                            {% if messages %}
                            {% for message in messages %}
                            {{ message }}
                            {% endfor %}
                            {% endif %}
                            {% endwith %}
                        </div>
                        <hr class="oddelovac">
                        <div><label>Login ID<input type="text" name="login_id"></label></div>
                        <div><label>Heslo<input type="password" name="passw"></label></div>
                        <hr class="oddelovac">
                        <input name="submitINFO" type="submit" value="Odeslat na panel">
                    </form>
                </span>
            </div>
        </div>
        <div class="clear"></div>
    </div>
</body>

</html>
