<h1 class="page-header">Welcome Customer
    <%= customer.fullName %>
</h1>

<h2 class="header-nav">
    <ul>
        <li><a href="/books">Books</a></li>
        <li><a href="/events">Events</a></li>
        <li><a href="/topics">Topics</a></li>
        <li><a href="/rooms">Rooms</a></li>
    </ul>
</h2>


<div class='index-row'>
    <div class='index-item-left'>
        <a class='index-text' href="/customer/<%= customer.id %>">Profile</a>
    </div>
    <div class='index-item-right'>
        <a class='index-text' href='/books'>Books</a>
    </div>
</div>

<div class='index-row'>
    <div class='index-item-left'>
        <a class='index-text' href='/payments/new'>Add Payment</a>
    </div>
    <div class='index-item-right'>
        <a class='index-text' href='/rentals/new'>Add Rental</a>
    </div>
</div>

<div class='index-row'>
    <div class='index-item-left'>
        <a class='index-text' href='/topics'>Topics</a>
    </div>
    <div class='index-item-right'>
        <a class='index-text' href='/events'>Events</a>
    </div>
</div>

<div class='index-row'>
    <div class='index-item-left'>
        <a class='index-text' href='/rooms'>Rooms</a>
    </div>
    <div class='index-item-right'>
        <a class='index-text' href='/reservations/new'>Add Reservation</a>
    </div>
</div>

<div class='index-row'>
    <div class='index-item-left'>
        <a class='index-text' href='/registrations/new'>Add Registration</a>
    </div>
    <div class='index-item-right'>
        <a class='index-text' href='/sponsors/new'>Add Sponsor</a>
    </div>
</div>

<div class='index-row'>
    <div class='index-item-left index-item-right'>
        <a class='index-text' href='/funds/new'>Add Fund</a>
    </div>
</div>
<% if (invoices.length> 0) { %>
    <h2>Invoice</h2>
    <% invoices.forEach(invoice=> { %>
        <div class="author-row">
            <div class="author-name">
                ID: <%= invoice.id %>
            </div>
        </div> 
        <div class="form-row form-row-end btn-row">
            <a class="btn btn-primary" 
            href="/invoices/<%= invoice.id %>">View</a>
        </div>
        <br>
        <% }) %>
            <% } %>

                <% if (payments.length> 0) { %>
                    <h2>Payment</h2>
                    <% payments.forEach(payment=> { %>
                        <div class="author-row">
                            <div class="author-name">
                                ID: <%= payment.id %>
                            </div>
                        </div>

                        <div class="form-row form-row-end btn-row">
                            <a class="btn btn-primary" 
                            href="/payments/<%= payment.id %>">View</a>
                        </div>
                        <br>
                        <% }) %>
                            <% } %>

                                <% if (rentals.length> 0) { %>
                                    <h2>Rental</h2>
                                    <% rentals.forEach(rental=> { %>
                                        <div class="author-row">
                                            <div class="author-name">
                                                ID: <%= rental.id %>
                                            </div>
                                        </div>
                                        <div class="form-row form-row-end btn-row">
                                            <a class="btn btn-primary" href="/rentals/<%= rental.id %>">View</a>
                                        </div>
                                        <br>
                                        <% }) %>
                                            <% } %>

                                                <% if (registrations.length> 0) { %>
                                                    <h2>Registration</h2>
                                                    <% registrations.forEach(registration=> { %>
                                                        <div class="author-row">
                                                            <div class="author-name">
                                                                Registration ID: <%= registration.regID %>
                                                            </div>
                                                        </div>
                                                        <div class="form-row form-row-end btn-row">
                                                            <a class="btn btn-primary" 
                                                            href="/registrations/<%= registration.id %>">View</a>
                                                        </div>
                                                        <br>
                                                        <% }) %>
                                                            <% } %>

                                                                <% if (reservations.length> 0) { %>
                                                                    <h2>Reservation</h2>
                                                                    <% reservations.forEach(reservation=> { %>
                                                                        <div class="author-row">
                                                                            <div class="author-name">
                                                                                ID: <%= reservation.id %>
                                                                            </div>
                                                                        </div>
                                                                        <div class="form-row form-row-end btn-row">
                                                                            <a class="btn btn-primary"
                                                                            href="/reservations/<%= reservation.id %>">View</a>
                                                                        </div>
                                                                        <br>
                                                                        <% }) %>
                                                                            <% } %>
                                                                            
                                                                            <div class="form-row form-row-end btn-row">
                                                                                <a class="btn btn-primary" href='/'>Logout</a>
                                                                            </div>