<!DOCTYPE html>
<html lang="en">

<head>
  <link rel="stylesheet" href="/stylesheets/adminNav.css">
  <link rel="stylesheet" href="/stylesheets/add.css">
  <%- include("partials/header.ejs") %>
</head>

<body>
    <%- include("partials/loading.ejs") %>
        <%- include("partials/adminNav.ejs") %>
            <%- include("partials/adminPageLink.ejs") %>
            <form method="post" id="addForm">
                <h2>Change <%= option %>
                </h2>
                <% if (error) { %>
                    <div class="messageBlock">
                        <p id="message">
                            <%= error %>
                        </p>
                    </div>
                    <% } %>
                <table>
                    <thead>
                        <% for(var i=1;i < keys.length;i++){%>
                            <% if(keys[i] !== 'courses') { %>
                            <tr>
                                <td>
                                    <%= keys[i] %>
                                </td>
                                <% if (keys[i] === 'email') { %> 
                                    <td><%= typeof query[keys[i]] !== 'undefined' ? query[keys[i]] : '' %></td> 
                                <% } else { %> 
                                    <% if (keys[i] !== 'password') { %> 
                                            <td><input type="text" name="<%= keys[i] %>" value="<%= typeof query[keys[i]] !== 'undefined' ? query[keys[i]] : '' %>" required></td>
                                    <% } else { %> 
                                            <td><input type="password" name="<%= keys[i] %>" value="" ></td> 
                                    <% } %>
                                <% } %>
                            </tr>
                            <%}%>
                            <%}%>
                    </thead>
                </table>
                <button id="saveButton" type="submit">Save</button>
            </form>
</body>

</html>