<h4>
    <a href="#/appointment/<%= a.getId() %>/attendee"><i class="fas fa-chevron-left"></i></a>
    <%= _lc( 'APPOINTMENT_EDIT_ATTENDEE' ) %>
</h4>
<div class="row">
    <div class="col-sm-12">
        <div class="card">

            <form data-id="form-appointment"
                  class="needs-validation"
                  novalidate>
                <div class="card-body no-padding">
                    <table class="table">
                        <thead>
                            <tr>
                                <th><%= _lc( 'NAME' ) %></th>
                                <th class="text-center"><%= _lc( 'CURRENT_STATUS' ) %></th>
                                <th class="text-center">
                                    <%= a.hasStarted() ? _lc( 'HAS_ATTENDED' ) : _lc( 'CHANGE_TO' ) %>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                        <% var aa = a.getAttendeesAccepted(), prfl; %>
                        <% for ( var aai = 0; aai < aa.length; aai++ ) {    %>
                            <% prfl = a.getProfileById( aa[ aai ].profile_id ); %>
                            <%=raw app.core.View.getTemplate( 'appointment-edit-attendee-row', { attendee : prfl, a: a, currentStatus : 'accepted', childProfile : prfl.getChildProfileById( aa[ aai ].profile_child_id ) } ) %>
                        <% }    %>
                        <% var aw = a.getAttendeesWaiting(); %>
                        <% for ( var awi = 0; awi < aw.length; awi++ ) {    %>
                            <% prfl = a.getProfileById( aw[ awi ].profile_id ); %>
                            <%=raw app.core.View.getTemplate( 'appointment-edit-attendee-row', { attendee : prfl, a: a, currentStatus : 'waiting', childProfile : prfl.getChildProfileById( aw[ awi ].profile_child_id ) } ) %>
                        <% }    %>
                        <% var ad = a.getAttendeesDeclined(); %>
                        <% for ( var adi = 0; adi < ad.length; adi++ ) {    %>
                            <% prfl = a.getProfileById( ad[ adi ].profile_id ); %>
                            <%=raw app.core.View.getTemplate( 'appointment-edit-attendee-row', { attendee : prfl, a: a, currentStatus : 'declined', childProfile : prfl.getChildProfileById( ad[ adi ].profile_child_id ) } ) %>
                        <% }    %>
                        <% for ( var ndmi = 0; ndmi < notDecided.length; ndmi++ ) {    %>
                            <%=raw app.core.View.getTemplate( 'appointment-edit-attendee-row', { attendee : notDecided[ ndmi ].profile, a: a, currentStatus : 'no-reaction', childProfile : notDecided[ ndmi ].child } ) %>
                        <% }    %>
                        </tbody>
                    </table>

                </div>

                <div class="card-footer">
                    <a href="#/appointment/<%= a.getId() %>/attendee"
                        class="btn btn-sm btn-secondary">
                        <%= _lc( 'BTN_CANCEL' ) %>
                    </a>
                    <button type="button"
                            data-id="btn-save"
                            class="btn btn-sm btn-primary">
                        <%= _lc( 'BTN_SAVE' ) %>
                    </button>
                </div>
            </form>
        </div>
    </div>
</div>