feat(admin): complete admin management and add edit functionality

This commit is contained in:
2026-08-20 11:56:46 +03:30
parent 0a0ee7ca5a
commit 3867350331
16 changed files with 1883 additions and 39 deletions
@@ -0,0 +1,269 @@
<?php $__env->startSection('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>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="container-fluid pt-4">
<?php if(session('success')): ?>
<span style="color: green"><?php echo e(session('success')); ?></span>
<?php endif; ?>
<?php if(session('error')): ?>
<span style="color: red"><?php echo e(session('error')); ?></span>
<?php endif; ?>
<div class="row">
<div class="col-xl-12">
<div class="card custom-card">
<div class="card-body p-3">
<form method="GET" action="<?php echo e(route('admin.tours.index')); ?>">
<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="<?php echo e(request()->input('search')); ?>"
aria-label="جست‌وجو">
<button class="btn btn-light" type="submit">
جست‌وجو
</button>
</div>
<select id="choices-single-default"
class="form-control"
name="sort"
onchange="this.form.submit()">
<option value="">مرتب‌سازی بر اساس</option>
<option value="newest"
<?php if(request()->missing('sort') || request()->input('sort') === 'newest'): echo 'selected'; endif; ?>>
جدیدترین
</option>
<option value="lowest"
<?php if(request()->input('sort') === 'lowest'): echo 'selected'; endif; ?>>
کمترین قیمت
</option>
<option value="highest"
<?php if(request()->input('sort') === 'highest'): echo 'selected'; endif; ?>>
بیشترین قیمت
</option>
</select>
</div>
<div class="d-flex align-items-center gap-2">
<a href="<?php echo e(route('admin.tours.trash.index')); ?>"
class="btn btn-danger-light d-flex align-items-center">
<i class="ri-delete-bin-3-line me-1 fw-medium align-middle"></i>
سطل زباله
</a>
<a href="<?php echo e(route('admin.tours.create')); ?>"
class="btn btn-primary me-2">
<i class="ri-add-line me-1 fw-medium align-middle"></i>
ایجاد تور
</a>
</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 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>
<th>اقدامات</th>
</tr>
</thead>
<tbody>
<?php $__empty_1 = true; $__currentLoopData = $tours; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $tour): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
<tr>
<td>
<span class="avatar avatar-md avatar-square bg-light">
<?php if($tour->coverImage?->file): ?>
<img src="<?php echo e(getFileUrl($tour->coverImage->file_id)); ?>"
class="w-100 h-100"
alt="<?php echo e($tour->title); ?>">
<?php else: ?>
<img src="<?php echo e(asset('assets/Admin/images/tour/single-2.jpg')); ?>"
class="w-100 h-100"
alt="<?php echo e($tour->title); ?>">
<?php endif; ?>
</span>
</td>
<td>
<div class="fw-medium">
<?php echo e($tour->title); ?>
</div>
<?php if($tour->summary): ?>
<small class="text-muted d-inline-block text-truncate"
style="max-width: 180px;">
<?php echo e($tour->summary); ?>
</small>
<?php endif; ?>
</td>
<td>
<?php echo e($tour->originCity?->name ?? '-'); ?>
</td>
<td>
<?php echo e($tour->city?->name ?? '-'); ?>
</td>
<td>
<?php if($tour->tour_scope): ?>
<span class="badge bg-primary-transparent">
<?php echo e($tour->tour_scope->label()); ?>
</span>
<?php else: ?>
-
<?php endif; ?>
</td>
<td>
<?php if($tour->tour_mode): ?>
<span class="badge bg-warning-transparent">
<?php echo e($tour->tour_mode->label()); ?>
</span>
<?php else: ?>
-
<?php endif; ?>
</td>
<td>
<?php if($tour->tour_type): ?>
<span class="badge bg-success-transparent">
<?php echo e($tour->tour_type->label()); ?>
</span>
<?php else: ?>
-
<?php endif; ?>
</td>
<td>
<span class="badge bg-info-transparent">
<?php echo e($tour->tour_departures_count); ?> حرکت
</span>
</td>
<td>
<?php if($tour->tour_departures_min_price === $tour->tour_departures_max_price): ?>
<?php echo e(number_format($tour->tour_departures_min_price)); ?> تومان
<?php else: ?>
<?php echo e(number_format($tour->tour_departures_min_price)); ?>
-
<?php echo e(number_format($tour->tour_departures_max_price)); ?>
تومان
<?php endif; ?>
</td>
<td>
<?php echo e($tour->views_count ?? 0); ?>
</td>
<td>
<?php echo e($tour->created_at->toJalali()->format('d F Y - H:i')); ?>
</td>
<td>
<div class="hstack gap-2 fs-15">
<a href="<?php echo e(route('admin.tours.edit', $tour->id)); ?>"
class="btn btn-secondary-light btn-icon btn-sm"
title="ویرایش">
<i class="ti ti-pencil"></i>
</a>
<form action="<?php echo e(route('admin.tours.destroy', $tour->id)); ?>"
method="POST"
class="d-inline"
onsubmit="return confirm('از حذف این تور مطمئن هستید؟')">
<?php echo csrf_field(); ?>
<?php echo method_field('DELETE'); ?>
<button type="submit"
class="btn btn-icon btn-sm btn-danger-light"
title="حذف">
<i class="ri-delete-bin-line"></i>
</button>
</form>
</div>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
<tr>
<td colspan="11" class="text-center text-muted py-4">
هیچ توری یافت نشد.
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="d-flex justify-content-end mt-3">
<?php echo e($tours->links()); ?>
</div>
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\ASUS\Desktop\airline-agency\resources\views/admin/tours/index.blade.php ENDPATH**/ ?>