You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
4.0 KiB
PHTML

6 years ago
@extends('layouts.app')
@section('site-name','Sistem Informasi SPP')
@section('page-name','Periode')
@section('content')
<div class="page-header">
<h1 class="page-title">
@yield('page-name')
</h1>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-header">
<h3 class="card-title">@yield('page-name')</h3>
<a href="{{ route('periode.create') }}" class="btn btn-outline-primary btn-sm ml-5">Tambah Periode</a>
</div>
6 years ago
@if(session()->has('msg'))
<div class="alert alert-{{ session()->get('type') }}" id="message" style="border-radius: 0px !important">
{{ session()->get('msg') }}
</div>
@endif
6 years ago
<div class="table-responsive">
6 years ago
6 years ago
<table class="table card-table table-vcenter text-nowrap">
<thead>
<tr>
<th class="w-1">No.</th>
<th>Nama</th>
<th>Tanggal Mulai</th>
<th>Tanggal Selesai</th>
<th>Aktif</th>
<th></th>
</tr>
</thead>
<tbody>
6 years ago
@foreach ($periode as $index => $item)
6 years ago
<tr>
6 years ago
<td><span class="text-muted">{{ $index+1 }}</span></td>
6 years ago
<td>{{ $item->nama }}</td>
<td>
{{ $item->tgl_mulai }}
</td>
<td>
{{ $item->tgl_selesai }}
</td>
<td>
{{ $item->is_active }}
</td>
<td>
<a class="icon" href="javascript:void(0)" title="edit item">
<i class="fe fe-edit"></i>
</a>
6 years ago
<a class="icon btn-delete" href="#!" data-id="{{ $item->id }}" title="delete item">
6 years ago
<i class="fe fe-trash"></i>
</a>
6 years ago
<form action="{{ route('periode.destroy', $item->id) }}" method="POST" id="form-{{ $item->id }}">
@csrf
</form>
6 years ago
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="card-footer">
<div class="d-flex">
<div class="ml-auto mb-0">
{{ $periode->links() }}
</div>
</div>
</div>
</div>
</div>
</div>
6 years ago
@endsection
@section('js')
<script>
require(['jquery', 'sweetalert'], function ($, sweetalert) {
$(document).ready(function () {
$(document).on('click','.btn-delete', function(){
formid = $(this).attr('data-id');
swal({
title: 'Anda yakin ingin menghapus?',
text: 'periode yang dihapus tidak dapat dikembalikan',
dangerMode: true,
buttons: {
cancel: true,
confirm: true,
},
}).then((result) => {
if (result) {
$('#form-' + formid).submit();
}
})
})
});
});
</script>
6 years ago
@endsection