git commit "add user reservations and complete profile features"
This commit is contained in:
@@ -55,6 +55,13 @@
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{route('users.reservations.index')}}">
|
||||
<i class="fa fa-reservations"></i>
|
||||
رزرو من
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="theme-page-section theme-page-section-lg">
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
@include('account.layout.app')
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="col-md-9">
|
||||
|
||||
|
||||
<div class="account-content">
|
||||
|
||||
|
||||
<h2 class="account-title">
|
||||
رزروهای من ✈️
|
||||
</h2>
|
||||
|
||||
|
||||
|
||||
@if($reservations->count())
|
||||
|
||||
|
||||
<div class="favorite-list">
|
||||
|
||||
|
||||
@foreach($reservations as $reservation)
|
||||
|
||||
|
||||
<div class="favorite-card">
|
||||
|
||||
|
||||
<div class="favorite-info">
|
||||
|
||||
|
||||
@if($reservation->reservable_type == 'App\Models\Tour')
|
||||
|
||||
|
||||
<h3>
|
||||
{{ $reservation->reservable?->title ?? 'تور حذف شده' }}
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
تور
|
||||
</p>
|
||||
|
||||
|
||||
@elseif($reservation->reservable_type == 'App\Models\Flight')
|
||||
|
||||
|
||||
<h3>
|
||||
{{ $reservation->reservable?->name ?? 'پرواز حذف شده' }}
|
||||
</h3>
|
||||
|
||||
<p>
|
||||
پرواز
|
||||
</p>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
مبلغ:
|
||||
|
||||
<strong>
|
||||
{{ number_format($reservation->price) }}
|
||||
تومان
|
||||
</strong>
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
|
||||
وضعیت:
|
||||
|
||||
@if($reservation->status == 'pending')
|
||||
|
||||
<span class="badge bg-warning">
|
||||
در انتظار بررسی
|
||||
</span>
|
||||
|
||||
@elseif($reservation->status == 'confirmed')
|
||||
|
||||
<span class="badge bg-success">
|
||||
تایید شده
|
||||
</span>
|
||||
|
||||
@elseif($reservation->status == 'cancelled')
|
||||
|
||||
<span class="badge bg-danger">
|
||||
لغو شده
|
||||
</span>
|
||||
|
||||
@endif
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endforeach
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@else
|
||||
|
||||
|
||||
<div class="empty-favorite">
|
||||
|
||||
<i class="fa fa-plane"></i>
|
||||
|
||||
<p>
|
||||
هنوز رزروی ثبت نکردهاید.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@endsection
|
||||
@@ -54,6 +54,22 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<div class="card border-0 shadow-sm rounded-4 p-3">
|
||||
|
||||
<h5>
|
||||
رزرو✈️
|
||||
</h5>
|
||||
|
||||
<strong>
|
||||
{{ auth()->user()->reservations()->count() }}
|
||||
</strong>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -483,6 +483,33 @@
|
||||
<span>قیمت</span>
|
||||
<b>{{ number_format($flight->price) }} تومان</b>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
|
||||
@auth
|
||||
<form action="{{ route('users.reservations.store') }}" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="reservable_id" value="{{ $flight->id }}">
|
||||
|
||||
<input type="hidden" name="reservable_type" value="App\Models\Flight">
|
||||
|
||||
<input type="hidden" name="price" value="{{ $flight->price }}">
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-success">
|
||||
رزرو تور
|
||||
</button>
|
||||
|
||||
</form> @else
|
||||
|
||||
<a href="{{ route('auth.login.index') }}" class="btn btn-warning btn-lg px-5">
|
||||
برای رزرو وارد شوید
|
||||
</a>
|
||||
|
||||
@endauth
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span>تعداد مشاهده</span>
|
||||
|
||||
@@ -312,6 +312,9 @@
|
||||
نظرات قبلی
|
||||
</a>
|
||||
|
||||
<a href="{{route('users.reservations.index')}}">
|
||||
رزرو من
|
||||
</a>
|
||||
|
||||
<form action="{{ route('auth.logout.index') }}" method="POST">
|
||||
|
||||
|
||||
@@ -101,7 +101,33 @@
|
||||
<p class="mt-3">
|
||||
{{ $tour->description }}
|
||||
</p>
|
||||
<div class="mt-4">
|
||||
|
||||
@auth
|
||||
<form action="{{ route('users.reservations.store') }}" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="reservable_id" value="{{ $tour->id }}">
|
||||
|
||||
<input type="hidden" name="reservable_type" value="App\Models\Tour">
|
||||
|
||||
<input type="hidden" name="price" value="{{ $tour->price }}">
|
||||
|
||||
|
||||
<button type="submit" class="btn btn-success">
|
||||
رزرو تور
|
||||
</button>
|
||||
|
||||
</form> @else
|
||||
|
||||
<a href="{{ route('auth.login.index') }}" class="btn btn-warning btn-lg px-5">
|
||||
برای رزرو وارد شوید
|
||||
</a>
|
||||
|
||||
@endauth
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<span>تعداد مشاهده</span>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user