ringkasan dan summary petani
Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -2,6 +2,32 @@
|
||||
|
||||
@section('content')
|
||||
<div class="container-xxl flex-grow-1 container-p-y">
|
||||
@if($ringkasan->isNotEmpty())
|
||||
<div class="row g-6 mb-6">
|
||||
@foreach($ringkasan as $r)
|
||||
<div class="col-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="d-flex align-items-start justify-content-between">
|
||||
<div class="content-left">
|
||||
<span class="text-heading">{{ $r->heading }}</span>
|
||||
<div class="d-flex align-items-center my-1">
|
||||
<h4 class="mb-0 me-2">{{ $r->nilai }}</h4>
|
||||
</div>
|
||||
<small class="mb-0">{{ $r->subheading }}</small>
|
||||
</div>
|
||||
<div class="avatar">
|
||||
<span class="avatar-initial rounded bg-label-primary">
|
||||
<i class="icon-base ti tabler-gauge icon-26px"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
<div class="card">
|
||||
<div class="card-header border-bottom">
|
||||
<h5 class="card-title mb-0">Data {{ $tabel->label }}</h5>
|
||||
@@ -40,7 +66,8 @@
|
||||
<input type="text" name="search" class="form-control" placeholder="Cari Nama Tabel..." value="{{ request('search') }}">
|
||||
<button type="submit" class="btn btn-outline-primary"><i class="ti tabler-search"></i></button>
|
||||
</div>
|
||||
<a href="{{ route('tabel.data.create', [$tabel->id, 'program_id' => request('program')]) }}" class="btn btn-sm btn-primary add-new">
|
||||
<a href="{{ route('tabel.data.create', [$tabel->id, 'program_id' => request('program_id')]) }}" class="btn btn-sm btn-primary add-new"
|
||||
style="display: {{ request('program_id') ? 'flex' : 'none' }};">
|
||||
<i class="ti tabler-plus me-1"></i> Tambah
|
||||
</a>
|
||||
</div>
|
||||
@@ -52,6 +79,7 @@
|
||||
<thead class="border-top">
|
||||
<tr>
|
||||
<th>No</th>
|
||||
<th>Nama Program</th>
|
||||
@foreach($kolom as $k)
|
||||
<th>{{ $k->label }}</th>
|
||||
@endforeach
|
||||
@@ -62,14 +90,15 @@
|
||||
@forelse($values as $v)
|
||||
<tr>
|
||||
<td>{{ $loop->iteration }}</td>
|
||||
<td>{{ $v->program_nama ?? 'N/A' }}</td>
|
||||
@foreach($kolom as $k)
|
||||
<td>{{ $v->{$k->kolom} }}</td>
|
||||
@endforeach
|
||||
<td>
|
||||
<div class="d-flex align-items-center">
|
||||
<a href="{{ route('tabel.data.edit', [$tabel->id, $v->value_id, 'program_id' => $k->program_id]) }}" class="btn btn-icon btn-text-secondary rounded-pill edit-record"><i class="ti tabler-edit ti-md"></i></a>
|
||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill delete-record" data-id="{{ $v->value_id }}" data-program-id="{{ $k->program_id }}"><i class="ti tabler-trash ti-md"></i></a>
|
||||
<a href="{{ route('tabel.data.show', [$tabel->id, $v->value_id, 'program_id' => $k->program_id]) }}" class="btn btn-icon btn-text-secondary rounded-pill view-record"><i class="ti tabler-eye ti-md"></i></a>
|
||||
<a href="{{ route('tabel.data.edit', [$tabel->id, $v->value_id, 'program_id' => $v->program_id]) }}" class="btn btn-icon btn-text-secondary rounded-pill edit-record"><i class="ti tabler-edit ti-md"></i></a>
|
||||
<a href="javascript:;" class="btn btn-icon btn-text-secondary rounded-pill delete-record" data-id="{{ $v->value_id }}" data-program-id="{{ $v->program_id }}"><i class="ti tabler-trash ti-md"></i></a>
|
||||
<a href="{{ route('tabel.data.show', [$tabel->id, $v->value_id, 'program_id' => $v->program_id]) }}" class="btn btn-icon btn-text-secondary rounded-pill view-record"><i class="ti tabler-eye ti-md"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -98,6 +127,7 @@
|
||||
e.preventDefault();
|
||||
const id = $(this).data('id');
|
||||
const programId = $(this).data('program-id');
|
||||
|
||||
|
||||
Swal.fire({
|
||||
title: 'Hapus?',
|
||||
@@ -108,9 +138,19 @@
|
||||
customClass: { confirmButton: 'btn btn-danger me-3', cancelButton: 'btn btn-label-secondary' },
|
||||
buttonsStyling: false
|
||||
}).then(function (result) {
|
||||
console.log(id);
|
||||
console.log(programId);
|
||||
var baseUrl = "{{ route('tabel.data.destroy', [$tabel->id, ':id']) }}"
|
||||
.replace(':id', id)
|
||||
var params = new URLSearchParams({
|
||||
program_id: programId
|
||||
});
|
||||
|
||||
var url = baseUrl + '?' + params.toString();
|
||||
console.log(url);
|
||||
if (result.value) {
|
||||
$.ajax({
|
||||
url: "{{ route('tabel.data.destroy', [$tabel->id, ':id', 'program_id' => ':programId']) }}".replace(':id', id).replace(':programId', programId),
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: {
|
||||
_token: '{{ csrf_token() }}',
|
||||
|
||||
Reference in New Issue
Block a user