<!--
written by: Siddharth Musale
tested by: Siddharth Musale
debugged by: Siddharth Musale
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="../../favicon.ico">

    <title>AutoPark</title>

    <!-- Bootstrap core CSS -->
    <link href="../public/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="../public/css/starter-template.css" rel="stylesheet">

  </head>

  <body>

    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="/admin/home">Home</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a href="/admin/spots">Parking Spots</a></li>
            <li><a href="/admin/users">Users</a></li>
            <li><a href="/admin/reservations">Reservations</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
<body>
    <div class="container container-small">
        <table class = "table table-sm">
            <thead>
                <tr>
                    <th scope = "col"><h3>ReservationID</h3></th>
                    <th scope = "col"><h3>userID</h3></th>
                    <th scope = "col"><h3>DateTime</h3></th>
                    <th scope = "col"><h3>Check In</h3></th>
                    <th scope = "col"><h3>Parking Spot</h3></th>
                </tr>
            </thead>
            <tbody>
                <% for (var i = 0; i < spot.length; i++){ %>
                     <tr> 
                        <td><%- resID[i] %></td>
                        <td><%- uID[i] %></td>
                        <td><%- time[i] %></td>
                        <td><%- checkIn[i] %></td>
                        <td><%- spot[i] %></td>
                     </tr>
                <% } %>
            </tbody>
        </table>
        <form method = "POST"> 
                <div class="row">
                  <div class="col">
                    <input name = "resID" type="number" class="form-control" placeholder="ReservationID">
                  </div>
                  <div class="col">
                    <input name = "uID" type="number" class="form-control" placeholder="UserID">
                  </div>
                  <div class="col">
                    <input name = "time" type="datetime-local" class="form-control" placeholder="Datetime">
                    </div>
                </div>
                <div class="row">
                    <div class="col">
                        <input name = "checkIn" type="number" class="form-control" placeholder="CheckIn">
                    </div>
                    <div class="col">
                        <input name = "spot" type="number" class="form-control" placeholder="Spot">
                    </div>
                    <div class = "col">
                    <button type="submit" class="btn btn-primary" formaction = /admin/reservations/updated>Update</button>
                    </div>
                    <div class = "col">
                        <button type="submit" class="btn btn-primary" formaction = /admin/reservations/deleted>Delete</button>
                    </div>
                </div>
        </form>
    </div>
</body>
</html>