
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>My Bookings</title>
    <!-- Include your stylesheet here -->
</head>
<div class="topnav">
    <!--  nav bar  -->
      <nav class="navbar navbar-expand-sm bg-dark navbar-dark">
        <a>
            <img src="https://www.una.edu/brand/images/logo/round/UNA-roundLionPurpleW.png.pagespeed.ce.sooHu-qo8w.png" onclick="location.href = 'https:/una.edu/'" alt="buttonpng" height = "30" width = "30" background-color="black" />
            </a>
                <a class="nav-link" onclick="location.href='/index'">Home</a>
                <a class="nav-link" onclick="location.href='/login'">Login</a>
                <a class="nav-link" onclick="location.href='/register'">Register</a>
                <a class="nav-link" onclick="location.href='/manage-bookings'" class="manage-bookings-btn">Manage My Bookings</a>
                <a class="nav-link" href="https://github.com/LoganBeckman21/congenial-barnacle-Group4/blob/main/README.md">About</a>
                
        </div>

<body>
    <h1>My Bookings</h1>
    <% bookings.forEach(booking => { %>
        <div class="booking">
            <p>Course: <%= booking.course %></p>
            <p>Time: <%= booking.selectedTime %></p>
            <!-- Form to update a booking -->
            <form action="/update-booking" method="post">
                <input type="hidden" name="bookingId" value="<%= booking._id %>">
                <input type="text" name="newName" placeholder="New Name" value="<%= booking.name %>">
                <input type="text" name="newTime" placeholder="New Time" value="<%= booking.selectedTime %>">
                <input type="hidden" name="email" value="<%= email %>">
                <button type="submit">Update</button>
            </form>
            <!-- Form to delete a booking -->
            <form action="/delete-booking" method="post">
                <input type="hidden" name="bookingId" value="<%= booking._id %>">
                <input type="hidden" name="email" value="<%= email %>">
                <button type="submit">Delete</button>
            </form>
        </div>
    <% }); %>
</body>

<footer class="container-fluid text-center">
    <p>Office Hour Application Group 4 - Cumbie Â© 2024</p>
  </footer>
</html>
