search and pagination 2
This commit is contained in:
parent
4767cae919
commit
060b916e40
|
|
@ -11,11 +11,18 @@ class AduanController extends Controller
|
||||||
/**
|
/**
|
||||||
* Tampilkan semua aduan
|
* Tampilkan semua aduan
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
|
$search = $request->search;
|
||||||
|
|
||||||
$aduan = AduanTps::with('lokasiTps')
|
$aduan = AduanTps::with('lokasiTps')
|
||||||
|
->when($search, function ($query) use ($search) {
|
||||||
|
$query->whereHas('lokasiTps', function ($q) use ($search) {
|
||||||
|
$q->where('nama_tps', 'like', '%' . $search . '%');
|
||||||
|
});
|
||||||
|
})
|
||||||
->orderBy('tanggal_aduan', 'desc')
|
->orderBy('tanggal_aduan', 'desc')
|
||||||
->get();
|
->paginate(10);
|
||||||
|
|
||||||
return view('admin.aduan.index', compact('aduan'));
|
return view('admin.aduan.index', compact('aduan'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,16 @@
|
||||||
class InformasiController extends Controller
|
class InformasiController extends Controller
|
||||||
{
|
{
|
||||||
// Menampilkan semua informasi
|
// Menampilkan semua informasi
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$informasi = Informasi::orderBy('tanggal_informasi', 'desc')->get();
|
$search = $request->search;
|
||||||
|
|
||||||
|
$informasi = Informasi::when($search, function ($query) use ($search) {
|
||||||
|
$query->where('judul', 'like', '%' . $search . '%');
|
||||||
|
})
|
||||||
|
->orderBy('tanggal_informasi', 'desc')
|
||||||
|
->paginate(10);
|
||||||
|
|
||||||
return view('admin.informasi.index', compact('informasi'));
|
return view('admin.informasi.index', compact('informasi'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -53,7 +60,7 @@ public function store(Request $request)
|
||||||
Informasi::create($data);
|
Informasi::create($data);
|
||||||
|
|
||||||
return redirect()->route('admin.informasi.index')
|
return redirect()->route('admin.informasi.index')
|
||||||
->with('success','Informasi berhasil ditambahkan.');
|
->with('success', 'Informasi berhasil ditambahkan.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Form edit informasi
|
// Form edit informasi
|
||||||
|
|
@ -94,13 +101,13 @@ public function update(Request $request, $id_informasi)
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['gambar_informasi'] = $request->file('gambar_informasi')
|
$data['gambar_informasi'] = $request->file('gambar_informasi')
|
||||||
->store('informasi','public');
|
->store('informasi', 'public');
|
||||||
}
|
}
|
||||||
|
|
||||||
$informasi->update($data);
|
$informasi->update($data);
|
||||||
|
|
||||||
return redirect()->route('admin.informasi.index')
|
return redirect()->route('admin.informasi.index')
|
||||||
->with('success','Informasi berhasil diperbarui.');
|
->with('success', 'Informasi berhasil diperbarui.');
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hapus informasi
|
// Hapus informasi
|
||||||
|
|
@ -115,6 +122,6 @@ public function destroy($id_informasi)
|
||||||
$informasi->delete();
|
$informasi->delete();
|
||||||
|
|
||||||
return redirect()->route('admin.informasi.index')
|
return redirect()->route('admin.informasi.index')
|
||||||
->with('success','Informasi berhasil dihapus.');
|
->with('success', 'Informasi berhasil dihapus.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,17 @@
|
||||||
|
|
||||||
class KategoriTpsController extends Controller
|
class KategoriTpsController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$title = 'Kategori TPS';
|
$title = 'Kategori TPS';
|
||||||
$kategori = KategoriTps::all();
|
$search = $request->search;
|
||||||
|
|
||||||
|
$kategori = KategoriTps::when($search, function ($query) use ($search) {
|
||||||
|
$query->where('nama_kategori', 'like', '%' . $search . '%');
|
||||||
|
})
|
||||||
|
->orderBy('id_kategori_tps', 'desc')
|
||||||
|
->paginate(10);
|
||||||
|
|
||||||
return view('admin.kategori-tps.index', compact('title', 'kategori'));
|
return view('admin.kategori-tps.index', compact('title', 'kategori'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,8 +52,8 @@ public function store(Request $request)
|
||||||
if ($request->hasFile('foto_kategori')) {
|
if ($request->hasFile('foto_kategori')) {
|
||||||
$file = $request->file('foto_kategori');
|
$file = $request->file('foto_kategori');
|
||||||
$filename = strtolower(str_replace(' ', '_', $request->nama_kategori))
|
$filename = strtolower(str_replace(' ', '_', $request->nama_kategori))
|
||||||
. '_' . time()
|
. '_' . time()
|
||||||
. '.' . $file->getClientOriginalExtension();
|
. '.' . $file->getClientOriginalExtension();
|
||||||
$file->move(public_path('assets/admin/images/kategori-tps'), $filename);
|
$file->move(public_path('assets/admin/images/kategori-tps'), $filename);
|
||||||
$data['foto_kategori'] = $filename;
|
$data['foto_kategori'] = $filename;
|
||||||
}
|
}
|
||||||
|
|
@ -94,8 +101,8 @@ public function update(Request $request, $id)
|
||||||
|
|
||||||
$file = $request->file('foto_kategori');
|
$file = $request->file('foto_kategori');
|
||||||
$filename = strtolower(str_replace(' ', '_', $request->nama_kategori))
|
$filename = strtolower(str_replace(' ', '_', $request->nama_kategori))
|
||||||
. '_' . time()
|
. '_' . time()
|
||||||
. '.' . $file->getClientOriginalExtension();
|
. '.' . $file->getClientOriginalExtension();
|
||||||
$file->move(public_path('assets/admin/images/kategori-tps'), $filename);
|
$file->move(public_path('assets/admin/images/kategori-tps'), $filename);
|
||||||
$data['foto_kategori'] = $filename;
|
$data['foto_kategori'] = $filename;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,19 +8,36 @@
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Validator;
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class SampahController extends Controller
|
class SampahController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
|
Carbon::setLocale('id');
|
||||||
|
|
||||||
$title = 'Data Sampah';
|
$title = 'Data Sampah';
|
||||||
|
|
||||||
$sampah = Sampah::with('user')
|
$tahun = $request->tahun;
|
||||||
->orderBy('tahun', 'desc')
|
|
||||||
|
$query = Sampah::with('user');
|
||||||
|
|
||||||
|
// Filter tahun jika dipilih
|
||||||
|
if ($tahun) {
|
||||||
|
$query->where('tahun', $tahun);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sampah = $query->orderBy('tahun', 'desc')
|
||||||
->orderBy('bulan', 'desc')
|
->orderBy('bulan', 'desc')
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
return view('admin.sampah.index', compact('title', 'sampah'));
|
// ambil daftar tahun untuk dropdown filter
|
||||||
|
$listTahun = Sampah::select('tahun')
|
||||||
|
->distinct()
|
||||||
|
->orderBy('tahun', 'desc')
|
||||||
|
->pluck('tahun');
|
||||||
|
|
||||||
|
return view('admin.sampah.index', compact('title', 'sampah', 'listTahun'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
|
|
|
||||||
|
|
@ -27779,9 +27779,11 @@ .navbar .navbar-brand-wrapper .brand-logo-mini {
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .navbar-brand-wrapper .brand-logo-mini img {
|
.navbar .navbar-brand-wrapper .brand-logo-mini img {
|
||||||
width: calc(70px - 30px);
|
width: 30px;
|
||||||
|
height: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.navbar .navbar-menu-wrapper {
|
.navbar .navbar-menu-wrapper {
|
||||||
|
|
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 951 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 1.8 MiB |
|
|
@ -3,128 +3,139 @@
|
||||||
@section('title', 'Data Aduan TPS')
|
@section('title', 'Data Aduan TPS')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12 grid-margin stretch-card">
|
<div class="col-lg-12 grid-margin stretch-card">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<div class="mb-3 d-flex justify-content-between align-items-center">
|
<div class="mb-3 d-flex justify-content-between align-items-center">
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mb-0 card-title">Data Aduan TPS</h4>
|
<h4 class="mb-0 card-title">Data Aduan TPS</h4>
|
||||||
<p class="mb-0 card-description">
|
<p class="mb-0 card-description">
|
||||||
Daftar aduan masyarakat terhadap TPS
|
Daftar aduan masyarakat terhadap TPS
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3 d-flex align-items-center">
|
||||||
|
|
||||||
|
<!-- SEARCH -->
|
||||||
|
<form action="{{ route('admin.aduan.index') }}" method="GET"
|
||||||
|
style="width:300px; margin-right:20px;">
|
||||||
|
<input type="text" name="search" value="{{ request('search') }}"
|
||||||
|
class="form-control" placeholder="Cari Aduan...">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Tabel -->
|
<!-- Tabel -->
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<th>TPS</th>
|
|
||||||
<th>Nama Pelapor</th>
|
|
||||||
<th>Tanggal Aduan</th>
|
|
||||||
<th>Status</th>
|
|
||||||
<th class="text-center">Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@forelse ($aduan as $item)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<th>TPS</th>
|
||||||
<strong>
|
<th>Nama Pelapor</th>
|
||||||
{{ $item->lokasiTps->nama_tps ?? '-' }}
|
<th>Tanggal Aduan</th>
|
||||||
</strong>
|
<th>Status</th>
|
||||||
<br>
|
<th class="text-center">Aksi</th>
|
||||||
<small class="text-muted">
|
</tr>
|
||||||
{{ $item->lokasiTps->alamat_tps ?? '' }}
|
</thead>
|
||||||
</small>
|
<tbody>
|
||||||
</td>
|
@forelse ($aduan as $item)
|
||||||
<td>{{ $item->nama_pelapor }}</td>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{{ \Carbon\Carbon::parse($item->tanggal_aduan)->format('d M Y') }}
|
<strong>
|
||||||
</td>
|
{{ $item->lokasiTps->nama_tps ?? '-' }}
|
||||||
<td>
|
</strong>
|
||||||
@if ($item->tanggapan_admin)
|
<br>
|
||||||
<span class="badge badge-success">Ditanggapi</span>
|
<small class="text-muted">
|
||||||
@else
|
{{ $item->lokasiTps->alamat_tps ?? '' }}
|
||||||
<span class="badge badge-danger">Belum</span>
|
</small>
|
||||||
@endif
|
</td>
|
||||||
</td>
|
<td>{{ $item->nama_pelapor }}</td>
|
||||||
<td class="text-center">
|
<td>
|
||||||
<a href="{{ route('admin.aduan.show', $item->id_aduan) }}"
|
{{ \Carbon\Carbon::parse($item->tanggal_aduan)->format('d M Y') }}
|
||||||
class="btn btn-warning btn-sm"
|
</td>
|
||||||
title="Tanggapi Aduan">
|
<td>
|
||||||
<i class="bi bi-pencil-square"></i>
|
@if ($item->tanggapan_admin)
|
||||||
</a>
|
<span class="badge badge-success">Ditanggapi</span>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-danger">Belum</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="{{ route('admin.aduan.show', $item->id_aduan) }}"
|
||||||
|
class="btn btn-warning btn-sm" title="Tanggapi Aduan">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
<form action="{{ route('admin.aduan.destroy', $item->id_aduan) }}"
|
<form action="{{ route('admin.aduan.destroy', $item->id_aduan) }}"
|
||||||
method="POST"
|
method="POST" class="d-inline form-hapus">
|
||||||
class="d-inline form-hapus">
|
@csrf
|
||||||
@csrf
|
@method('DELETE')
|
||||||
@method('DELETE')
|
<button type="submit" class="btn btn-danger btn-sm"
|
||||||
<button type="submit"
|
|
||||||
class="btn btn-danger btn-sm"
|
|
||||||
title="Hapus Aduan">
|
title="Hapus Aduan">
|
||||||
<i class="bi bi-trash"></i>
|
<i class="bi bi-trash"></i>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@empty
|
@empty
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6" class="text-center text-muted">
|
<td colspan="6" class="text-center text-muted">
|
||||||
Data aduan belum tersedia
|
Data aduan belum tersedia
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- PAGINATION -->
|
||||||
|
<div class="mt-3">
|
||||||
|
{{ $aduan->appends(request()->query())->links() }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- SweetAlert Hapus --}}
|
{{-- SweetAlert Hapus --}}
|
||||||
<script>
|
<script>
|
||||||
document.querySelectorAll('.form-hapus').forEach(form => {
|
document.querySelectorAll('.form-hapus').forEach(form => {
|
||||||
form.addEventListener('submit', function (e) {
|
form.addEventListener('submit', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Hapus Aduan?',
|
title: 'Hapus Aduan?',
|
||||||
text: 'Data yang dihapus tidak dapat dikembalikan!',
|
text: 'Data yang dihapus tidak dapat dikembalikan!',
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: '#d33',
|
confirmButtonColor: '#d33',
|
||||||
cancelButtonColor: '#6c757d',
|
cancelButtonColor: '#6c757d',
|
||||||
confirmButtonText: 'Ya, Hapus',
|
confirmButtonText: 'Ya, Hapus',
|
||||||
cancelButtonText: 'Batal'
|
cancelButtonText: 'Batal'
|
||||||
}).then((result) => {
|
}).then((result) => {
|
||||||
if (result.isConfirmed) {
|
if (result.isConfirmed) {
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
</script>
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
{{-- SweetAlert Success --}}
|
{{-- SweetAlert Success --}}
|
||||||
@if (session('success'))
|
@if (session('success'))
|
||||||
<script>
|
<script>
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: 'Berhasil',
|
title: 'Berhasil',
|
||||||
text: '{{ session('success') }}',
|
text: '{{ session('success') }}',
|
||||||
timer: 2000,
|
timer: 2000,
|
||||||
showConfirmButton: false
|
showConfirmButton: false
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
||||||
|
|
@ -29,10 +29,21 @@
|
||||||
Daftar semua berita dan pengumuman
|
Daftar semua berita dan pengumuman
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="mb-3 d-flex align-items-center">
|
||||||
|
|
||||||
<a href="{{ route('admin.informasi.create') }}" class="btn btn-primary">
|
<!-- SEARCH -->
|
||||||
<i class="bi bi-plus-lg"></i> Tambah
|
<form action="{{ route('admin.informasi.index') }}" method="GET"
|
||||||
</a>
|
style="width:300px; margin-right:20px;">
|
||||||
|
<input type="text" name="search" value="{{ request('search') }}"
|
||||||
|
class="form-control" placeholder="Cari judul informasi...">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- BUTTON TAMBAH -->
|
||||||
|
<a href="{{ route('admin.informasi.create') }}" class="btn btn-primary">
|
||||||
|
<i class="bi bi-plus-lg"></i> Tambah
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|
@ -102,6 +113,10 @@ class="btn btn-warning btn-sm me-1" title="Edit">
|
||||||
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- PAGINATION -->
|
||||||
|
<div class="mt-3">
|
||||||
|
{{ $informasi->appends(request()->query())->links() }}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -3,124 +3,141 @@
|
||||||
@section('title', 'Data Kategori TPS')
|
@section('title', 'Data Kategori TPS')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<style>
|
<style>
|
||||||
.deskripsi-truncate-div {
|
.deskripsi-truncate-div {
|
||||||
max-width: 300px; /* lebar kolom deskripsi */
|
max-width: 300px;
|
||||||
white-space: normal !important; /* override Bootstrap */
|
/* lebar kolom deskripsi */
|
||||||
word-wrap: break-word !important;
|
white-space: normal !important;
|
||||||
overflow-wrap: break-word !important;
|
/* override Bootstrap */
|
||||||
}
|
word-wrap: break-word !important;
|
||||||
.table td {
|
overflow-wrap: break-word !important;
|
||||||
vertical-align: top; /* supaya teks membungkus ke bawah */
|
}
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<div class="content-wrapper">
|
.table td {
|
||||||
<div class="row">
|
vertical-align: top;
|
||||||
<div class="col-lg-12 grid-margin stretch-card">
|
/* supaya teks membungkus ke bawah */
|
||||||
<div class="card">
|
}
|
||||||
<div class="card-body">
|
</style>
|
||||||
<div class="mb-3 d-flex justify-content-between">
|
|
||||||
<div>
|
<div class="content-wrapper">
|
||||||
<h4 class="mb-0 card-title">Data Kategori TPS</h4>
|
<div class="row">
|
||||||
<p class="mb-0 card-description">
|
<div class="col-lg-12 grid-margin stretch-card">
|
||||||
Daftar Kategori Tempat Pembuangan Sampah (TPS)
|
<div class="card">
|
||||||
</p>
|
<div class="card-body">
|
||||||
|
<div class="mb-3 d-flex justify-content-between">
|
||||||
|
<div>
|
||||||
|
<h4 class="mb-0 card-title">Data Kategori TPS</h4>
|
||||||
|
<p class="mb-0 card-description">
|
||||||
|
Daftar Kategori Tempat Pembuangan Sampah (TPS)
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="mb-3 d-flex align-items-center">
|
||||||
|
|
||||||
|
<!-- SEARCH -->
|
||||||
|
<form action="{{ route('admin.informasi.index') }}" method="GET"
|
||||||
|
style="width:300px; margin-right:20px;">
|
||||||
|
<input type="text" name="search" value="{{ request('search') }}"
|
||||||
|
class="form-control" placeholder="Cari kategori TPS...">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<!-- BUTTON TAMBAH -->
|
||||||
|
<a href="{{ route('admin.informasi.create') }}" class="btn btn-primary">
|
||||||
|
<i class="bi bi-plus-lg"></i> Tambah
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<a href="{{ route('admin.kategori.create') }}" class="btn btn-primary">
|
|
||||||
<i class="bi bi-plus-lg"></i> Tambah
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
|
||||||
<th>Nama Kategori</th>
|
|
||||||
<th>Foto</th>
|
|
||||||
<th>Deskripsi</th>
|
|
||||||
<th>Aksi</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($kategori as $item)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $item->nama_kategori }}</td>
|
<th>Nama Kategori</th>
|
||||||
<td>
|
<th>Foto</th>
|
||||||
@if ($item->foto_kategori)
|
<th>Deskripsi</th>
|
||||||
<img src="{{ asset('assets/admin/images/kategori-tps/' . $item->foto_kategori) }}"
|
<th>Aksi</th>
|
||||||
alt="Foto Kategori"
|
|
||||||
style="width:200px; height:auto; border-radius:2px;">
|
|
||||||
@else
|
|
||||||
<span class="text-muted">-</span>
|
|
||||||
@endif
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<div class="text-justify deskripsi-truncate-div">
|
|
||||||
{{ $item->deskripsi ?? '-' }}
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td class="text-center">
|
|
||||||
<a href="{{ route('admin.kategori.edit', $item->id_kategori_tps) }}"
|
|
||||||
class="btn btn-warning btn-sm me-1" title="Edit">
|
|
||||||
<i class="bi bi-pencil-square"></i>
|
|
||||||
</a>
|
|
||||||
<form action="{{ route('admin.kategori.destroy', $item->id_kategori_tps) }}"
|
|
||||||
method="POST" class="form-hapus" style="display:inline;">
|
|
||||||
@csrf
|
|
||||||
@method('DELETE')
|
|
||||||
<button type="submit" class="btn btn-danger btn-sm">
|
|
||||||
<i class="bi bi-trash"></i>
|
|
||||||
</button>
|
|
||||||
</form>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
@foreach ($kategori as $item)
|
||||||
</div>
|
<tr>
|
||||||
|
<td>{{ $item->nama_kategori }}</td>
|
||||||
|
<td>
|
||||||
|
@if ($item->foto_kategori)
|
||||||
|
<img src="{{ asset('assets/admin/images/kategori-tps/' . $item->foto_kategori) }}"
|
||||||
|
alt="Foto Kategori"
|
||||||
|
style="width:200px; height:auto; border-radius:2px;">
|
||||||
|
@else
|
||||||
|
<span class="text-muted">-</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="text-justify deskripsi-truncate-div">
|
||||||
|
{{ $item->deskripsi ?? '-' }}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="text-center">
|
||||||
|
<a href="{{ route('admin.kategori.edit', $item->id_kategori_tps) }}"
|
||||||
|
class="btn btn-warning btn-sm me-1" title="Edit">
|
||||||
|
<i class="bi bi-pencil-square"></i>
|
||||||
|
</a>
|
||||||
|
<form action="{{ route('admin.kategori.destroy', $item->id_kategori_tps) }}"
|
||||||
|
method="POST" class="form-hapus" style="display:inline;">
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
<button type="submit" class="btn btn-danger btn-sm">
|
||||||
|
<i class="bi bi-trash"></i>
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
document.querySelectorAll('.form-hapus').forEach(form => {
|
document.querySelectorAll('.form-hapus').forEach(form => {
|
||||||
form.addEventListener('submit', function(e) {
|
form.addEventListener('submit', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
title: 'Hapus Data Kategori TPS?',
|
title: 'Hapus Data Kategori TPS?',
|
||||||
text: 'Data yang sudah dihapus tidak dapat dikembalikan!',
|
text: 'Data yang sudah dihapus tidak dapat dikembalikan!',
|
||||||
icon: 'warning',
|
icon: 'warning',
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
confirmButtonColor: '#d33',
|
confirmButtonColor: '#d33',
|
||||||
cancelButtonColor: '#6c757d',
|
cancelButtonColor: '#6c757d',
|
||||||
confirmButtonText: 'Ya, Hapus',
|
confirmButtonText: 'Ya, Hapus',
|
||||||
cancelButtonText: 'Batal',
|
cancelButtonText: 'Batal',
|
||||||
didOpen: () => {
|
didOpen: () => {
|
||||||
document.querySelector('.swal2-popup').style.fontFamily = 'Nunito, sans-serif';
|
document.querySelector('.swal2-popup').style.fontFamily =
|
||||||
}
|
'Nunito, sans-serif';
|
||||||
}).then((result) => {
|
}
|
||||||
if (result.isConfirmed) {
|
}).then((result) => {
|
||||||
form.submit();
|
if (result.isConfirmed) {
|
||||||
}
|
form.submit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
</script>
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
@if (session('success'))
|
@if (session('success'))
|
||||||
<script>
|
<script>
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: 'success',
|
icon: 'success',
|
||||||
title: 'Berhasil',
|
title: 'Berhasil',
|
||||||
text: '{{ session('success') }}',
|
text: '{{ session('success') }}',
|
||||||
timer: 2000,
|
timer: 2000,
|
||||||
showConfirmButton: false
|
showConfirmButton: false
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endif
|
@endif
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,38 @@
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<div class="mb-3 d-flex justify-content-between align-items-center">
|
<div class="mb-4 d-flex justify-content-between align-items-center">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h4 class="mb-0 card-title">Data Sampah Bulanan</h4>
|
<h4 class="mb-1 card-title">Data Sampah Bulanan</h4>
|
||||||
<p class="mb-0 card-description">
|
<p class="mb-0 text-muted">
|
||||||
Daftar data sampah per bulan
|
Daftar data sampah per bulan
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="{{ route('admin.sampah.create') }}" class="btn btn-primary">
|
<div class="mb-3 d-flex justify-content-between align-items-center">
|
||||||
<i class="bi bi-plus-lg"></i> Tambah
|
|
||||||
</a>
|
<form method="GET" action="{{ route('admin.sampah.index') }}" class="w-50">
|
||||||
|
|
||||||
|
<select name="tahun" class="form-control" onchange="this.form.submit()">
|
||||||
|
<option value="">Filter Tahun...</option>
|
||||||
|
|
||||||
|
@foreach ($listTahun as $thn)
|
||||||
|
<option value="{{ $thn }}"
|
||||||
|
{{ request('tahun') == $thn ? 'selected' : '' }}>
|
||||||
|
{{ $thn }}
|
||||||
|
</option>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<a href="{{ route('admin.sampah.create') }}" class="btn btn-primary">
|
||||||
|
<i class="bi bi-plus-lg"></i> Tambah
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<!-- inject:css -->
|
<!-- inject:css -->
|
||||||
<link rel="stylesheet" href="{{ asset('assets/admin/css/vertical-layout-light/style.css') }}">
|
<link rel="stylesheet" href="{{ asset('assets/admin/css/vertical-layout-light/style.css') }}">
|
||||||
<!-- endinject -->
|
<!-- endinject -->
|
||||||
<link rel="shortcut icon" href="{{ asset('assets/admin/images/icn.png') }}" />
|
<link rel="shortcut icon" href="{{ asset('assets/admin/images/iconsig.png') }}" />
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
|
<link href="https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap" rel="stylesheet">
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
style="height: 55px; width: auto;" class="mr-2">
|
style="height: 55px; width: auto;" class="mr-2">
|
||||||
</a>
|
</a>
|
||||||
<a class="navbar-brand brand-logo-mini" href="index.html"><img
|
<a class="navbar-brand brand-logo-mini" href="index.html"><img
|
||||||
src="{{ asset('assets/admin/images/icon-mini.png') }}" alt="logo" /></a>
|
src="{{ asset('assets/admin/images/iconsig.png') }}" alt="logo" /></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
|
<div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
|
||||||
<button class="navbar-toggler align-self-center" type="button" data-toggle="minimize">
|
<button class="navbar-toggler align-self-center" type="button" data-toggle="minimize">
|
||||||
|
|
@ -103,7 +103,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ request()->routeIs('admin.kategori.index') ? 'active' : '' }}">
|
<li class="nav-item {{ request()->routeIs('admin.kategori.index') ? 'active' : '' }}">
|
||||||
<a class="nav-link" href="{{ route('admin.kategori.index') }}">
|
<a class="nav-link" href="{{ route('admin.kategori.index') }}">
|
||||||
<i class="icon-paper menu-icon"></i>
|
<i class="icon-menu menu-icon"></i>
|
||||||
<span class="menu-title">Kategori TPS</span>
|
<span class="menu-title">Kategori TPS</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -121,7 +121,7 @@
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item {{ request()->routeIs('admin.informasi.index') ? 'active' : '' }}">
|
<li class="nav-item {{ request()->routeIs('admin.informasi.index') ? 'active' : '' }}">
|
||||||
<a class="nav-link" href="{{ route('admin.informasi.index') }}">
|
<a class="nav-link" href="{{ route('admin.informasi.index') }}">
|
||||||
<i class="icon-mail menu-icon"></i>
|
<i class="icon-paper menu-icon"></i>
|
||||||
<span class="menu-title">Kelola Informasi</span>
|
<span class="menu-title">Kelola Informasi</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -28,22 +28,22 @@
|
||||||
<div class="mb-4 text-center row">
|
<div class="mb-4 text-center row">
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h4>{{ number_format($rekap['timbulan'], 0, ',', '.') }}</h4>
|
<h4>{{ number_format($rekap['timbulan'], 0, ',', '.') }} Ton</h4>
|
||||||
<p>Total Timbulan</p>
|
<p>Total Timbulan</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h4>{{ number_format($rekap['kelola'], 0, ',', '.') }}</h4>
|
<h4>{{ number_format($rekap['kelola'], 0, ',', '.') }} Ton</h4>
|
||||||
<p>Total Dikelola</p>
|
<p>Total Dikelola</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h4>{{ number_format($rekap['daur'], 0, ',', '.') }}</h4>
|
<h4>{{ number_format($rekap['daur'], 0, ',', '.') }} Ton</h4>
|
||||||
<p>Total Daur Ulang</p>
|
<p>Total Daur Ulang</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<h4>{{ number_format($rekap['sisa'], 0, ',', '.') }}</h4>
|
<h4>{{ number_format($rekap['sisa'], 0, ',', '.') }} Ton</h4>
|
||||||
<p>Total Sisa</p>
|
<p>Total Sisa</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -95,18 +95,35 @@
|
||||||
plugins: {
|
plugins: {
|
||||||
legend: {
|
legend: {
|
||||||
position: 'top'
|
position: 'top'
|
||||||
|
},
|
||||||
|
tooltip: {
|
||||||
|
callbacks: {
|
||||||
|
label: function(context) {
|
||||||
|
return context.dataset.label + ': ' + context.raw.toLocaleString('id-ID') +
|
||||||
|
' Ton';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
scales: {
|
scales: {
|
||||||
y: {
|
y: {
|
||||||
beginAtZero: true
|
beginAtZero: true,
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Jumlah Sampah (Ton)'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
x: {
|
||||||
|
title: {
|
||||||
|
display: true,
|
||||||
|
text: 'Bulan'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<!-- About Section -->
|
<!-- About Section -->
|
||||||
<section id="about" class="about section">
|
<section id="about" class="about section">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@
|
||||||
<meta name="keywords" content="">
|
<meta name="keywords" content="">
|
||||||
|
|
||||||
<!-- Favicons -->
|
<!-- Favicons -->
|
||||||
<link href="{{ asset('assets/user/img/favicon.png') }}" rel="icon">
|
<link href="{{ asset('assets/user/img/iconsig.png') }}" rel="icon">
|
||||||
<link href="{{ asset('assets/user/img/apple-touch-icon.png') }}" rel="apple-touch-icon">
|
<link href="{{ asset('assets/user/img/iconsig.png') }}" rel="apple-touch-icon">
|
||||||
|
|
||||||
<!-- Fonts -->
|
<!-- Fonts -->
|
||||||
<link href="https://fonts.googleapis.com" rel="preconnect">
|
<link href="https://fonts.googleapis.com" rel="preconnect">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue