  <!--
// written by: Siddharth Musale and Corey Chen
// tested by: Corey Chen
// debugged by: Corey Chen
-->
<!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="/users/home">Auto Park</a>
        </div>
        <div id="navbar" class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li class="active"><a href="/users/home">Welcome</a></li>
            <li><a href="/users/about">About</a></li>
            <li><a href="/users/map">Parking Map</a></li>
              <li><a href="/users/dynamicprice">Price</a></li>
            <li><a href="/users/update">Update User</a></li>
            <li><a href="/users/home">Logout</a></li>
          </ul>
        </div><!--/.nav-collapse -->
      </div>
    </nav>
<body>
    <div class="container">
    <h3>Welcome <%= name %></h3>
    <table class = "table">
        <thead>
            <tr>
                <th scope="col"><h3>Actions </h3></th>
                <th scope = "col"><h3>Your Reservations</h3></th>
            </tr>
        </thead>

        <tbody>
            <tr>
                <td>
                    <button id="makeRes">Make a Reservation</button>
                    <script>document.getElementById("makeRes").onclick = () => {
                        location.href = "/reservation/form"
                    }</script>

                    <br><br>

                    <button id="cancelRes">Cancel a Reservation</button>
                     <script>document.getElementById('cancelRes').onclick = () =>{
                        location.href = "/reservation/cancel"
                    }</script>
                
                    <br><br>
                    <button id="updateInfo">Account Management</button><br><br>
                    <script>document.getElementById('updateInfo').onclick = () =>{
                        location.href = "/users/profile/update"
                    }</script>
                </td>
                <td>
                    <ol>
                        <% for (var res of reservations) { %>
                            <li><%= res.DateTime %></li>
                        <% } %>
                    </ol>
                </td>  
            </tr>
    </tbody>
    </table>
</div>
</body>
</html>