feat: add tour list and show and edit and delete tours in admin panel
This commit is contained in:
@@ -0,0 +1,132 @@
|
||||
@extends('dashboard.layouts.app')
|
||||
|
||||
@section('title', 'لیست تورها')
|
||||
|
||||
@section('account-content')
|
||||
|
||||
<div class="user-profile-wrapper">
|
||||
|
||||
@if(session('success'))
|
||||
<div class="col-lg-12 mb-3">
|
||||
<div class="alert alert-success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="col-lg-12">
|
||||
<div class="user-profile-card">
|
||||
|
||||
<h4 class="user-profile-card-title">
|
||||
لیست تورها
|
||||
</h4>
|
||||
|
||||
<div class="user-profile-form">
|
||||
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>عنوان تور</th>
|
||||
<th>مبدأ</th>
|
||||
<th>مقصد</th>
|
||||
<th>تاریخ حرکت</th>
|
||||
<th>تاریخ برگشت</th>
|
||||
<th>نوع تور</th>
|
||||
<th>عملیات</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
@forelse($tours as $tour)
|
||||
|
||||
@php
|
||||
$detail = $tour->tour_details->first();
|
||||
@endphp
|
||||
|
||||
<tr>
|
||||
|
||||
<td>
|
||||
{{ $tours->firstItem() + $loop->index }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $tour->title }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $tour->originAirport?->city ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $tour->destinationAirport?->city ?? '-' }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ verta($tour->tour_details->first()->start_date)->format('Y/m/d') }}
|
||||
<td>
|
||||
{{ verta($tour->tour_details->first()->end_date)->format('Y/m/d') }} </td>
|
||||
|
||||
<td>
|
||||
{{ $tour->tour_type }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<a href="{{ route('tour.show', $tour->id) }}" title="مشاهده"
|
||||
class="btn btn-outline-secondary btn-sm">
|
||||
<i class="far fa-eye"></i>
|
||||
</a>
|
||||
<a href="{{ route('admin.tours.edit', $tour->id) }}" title="ویرایش"
|
||||
class="btn btn-outline-secondary btn-sm">
|
||||
<i class="far fa-pen"></i>
|
||||
</a>
|
||||
<form action="{{ route('admin.tours.destroy', $tour->id) }}" method="POST"
|
||||
style="display: inline-block;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button type="submit" title="حذف"
|
||||
onclick="return confirm('آیا از حذف این تور مطمئن هستید؟')"
|
||||
|
||||
class="btn btn-outline-secondary btn-sm"><i class="far fa-trash-can"></i> </button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
<td colspan="8" class="text-center">
|
||||
هیچ توری ثبت نشده است.
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
{{ $tours->links() }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in New Issue
Block a user