<x-layout bodyClass="g-sidenav-show  bg-gray-200">
  <x-navbars.sidebar_triage
    role="{{ $request->user()->role }}"
    activePage="attendances"
  >
  </x-navbars.sidebar_triage>

  <main
    class="main-content position-relative max-height-vh-100 h-100 border-radius-lg"
  >

    <!-- Navbar -->
    <x-navbars.navs.auth
      titlePage="attendances"
      role="{{ $request->user()->role }}"
      firstName="{{ $request->user()->name }}"
    >
    </x-navbars.navs.auth>
    <!-- End Navbar -->

    <div class="container-fluid px-md-4 px-2">
      <div class="row gx-4 mb-2">

        <div class="col-auto my-auto">
          <div class="h-100">
            <h5 class="mb-1">
              Attendance Id: {{ $attendance->id }}
            </h5>
          </div>
        </div>
      </div>

      <div class="card card-plain h-100">
        <div class="card-header p-3 pb-0">
          <div class="row mb-4">
            <div class="col-md-6 d-flex align-items-center">
              <h6
                class="align-center mb-3"
                style="margin-bottom: 0 !important;"
              >
                View Attendance Information
              </h6>
            </div>

            <div class="col-md-6 d-flex align-items-center">
              <form
                action="/attendances/{{ $attendance->id }}"
                method="POST"
              >

                <a
                  class="btn btn-secondary btn-sm"
                  href="/attendances/{{ $attendance->id }}/edit"
                  style="margin-bottom: 0;"
                >
                  <span class="btn-text">edit</span>
                </a>

                @csrf
                @method('DELETE')
                <button
                  class="btn btn-danger btn-sm"
                  style="margin-bottom: 0;"
                >
                  <span class="btn-text">delete</span>
                </button>

              </form>
            </div>
          </div>
        </div>

        <div
          class="card-body p-3 pb-0"
          style="background-color: white;"
        >
          <div class="row">
            <div class="col-md-12 mb-3">
              <label class="form-label">Check time (Y-m-d) :</label>
              <input
                class="form-control border border-2 p-2"
                name="check_time"
                type="text"
                value="{{ old('check_time', $attendance->check_time) }}"
                disabled
              />

              @error('check_time')
                <p class='text-danger inputerror'>{{ $message }} </p>
              @enderror
            </div>

            <div class="col-md-12 mb-3">
              <label class="form-label">Student email :</label>
              <input
                class="form-control border border-2 p-2"
                name="student_email"
                type="text"
                value="{{ old('student_email', $attendance->student_email) }}"
                disabled
              />
              @error('student_email')
                <p class='text-danger inputerror'>{{ $message }} </p>
              @enderror
            </div>

            <div class="col-md-12 mb-3">
              <label class="form-label">subject_id</label>
              <input
                class="form-control border border-2 p-2"
                name="subject_id"
                type="text"
                value="{{ old('subject_id', $attendance->subject_id) }}"
                disabled
              />
              @error('subject_id')
                <p class='text-danger inputerror'>{{ $message }} </p>
              @enderror
            </div>

            <div class="col-md-12 mb-3">
              <label for="floatingTextarea2">Remarks :</label>
              <textarea
                class="form-control border border-2 p-2"
                id="floatingTextarea2"
                name="remarks"
                placeholder="student living remarks ... "
                rows="4"
                cols="50"
                disabled
              >{{ old('remarks', $attendance->remarks) }}</textarea>

              @error('remarks')
                <p class='text-danger inputerror'>{{ $message }} </p>
              @enderror
            </div>
          </div>
        </div>

        <div
          class="card-footer d-flex"
          style="background-color: white;"
        >
          <a
            class="btn btn-secondary btn-sm font-weight-normal my-auto"
            href="/attendances"
            style="display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 1rem;"
          >
            <i
              class="fas fa-arrow-left"
              style="font-size: 1rem;"
            ></i> Back
          </a>
        </div>

      </div>
    </div>

  </main>

</x-layout>
