fiks bug route
This commit is contained in:
parent
660d53ad8a
commit
f2d6d8c549
|
|
@ -26,4 +26,14 @@ public function transactions(Request $request)
|
||||||
|
|
||||||
return view('admin.reports.transactions', compact('transactions', 'request'));
|
return view('admin.reports.transactions', compact('transactions', 'request'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updateStatus($id)
|
||||||
|
{
|
||||||
|
$sewa = Sewa::findOrFail($id);
|
||||||
|
$sewa->status = 'completed';
|
||||||
|
$sewa->save();
|
||||||
|
|
||||||
|
return redirect()->route('admin.reports.transactions')
|
||||||
|
->with('success', 'Status transaksi berhasil diperbarui menjadi completed');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -235,7 +235,7 @@ class="border border-gray-300 rounded-md px-3 py-2 w-24 focus:outline-none focus
|
||||||
|
|
||||||
<!-- Tombol Submit dan Batal -->
|
<!-- Tombol Submit dan Batal -->
|
||||||
<div class="flex justify-end space-x-4 pt-6 border-t">
|
<div class="flex justify-end space-x-4 pt-6 border-t">
|
||||||
<a href="{{ route('paket') }}" class="px-4 py-2 bg-gray-300 text-gray-800 rounded-md hover:bg-gray-400 transition duration-300">
|
<a href="{{ route('paket.index') }}" class="px-4 py-2 bg-gray-300 text-gray-800 rounded-md hover:bg-gray-400 transition duration-300">
|
||||||
Batal
|
Batal
|
||||||
</a>
|
</a>
|
||||||
<button type="submit" class="px-6 py-2 bg-blue-700 text-white rounded-md hover:bg-blue-800 transition duration-300">
|
<button type="submit" class="px-6 py-2 bg-blue-700 text-white rounded-md hover:bg-blue-800 transition duration-300">
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="bg-gray-100">
|
<tr class="bg-gray-100">
|
||||||
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">No</th>
|
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">No</th>
|
||||||
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">ID Sewa</th>
|
|
||||||
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Tanggal Sewa</th>
|
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Tanggal Sewa</th>
|
||||||
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Pelanggan</th>
|
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Pelanggan</th>
|
||||||
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Paket</th>
|
<th class="py-3 px-4 text-left text-sm font-semibold text-gray-600 border-b">Paket</th>
|
||||||
|
|
@ -43,7 +42,6 @@
|
||||||
@foreach($transactions as $index => $sewa)
|
@foreach($transactions as $index => $sewa)
|
||||||
<tr class="border-b hover:bg-gray-50">
|
<tr class="border-b hover:bg-gray-50">
|
||||||
<td class="py-3 px-4 text-sm text-gray-800">{{ $transactions->firstItem() + $index }}</td>
|
<td class="py-3 px-4 text-sm text-gray-800">{{ $transactions->firstItem() + $index }}</td>
|
||||||
<td class="py-3 px-4 text-sm text-gray-800">#{{ $sewa->id }}</td>
|
|
||||||
<td class="py-3 px-4 text-sm text-gray-800">{{ \Carbon\Carbon::parse($sewa->created_at)->format('d M Y H:i') }}</td>
|
<td class="py-3 px-4 text-sm text-gray-800">{{ \Carbon\Carbon::parse($sewa->created_at)->format('d M Y H:i') }}</td>
|
||||||
<td class="py-3 px-4 text-sm text-gray-800">{{ $sewa->user->nama }}</td>
|
<td class="py-3 px-4 text-sm text-gray-800">{{ $sewa->user->nama }}</td>
|
||||||
<td class="py-3 px-4 text-sm text-gray-800">{{ $sewa->paket->nama_paket }}</td>
|
<td class="py-3 px-4 text-sm text-gray-800">{{ $sewa->paket->nama_paket }}</td>
|
||||||
|
|
@ -71,9 +69,13 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="py-3 px-4 text-center text-sm">
|
<td class="py-3 px-4 text-center text-sm">
|
||||||
@if($sewa->status !== 'completed' && $sewa->status !== 'dibatalkan')
|
@if($sewa->status !== 'completed' && $sewa->status !== 'dibatalkan')
|
||||||
<a href="{{ route('admin.riwayat.show-update-payment', $sewa->id) }}" class="bg-indigo-500 hover:bg-indigo-600 text-white px-3 py-1 rounded-md">
|
<form action="{{ route('admin.riwayat.update-status', $sewa->id) }}" method="POST" class="inline">
|
||||||
Update Pembayaran
|
@csrf
|
||||||
</a>
|
@method('PUT')
|
||||||
|
<button type="submit" class="bg-indigo-500 hover:bg-indigo-600 text-white px-3 py-1 rounded-md">
|
||||||
|
Selesaikan Pembayaran
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
@else
|
@else
|
||||||
<span class="text-gray-500">Tidak Ada Aksi</span>
|
<span class="text-gray-500">Tidak Ada Aksi</span>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<!-- Barang Stats -->
|
<!-- Barang Stats -->
|
||||||
<div class="bg-gradient-to-br from-purple-50 to-purple-100 rounded-xl shadow-lg p-6 transform hover:scale-105 transition-all duration-300">
|
<div class="bg-gradient-to-br from-purple-50 to-purple-100 rounded-xl shadow-lg p-6 transform hover:scale-105 transition-all duration-300">
|
||||||
<a href="{{ route('paket') }}" class="block">
|
<a href="{{ route('paket.index') }}" class="block">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<div class="p-3 rounded-full bg-purple-500 text-white mr-4 shadow-md">
|
<div class="p-3 rounded-full bg-purple-500 text-white mr-4 shadow-md">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ class="w-full rounded-lg border-gray-300 focus:border-blue-500 focus:ring-blue-5
|
||||||
|
|
||||||
<!-- Tombol Submit -->
|
<!-- Tombol Submit -->
|
||||||
<div class="mt-6 flex justify-end space-x-3">
|
<div class="mt-6 flex justify-end space-x-3">
|
||||||
<a href="{{ route('paket') }}"
|
<a href="{{ route('paket.index') }}"
|
||||||
class="px-4 py-2 bg-gray-500 text-white rounded-lg hover:bg-gray-600 transition duration-200">
|
class="px-4 py-2 bg-gray-500 text-white rounded-lg hover:bg-gray-600 transition duration-200">
|
||||||
Batal
|
Batal
|
||||||
</a>
|
</a>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
<a href="{{ route('pengguna') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('pengguna*') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('pengguna') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('pengguna*') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
Manajemen User
|
Manajemen User
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ route('paket') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('paket*') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('paket.index') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('paket*') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
Manajemen Paket
|
Manajemen Paket
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ route('input-stock') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('input-stock*') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('input-stock') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('input-stock*') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
Input Stock
|
Input Stock
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
<a href="{{ route('paket') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('paket*') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('paket.index') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('paket*') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
Paket
|
Paket
|
||||||
</a>
|
</a>
|
||||||
@if(auth()->user()->tipe_pengguna === 'user')
|
@if(auth()->user()->tipe_pengguna === 'user')
|
||||||
|
|
@ -35,11 +35,19 @@
|
||||||
Laporan Transaksi
|
Laporan Transaksi
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
|
@if(auth()->user()->tipe_pengguna === 'user')
|
||||||
<a href="{{ route('riwayat') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('riwayat') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('riwayat') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('riwayat') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
Riwayat
|
Riwayat
|
||||||
</a>
|
</a>
|
||||||
|
@endif
|
||||||
|
@if(auth()->user()->tipe_pengguna === 'admin')
|
||||||
|
<a href="{{ route('contact.index') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('contact.index') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
|
Hubungi Kami
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
<a href="{{ route('contact.show') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('contact.*') ? 'bg-blue-800 text-white' : '' }}">
|
<a href="{{ route('contact.show') }}" class="block py-3 px-4 text-gray-800 font-semibold mb-1 hover:bg-gray-100 {{ request()->routeIs('contact.*') ? 'bg-blue-800 text-white' : '' }}">
|
||||||
Hubungi Kami
|
Hubungi Kami
|
||||||
</a>
|
</a>
|
||||||
|
@endif
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -126,7 +126,7 @@ class="w-full bg-gray-500 text-white px-3 py-1 rounded hover:bg-gray-600">
|
||||||
Pesan Sekarang
|
Pesan Sekarang
|
||||||
</a>
|
</a>
|
||||||
@else
|
@else
|
||||||
<a href="{{ route('paket') }}" class="mt-4 inline-block bg-blue-800 text-white py-2 px-4 rounded hover:bg-blue-900 transition duration-200">
|
<a href="{{ route('paket.index') }}" class="mt-4 inline-block bg-blue-800 text-white py-2 px-4 rounded hover:bg-blue-900 transition duration-200">
|
||||||
Lihat Paket
|
Lihat Paket
|
||||||
</a>
|
</a>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
Route::delete('/barang/{id}', [BarangController::class, 'destroy'])->name('barang.destroy');
|
Route::delete('/barang/{id}', [BarangController::class, 'destroy'])->name('barang.destroy');
|
||||||
|
|
||||||
// Paket (untuk semua user)
|
// Paket (untuk semua user)
|
||||||
Route::get('/paket', [PaketController::class, 'index'])->name('paket');
|
Route::get('/paket', [PaketController::class, 'index'])->name('paket.index');
|
||||||
|
|
||||||
// Khusus Admin
|
// Khusus Admin
|
||||||
Route::middleware(['admin'])->group(function () {
|
Route::middleware(['admin'])->group(function () {
|
||||||
|
|
@ -219,3 +219,5 @@
|
||||||
// Route untuk data pengguna biasa
|
// Route untuk data pengguna biasa
|
||||||
Route::get('/users', [UserController::class, 'index'])->name('users');
|
Route::get('/users', [UserController::class, 'index'])->name('users');
|
||||||
Route::delete('/users/{id}', [UserController::class, 'destroy'])->name('users.destroy');
|
Route::delete('/users/{id}', [UserController::class, 'destroy'])->name('users.destroy');
|
||||||
|
|
||||||
|
Route::put('/admin/riwayat/{id}/update-status', [App\Http\Controllers\Admin\ReportController::class, 'updateStatus'])->name('admin.riwayat.update-status');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue