@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 Judul Penelitian</h4>
                                        {{-- <button type="button" class="btn btn-sm btn-primary btn-rounded btn-fw">Tambah</button> --}}
                                        {{-- <p class="card-subtitle card-subtitle-dash">Lorem ipsum dolor sit amet consectetur adipisicing elit
                  </p> --}}
                                    </div>
                                </div>
                                <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
                                <table class="table table-light">
                                    <thead class="thead-light">
                                        <tr>
                                            <th width="1%">No</th>
                                            <th width="10%">Nama Dosen</th>
                                            <th>Judul Penelitian</th>
                                            <th width="8%">File</th>
                                            <th width="8%">Status</th>
                                            <th width="8%">Aksi</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        @foreach ($objek as $row)
                                            <tr>
                                                <td>{{ $loop->iteration }}</td>
                                                <td>{{ $row->dosen->nama }}</td>
                                                <td>{{ $row->judul }}</td>
                                                <td> <a href="{{ \Storage::url($row->file) }}">Download File</a></td>
                                                <td>
                                                    @if ($row->statusjudul_id == '1')
                                                    <label class="badge badge-warning">{{ $row->statusjudul->status }}</label></td>
                                                    @elseif ($row->statusjudul_id == '2') 
                                                    <label class="badge badge-success">{{ $row->statusjudul->status }}</label>
                                                    @elseif ($row->statusjudul_id == '3') 
                                                    <label class="badge badge-warning">{{ $row->statusjudul->status }}</label>
                                                    @elseif ($row->statusjudul_id == '4') 
                                                    <label class="badge badge-primary">{{ $row->statusjudul->status }}</label>
                                                    @elseif ($row->statusjudul_id == '5') 
                                                    <label class="badge badge-danger">{{ $row->statusjudul->status }}</label>
                                                    @endif
                                                </td>
                                                <td>
                                                    <a href="{{ url('admin/judulpenelitian/detail/'.$row->id, []) }}"
                                                        class="btn btn-primary btn-sm">detail</a>

                                                </td>
                                            </tr>
                                        @endforeach
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
