Browse Source

update pengecekan halaman

master
Gunawan19621 1 year ago
parent
commit
6b5fec3e57
  1. 1
      app/Http/Controllers/PeminjamanController.php
  2. 6
      app/Models/asset_status.php
  3. 10
      resources/views/dashboard/Master_Data/Customer/create.blade.php
  4. 10
      resources/views/dashboard/Master_Data/Customer/edit.blade.php
  5. 10
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php
  6. 11
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php
  7. 11
      resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php
  8. 10
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php
  9. 10
      resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php
  10. 15
      resources/views/dashboard/Master_Data/Role/index.blade.php
  11. 10
      resources/views/dashboard/Master_Data/User/create.blade.php
  12. 11
      resources/views/dashboard/Master_Data/User/edit.blade.php
  13. 15
      resources/views/dashboard/Master_Data/Warehouse/index.blade.php
  14. 30
      resources/views/dashboard/Peminjaman/create.blade.php
  15. 10
      resources/views/dashboard/Peminjaman/edit.blade.php
  16. 47
      resources/views/dashboard/Peminjaman/index.blade.php
  17. 10
      resources/views/dashboard/Pengembalian/edit.blade.php
  18. 8
      resources/views/dashboard/Pengembalian/index.blade.php
  19. 35
      resources/views/layouts/main.blade.php
  20. 24
      resources/views/layouts/navbar.blade.php

1
app/Http/Controllers/PeminjamanController.php

@ -41,6 +41,7 @@ class PeminjamanController extends Controller
'asset' => m_asset::all(), 'asset' => m_asset::all(),
'peminjaman' => asset_status::get(), 'peminjaman' => asset_status::get(),
'warehouse' => m_warehouse::get(), 'warehouse' => m_warehouse::get(),
'peti_block' => Peti::whereNotIn('id', asset_status::pluck('peti_id')->toArray())->get(),
'existingPeti' => asset_status::pluck('peti_id')->toArray(), 'existingPeti' => asset_status::pluck('peti_id')->toArray(),
'active' => 'menu-peminjaman', 'active' => 'menu-peminjaman',
]; ];

6
app/Models/asset_status.php

@ -56,10 +56,4 @@ class asset_status extends Model
{ {
return $this->belongsTo(Customer::class, 'customer_id'); return $this->belongsTo(Customer::class, 'customer_id');
} }
// public function customer()
// {
// return $this->belongsTo(Customer::class, 'customer_id')->select('id', 'name');
// }
} }

10
resources/views/dashboard/Master_Data/Customer/create.blade.php

@ -11,7 +11,7 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.customer.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.customer.store') }}" method="POST" enctype="multipart/form-data" id="createForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Nama Customer: <span class="text-danger">*</span></label> <label for="name" class="col-form-label">Nama Customer: <span class="text-danger">*</span></label>
@ -39,9 +39,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('createForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

10
resources/views/dashboard/Master_Data/Customer/edit.blade.php

@ -12,7 +12,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.customer.update', [$customer->id]) }}" method="POST" <form action="{{ route('dashboard.customer.update', [$customer->id]) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -43,9 +43,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.customer.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

10
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/create.blade.php

@ -11,7 +11,7 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.peti.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.peti.store') }}" method="POST" enctype="multipart/form-data" id="createForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="tipe_peti_id" class="col-form-label">Tipe Peti: <span class="text-danger">*</span></label> <label for="tipe_peti_id" class="col-form-label">Tipe Peti: <span class="text-danger">*</span></label>
@ -64,9 +64,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('createForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

11
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/edit.blade.php

@ -11,7 +11,8 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.peti.update', [$peti->id]) }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.peti.update', [$peti->id]) }}" method="POST" enctype="multipart/form-data"
id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -73,9 +74,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

11
resources/views/dashboard/Master_Data/Manajemen_Peti/Peti/index.blade.php

@ -22,16 +22,17 @@
<a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split"> <a href="{{ route('dashboard.peti.create') }}" class="btn btn-success btn-icon-split">
<span class="text">Tambah Peti</span> <span class="text">Tambah Peti</span>
</a> </a>
<form action="{{ route('dashboard.all-pdf.cetakpdf') }}" method="GET" id="pdfForm"
class="mb-3">
@csrf
<input type="hidden" name="peti_ids" id="peti_ids" value="">
<button type="submit" class="btn btn-primary my-2">Cetak PDF</button>
</form>
</div> </div>
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <div class="table-responsive">
<form action="{{ route('dashboard.all-pdf.cetakpdf') }}" method="GET" id="pdfForm" class="mb-3">
@csrf
<input type="hidden" name="peti_ids" id="peti_ids" value="">
<button type="submit" class="btn btn-primary my-2">Cetak PDF</button>
</form>
<table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0"> <table class="table table-bordered" id="tablebarang" width="100%" cellspacing="0">
<thead> <thead>
<tr> <tr>

10
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/create.blade.php

@ -11,7 +11,7 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.typepeti.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.typepeti.store') }}" method="POST" enctype="multipart/form-data" id="createForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="type" class="col-form-label">Tipe Peti: <span class="text-danger">*</span></label> <label for="type" class="col-form-label">Tipe Peti: <span class="text-danger">*</span></label>
@ -29,9 +29,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('createForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

10
resources/views/dashboard/Master_Data/Manajemen_Peti/Type_peti/edit.blade.php

@ -12,7 +12,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.typepeti.update', [$typepeti->id]) }}" method="POST" <form action="{{ route('dashboard.typepeti.update', [$typepeti->id]) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -31,9 +31,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.typepeti.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

15
resources/views/dashboard/Master_Data/Role/index.blade.php

@ -76,7 +76,8 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('dashboard.role.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.role.store') }}" method="POST" enctype="multipart/form-data"
id="inputanForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
@ -94,7 +95,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -116,7 +117,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('dashboard.role.update', $data->id) }}" method="POST" <form action="{{ route('dashboard.role.update', $data->id) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="inputanForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -134,7 +135,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -142,4 +143,10 @@
</div> </div>
</div> </div>
@endforeach @endforeach
<script>
document.getElementById('inputanForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

10
resources/views/dashboard/Master_Data/User/create.blade.php

@ -12,7 +12,7 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.user.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.user.store') }}" method="POST" enctype="multipart/form-data" id="createForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="username" class="col-form-label">Username: <span class="text-danger">*</span></label> <label for="username" class="col-form-label">Username: <span class="text-danger">*</span></label>
@ -69,7 +69,7 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.user.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.user.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -89,4 +89,10 @@
} }
}); });
</script> </script>
<script>
document.getElementById('createForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

11
resources/views/dashboard/Master_Data/User/edit.blade.php

@ -12,7 +12,8 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.user.update', [$user->id]) }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.user.update', [$user->id]) }}" method="POST" enctype="multipart/form-data"
id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -73,7 +74,7 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.user.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.user.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -93,4 +94,10 @@
} }
}); });
</script> </script>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

15
resources/views/dashboard/Master_Data/Warehouse/index.blade.php

@ -81,7 +81,8 @@
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('dashboard.warehouse.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.warehouse.store') }}" method="POST" enctype="multipart/form-data"
id="inputanForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="name" class="col-form-label">Nama Gudang: <span <label for="name" class="col-form-label">Nama Gudang: <span
@ -99,7 +100,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -121,7 +122,7 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form action="{{ route('dashboard.warehouse.update', $data->id) }}" method="POST" <form action="{{ route('dashboard.warehouse.update', $data->id) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="inputanForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -140,7 +141,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button> <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -148,4 +149,10 @@
</div> </div>
</div> </div>
@endforeach @endforeach
<script>
document.getElementById('inputanForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

30
resources/views/dashboard/Peminjaman/create.blade.php

@ -10,19 +10,18 @@
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.peminjaman.store') }}" method="POST" enctype="multipart/form-data"> <form action="{{ route('dashboard.peminjaman.store') }}" method="POST" enctype="multipart/form-data"
id="peminjamanForm">
@csrf @csrf
<div class="form-group"> <div class="form-group">
<label for="peti_id" class="col-form-label">Pilih Detail Peti: <span <label for="peti_id" class="col-form-label">Pilih Detail Peti: <span
class="text-danger">*</span></label> class="text-danger">*</span></label>
<select class="form-control" name="peti_id" type="text" id="peti_id" required> <select class="form-control" name="peti_id" type="text" id="peti_id" required>
<option disabled selected>Pilih Detail Peti</option> <option disabled selected>Pilih Detail Peti</option>
@foreach ($peti as $data_peti) @foreach ($peti_block as $data_peti)
@if (!in_array($data_peti->id, $existingPeti)) <option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}">
<option value="{{ $data_peti->id }}" data-warehouse-id="{{ $data_peti->warehouse_id }}"> {{ $data_peti->fix_lot }}
{{ $data_peti->fix_lot }} </option>
</option>
@endif
@endforeach @endforeach
</select> </select>
<label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span <label for="exit_at" class="col-form-label">Tanggal Peminjaman: <span
@ -46,24 +45,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.addEventListener('DOMContentLoaded', function() {
const petiSelect = document.getElementById('peti_id');
const exitWarehouseSelect = document.getElementById('exit_warehouse');
// Saat pilihan Detail Peti berubah
petiSelect.addEventListener('change', function() {
const selectedOption = petiSelect.options[petiSelect.selectedIndex];
const warehouseId = selectedOption.getAttribute('data-warehouse-id');
// Atur nilai pilihan Asal Gudang sesuai dengan data peti yang dipilih <script>
exitWarehouseSelect.value = warehouseId; document.getElementById('peminjamanForm').addEventListener('submit', function() {
}); document.getElementById('submitButton').setAttribute('disabled', 'true');
}); });
</script> </script>
@endsection @endsection

10
resources/views/dashboard/Peminjaman/edit.blade.php

@ -11,7 +11,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.peminjaman.update', $peminjaman->id) }}" method="POST" <form action="{{ route('dashboard.peminjaman.update', $peminjaman->id) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -57,7 +57,7 @@
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.peminjaman.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
@ -80,4 +80,10 @@
}); });
}); });
</script> </script>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

47
resources/views/dashboard/Peminjaman/index.blade.php

@ -1,5 +1,15 @@
@extends('layouts.main') @extends('layouts.main')
@section('content') @section('content')
<style>
.table th {
white-space: nowrap;
}
.table td {
white-space: nowrap;
}
</style>
@include('layouts.components.alert-prompt') @include('layouts.components.alert-prompt')
@if (auth()->user()->role_id == 1) @if (auth()->user()->role_id == 1)
<div class="card shadow mb-4"> <div class="card shadow mb-4">
@ -24,6 +34,7 @@
<th class="text-center">No</th> <th class="text-center">No</th>
<th>Kode Peti</th> <th>Kode Peti</th>
<th>Nama Customer</th> <th>Nama Customer</th>
<th>Kode</th>
<th>Tgl Peminjaman</th> <th>Tgl Peminjaman</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
<th>Asal Gudang</th> <th>Asal Gudang</th>
@ -35,11 +46,41 @@
$no_peminjaman = 1; $no_peminjaman = 1;
@endphp @endphp
@forelse ($peminjaman as $data_peminjaman) @forelse ($peminjaman as $data_peminjaman)
<tr> @if ($data_peminjaman->enter_warehouse == null)
<tr>
<td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td>
<td class="text-center">
<a href="{{ route('dashboard.peminjaman.edit', $data_peminjaman->id) }}"
title="Edit">
<i class="fa fa-edit mr-2" style="font-size: 20px"></i>
</a>
<form
action="{{ route('dashboard.peminjaman.destroy', $data_peminjaman->id) }}"
method="POST" style="display: inline;">
@csrf
@method('DELETE')
<button type="submit"
onclick="return confirm('Apakah Anda yakin ingin menghapus data ini?')"
title="Delete" style="border: none; background: none; cursor: pointer;">
<i class="fa fa-trash text-danger" style="font-size: 20px"></i>
</button>
</form>
</td>
</tr>
@endif
{{-- <tr>
<td class="text-center">{{ $no_peminjaman++ }}</td> <td class="text-center">{{ $no_peminjaman++ }}</td>
<td>{{ $data_peminjaman->peti->fix_lot }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ $data_peminjaman->peti->customer->code_customer }} - <td>{{ $data_peminjaman->peti->customer->code_customer }} -
{{ $data_peminjaman->peti->tipe_peti->type }}</td> {{ $data_peminjaman->peti->tipe_peti->type }}</td>
<td>{{ $data_peminjaman->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data_peminjaman->exit_at)->format('d/m/Y') }}</td>
<td>{{ $data_peminjaman->exit_pic }}</td> <td>{{ $data_peminjaman->exit_pic }}</td>
<td>{{ $data_peminjaman->warehouse->name }}</td> <td>{{ $data_peminjaman->warehouse->name }}</td>
@ -59,7 +100,7 @@
</button> </button>
</form> </form>
</td> </td>
</tr> </tr> --}}
@empty @empty
<p>Data Kosong</p> <p>Data Kosong</p>
@endforelse @endforelse

10
resources/views/dashboard/Pengembalian/edit.blade.php

@ -11,7 +11,7 @@
</div> </div>
<div class="card-body"> <div class="card-body">
<form action="{{ route('dashboard.pengembalian.update', [$peminjaman->id]) }}" method="POST" <form action="{{ route('dashboard.pengembalian.update', [$peminjaman->id]) }}" method="POST"
enctype="multipart/form-data"> enctype="multipart/form-data" id="editForm">
@csrf @csrf
@method('PUT') @method('PUT')
<div class="form-group"> <div class="form-group">
@ -62,9 +62,15 @@
</div> </div>
<div class="modal-footer d-flex justify-content-center"> <div class="modal-footer d-flex justify-content-center">
<a href="{{ route('dashboard.pengembalian.index') }}" class="btn btn-secondary">Kembali</a> <a href="{{ route('dashboard.pengembalian.index') }}" class="btn btn-secondary">Kembali</a>
<button type="submit" class="btn btn-primary">Simpan</button> <button type="submit" class="btn btn-primary" id="submitButton">Simpan</button>
</div> </div>
</form> </form>
</div> </div>
</div> </div>
<script>
document.getElementById('editForm').addEventListener('submit', function() {
document.getElementById('submitButton').setAttribute('disabled', 'true');
});
</script>
@endsection @endsection

8
resources/views/dashboard/Pengembalian/index.blade.php

@ -22,6 +22,7 @@
<tr> <tr>
<th>No</th> <th>No</th>
<th>Kode Peti</th> <th>Kode Peti</th>
<th>Customer</th>
<th>Tgl Peinjaman</th> <th>Tgl Peinjaman</th>
<th>Estimasi Pengembalian</th> <th>Estimasi Pengembalian</th>
<th>PJ Peminjaman</th> <th>PJ Peminjaman</th>
@ -38,14 +39,11 @@
@php @php
$no_peminjaman = 1; $no_peminjaman = 1;
@endphp @endphp
{{-- @foreach ($peminjaman as $data)
@endforeach --}}
@forelse ($peminjaman as $data) @forelse ($peminjaman as $data)
<tr> <tr>
<td>{{ $no_peminjaman++ }}</td> <td>{{ $no_peminjaman++ }}</td>
<td>{{ $data->peti->customer->code_customer }} - <td>{{ $data->peti->fix_lot }}</td>
{{ $data->peti->tipe_peti->type }}</td> <td>{{ $data->peti->customer->name }}</td>
<td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->exit_at)->format('d/m/Y') }}</td>
<td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td> <td>{{ \Carbon\Carbon::parse($data->est_pengembalian)->format('d/m/Y') }}</td>
<td>{{ $data->exit_pic }}</td> <td>{{ $data->exit_pic }}</td>

35
resources/views/layouts/main.blade.php

@ -27,17 +27,6 @@
@include('layouts.navbar') @include('layouts.navbar')
<div class="container-fluid"> <div class="container-fluid">
<!-- allert update data foto -->
{{-- @if (session()->has('success'))
<div id="success-alert" class="alert alert-success floating-alert">
{{ session()->get('success') }}
</div>
@elseif(session()->has('error'))
<div id="error-alert" class="alert alert-danger floating-alert">
X {{ session()->get('error') }}
</div>
@endif --}}
<!-- Main Bar --> <!-- Main Bar -->
@yield('content') @yield('content')
</div> </div>
@ -60,30 +49,6 @@
<i class="fas fa-angle-up"></i> <i class="fas fa-angle-up"></i>
</a> </a>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Apakah anda yakin ingin keluar?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Pilih "Logout" di bawah ini jika Anda siap untuk mengakhiri sesi Anda saat ini.
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button class="btn btn-danger" style="cursor: pointer" type="submit">Logout</button>
</form>
</div>
</div>
</div>
</div>
@stack('script') @stack('script')
@include('layouts.script') @include('layouts.script')

24
resources/views/layouts/navbar.blade.php

@ -103,3 +103,27 @@
</li> </li>
</ul> </ul>
</nav> </nav>
<!-- Logout Modal-->
<div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Apakah anda yakin ingin keluar?</h5>
<button class="close" type="button" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">Pilih "Logout" di bawah ini jika Anda siap untuk mengakhiri sesi Anda saat ini.
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
<form method="POST" action="{{ route('logout') }}">
@csrf
<button class="btn btn-danger" style="cursor: pointer" type="submit">Logout</button>
</form>
</div>
</div>
</div>
</div>

Loading…
Cancel
Save