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

82 lines
3.7 KiB
PHP

@extends('layouts.app')
@section('title', 'Jadwal Panen')
@section('main')
<div class="main-content">
<section class="section">
<div class="section-header">
<h1>Jadwal Panen</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">
<a href="{{ route('jadwalpanen.create') }}" class="btn btn-primary">Tambah Jadwal Panen</a>
</div>
</div>
<div class="row">
<div class="col-11">
<h5 class="text-primary mt-1">Tabel Jadwal Panen</h5>
</div>
</div>
@if(session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<table class="table mt-2 table-striped" id="jadwalpanen">
<thead>
<th>#</th>
<th>Peternakan / Kandang / Bibit</th>
<th>Jadwal Panen</th>
<th>Sopir</th>
<th>Aksi</th>
</thead>
<tbody>
@forelse ($data as $hasilPanen)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $hasilPanen->kandang->peternakan->nama_peternakan }}<br>
{{ $hasilPanen->kandang->nama_kandang }} -
Kapasitas {{ number_format($hasilPanen->kandang->kapasitas )}} Ekor<br>
<br>
<b>Bibit</b><br>
Tanggal Masuk : {{ date("d-m-Y",strtotime($hasilPanen->bibit->tanggal)) }}<br>
Jumlah Bibit Awal : {{ number_format($hasilPanen->bibit->jumlah_bibit)}} Ekor
</td>
<td>Tanggal : {{ date("d-m-Y",strtotime($hasilPanen->tanggal))}}<br>
Jumlah Ayam : {{number_format( $hasilPanen->jumlah_ayam )}} Ekor <br>
Tonase : {{ $hasilPanen->bobot_ayam }}
</td>
<td>Sopir : {{ $hasilPanen->sopir->nama_sopir }}<br>
Nopol : {{ $hasilPanen->sopir->nopol }}<br>
Telepon : {{ $hasilPanen->sopir->no_telp }}
</td>
<td>
<a href="{{ route('jadwalpanen.edit', $hasilPanen->id) }}" class="btn btn-warning">Edit</a>
<form action="{{ route('jadwalpanen.destroy', $hasilPanen->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?')">Delete</button>
</form>
</td>
</tr>
@empty
@endforelse
</tbody>
</table>
</div>
</div>
</section>
</div>
<script>
let table = new DataTable('#jadwalpanen');
</script>
@endsection