ubah success page
This commit is contained in:
parent
c502439228
commit
871aa2fa2d
|
@ -127,6 +127,7 @@ public function placeOrder()
|
|||
|
||||
// Tampilkan pesan sukses dan redirect
|
||||
session()->flash('message', 'Booking berhasil dibuat! Silahkan lakukan pembayaran sesuai metode yang dipilih.');
|
||||
session()->flash('booking_name', $this->nama);
|
||||
return redirect()->route('booking.success');
|
||||
}
|
||||
|
||||
|
|
|
@ -2,10 +2,26 @@
|
|||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Reservasii;
|
||||
use Livewire\Component;
|
||||
|
||||
class SuccesPage extends Component
|
||||
{
|
||||
public $booking;
|
||||
public $bookingName;
|
||||
|
||||
public function mount()
|
||||
{
|
||||
// Ambil booking terakhir dari user yang sedang login
|
||||
$this->booking = Reservasii::with(['user', 'detail.paketFoto'])
|
||||
->where('user_id', auth()->id())
|
||||
->latest()
|
||||
->first();
|
||||
|
||||
// Ambil nama dari session
|
||||
$this->bookingName = session('booking_name');
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.succes-page');
|
||||
|
|
|
@ -8,10 +8,8 @@
|
|||
<div class="flex items-center justify-center w-full pb-6 space-x-4 md:justify-start">
|
||||
<div class="flex flex-col items-start justify-start space-y-2">
|
||||
<p class="text-lg font-semibold leading-4 text-left text-gray-800 dark:text-gray-400">
|
||||
Cielo Schimmel</p>
|
||||
<p class="text-sm leading-4 text-gray-600 dark:text-gray-400">71582 Schmitt Springs</p>
|
||||
<p class="text-sm leading-4 text-gray-600 dark:text-gray-400">Castro Valley, Delaware, 53476-0454</p>
|
||||
<p class="text-sm leading-4 cursor-pointer dark:text-gray-400">Phone: 587-019-6103</p>
|
||||
{{ $bookingName }}</p>
|
||||
<p class="text-sm leading-4 text-gray-600 dark:text-gray-400">{{ $booking->user->email }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,31 +19,31 @@
|
|||
<p class="mb-2 text-sm leading-5 text-gray-600 dark:text-gray-400 ">
|
||||
Order Number: </p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-800 dark:text-gray-400">
|
||||
29</p>
|
||||
{{ $booking->id }}</p>
|
||||
</div>
|
||||
<div class="w-full px-4 mb-4 md:w-1/5">
|
||||
<p class="mb-2 text-sm leading-5 text-gray-600 dark:text-gray-400 ">
|
||||
Tanggal: </p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-800 dark:text-gray-400">
|
||||
17-02-2024</p>
|
||||
{{ \Carbon\Carbon::parse($booking->tanggal)->format('d-m-Y') }}</p>
|
||||
</div>
|
||||
<div class="w-full px-4 mb-4 md:w-1/5">
|
||||
<p class="mb-2 text-sm leading-5 text-gray-600 dark:text-gray-400 ">
|
||||
Waktu: </p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-800 dark:text-gray-400">
|
||||
29</p>
|
||||
{{ \Carbon\Carbon::parse($booking->waktu)->format('H:i') }}</p>
|
||||
</div>
|
||||
<div class="w-full px-4 mb-4 md:w-1/5">
|
||||
<p class="mb-2 text-sm font-medium leading-5 text-gray-800 dark:text-gray-400 ">
|
||||
Total: </p>
|
||||
<p class="text-base font-semibold leading-4 text-blue-600 dark:text-gray-400">
|
||||
₹157,495.00</p>
|
||||
Rp {{ number_format($booking->total, 0, ',', '.') }}</p>
|
||||
</div>
|
||||
<div class="w-full px-4 mb-4 md:w-1/5">
|
||||
<p class="mb-2 text-sm leading-5 text-gray-600 dark:text-gray-400 ">
|
||||
Payment Method: </p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-800 dark:text-gray-400 ">
|
||||
Cash on Delivery </p>
|
||||
{{ ucfirst($booking->metode_pembayaran) }} </p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-4 mb-10">
|
||||
|
@ -53,19 +51,19 @@
|
|||
<div class="flex flex-col w-full space-y-6 ">
|
||||
<h2 class="mb-2 text-xl font-semibold text-gray-700 dark:text-gray-400">Order details</h2>
|
||||
<div class="flex flex-col items-center justify-center w-full pb-4 space-y-4 border-b border-gray-200 dark:border-gray-700">
|
||||
@foreach($booking->detail as $detail)
|
||||
<div class="flex justify-between w-full">
|
||||
<p class="text-base leading-4 text-gray-800 dark:text-gray-400">Subtotal</p>
|
||||
<p class="text-base leading-4 text-gray-600 dark:text-gray-400">₹157,495.00</p>
|
||||
<p class="text-base leading-4 text-gray-800 dark:text-gray-400">{{ $detail->paketFoto->nama_paket_foto }}</p>
|
||||
<p class="text-base leading-4 text-gray-600 dark:text-gray-400">Rp {{ number_format($detail->total_harga, 0, ',', '.') }}</p>
|
||||
</div>
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<p class="text-base leading-4 text-gray-800 dark:text-gray-400">Discount
|
||||
</p>
|
||||
<p class="text-base leading-4 text-gray-600 dark:text-gray-400">00</p>
|
||||
<div class="flex justify-between w-full">
|
||||
<p class="text-base leading-4 text-gray-800 dark:text-gray-400">Background: {{ ucfirst($detail->warna) }}</p>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="flex items-center justify-between w-full">
|
||||
<p class="text-base font-semibold leading-4 text-gray-800 dark:text-gray-400">Total</p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-600 dark:text-gray-400">₹157,495.00</p>
|
||||
<p class="text-base font-semibold leading-4 text-gray-600 dark:text-gray-400">Rp {{ number_format($booking->total, 0, ',', '.') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,7 +73,7 @@
|
|||
Kembali
|
||||
</a>
|
||||
<a href="/histori" class="w-full text-center px-4 py-2 bg-blue-500 rounded-md text-gray-50 md:w-auto dark:text-gray-300 hover:bg-blue-600 dark:hover:bg-gray-700 dark:bg-gray-800">
|
||||
Lihat
|
||||
Lihat Histori
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue