@layout('admin/master')
@section('content')
  <section class="main-content">
    <div class="row">
        <div class="col-sm-12">
            @if(hasErrorFor('errors'))
              @!component('admin.flash-errors', {errors: getErrorFor('errors')})
            @endif
            @if(hasErrorFor('error'))
              @!component('admin.flash-error', error = getErrorFor('error') )
            @endif
            @if(flashMessage('success'))
              @!component('admin.flash-success', success = flashMessage('success') )
            @endif
            <div class="card">
                <div class="card-header card-default">
                    Cancelled Booking Details
                </div>
                <div class="card-body">
                  <div class="row" style="text-align:center">
                    <div class="col-sm-6">
                        <div class='d-flex flex-row'>
                          <label><strong>ID: </strong></label>
                          <p>{{ booking._id }}</p>
                        </div>
                      <div class='d-flex flex-row'>
                          <label><strong>Booking Status: </strong></label>
                          <p>{{ booking.booking_status }}</p>
                      </div>
                      <div class='d-flex flex-row'>
                          <label><strong>Artist Email: </strong></label>
                          <p>{{ booking.artist.email }}</p>
                      </div>
                      <div class='d-flex flex-row'>
                          <label><strong>Booked By: </strong></label>
                          <p>{{ booking.user.email }}</p>
                      </div>
                      <div class='d-flex flex-row'>
                          <label><strong>Cancelled By: </strong></label>
                          <p>{{ booking.cancelled_by }}</p>
                      </div>
                      <div class='d-flex flex-row'>
                          <label><strong>Cancellation Reason: </strong></label>
                          <p>{{ booking.cancellation_reason }}</p>
                      </div>
                      <div class='d-flex flex-row'>
                            <label><strong>Date: </strong></label>
                            <p>{{ booking.created_at }}</p>
                      </div>
                    </div>
                    <div class="col-sm-6">
                        <div class='d-flex flex-row'>
                            <label><strong>Gathering Size: </strong></label>
                            <p>{{ booking.gathering_size }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                            <label><strong>Additional Notes: </strong></label>
                            <p>{{ booking.notes }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Platform Fee: </strong></label>
                          <p>{{ booking.transaction.platform_fee }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Platform Fee: </strong></label>
                          <p>{{ booking.transaction.stripe_fee }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Per Hour Charges: </strong></label>
                          <p>{{ booking.transaction.per_hour_charge_amount }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Total Charges: </strong></label>
                          <p>{{ booking.transaction.total_charge }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Booking for the date: </strong></label>
                          <p>{{ booking.date }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Booked Slots( 24 hours ): </strong></label>
                          <p>{{ booking.time_slot_start }} - {{ booking.time_slot_end }}</p>
                        </div>
                        <div class='d-flex flex-row'>
                          <label><strong>Location: </strong></label>
                          <p>{{ booking.address.street }}, {{ booking.address.city }}, {{ booking.address.state }}</p>
                        </div>
                    </div>
                  </div>
                  <form method="post">
                    {{ csrfField() }}
                    <div class="form-group">
                        <input type='hidden' name="booking_id" value= {{booking._id}} />
                        <label>Refund Status</label>
                        <select required name="refund_status" class="form-control">
                            <option {{ booking.refund_status == 'pending' ? 'selected' : '' }} value="pending">Pending</option>
                            <option {{ booking.refund_status == 'process' ? 'selected' : '' }} value="process">Process</option>
                            <option {{ booking.refund_status == 'refunded' ? 'selected' : '' }} value="refunded">Refunded</option>
                            <option {{ booking.refund_status == 'undue' || booking.refund_status == false? 'selected' : '' }} value="undue">No Due</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <div class="buttons">
                            <button class="btn btn-primary">Submit</button>
                        </div>
                    </div>
                </form>
                </div>
            </div>
        </div>
    </div>
    @include('admin.footer')
  </section>
@endsection
