@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">
                    <div class="col-12 grid-margin stretch-card">
                        <div class="card card-rounded">
                            <div class="card-body">
                                <div class="d-sm-flex justify-content-between align-items-start">
                                    <div>
                                        <h4 class="card-title card-title-dash">Data Akun Dosen</h4>
                                       
                                        {{-- <p class="card-subtitle card-subtitle-dash">Lorem ipsum dolor sit amet consectetur adipisicing elit
                  </p> --}}
                                    </div>
                                </div>
                                <br>
                                <div class="d-sm-flex align-items-center mt-1 justify-content-between">
                                    <a href="{{ url('admin/akun/dosen/tambah') }}" class="btn btn-sm btn-primary btn-rounded btn-fw">Tambah Dosen</a>
                                </div>
                                <br>
                                @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
                                <table class="table table-light">
                                    <thead class="thead-light">
                                        <tr>
                                            <th>No</th>
                                            <th>Nama Dosen</th>
                                            <th>NIP</th>
                                            <th>NIDN</th>
                                            <th>Email</th>
                                            <th>Aksi</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach ($objek as $row)
                                            <tr>
                                                <td>{{ $loop->iteration }}</td>
                                                <td>{{ $row->gelar_depan }} {{ $row->nama }} {{ $row->gelar_belakang }}</td>
                                                <td>
                                                    @if (empty($row->nip))
                                                        Tidak Ada
                                                    @else
                                                    {{ $row->nip }}
                                                    @endif
                                                </td>
                                                <td>
                                                    @if (empty($row->nidn))
                                                        TIdak Ada
                                                    @else
                                                    {{ $row->nidn }}
                                                    @endif
                                                </td>
                                                <td>{{ $row->email }}</td>
                                                {{-- <td>
                                                    @if (empty($row->reviewer_id))
                                                        Bukan Reviewer
                                                    @else
                                                        Reviewer
                                                    @endif
                                                </td> --}}
                                                <td>
                                                    {{-- <a href="#" class="btn btn-primary btn-sm">Detail</a> --}}
                                                    <a href="{{ url('admin/akun/dosen/edit/' . $row->id, []) }}" class="btn btn-primary btn-sm">Edit</a>
                                                    <a href="{{ url('admin/akun/dosen/hapus/' . $row->id, []) }}" class="btn btn-primary btn-sm"
                                                        onclick="return confirm('Anda yakin?')">Hapus</a>
                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                                <br>
                                {{ $objek->links() }}
                            </div>
                            
                        </div>
                    </div>
                </div>
            </div>


        </div>
    </div>
    </div>
    </div>
@endsection
