git commit "feat: improve admin panel and frontend features"
This commit is contained in:
@@ -1,278 +1,380 @@
|
||||
@extends('admin.layouts.app')
|
||||
@extends('admin.layouts.app')
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="container">
|
||||
<div class="container-fluid pt-4">
|
||||
|
||||
<div class="d-flex justify-content-between mb-4">
|
||||
<div class="card custom-card">
|
||||
|
||||
<h4>
|
||||
مدیریت پروازها
|
||||
</h4>
|
||||
|
||||
<a href="{{ route('admin.flights.create') }}"
|
||||
class="btn btn-primary">
|
||||
|
||||
ثبت پرواز جدید
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<form method="GET"
|
||||
action="{{ route('admin.flights.index') }}"
|
||||
class="mb-3">
|
||||
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control"
|
||||
placeholder="جستجو..."
|
||||
value="{{ request('search') }}">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
|
||||
<div class="card-title">
|
||||
مدیریت پروازها
|
||||
</div>
|
||||
|
||||
<a href="{{ route('admin.flights.create') }}"
|
||||
class="btn btn-primary">
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<select name="type" class="form-control">
|
||||
|
||||
<option value="">
|
||||
همه انواع
|
||||
</option>
|
||||
|
||||
<option value="0"
|
||||
@selected(request('type')=='0')>
|
||||
داخلی
|
||||
</option>
|
||||
|
||||
<option value="2"
|
||||
@selected(request('type')=='2')>
|
||||
خارجی
|
||||
</option>
|
||||
|
||||
<option value="3"
|
||||
@selected(request('type')=='3')>
|
||||
چارتر
|
||||
</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<select name="sort"
|
||||
class="form-control">
|
||||
|
||||
<option value="newest">
|
||||
جدیدترین
|
||||
</option>
|
||||
|
||||
<option value="price_asc">
|
||||
ارزانترین
|
||||
</option>
|
||||
|
||||
<option value="price_desc">
|
||||
گرانترین
|
||||
</option>
|
||||
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-2">
|
||||
|
||||
<button class="btn btn-dark w-100">
|
||||
اعمال
|
||||
</button>
|
||||
|
||||
</div>
|
||||
ثبت پرواز جدید
|
||||
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</form>
|
||||
<div class="card-body">
|
||||
|
||||
<form method="GET"
|
||||
action="{{ route('admin.flights.index') }}"
|
||||
class="mb-4">
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
<div class="col-md-4">
|
||||
|
||||
<input type="text"
|
||||
name="search"
|
||||
class="form-control"
|
||||
placeholder="جستجو بر اساس ایرلاین، شماره پرواز یا مسیر..."
|
||||
value="{{ request('search') }}">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
|
||||
<table class="table table-bordered text-center">
|
||||
<select name="type"
|
||||
class="form-control">
|
||||
|
||||
<thead>
|
||||
<option value="">
|
||||
همه انواع
|
||||
</option>
|
||||
|
||||
<tr>
|
||||
<option value="0"
|
||||
@selected(request('type') == '0')>
|
||||
داخلی
|
||||
</option>
|
||||
|
||||
<th>
|
||||
شناسه
|
||||
</th>
|
||||
<option value="2"
|
||||
@selected(request('type') == '2')>
|
||||
خارجی
|
||||
</option>
|
||||
|
||||
<th>
|
||||
ایرلاین
|
||||
</th>
|
||||
<option value="3"
|
||||
@selected(request('type') == '3')>
|
||||
چارتر
|
||||
</option>
|
||||
|
||||
<th>
|
||||
تصویر
|
||||
</th>
|
||||
</select>
|
||||
|
||||
<th>
|
||||
شماره پرواز
|
||||
</th>
|
||||
<th>
|
||||
تاریخ حرکت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
مسیر
|
||||
</th>
|
||||
|
||||
<th>
|
||||
نوع
|
||||
</th>
|
||||
|
||||
<th>
|
||||
قیمت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
وضعیت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
عملیات
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
</div>
|
||||
|
||||
|
||||
<tbody>
|
||||
<div class="col-md-3">
|
||||
|
||||
<select name="sort"
|
||||
class="form-control">
|
||||
|
||||
<option value="newest"
|
||||
@selected(request('sort', 'newest') == 'newest')>
|
||||
جدیدترین
|
||||
</option>
|
||||
|
||||
<option value="price_asc"
|
||||
@selected(request('sort') == 'price_asc')>
|
||||
ارزانترین
|
||||
</option>
|
||||
|
||||
<option value="price_desc"
|
||||
@selected(request('sort') == 'price_desc')>
|
||||
گرانترین
|
||||
</option>
|
||||
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@forelse($flights as $flight)
|
||||
<div class="col-md-2">
|
||||
|
||||
<tr>
|
||||
<button type="submit"
|
||||
class="btn btn-dark w-100">
|
||||
|
||||
<td>
|
||||
{{ $loop->iteration }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
{{ $flight->airline }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($flight->image)
|
||||
<img src="{{ getImageUrl($flight->image) }}"
|
||||
width="120">
|
||||
@endif
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
{{ $flight->flight_number }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
{{ $flight->origin }}
|
||||
-
|
||||
{{ $flight->destination }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
@switch($flight->type)
|
||||
|
||||
@case(0)
|
||||
داخلی
|
||||
@break
|
||||
|
||||
@case(2)
|
||||
خارجی
|
||||
@break
|
||||
|
||||
@case(3)
|
||||
چارتر
|
||||
@break
|
||||
|
||||
@endswitch
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ number_format($flight->price) }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
{{ $flight->status }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
<a href="{{ route('admin.flights.edit',$flight) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
|
||||
ویرایش
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<form action="{{ route('admin.flights.destroy',$flight) }}"
|
||||
method="POST"
|
||||
class="d-inline">
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
|
||||
<button class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('حذف شود؟')">
|
||||
|
||||
حذف
|
||||
جستجو
|
||||
|
||||
</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
</tr>
|
||||
<div class="table-responsive">
|
||||
|
||||
<table class="table table-bordered table-hover text-center align-middle">
|
||||
|
||||
<thead>
|
||||
|
||||
<tr>
|
||||
|
||||
<th>
|
||||
شناسه
|
||||
</th>
|
||||
|
||||
<th>
|
||||
ایرلاین
|
||||
</th>
|
||||
|
||||
<th>
|
||||
تصویر
|
||||
</th>
|
||||
|
||||
<th>
|
||||
شماره پرواز
|
||||
</th>
|
||||
|
||||
<th>
|
||||
تاریخ حرکت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
مسیر
|
||||
</th>
|
||||
|
||||
<th>
|
||||
نوع
|
||||
</th>
|
||||
|
||||
<th>
|
||||
قیمت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
وضعیت
|
||||
</th>
|
||||
|
||||
<th>
|
||||
عملیات
|
||||
</th>
|
||||
|
||||
</tr>
|
||||
|
||||
</thead>
|
||||
|
||||
|
||||
@empty
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
@forelse($flights as $flight)
|
||||
|
||||
<td colspan="8">
|
||||
موردی یافت نشد
|
||||
</td>
|
||||
<tr>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
<td>
|
||||
{{ $flight->id }}
|
||||
</td>
|
||||
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<td>
|
||||
{{ $flight->airline }}
|
||||
</td>
|
||||
|
||||
|
||||
{{ $flights->links() }}
|
||||
<td>
|
||||
|
||||
@if($flight->image)
|
||||
|
||||
<img
|
||||
src="{{ getImageUrl($flight->image) }}"
|
||||
alt="{{ $flight->airline }}"
|
||||
width="100"
|
||||
height="60"
|
||||
style="object-fit: cover; border-radius: 6px;"
|
||||
>
|
||||
|
||||
@else
|
||||
|
||||
<span class="text-muted">
|
||||
بدون تصویر
|
||||
</span>
|
||||
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
{{ $flight->flight_number }}
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
{{ $flight->departure_date ?? '-' }}
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
{{ $flight->origin }}
|
||||
|
||||
<span class="mx-1">
|
||||
←
|
||||
</span>
|
||||
|
||||
{{ $flight->destination }}
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
@switch($flight->type)
|
||||
|
||||
@case(0)
|
||||
|
||||
<span class="badge bg-primary">
|
||||
داخلی
|
||||
</span>
|
||||
|
||||
@break
|
||||
|
||||
@case(2)
|
||||
|
||||
<span class="badge bg-info">
|
||||
خارجی
|
||||
</span>
|
||||
|
||||
@break
|
||||
|
||||
@case(3)
|
||||
|
||||
<span class="badge bg-warning text-dark">
|
||||
چارتر
|
||||
</span>
|
||||
|
||||
@break
|
||||
|
||||
@default
|
||||
|
||||
<span class="badge bg-secondary">
|
||||
نامشخص
|
||||
</span>
|
||||
|
||||
@endswitch
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
{{ number_format($flight->price) }}
|
||||
|
||||
<span class="text-muted">
|
||||
تومان
|
||||
</span>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
@if($flight->status)
|
||||
|
||||
<span class="badge bg-success">
|
||||
فعال
|
||||
</span>
|
||||
|
||||
@else
|
||||
|
||||
<span class="badge bg-danger">
|
||||
غیرفعال
|
||||
</span>
|
||||
|
||||
@endif
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
|
||||
<div class="d-flex justify-content-center gap-1">
|
||||
|
||||
<a href="{{ route('admin.flights.edit', $flight) }}"
|
||||
class="btn btn-warning btn-sm">
|
||||
|
||||
ویرایش
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
<form
|
||||
action="{{ route('admin.flights.destroy', $flight) }}"
|
||||
method="POST"
|
||||
class="d-inline"
|
||||
>
|
||||
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-danger btn-sm"
|
||||
onclick="return confirm('آیا از حذف این پرواز مطمئن هستید؟')"
|
||||
>
|
||||
|
||||
حذف
|
||||
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@empty
|
||||
|
||||
<tr>
|
||||
|
||||
<td colspan="10"
|
||||
class="text-center py-4">
|
||||
|
||||
<span class="text-muted">
|
||||
هیچ پروازی یافت نشد.
|
||||
</span>
|
||||
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
@endforelse
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@if($flights->hasPages())
|
||||
|
||||
<div class="mt-4">
|
||||
|
||||
{{ $flights->withQueryString()->links() }}
|
||||
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
|
||||
Reference in New Issue
Block a user