404 lines
13 KiB
PHP
404 lines
13 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('content')
|
|
|
|
<div class="container-fluid pt-4">
|
|
|
|
{{-- Success --}}
|
|
@if(session('success'))
|
|
<div class="alert alert-success">
|
|
{{ session('success') }}
|
|
</div>
|
|
@endif
|
|
|
|
{{-- Error --}}
|
|
@if(session('error'))
|
|
<div class="alert alert-danger">
|
|
{{ session('error') }}
|
|
</div>
|
|
@endif
|
|
|
|
@error('error')
|
|
<div class="alert alert-danger">
|
|
{{ $message }}
|
|
</div>
|
|
@enderror
|
|
|
|
|
|
<div class="card custom-card">
|
|
|
|
{{-- Header --}}
|
|
<div class="card-header d-flex justify-content-between align-items-center">
|
|
|
|
<div class="card-title">
|
|
لیست تورها
|
|
</div>
|
|
|
|
<a
|
|
href="{{ route('admin.tours.create') }}"
|
|
class="btn btn-primary"
|
|
>
|
|
<i class="ri-add-line"></i>
|
|
ایجاد تور
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="card-body">
|
|
|
|
{{-- Filters --}}
|
|
<form
|
|
action="{{ route('admin.tours.index') }}"
|
|
method="GET"
|
|
class="mb-4"
|
|
>
|
|
|
|
<div class="row g-3">
|
|
|
|
{{-- Search --}}
|
|
<div class="col-xl-5">
|
|
|
|
<input
|
|
type="text"
|
|
class="form-control"
|
|
name="search"
|
|
value="{{ request('search') }}"
|
|
placeholder="جستجوی تور..."
|
|
>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Status --}}
|
|
<div class="col-xl-3">
|
|
|
|
<select
|
|
class="form-control"
|
|
name="status"
|
|
>
|
|
|
|
<option value="">
|
|
همه وضعیتها
|
|
</option>
|
|
|
|
<option
|
|
value="{{ \App\Enums\TourStatus::ENABLE->value }}"
|
|
@selected(
|
|
request('status') ==
|
|
\App\Enums\TourStatus::ENABLE->value
|
|
)
|
|
>
|
|
فعال
|
|
</option>
|
|
|
|
<option
|
|
value="{{ \App\Enums\TourStatus::DISABLE->value }}"
|
|
@selected(
|
|
request('status') ==
|
|
\App\Enums\TourStatus::DISABLE->value
|
|
)
|
|
>
|
|
غیرفعال
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Apply --}}
|
|
<div class="col-xl-2">
|
|
|
|
<button
|
|
type="submit"
|
|
class="btn btn-primary w-100"
|
|
>
|
|
اعمال فیلتر
|
|
</button>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Reset --}}
|
|
<div class="col-xl-2">
|
|
|
|
<a
|
|
href="{{ route('admin.tours.index') }}"
|
|
class="btn btn-light w-100"
|
|
>
|
|
حذف فیلتر
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
|
|
{{-- Table --}}
|
|
<div class="table-responsive">
|
|
|
|
<table class="table text-nowrap table-bordered align-middle">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>تور</th>
|
|
<th>مبدأ</th>
|
|
<th>مقصد</th>
|
|
<th>مدت</th>
|
|
<th>قیمت</th>
|
|
<th>تاریخ حرکت</th>
|
|
<th>وضعیت</th>
|
|
<th>بازدید</th>
|
|
<th>عملیات</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
@forelse($tours as $tour)
|
|
|
|
<tr>
|
|
|
|
{{-- Tour --}}
|
|
<td>
|
|
|
|
<div class="d-flex align-items-center">
|
|
|
|
<span
|
|
class="avatar avatar-md avatar-square bg-light"
|
|
style="
|
|
width:60px;
|
|
height:60px;
|
|
overflow:hidden;
|
|
"
|
|
>
|
|
|
|
@if($tour->file?->path)
|
|
|
|
<img
|
|
src="{{ asset('storage/' . $tour->file->path) }}"
|
|
alt="{{ $tour->title }}"
|
|
style="
|
|
width:100%;
|
|
height:100%;
|
|
object-fit:cover;
|
|
"
|
|
>
|
|
|
|
@else
|
|
|
|
<img
|
|
src="{{ asset('assets/img/tour/01.jpg') }}"
|
|
alt="{{ $tour->title }}"
|
|
style="
|
|
width:100%;
|
|
height:100%;
|
|
object-fit:cover;
|
|
"
|
|
>
|
|
|
|
@endif
|
|
|
|
</span>
|
|
|
|
|
|
<div class="ms-2">
|
|
|
|
<span class="fw-semibold d-block">
|
|
{{ $tour->title }}
|
|
</span>
|
|
|
|
@if($tour->summary)
|
|
|
|
<small class="text-muted">
|
|
{{ \Illuminate\Support\Str::limit($tour->summary, 50) }}
|
|
</small>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
|
|
{{-- Origin --}}
|
|
<td>
|
|
{{ $tour->origin }}
|
|
</td>
|
|
|
|
|
|
{{-- Destination --}}
|
|
<td>
|
|
{{ $tour->destination }}
|
|
</td>
|
|
|
|
|
|
{{-- Duration --}}
|
|
<td>
|
|
{{ $tour->duration }}
|
|
روز
|
|
</td>
|
|
|
|
|
|
{{-- Price --}}
|
|
<td>
|
|
{{ number_format($tour->price) }}
|
|
تومان
|
|
</td>
|
|
|
|
|
|
{{-- Tour Dates --}}
|
|
<td>
|
|
|
|
@forelse($tour->tourDates as $tourDate)
|
|
|
|
<div class="mb-1">
|
|
|
|
<span>
|
|
{{ $tourDate->start_date?->toJalali()->format('Y/m/d') }}
|
|
</span>
|
|
|
|
<span>
|
|
-
|
|
</span>
|
|
|
|
<span>
|
|
{{ $tourDate->end_date?->toJalali()->format('Y/m/d') }}
|
|
</span>
|
|
|
|
</div>
|
|
|
|
@empty
|
|
|
|
<span class="text-muted">
|
|
تاریخی ثبت نشده
|
|
</span>
|
|
|
|
@endforelse
|
|
|
|
</td>
|
|
|
|
|
|
{{-- Status --}}
|
|
<td>
|
|
|
|
@if($tour->status === \App\Enums\TourStatus::ENABLE)
|
|
|
|
<span class="badge bg-success">
|
|
فعال
|
|
</span>
|
|
|
|
@elseif($tour->status === \App\Enums\TourStatus::DISABLE)
|
|
|
|
<span class="badge bg-danger">
|
|
غیرفعال
|
|
</span>
|
|
|
|
@else
|
|
|
|
<span class="badge bg-secondary">
|
|
نامشخص
|
|
</span>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
|
|
{{-- Views --}}
|
|
<td>
|
|
{{ number_format($tour->views ?? 0) }}
|
|
</td>
|
|
|
|
|
|
{{-- Actions --}}
|
|
<td>
|
|
|
|
<div class="hstack gap-2 fs-15">
|
|
|
|
{{-- Edit --}}
|
|
<a
|
|
href="{{ route('admin.tours.edit', $tour) }}"
|
|
class="btn btn-secondary-light btn-icon btn-sm"
|
|
data-bs-toggle="tooltip"
|
|
title="ویرایش"
|
|
>
|
|
<i class="ti ti-pencil"></i>
|
|
</a>
|
|
|
|
|
|
{{-- Delete --}}
|
|
<form
|
|
action="{{ route('admin.tours.destroy', $tour) }}"
|
|
method="POST"
|
|
style="display:inline;"
|
|
onsubmit="return confirm('آیا از حذف این تور مطمئن هستید؟')"
|
|
>
|
|
|
|
@csrf
|
|
@method('DELETE')
|
|
|
|
<button
|
|
type="submit"
|
|
class="btn btn-icon btn-sm btn-danger-light"
|
|
data-bs-toggle="tooltip"
|
|
title="حذف"
|
|
>
|
|
<i class="ri-delete-bin-line"></i>
|
|
</button>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@empty
|
|
|
|
<tr>
|
|
|
|
<td
|
|
colspan="9"
|
|
class="text-center py-4"
|
|
>
|
|
توری یافت نشد.
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforelse
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
{{-- Pagination --}}
|
|
<div class="mt-3">
|
|
|
|
{{ $tours->links() }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|