314 lines
13 KiB
PHP
314 lines
13 KiB
PHP
@extends('admin.layouts.app')
|
|
|
|
@section('breadcrumb')
|
|
<div>
|
|
<h1 class="page-title fw-medium fs-18 mb-2">لیست تورها</h1>
|
|
<div>
|
|
<nav>
|
|
<ol class="breadcrumb mb-0">
|
|
<li class="breadcrumb-item">
|
|
<a href="javascript:void(0)">مدیریت تورها</a>
|
|
</li>
|
|
<li class="breadcrumb-item active" aria-current="page">
|
|
لیست تورها
|
|
</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div class="main-content app-content">
|
|
<div class="container-fluid pt-4">
|
|
|
|
@error('success')
|
|
<span class="text-success">{{ $message }}</span>
|
|
@enderror
|
|
|
|
@error('errors')
|
|
<span class="text-danger">{{ $message }}</span>
|
|
@enderror
|
|
|
|
<div class="row">
|
|
<div class="col-xl-12">
|
|
<div class="card custom-card">
|
|
|
|
<div class="card-body p-3">
|
|
|
|
<form method="GET">
|
|
|
|
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
|
|
|
<div class="d-flex flex-wrap gap-1 project-list-main align-items-center">
|
|
|
|
<div class="d-flex me-2">
|
|
|
|
<input
|
|
class="form-control me-2"
|
|
type="search"
|
|
name="search"
|
|
placeholder="جستجو تور"
|
|
value="{{ request()->input('search') }}"
|
|
aria-label="جستجو"
|
|
>
|
|
|
|
<button class="btn btn-light" type="submit">
|
|
جستجو
|
|
</button>
|
|
|
|
</div>
|
|
|
|
<select
|
|
id="choices-single-default"
|
|
class="form-control"
|
|
name="sort"
|
|
>
|
|
|
|
<option value="" selected>
|
|
مرتبسازی بر اساس
|
|
</option>
|
|
|
|
<option
|
|
value="created_at"
|
|
@selected(request()->input('sort') == 'created_at')
|
|
>
|
|
جدیدترین
|
|
</option>
|
|
|
|
<option
|
|
value="price_asc"
|
|
@selected(request()->input('sort') == 'price_asc')
|
|
>
|
|
قیمت (کم به زیاد)
|
|
</option>
|
|
|
|
<option
|
|
value="price_desc"
|
|
@selected(request()->input('sort') == 'price_desc')
|
|
>
|
|
قیمت (زیاد به کم)
|
|
</option>
|
|
|
|
<option
|
|
value="duration_asc"
|
|
@selected(request()->input('sort') == 'duration_asc')
|
|
>
|
|
مدت زمان (کم به زیاد)
|
|
</option>
|
|
|
|
<option
|
|
value="duration_desc"
|
|
@selected(request()->input('sort') == 'duration_desc')
|
|
>
|
|
مدت زمان (زیاد به کم)
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
|
|
@if(auth('admin')->user()->permission?->tour_create)
|
|
|
|
<div class="d-flex">
|
|
|
|
<a
|
|
href="{{ route('admin.tours.create') }}"
|
|
class="btn btn-primary me-2"
|
|
>
|
|
<i class="ri-add-line me-1 fw-medium align-middle"></i>
|
|
ایجاد تور
|
|
</a>
|
|
|
|
</div>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Tours Table -->
|
|
<div class="row">
|
|
|
|
<div class="col-xl-12">
|
|
|
|
<div class="card custom-card">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table text-nowrap table-bordered">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
<th>عکس</th>
|
|
<th>عنوان</th>
|
|
<th>مبدا</th>
|
|
<th>مقصد</th>
|
|
<th>زمان حرکت</th>
|
|
<th>مدت زمان</th>
|
|
<th>قیمت</th>
|
|
<th>وضعیت</th>
|
|
<th>تاریخ ثبت</th>
|
|
<th>تاریخ ویرایش</th>
|
|
<th>عملیات</th>
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
|
|
<tbody>
|
|
|
|
@foreach($tours as $tour)
|
|
|
|
<tr>
|
|
|
|
{{-- Image --}}
|
|
<td>
|
|
|
|
<span class="avatar avatar-md avatar-square bg-light">
|
|
|
|
@if($tour->file?->id)
|
|
|
|
<img
|
|
src="{{ getFileUrl($tour->file->id) }}"
|
|
class="w-100 h-100"
|
|
alt="{{ $tour->title }}"
|
|
>
|
|
|
|
@else
|
|
|
|
<img
|
|
src="{{ asset('images/no-image.png') }}"
|
|
class="w-100 h-100"
|
|
alt="{{ $tour->title }}"
|
|
>
|
|
|
|
@endif
|
|
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<span class="fw-semibold">
|
|
{{ $tour->title }}
|
|
</span>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
{{ $tour->origin }}
|
|
</td>
|
|
|
|
<td>
|
|
{{ $tour->destination }}
|
|
</td>
|
|
|
|
<td>
|
|
{{ $tour->departure_time->toJalali()->format('H:i Y-m-d') }}
|
|
</td>
|
|
|
|
<td>
|
|
{{ $tour->duration }} روز
|
|
</td>
|
|
|
|
<td>
|
|
|
|
{{ number_format($tour->price) }}
|
|
تومان
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
@if($tour->status == \App\Enums\TourStatus::ENABLE)
|
|
<span class="badge bg-primary-transparent">فعال</span>
|
|
@elseif($tour->status == \App\Enums\TourStatus::DISABLE)
|
|
<span class="badge bg-warning-transparent">غیرفعال</span>
|
|
@endif
|
|
|
|
</td>
|
|
<td>{{ $tour->created_at->toJalali()->format('H:i Y-m-d') }}</td>
|
|
<td>{{ $tour->updated_at->toJalali()->format('H:i Y-m-d') }}</td>
|
|
|
|
|
|
{{-- Actions --}}
|
|
<td>
|
|
|
|
<div class="hstack gap-2 fs-15">
|
|
|
|
@if(auth('admin')->user()->permission?->tour_edit)
|
|
|
|
<a
|
|
href="{{ route('admin.tours.edit', $tour->id) }}"
|
|
class="btn btn-secondary-light btn-icon btn-sm"
|
|
data-bs-toggle="tooltip"
|
|
data-bs-placement="top"
|
|
title="ویرایش"
|
|
>
|
|
<i class="ti ti-pencil"></i>
|
|
</a>
|
|
|
|
@endif
|
|
|
|
|
|
@if(auth('admin')->user()->permission?->tour_delete)
|
|
|
|
<form
|
|
action="{{ route('admin.tours.destroy', $tour->id) }}"
|
|
method="POST"
|
|
onsubmit="return confirm('آیا از حذف این تور مطمئن هستید؟')"
|
|
>
|
|
|
|
@csrf
|
|
@method('DELETE')
|
|
|
|
<button
|
|
type="submit"
|
|
class="btn btn-icon btn-sm btn-danger-light"
|
|
title="حذف"
|
|
>
|
|
<i class="ri-delete-bin-line"></i>
|
|
</button>
|
|
|
|
</form>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ $tours->links() }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
@endsection
|