@extends('layouts.layout')

@section('content')
        <div class="col-md-12">
            <div class="card">
                <div class="header">
                    <h4 class="title">{{$title}}</h4>
                    <p class="category"></p>
                </div>
                <div class="content table-responsive table-full-width">
                    <table class="table table-striped">
                        <thead>
                            <th>NIP</th>
                            <th>Nama pegawai</th>
                            <th>Tahun masuk</th>
                            <th>Jabatan</th>
                            <th>Aksi</th>
                            <th><a href="{{route('pegawai.create')}}" class="btn btn-default"><span class="ti-plus"></span> Tambah pegawai</a></th>
                        </thead>
                        <tbody>
                            @foreach($pegawai as $mhs)
                            <form action="{{route('pegawai.destroy',$mhs->id)}}" method="post"  class="form-inline">
                            <tr>
                                <td>{{$mhs->nip}}</td>
                                <td>{{$mhs->nama_pegawai}}</td>
                                <td>{{$mhs->tahun_masuk}}</td>
                                <td>{{$mhs->jabatan}}</td>
                                <td colspan="2">
                                    <a href="{{route('pegawai.edit',$mhs->id)}}" class="btn btn-info"><i class="ti-pencil-alt"></i></a>
                                    {{ csrf_field() }}
                                    <input type="hidden" name="_method" value="delete" >
                                    <button type="submit" class="btn btn-danger"><i class="ti-close"></i></a>
                                </td>
                            </tr>
                            </form>
                            @endforeach
                        </tbody>
                    </table>
                    {{$pegawai->links()}}
                </div>
            </div>
        </div>
@endsection