feat:add index and logs blade
This commit is contained in:
@@ -0,0 +1,589 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
<div>
|
||||||
|
<h1 class="page-title fw-medium fs-18 mb-2">
|
||||||
|
لیست پروازها
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<ol class="breadcrumb mb-0">
|
||||||
|
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{{ route('admin.flights.index') }}">
|
||||||
|
مدیریت پروازها
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">
|
||||||
|
لیست پروازها
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
@php
|
||||||
|
$permission = auth('admin')->user()->permission;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4">
|
||||||
|
|
||||||
|
{{-- پیام خطا --}}
|
||||||
|
@if($errors->has('error'))
|
||||||
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||||
|
|
||||||
|
{{ $errors->first('error') }}
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn-close"
|
||||||
|
data-bs-dismiss="alert"
|
||||||
|
aria-label="Close"
|
||||||
|
></button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
{{-- پیام موفقیت --}}
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||||
|
|
||||||
|
{{ session('success') }}
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
class="btn-close"
|
||||||
|
data-bs-dismiss="alert"
|
||||||
|
aria-label="Close"
|
||||||
|
></button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
{{-- فیلتر و جستجو --}}
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-xl-12">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-body p-3">
|
||||||
|
|
||||||
|
<form
|
||||||
|
method="GET"
|
||||||
|
action="{{ route('admin.flights.index') }}"
|
||||||
|
>
|
||||||
|
|
||||||
|
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
||||||
|
|
||||||
|
<div class="d-flex flex-wrap gap-2 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
|
||||||
|
class="form-control"
|
||||||
|
name="flight_type"
|
||||||
|
>
|
||||||
|
|
||||||
|
<option value="">
|
||||||
|
نوع پرواز
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="{{ \App\Enums\FlightType::DEPARTURE->value }}"
|
||||||
|
@selected(
|
||||||
|
request()->input('flight_type') ===
|
||||||
|
(string) \App\Enums\FlightType::DEPARTURE->value
|
||||||
|
)
|
||||||
|
>
|
||||||
|
یکطرفه
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="{{ \App\Enums\FlightType::RETURN->value }}"
|
||||||
|
@selected(
|
||||||
|
request()->input('flight_type') ===
|
||||||
|
(string) \App\Enums\FlightType::RETURN->value
|
||||||
|
)
|
||||||
|
>
|
||||||
|
برگشت
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="{{ \App\Enums\FlightType::ROUNDTRIP->value }}"
|
||||||
|
@selected(
|
||||||
|
request()->input('flight_type') ===
|
||||||
|
(string) \App\Enums\FlightType::ROUNDTRIP->value
|
||||||
|
)
|
||||||
|
>
|
||||||
|
رفت و برگشت
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- وضعیت --}}
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
name="status"
|
||||||
|
>
|
||||||
|
|
||||||
|
<option value="">
|
||||||
|
وضعیت
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="{{ \App\Enums\FlightStatus::ENABLE->value }}"
|
||||||
|
@selected(
|
||||||
|
request()->input('status') ===
|
||||||
|
(string) \App\Enums\FlightStatus::ENABLE->value
|
||||||
|
)
|
||||||
|
>
|
||||||
|
فعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="{{ \App\Enums\FlightStatus::DISABLE->value }}"
|
||||||
|
@selected(
|
||||||
|
request()->input('status') ===
|
||||||
|
(string) \App\Enums\FlightStatus::DISABLE->value
|
||||||
|
)
|
||||||
|
>
|
||||||
|
غیرفعال
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- مرتب سازی --}}
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
name="sort"
|
||||||
|
>
|
||||||
|
|
||||||
|
<option value="">
|
||||||
|
مرتبسازی بر اساس
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="newest"
|
||||||
|
@selected(
|
||||||
|
request()->missing('sort') ||
|
||||||
|
request()->input('sort') === 'newest'
|
||||||
|
)
|
||||||
|
>
|
||||||
|
جدیدترین
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="oldest"
|
||||||
|
@selected(
|
||||||
|
request()->input('sort') === 'oldest'
|
||||||
|
)
|
||||||
|
>
|
||||||
|
قدیمیترین
|
||||||
|
</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="departure_asc"
|
||||||
|
@selected(
|
||||||
|
request()->input('sort') === 'departure_asc'
|
||||||
|
)
|
||||||
|
>
|
||||||
|
تاریخ حرکت (قدیمیتر)
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="departure_desc"
|
||||||
|
@selected(
|
||||||
|
request()->input('sort') === 'departure_desc'
|
||||||
|
)
|
||||||
|
>
|
||||||
|
تاریخ حرکت (جدیدتر)
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn-primary"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
اعمال فیلتر
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- حذف فیلتر --}}
|
||||||
|
@if(request()->anyFilled([
|
||||||
|
'search',
|
||||||
|
'flight_type',
|
||||||
|
'status',
|
||||||
|
'sort'
|
||||||
|
]))
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="{{ route('admin.flights.index') }}"
|
||||||
|
class="btn btn-light"
|
||||||
|
>
|
||||||
|
حذف فیلتر
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- ایجاد پرواز --}}
|
||||||
|
@if($permission?->flight_create)
|
||||||
|
|
||||||
|
<div class="d-flex">
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="{{ route('admin.flights.create') }}"
|
||||||
|
class="btn btn-primary"
|
||||||
|
>
|
||||||
|
<i class="ri-add-line me-1 fw-medium align-middle"></i>
|
||||||
|
ایجاد پرواز
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- جدول پروازها --}}
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-xl-12">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<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>
|
||||||
|
<th>تاریخ ثبت</th>
|
||||||
|
<th>عملیات</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
@forelse($flights as $flight)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
{{-- عکس و عنوان --}}
|
||||||
|
<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($flight->file?->path)
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="{{ asset('storage/' . $flight->file->path) }}"
|
||||||
|
alt="{{ $flight->title }}"
|
||||||
|
style="width:100%;height:100%;object-fit:cover;"
|
||||||
|
>
|
||||||
|
|
||||||
|
@else
|
||||||
|
|
||||||
|
<img
|
||||||
|
src="{{ asset('assets/images/default.jpg') }}"
|
||||||
|
alt="تصویر پیشفرض"
|
||||||
|
style="width:100%;height:100%;object-fit:cover;"
|
||||||
|
>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="ms-2">
|
||||||
|
|
||||||
|
<span class="fw-semibold d-block">
|
||||||
|
{{ $flight->title }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@if($flight->summary)
|
||||||
|
|
||||||
|
<small class="text-muted">
|
||||||
|
{{ \Illuminate\Support\Str::limit($flight->summary, 50) }}
|
||||||
|
</small>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- مبدأ --}}
|
||||||
|
<td>
|
||||||
|
{{ $flight->departureAirport?->city?->name ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- مقصد --}}
|
||||||
|
<td>
|
||||||
|
{{ $flight->arrivalAirport?->city?->name ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- ایرلاین --}}
|
||||||
|
<td>
|
||||||
|
{{ $flight->airline?->name ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- نوع پرواز --}}
|
||||||
|
<td>
|
||||||
|
|
||||||
|
@if($flight->flight_type === \App\Enums\FlightType::DEPARTURE)
|
||||||
|
|
||||||
|
<span class="badge bg-primary">
|
||||||
|
یکطرفه
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@elseif($flight->flight_type === \App\Enums\FlightType::RETURN)
|
||||||
|
|
||||||
|
<span class="badge bg-info">
|
||||||
|
برگشت
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@elseif($flight->flight_type === \App\Enums\FlightType::ROUNDTRIP)
|
||||||
|
|
||||||
|
<span class="badge bg-warning">
|
||||||
|
رفت و برگشت
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@else
|
||||||
|
|
||||||
|
<span class="badge bg-secondary">
|
||||||
|
نامشخص
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- تاریخ حرکت --}}
|
||||||
|
<td>
|
||||||
|
{{ $flight->departure_time?->toJalali()->format('Y/m/d H:i') ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- قیمت --}}
|
||||||
|
<td>
|
||||||
|
{{ number_format($flight->price) }}
|
||||||
|
تومان
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- وضعیت --}}
|
||||||
|
<td>
|
||||||
|
|
||||||
|
@if($flight->status === \App\Enums\FlightStatus::ENABLE)
|
||||||
|
|
||||||
|
<span class="badge bg-success">
|
||||||
|
فعال
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@elseif($flight->status === \App\Enums\FlightStatus::DISABLE)
|
||||||
|
|
||||||
|
<span class="badge bg-danger">
|
||||||
|
غیرفعال
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@else
|
||||||
|
|
||||||
|
<span class="badge bg-secondary">
|
||||||
|
نامشخص
|
||||||
|
</span>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- بازدید --}}
|
||||||
|
<td>
|
||||||
|
{{ number_format($flight->views ?? 0) }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- تاریخ ثبت --}}
|
||||||
|
<td>
|
||||||
|
{{ $flight->created_at?->toJalali()->format('Y/m/d H:i') ?? '-' }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- عملیات --}}
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<div class="hstack gap-2 fs-15">
|
||||||
|
|
||||||
|
{{-- ویرایش --}}
|
||||||
|
@if($permission?->flight_edit)
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="{{ route('admin.flights.edit', $flight) }}"
|
||||||
|
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($permission?->flight_delete)
|
||||||
|
|
||||||
|
<form
|
||||||
|
action="{{ route('admin.flights.destroy', $flight) }}"
|
||||||
|
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>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@empty
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td
|
||||||
|
colspan="11"
|
||||||
|
class="text-center py-4"
|
||||||
|
>
|
||||||
|
پروازی یافت نشد.
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- Pagination --}}
|
||||||
|
<div class="card-footer">
|
||||||
|
{{ $flights->links() }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="card-title">
|
||||||
|
تاریخچهی تغییرات: {{ $flight->title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>عملیات</th>
|
||||||
|
<th>کاربر</th>
|
||||||
|
<th>تاریخ</th>
|
||||||
|
<th>تغییرات</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
@forelse($logs as $log)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if($log->action === 'created')
|
||||||
|
<span class="badge bg-success">ایجاد</span>
|
||||||
|
@else
|
||||||
|
<span class="badge bg-primary">ویرایش</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $log->admin?->first_name }}
|
||||||
|
{{ $log->admin?->last_name }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $log->created_at->format('Y-m-d H:i') }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if($log->action === 'updated')
|
||||||
|
<ul class="mb-0 ps-3">
|
||||||
|
@foreach($log->changes as $field => $value)
|
||||||
|
<li>
|
||||||
|
<strong>{{ $field }}:</strong>
|
||||||
|
{{ $value['old'] }}
|
||||||
|
←
|
||||||
|
{{ $value['new'] }}
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@else
|
||||||
|
ایجاد رکورد جدید
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@empty
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center">
|
||||||
|
هیچ لاگی ثبت نشده است.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ $logs->links() }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,403 @@
|
|||||||
|
@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
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-header">
|
||||||
|
<div class="card-title">
|
||||||
|
تاریخچهی تغییرات: {{ $tour->title }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
|
||||||
|
<table class="table table-bordered">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>عملیات</th>
|
||||||
|
<th>کاربر</th>
|
||||||
|
<th>تاریخ</th>
|
||||||
|
<th>تغییرات</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
@forelse($logs as $log)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if($log->action === 'created')
|
||||||
|
<span class="badge bg-success">ایجاد</span>
|
||||||
|
@else
|
||||||
|
<span class="badge bg-primary">ویرایش</span>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $log->admin?->first_name }}
|
||||||
|
{{ $log->admin?->last_name }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $log->created_at->format('Y-m-d H:i') }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
@if($log->action === 'updated')
|
||||||
|
<ul class="mb-0 ps-3">
|
||||||
|
@foreach($log->changes as $field => $value)
|
||||||
|
<li>
|
||||||
|
<strong>{{ $field }}:</strong>
|
||||||
|
{{ $value['old'] }}
|
||||||
|
←
|
||||||
|
{{ $value['new'] }}
|
||||||
|
</li>
|
||||||
|
@endforeach
|
||||||
|
</ul>
|
||||||
|
@else
|
||||||
|
ایجاد رکورد جدید
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@empty
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="text-center">
|
||||||
|
هیچ لاگی ثبت نشده است.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ $logs->links() }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
@@ -0,0 +1,331 @@
|
|||||||
|
@extends('admin.layouts.app')
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
<div>
|
||||||
|
<h1 class="page-title fw-medium fs-18 mb-2">
|
||||||
|
لیست کاربران
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<nav>
|
||||||
|
<ol class="breadcrumb mb-0">
|
||||||
|
<li class="breadcrumb-item">
|
||||||
|
<a href="{{ route('admin.users.index') }}">
|
||||||
|
مدیریت کاربران
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li class="breadcrumb-item active" aria-current="page">
|
||||||
|
لیست کاربران
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
|
||||||
|
@php
|
||||||
|
$permission = auth('admin')->user()->permission;
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="container-fluid pt-4">
|
||||||
|
|
||||||
|
@if(session('success'))
|
||||||
|
<div class="alert alert-success">
|
||||||
|
{{ session('success') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if(session('error'))
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
{{ session('error') }}
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="card-body p-3">
|
||||||
|
|
||||||
|
<form
|
||||||
|
action="{{ route('admin.users.index') }}"
|
||||||
|
method="GET"
|
||||||
|
>
|
||||||
|
<div class="d-flex align-items-center justify-content-between flex-wrap gap-3">
|
||||||
|
|
||||||
|
<div class="d-flex flex-wrap gap-2 align-items-center">
|
||||||
|
|
||||||
|
<div class="d-flex me-2">
|
||||||
|
|
||||||
|
<input
|
||||||
|
class="form-control me-2"
|
||||||
|
type="search"
|
||||||
|
name="search"
|
||||||
|
placeholder="جستجو (نام، ایمیل، موبایل)"
|
||||||
|
value="{{ request('search') }}"
|
||||||
|
>
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn-light"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
جستجو
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
name="mobile"
|
||||||
|
placeholder="موبایل"
|
||||||
|
value="{{ request('mobile') }}"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
name="email"
|
||||||
|
placeholder="ایمیل"
|
||||||
|
value="{{ request('email') }}"
|
||||||
|
>
|
||||||
|
<link rel="stylesheet"
|
||||||
|
href="https://unpkg.com/persian-datepicker@latest/dist/css/persian-datepicker.min.css">
|
||||||
|
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
name="from_date"
|
||||||
|
id="from_date"
|
||||||
|
placeholder="از تاریخ"
|
||||||
|
value="{{ request('from_date') }}"
|
||||||
|
autocomplete="off"
|
||||||
|
>
|
||||||
|
<input
|
||||||
|
class="form-control"
|
||||||
|
type="text"
|
||||||
|
name="to_date"
|
||||||
|
id="to_date"
|
||||||
|
placeholder="تا تاریخ"
|
||||||
|
value="{{ request('to_date') }}"
|
||||||
|
autocomplete="off"
|
||||||
|
>
|
||||||
|
|
||||||
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<script
|
||||||
|
src="https://unpkg.com/persian-date@latest/dist/persian-date.min.js"></script>
|
||||||
|
<script
|
||||||
|
src="https://unpkg.com/persian-datepicker@latest/dist/js/persian-datepicker.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$('#from_date, #to_date').persianDatepicker({
|
||||||
|
format: 'YYYY/MM/DD',
|
||||||
|
autoClose: true,
|
||||||
|
observer: true
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<select
|
||||||
|
class="form-control"
|
||||||
|
name="sort"
|
||||||
|
>
|
||||||
|
|
||||||
|
<option value="">
|
||||||
|
مرتبسازی بر اساس
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="newest"
|
||||||
|
@selected(request('sort', 'newest') == 'newest')
|
||||||
|
>
|
||||||
|
جدیدترین
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="oldest"
|
||||||
|
@selected(request('sort') == 'oldest')
|
||||||
|
>
|
||||||
|
قدیمیترین
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="name_asc"
|
||||||
|
@selected(request('sort') == 'name_asc')
|
||||||
|
>
|
||||||
|
الفبا (الف - ی)
|
||||||
|
</option>
|
||||||
|
|
||||||
|
<option
|
||||||
|
value="name_desc"
|
||||||
|
@selected(request('sort') == 'name_desc')
|
||||||
|
>
|
||||||
|
الفبا (ی - الف)
|
||||||
|
</option>
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<button
|
||||||
|
class="btn btn-primary"
|
||||||
|
type="submit"
|
||||||
|
>
|
||||||
|
اعمال فیلتر
|
||||||
|
</button>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- حذف فیلتر --}}
|
||||||
|
@if(request()->anyFilled([
|
||||||
|
'search',
|
||||||
|
'mobile',
|
||||||
|
'email',
|
||||||
|
'from_date',
|
||||||
|
'to_date',
|
||||||
|
'sort'
|
||||||
|
]))
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="{{ route('admin.users.index') }}"
|
||||||
|
class="btn btn-light"
|
||||||
|
>
|
||||||
|
حذف فیلتر
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{{-- جدول کاربران --}}
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-xl-12">
|
||||||
|
|
||||||
|
<div class="card custom-card">
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
|
||||||
|
<table class="table text-nowrap">
|
||||||
|
|
||||||
|
<thead>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th>نام و نام خانوادگی</th>
|
||||||
|
<th>ایمیل</th>
|
||||||
|
<th>شماره موبایل</th>
|
||||||
|
<th>تاریخ ثبتنام</th>
|
||||||
|
<th>عملیات</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
|
||||||
|
@forelse($users as $user)
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
{{ getUserFullName($user) }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $user->email }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ $user->mobile }}
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td>
|
||||||
|
{{ verta($user->created_at)->format('Y/m/d H:i') }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<div class="btn-list">
|
||||||
|
|
||||||
|
@if($permission?->user_edit)
|
||||||
|
|
||||||
|
<a
|
||||||
|
href="{{ route('admin.users.edit', $user) }}"
|
||||||
|
class="btn btn-secondary-light btn-icon btn-sm"
|
||||||
|
data-bs-toggle="tooltip"
|
||||||
|
title="ویرایش"
|
||||||
|
>
|
||||||
|
<i class="ri-edit-line"></i>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
@if($permission?->user_delete)
|
||||||
|
|
||||||
|
<form
|
||||||
|
action="{{ route('admin.users.destroy', $user) }}"
|
||||||
|
method="POST"
|
||||||
|
class="d-inline"
|
||||||
|
onsubmit="return confirm('آیا از حذف این کاربر مطمئن هستید؟')"
|
||||||
|
>
|
||||||
|
|
||||||
|
@csrf
|
||||||
|
@method('DELETE')
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
class="btn btn-pink-light btn-icon btn-sm"
|
||||||
|
data-bs-toggle="tooltip"
|
||||||
|
title="حذف"
|
||||||
|
>
|
||||||
|
<i class="ri-delete-bin-line"></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@empty
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td
|
||||||
|
colspan="5"
|
||||||
|
class="text-center py-4"
|
||||||
|
>
|
||||||
|
کاربری پیدا نشد.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
@endforelse
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="d-flex justify-content-end mt-3">
|
||||||
|
|
||||||
|
{{ $users->links() }}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@endsection
|
||||||
Reference in New Issue
Block a user