From 7881412e90e3904c1aad88768302c30734b021c9 Mon Sep 17 00:00:00 2001 From: Gunawan19621 Date: Thu, 30 Nov 2023 21:32:31 +0700 Subject: [PATCH] update tambahan pengembalian --- app/Http/Controllers/PeminjamanController.php | 17 ++++ .../Controllers/PengembalianController.php | 14 ---- .../dashboard/Peminjaman/index.blade.php | 6 +- .../Peminjaman/pengembalian.blade.php | 79 +++++++++++++++++++ .../dashboard/Pengembalian/edit.blade.php | 6 +- routes/web.php | 1 + 6 files changed, 106 insertions(+), 17 deletions(-) create mode 100644 resources/views/dashboard/Peminjaman/pengembalian.blade.php diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 0b94a24..1446011 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -8,6 +8,7 @@ use App\Models\Peti; use App\Models\m_warehouse; use App\Models\asset_status; use App\Models\Customer; +use App\Models\Kondisi_Peti; use Illuminate\Support\Facades\Auth; use Symfony\Component\Uid\Uuid; @@ -135,4 +136,20 @@ class PeminjamanController extends Controller return redirect()->back()->with('error', 'Data peminjaman gagal dihapus'); } } + + /** + * Show the form for editing the specified resource. + */ + public function pengembalian($id) + { + // dd('oke'); + $data = [ + 'peti' => Peti::get(), + 'peminjaman' => asset_status::findOrFail($id), + 'warehouse' => m_warehouse::get(), + 'kondisiPeti' => Kondisi_Peti::get(), + 'active' => 'menu-pengembalian', + ]; + return view('dashboard.Peminjaman.pengembalian', $data); + } } diff --git a/app/Http/Controllers/PengembalianController.php b/app/Http/Controllers/PengembalianController.php index affdae7..d9e2110 100644 --- a/app/Http/Controllers/PengembalianController.php +++ b/app/Http/Controllers/PengembalianController.php @@ -12,20 +12,6 @@ use Illuminate\Support\Facades\Auth; class PengembalianController extends Controller { - // public function index() - // { - // $pengembalian = asset_status::orderBy('created_at', 'desc')->get(); - - // $latestpengembalian = $pengembalian->groupBy('peti_id')->map(function ($group) { - // return $group->first(); - // }); - - // $data = [ - // 'peminjaman' => $latestpengembalian, - // 'active' => 'menu-pengembalian', - // ]; - // return view('dashboard.Pengembalian.index', $data); - // } public function index() { $pengembalian = asset_status::orderBy('created_at', 'desc')->get(); diff --git a/resources/views/dashboard/Peminjaman/index.blade.php b/resources/views/dashboard/Peminjaman/index.blade.php index ded370f..8a431a7 100644 --- a/resources/views/dashboard/Peminjaman/index.blade.php +++ b/resources/views/dashboard/Peminjaman/index.blade.php @@ -55,10 +55,14 @@ {{ $data_peminjaman->exit_pic }} {{ $data_peminjaman->warehouse->name }} - + {{-- + + --}} diff --git a/resources/views/dashboard/Peminjaman/pengembalian.blade.php b/resources/views/dashboard/Peminjaman/pengembalian.blade.php new file mode 100644 index 0000000..441af1e --- /dev/null +++ b/resources/views/dashboard/Peminjaman/pengembalian.blade.php @@ -0,0 +1,79 @@ +@extends('layouts.main') +@section('content') + @include('layouts.components.alert-prompt') +
+
+
+
+
Pengembalian Peti
+
+
+
+
+
+ + +@endsection diff --git a/resources/views/dashboard/Pengembalian/edit.blade.php b/resources/views/dashboard/Pengembalian/edit.blade.php index 2dd34d0..5a8d7a4 100644 --- a/resources/views/dashboard/Pengembalian/edit.blade.php +++ b/resources/views/dashboard/Pengembalian/edit.blade.php @@ -1,5 +1,4 @@ @extends('layouts.main') -@section('title', 'Update Data Pengembalian') @section('content') @include('layouts.components.alert-prompt')
@@ -60,7 +59,10 @@
diff --git a/routes/web.php b/routes/web.php index 31a81bf..c3ee14e 100644 --- a/routes/web.php +++ b/routes/web.php @@ -61,6 +61,7 @@ Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(func Route::get('peminjaman/{id}/edit', 'edit')->name('peminjaman.edit'); Route::put('peminjaman/{id}', 'update')->name('peminjaman.update'); Route::delete('peminjaman/delete/{id}', 'destroy')->name('peminjaman.destroy'); + Route::get('peminjaman/{id}/pengembalian', 'pengembalian')->name('peminjaman.pengembalian'); }); //Halaman Pengembalian