MIF_E31212289/resources/views/data_peternakan/index.blade.php

64 lines
2.6 KiB
PHP

@extends('layouts.app')
@section('title', 'Data Peternakan')
@section('main')
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>Data Peternakan</h1>
</div>
<div class="section-body">
<div class="card p-3 col-lg-12 col-md-6 col-sm-6">
<div class="row mb-3">
<div class="col-12 mb-10">
<a href="{{ route('data_peternakan.create') }}" class="btn btn-primary">+ Tambah Peternakan</a>
</div>
</div>
@if(session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<table id="peternakan" class="table mt-2 table-striped">
<thead>
<th>#</th>
<th>Nama Peternakan</th>
<th>Alamat</th>
<th>No. Telepon</th>
<th>User</th>
<th>Action</th>
</thead>
<tbody>
@forelse ($data as $datapeternakan)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $datapeternakan->nama_peternakan }}</td>
<td>{{ $datapeternakan->alamat }}</td>
<td>{{ $datapeternakan->no_telp }}</td>
<td>{{ $datapeternakan->user->nama }}</td>
<td>
<a href="{{ route('data_peternakan.edit', $datapeternakan->id) }}" class="btn btn-warning">Edit</a>
<form action="{{ route('data_peternakan.destroy', $datapeternakan->id) }}" method="POST" class="d-inline">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger" onclick="return confirm('Are you sure you want to delete this data peternakan?')">Delete</button>
</form>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</section>
</div>
<script>
let table = new DataTable('#peternakan');
</script>
@endsection