201 lines
9.0 KiB
PHP
201 lines
9.0 KiB
PHP
@extends('dashboard.layouts.app')
|
|
|
|
@section('title', 'ویرایش تور')
|
|
|
|
@section('account-content')
|
|
|
|
<div class="user-profile-wrapper">
|
|
<div class="col-lg-12">
|
|
<div class="user-profile-card">
|
|
<h4 class="user-profile-card-title">ویرایش تور</h4>
|
|
|
|
<div class="user-profile-form">
|
|
|
|
@if($errors->any())
|
|
<div class="alert alert-danger">
|
|
<ul class="mb-0">
|
|
@foreach($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
@endif
|
|
|
|
<form action="{{ route('admin.tours.update', $tour->id) }}" method="POST">
|
|
@csrf
|
|
@method('PUT')
|
|
|
|
@php
|
|
$detail = $tour->tour_details->first();
|
|
|
|
$startDate = $detail && $detail->start_date
|
|
? verta($detail->start_date)->format('Y/m/d')
|
|
: '';
|
|
|
|
$endDate = $detail && $detail->end_date
|
|
? verta($detail->end_date)->format('Y/m/d')
|
|
: '';
|
|
@endphp
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">عنوان تور</label>
|
|
<input type="text"
|
|
name="title"
|
|
class="form-control"
|
|
value="{{ old('title', $tour->title) }}"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">نوع تور</label>
|
|
<input type="text"
|
|
name="tour_type"
|
|
class="form-control"
|
|
value="{{ old('tour_type', $tour->tour_type) }}"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">مبدأ</label>
|
|
<select name="origin_airports_id"
|
|
class="form-control"
|
|
required>
|
|
<option value="">انتخاب مبدأ</option>
|
|
|
|
@foreach($airports as $airport)
|
|
<option value="{{ $airport->id }}"
|
|
{{ old('origin_airports_id', $tour->origin_airports_id) == $airport->id ? 'selected' : '' }}>
|
|
{{ $airport->city }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">مقصد</label>
|
|
<select name="destination_airports_id"
|
|
class="form-control"
|
|
required>
|
|
<option value="">انتخاب مقصد</option>
|
|
|
|
@foreach($airports as $airport)
|
|
<option value="{{ $airport->id }}"
|
|
{{ old('destination_airports_id', $tour->destination_airports_id) == $airport->id ? 'selected' : '' }}>
|
|
{{ $airport->city }}
|
|
</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">تاریخ حرکت</label>
|
|
<input type="text"
|
|
id="start_date"
|
|
name="start_date"
|
|
class="form-control"
|
|
value="{{ old('start_date', $startDate) }}"
|
|
placeholder="1405/06/01"
|
|
autocomplete="off"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">تاریخ برگشت</label>
|
|
<input type="text"
|
|
id="end_date"
|
|
name="end_date"
|
|
class="form-control"
|
|
value="{{ old('end_date', $endDate) }}"
|
|
placeholder="1405/06/05"
|
|
autocomplete="off"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">قیمت</label>
|
|
<input type="number"
|
|
name="price"
|
|
class="form-control"
|
|
value="{{ old('price', $detail?->price) }}"
|
|
min="0"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-6 mb-3">
|
|
<label class="form-label">ظرفیت</label>
|
|
<input type="number"
|
|
name="capacity"
|
|
class="form-control"
|
|
value="{{ old('capacity', $detail?->capacity) }}"
|
|
min="1"
|
|
required>
|
|
</div>
|
|
|
|
<div class="col-lg-12 mb-3">
|
|
<label class="form-label">خلاصه تور</label>
|
|
<textarea name="summary"
|
|
class="form-control"
|
|
rows="4"
|
|
required>{{ old('summary', $tour->summary) }}</textarea>
|
|
</div>
|
|
|
|
<div class="col-lg-12 mb-3">
|
|
<label class="form-label">توضیحات تور</label>
|
|
<textarea name="description"
|
|
class="form-control"
|
|
rows="7"
|
|
required>{{ old('description', $tour->description) }}</textarea>
|
|
</div>
|
|
|
|
<div class="col-lg-12">
|
|
<button type="submit" class="theme-btn">
|
|
ذخیره تغییرات
|
|
<i class="far fa-check"></i>
|
|
</button>
|
|
|
|
<a href="{{ route('admin.tours.index') }}" class="theme-btn">
|
|
بازگشت
|
|
</a>
|
|
</div>
|
|
|
|
</div>
|
|
</form>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function () {
|
|
|
|
const startTime = document.getElementById('start_time');
|
|
const endTime = document.getElementById('end_time');
|
|
|
|
if (typeof $ !== 'undefined' && typeof $.fn.persianDatepicker !== 'undefined') {
|
|
|
|
$(startTime).persianDatepicker({
|
|
format: 'YYYY/MM/DD HH:mm',
|
|
autoClose: true,
|
|
initialValue: false,
|
|
timePicker: {
|
|
enabled: true
|
|
}
|
|
});
|
|
|
|
$(endTime).persianDatepicker({
|
|
format: 'YYYY/MM/DD HH:mm',
|
|
autoClose: true,
|
|
initialValue: false,
|
|
timePicker: {
|
|
enabled: true
|
|
}
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
</script>
|
|
@endsection
|