diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 149f743..1b3fd08 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -86,7 +86,7 @@ class PeminjamanController extends Controller public function edit($id) { $data = [ - 'asset' => m_asset::all(), + 'peti' => Peti::all(), 'peminjaman' => asset_status::find($id), 'warehouse' => m_warehouse::get(), 'active' => 'menu-peminjaman', @@ -100,10 +100,11 @@ class PeminjamanController extends Controller public function update(Request $request, $id) { // dd('oke'); + // dd($request->all()); $request->validate([ - 'asset_id' => 'required', + 'peti_id' => 'required', 'exit_at' => 'required', - 'exit_pic' => 'required', + 'est_pengembalian' => 'required', 'exit_warehouse' => 'required', ]); // dd($request); diff --git a/app/Http/Controllers/PengembalianController.php b/app/Http/Controllers/PengembalianController.php index a27f57a..5278758 100644 --- a/app/Http/Controllers/PengembalianController.php +++ b/app/Http/Controllers/PengembalianController.php @@ -2,9 +2,10 @@ namespace App\Http\Controllers; -use App\Models\asset_status; +use App\Models\Peti; use App\Models\m_asset; use App\Models\m_warehouse; +use App\Models\asset_status; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; @@ -13,7 +14,7 @@ class PengembalianController extends Controller public function index() { $data = [ - 'peminjaman' => asset_status::get(), + 'peminjaman' => asset_status::all(), 'active' => 'menu-pengembalian', ]; return view('dashboard.Pengembalian.index', $data); @@ -48,6 +49,7 @@ class PengembalianController extends Controller public function edit($id) { $data = [ + 'peti' => Peti::get(), 'peminjaman' => asset_status::findOrFail($id), 'warehouse' => m_warehouse::get(), 'active' => 'menu-pengembalian', diff --git a/resources/views/dashboard/Peminjaman/create.blade.php b/resources/views/dashboard/Peminjaman/create.blade.php index 298f114..25f0338 100644 --- a/resources/views/dashboard/Peminjaman/create.blade.php +++ b/resources/views/dashboard/Peminjaman/create.blade.php @@ -13,13 +13,6 @@
@csrf
- {{-- - --}} - - @foreach ($asset as $data_asset) - + + - +
+ +
+ + value="{{ $peminjaman->exit_at }}" required> +
- - +
+ + +
- - + + @foreach ($warehouse as $data) + @endforeach @@ -53,4 +58,22 @@
+ @endsection diff --git a/resources/views/dashboard/Peminjaman/index.blade.php b/resources/views/dashboard/Peminjaman/index.blade.php index 1e9fba0..b91fef2 100644 --- a/resources/views/dashboard/Peminjaman/index.blade.php +++ b/resources/views/dashboard/Peminjaman/index.blade.php @@ -24,7 +24,7 @@ Kode Peti Nama Customer Tgl Peminjaman - PJ Keluar + PJ Peminjaman Asal Gudang Action @@ -35,29 +35,19 @@ @endphp @forelse ($peminjaman as $data_peminjaman) - {{ $no_peminjaman++ }} + {{ $no_peminjaman++ }} {{ $data_peminjaman->peti->customer->code_customer }} - {{ $data_peminjaman->peti->tipe_peti->type }} {{ $data_peminjaman->peti->customer->name }} - {{ $data_peminjaman->exit_at }} - - @empty -

Data Kosong

- @endforelse - {{-- - @foreach ($peminjaman as $data) - - {{ $no_peminjaman++ }} - {{ $data->asset->name }} - {{ \Carbon\Carbon::parse($data->exit_at)->format('d-m-Y') }} - {{ $data->exit_pic }} - {{ $data->warehouse->name }} + {{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }} + {{ $data_peminjaman->exit_pic }} + {{ $data_peminjaman->warehouse->name }} - + -
+ @csrf @method('DELETE') + --}} +
diff --git a/resources/views/dashboard/Pengembalian/index.blade.php b/resources/views/dashboard/Pengembalian/index.blade.php index bee41b6..8131745 100644 --- a/resources/views/dashboard/Pengembalian/index.blade.php +++ b/resources/views/dashboard/Pengembalian/index.blade.php @@ -1,8 +1,15 @@ @extends('layouts.main') -@section('title', 'Pengembalian') @section('content') +
-
Data Pengembalian
@@ -13,13 +20,14 @@ No - Nama Asset + Kode Peti Tgl Peinjaman - PJ Peinjaman - Asal Gudang + PJ Peminjaman + Asal WH Peminjaman Tgl Pengembalian PJ Pengembalian - Tujuan Gudang + Tujuan WH Pengembalian + Kondisi Peti Status Action @@ -28,11 +36,15 @@ @php $no_peminjaman = 1; @endphp - @foreach ($peminjaman as $data) + {{-- @foreach ($peminjaman as $data) + + @endforeach --}} + @forelse ($peminjaman as $data) {{ $no_peminjaman++ }} - {{ $data->asset->name }} - {{ \Carbon\Carbon::parse($data->exit_at)->format('d-m-Y') }} + {{ $data->peti->customer->code_customer }} - + {{ $data->peti->tipe_peti->type }} + {{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }} {{ $data->exit_pic }} {{ $data->warehouse->name }} @@ -56,6 +68,13 @@

-

@endif + + @if ($data->kondisi_peti) + {{ $data->kondisi_peti }} + @else +

-

+ @endif + @if ($data->enter_warehouse === null) Not Return @@ -69,7 +88,9 @@ - @endforeach + @empty +

Data Kosong

+ @endforelse