@extends('layouts.TF')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-lg-12 d-flex flex-column">
                <div class="row flex-grow">
                    {{-- @if ($proposal->isEmpty()) --}}
                    <div class="col-12 grid-margin stretch-card">
                        {{-- @else
        <div class="col-12 grid-margin stretch-card">
          @endif --}}
                        <div class="card"
                            style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
                            <div class="card-body">
                                <div class="d-sm-flex justify-content-between align-items-start">
                                    <div>
                                        <h4 class="card-title card-title-dash">List Jadwal Dosen</h4>

                                    </div>
                                </div>
                                <br>
                                <div class="d-sm-flex align-items-center mt-1 justify-content-between">
                                </div>
                                @if (Session::has('pesan'))
                                    <div class="alert alert-info alert-dismissible">
                                        <a href="#" class="close" data-dismiss="alert">&times;</a>
                                        {{ Session::get('pesan') }}
                                    </div>
                                @endif

                                @if ($proposal->isEmpty())
                                    <h4>Anda Belum Membuat Jadwal</h4>
                                @else
                                    <table class="table table-light">
                                        <thead class="thead-light">
                                            <tr>
                                                <th>No</th>
                                                <th>Nama Dosen</th>
                                                <th>Status Reviewer</th>
                                                <th>Jadwal </th>
                                                <th>Aksi</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            @foreach ($proposal as $row)
                                                <tr>
                                                    <td>{{ $loop->iteration }}</td>
                                                    <td>{{ $row->nama }}</td>
                                                    <td>
                                                        @if ($row->stat_reviewer =='off')
                                                        Bukan Reviewer
                                                        @else
                                                        Reviewer
                                                        @endif
                                                    </td>
                                                    <td>
                                                        @if (isset($row->jadwal_id))
                                                        {{ $row->jadwal->namajadwal }}
                                                        @else
                                                        Belum ada Jadwal
                                                        @endif
                                                        
                                                    <td>
                                                        {{-- <a href="{{ url('admin/anggota/detail/'.$row->id, []) }}" class="btn btn-sm btn-primary"><i class="mdi mdi-eye"></i></a> --}}
                                                        <a href="{{ url('admin/terapjadwal/tambah/' . $row->id, []) }}"
                                                            class="btn btn-sm btn-primary">Tambah Jadwal</a>
                                                        {{-- <a href="{{ url('dosen/hapus-proposal/' . $row->id, []) }}"
                                                            class="btn btn-sm btn-primary"
                                                            onclick="return confirm('Anda yakin?')"><i
                                                                class="mdi mdi-delete"></i></a> --}}
                                                    </td>
                                                </tr>
                                            @endforeach
                                        </tbody>
                                    </table>
                                @endif
                            </div>
                        </div>
                    </div>

                    {{-- @else

      @endif --}}
                </div>
            </div>
        </div>
    </div>


@endsection
