Compare commits
10 Commits
7c0bc5b08b
...
07e6dc7f5d
| Author | SHA1 | Date | |
|---|---|---|---|
| 07e6dc7f5d | |||
| 1544aed64d | |||
| 17090d0666 | |||
| 4462237c44 | |||
| fad359f1c5 | |||
| 2195f10016 | |||
| 178219b699 | |||
| 281b82fc5b | |||
| 65c4863f30 | |||
| cb494a933e |
@@ -1,13 +1,47 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\Account;
|
namespace App\Http\Controllers\Account;
|
||||||
|
|
||||||
|
|
||||||
|
use App\Http\Requests\CommentStoreRequest;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\Flight;
|
||||||
|
use App\Models\Tour;
|
||||||
|
|
||||||
class CommentController extends Controller
|
class CommentController extends Controller
|
||||||
{
|
{
|
||||||
public function index()
|
//ثبت نظر برای تور
|
||||||
|
public function storeTour(CommentStoreRequest $request, Tour $tour)
|
||||||
{
|
{
|
||||||
return view('account.comments');
|
$tour->comments()->create([
|
||||||
|
'user_id' => auth()->id(),
|
||||||
|
'body' => $request->validated('body'),
|
||||||
|
'status' => 1, // در انتظار تایید (طبق قرارداد: 1 = پیشنویس/فعال، 2 = منتشرشده)
|
||||||
|
]);
|
||||||
|
|
||||||
|
return back()->with('success', 'نظر شما با موفقیت ثبت شد.');
|
||||||
|
}
|
||||||
|
|
||||||
|
//ثبت نظر برای پرواز
|
||||||
|
public function storeFlight(CommentStoreRequest $request, Flight $flight)
|
||||||
|
{
|
||||||
|
$flight->comments()->create([
|
||||||
|
'user_id' => auth()->id(),
|
||||||
|
'body' => $request->validated('body'),
|
||||||
|
'status' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
return back()->with('success', 'نظر شما با موفقیت ثبت شد.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function myComments()
|
||||||
|
{
|
||||||
|
$comments = auth()->user()->comments()
|
||||||
|
->with('commentable')
|
||||||
|
->latest()
|
||||||
|
->paginate(10);
|
||||||
|
|
||||||
|
return view('account.comments', compact('comments'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Http\Controllers\Account;
|
|||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Requests\EditProfilePostRequest;
|
use App\Http\Requests\EditProfilePostRequest;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
|
||||||
@@ -11,7 +13,8 @@ class EditProfileController extends Controller
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$user = Auth::user();
|
|
||||||
|
$user = Auth::user()->load(['comments.commentable', 'favorites.favoritable']);
|
||||||
|
|
||||||
return view('account.edit-profile.index', compact('user'));
|
return view('account.edit-profile.index', compact('user'));
|
||||||
}
|
}
|
||||||
@@ -20,12 +23,26 @@ class EditProfileController extends Controller
|
|||||||
{
|
{
|
||||||
$user = Auth::user();
|
$user = Auth::user();
|
||||||
|
|
||||||
$user->name = $request['name'];
|
// بهروزرسانی فیلدها
|
||||||
$user->username = $request['username'];
|
$user->first_name = $request->first_name;
|
||||||
$user->email = $request['email'];
|
$user->last_name = $request->last_name;
|
||||||
|
$user->email = $request->email;
|
||||||
|
$user->username = $request->username;
|
||||||
|
|
||||||
|
|
||||||
if ($request->filled('password')) {
|
if ($request->filled('password')) {
|
||||||
$user->password = Hash::make($request['password']);
|
$user->password = Hash::make($request->password);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($request->hasFile('image')) {
|
||||||
|
|
||||||
|
if ($user->image) {
|
||||||
|
Storage::disk('public')->delete($user->image);
|
||||||
|
}
|
||||||
|
|
||||||
|
$path = $request->file('image')->store('avatars', 'public');
|
||||||
|
$user->image = $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class IndexController extends Controller
|
|||||||
{
|
{
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
|
|
||||||
$tours = Tour::query()
|
$tours = Tour::query()
|
||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
@@ -19,9 +20,13 @@ class IndexController extends Controller
|
|||||||
->orderByDesc('created_at')
|
->orderByDesc('created_at')
|
||||||
->paginate(6, ['*'], 'flights_page');
|
->paginate(6, ['*'], 'flights_page');
|
||||||
|
|
||||||
|
$latestTours= Tour::latest()->limit(6)->get();
|
||||||
|
$latestFlights = Flight::latest()->limit(6)->get();
|
||||||
|
|
||||||
return view('index', [
|
return view('index', [
|
||||||
'tours' => $tours,
|
'tours' => $tours,
|
||||||
'flights' => $flights,
|
'flights' => $flights,
|
||||||
|
compact('latestTours', 'latestFlights')
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Favorite;
|
use App\Models\Favorite;
|
||||||
use App\Models\Tour;
|
use App\Models\Tour;
|
||||||
|
use App\Models\Comment;
|
||||||
|
|
||||||
|
// اضافه شد
|
||||||
use App\Models\TravelType;
|
use App\Models\TravelType;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
@@ -18,95 +22,55 @@ class TourController extends Controller
|
|||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->with(['travelType', 'flights']);
|
->with(['travelType', 'flights']);
|
||||||
|
|
||||||
// فیلتر بر اساس نوع سفر
|
|
||||||
if ($request->filled('travel_type')) {
|
if ($request->filled('travel_type')) {
|
||||||
$query->where(
|
$query->where('travel_type_id', $request->input('travel_type'));
|
||||||
'travel_type_id',
|
|
||||||
$request->input('travel_type')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// جستجو بر اساس عنوان
|
|
||||||
if ($request->filled('q')) {
|
if ($request->filled('q')) {
|
||||||
$query->where(
|
$query->where('title', 'like', '%' . $request->input('q') . '%');
|
||||||
'title',
|
|
||||||
'like',
|
|
||||||
'%' . $request->input('q') . '%'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// حداقل قیمت
|
|
||||||
if ($request->filled('price_min')) {
|
if ($request->filled('price_min')) {
|
||||||
$query->where(
|
$query->where('price', '>=', $request->input('price_min'));
|
||||||
'price',
|
|
||||||
'>=',
|
|
||||||
$request->input('price_min')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// حداکثر قیمت
|
|
||||||
if ($request->filled('price_max')) {
|
if ($request->filled('price_max')) {
|
||||||
$query->where(
|
$query->where('price', '<=', $request->input('price_max'));
|
||||||
'price',
|
|
||||||
'<=',
|
|
||||||
$request->input('price_max')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// مرتبسازی
|
|
||||||
if ($request->filled('sort')) {
|
if ($request->filled('sort')) {
|
||||||
$query->orderBy(
|
$query->orderBy('price', $request->input('sort') === 'desc' ? 'desc' : 'asc');
|
||||||
'price',
|
|
||||||
$request->input('sort') === 'desc'
|
|
||||||
? 'desc'
|
|
||||||
: 'asc'
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
$query->latest();
|
$query->latest();
|
||||||
}
|
}
|
||||||
|
|
||||||
// صفحهبندی
|
$tours = $query->paginate(9);
|
||||||
$tours = $query->paginate(12)->withQueryString();
|
|
||||||
|
|
||||||
// انواع سفر
|
|
||||||
$travelTypes = TravelType::where('status', 1)->get();
|
$travelTypes = TravelType::where('status', 1)->get();
|
||||||
|
|
||||||
return view(
|
return view('tours.index', compact('tours', 'travelTypes'));
|
||||||
'tours.index',
|
|
||||||
compact('tours', 'travelTypes')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* حذف فیلترها
|
|
||||||
*/
|
|
||||||
public function removeFilters()
|
|
||||||
{
|
|
||||||
return redirect()->route('tours.index');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* نمایش جزئیات یک تور
|
* نمایش جزئیات یک تور
|
||||||
*/
|
*/
|
||||||
public function show(Tour $tour)
|
public function show(Tour $tour)
|
||||||
{
|
{
|
||||||
// فقط تورهای فعال قابل مشاهده باشند
|
|
||||||
if ($tour->status != 1) {
|
if ($tour->status != 1) {
|
||||||
abort(404);
|
abort(404);
|
||||||
}
|
}
|
||||||
|
|
||||||
// افزایش تعداد بازدید
|
|
||||||
$tour->increment('views_count');
|
$tour->increment('views_count');
|
||||||
|
|
||||||
// بارگذاری اطلاعات مورد نیاز
|
// بارگذاری اطلاعات مورد نیاز + نظرات تایید شده
|
||||||
$tour->load([
|
$tour->load([
|
||||||
'flights',
|
'flights',
|
||||||
'travelType',
|
'travelType',
|
||||||
|
'comments' => function ($query) {
|
||||||
|
$query->where('status', 1)->latest();
|
||||||
|
},
|
||||||
|
'comments.user' // برای نمایش نام کاربری در نظرات
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// تورهای مرتبط
|
|
||||||
$relatedTours = Tour::where('status', 1)
|
$relatedTours = Tour::where('status', 1)
|
||||||
->where('travel_type_id', $tour->travel_type_id)
|
->where('travel_type_id', $tour->travel_type_id)
|
||||||
->where('id', '!=', $tour->id)
|
->where('id', '!=', $tour->id)
|
||||||
@@ -115,7 +79,6 @@ class TourController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
|
|
||||||
$isFav = false;
|
$isFav = false;
|
||||||
|
|
||||||
if (auth()->check()) {
|
if (auth()->check()) {
|
||||||
$isFav = Favorite::where('user_id', auth()->id())
|
$isFav = Favorite::where('user_id', auth()->id())
|
||||||
->where('favoritable_type', Tour::class)
|
->where('favoritable_type', Tour::class)
|
||||||
@@ -123,35 +86,191 @@ class TourController extends Controller
|
|||||||
->exists();
|
->exists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return view('tours.show', compact('tour', 'relatedTours', 'isFav'));
|
||||||
return view(
|
|
||||||
'tours.show',
|
|
||||||
compact('tour', 'relatedTours', 'isFav')
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//ثبت نظر جدید برای تور
|
||||||
|
public function storeComment(Request $request, Tour $tour)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'body' => 'required|string|min:5|max:1000',
|
||||||
|
]);
|
||||||
|
|
||||||
/**
|
$tour->comments()->create([
|
||||||
* جستجوی پیشنهادی
|
'user_id' => auth()->id(),
|
||||||
*/
|
'body' => $request->body,
|
||||||
|
'status' => 0, // در انتظار تایید
|
||||||
|
]);
|
||||||
|
|
||||||
|
return back()->with('success', 'نظر شما ثبت شد و پس از تایید مدیریت نمایش داده میشود.');
|
||||||
|
}
|
||||||
|
|
||||||
|
//جستجوی پیشنهادی
|
||||||
public function searchSuggestion(Request $request)
|
public function searchSuggestion(Request $request)
|
||||||
{
|
{
|
||||||
$q = $request->input('q', '');
|
$q = $request->input('q', '');
|
||||||
|
return response()->json(
|
||||||
$tours = Tour::where('status', 1)
|
Tour::where('status', 1)
|
||||||
->where(
|
->where('title', 'like', '%' . $q . '%')
|
||||||
'title',
|
->limit(8)
|
||||||
'like',
|
->get(['id', 'title', 'slug', 'price'])
|
||||||
'%' . $q . '%'
|
);
|
||||||
)
|
|
||||||
->limit(8)
|
|
||||||
->get([
|
|
||||||
'id',
|
|
||||||
'title',
|
|
||||||
'slug',
|
|
||||||
'price'
|
|
||||||
]);
|
|
||||||
|
|
||||||
return response()->json($tours);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//namespace App\Http\Controllers;
|
||||||
|
//
|
||||||
|
//use App\Models\Favorite;
|
||||||
|
//use App\Models\Tour;
|
||||||
|
//use App\Models\TravelType;
|
||||||
|
//use Illuminate\Http\Request;
|
||||||
|
//
|
||||||
|
//class TourController extends Controller
|
||||||
|
//{
|
||||||
|
// /**
|
||||||
|
// * لیست / آرشیو تورها با قابلیت فیلتر
|
||||||
|
// */
|
||||||
|
// public function index(Request $request)
|
||||||
|
// {
|
||||||
|
// $query = Tour::query()
|
||||||
|
// ->where('status', 1)
|
||||||
|
// ->with(['travelType', 'flights']);
|
||||||
|
//
|
||||||
|
// // فیلتر بر اساس نوع سفر
|
||||||
|
// if ($request->filled('travel_type')) {
|
||||||
|
// $query->where(
|
||||||
|
// 'travel_type_id',
|
||||||
|
// $request->input('travel_type')
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // جستجو بر اساس عنوان
|
||||||
|
// if ($request->filled('q')) {
|
||||||
|
// $query->where(
|
||||||
|
// 'title',
|
||||||
|
// 'like',
|
||||||
|
// '%' . $request->input('q') . '%'
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // حداقل قیمت
|
||||||
|
// if ($request->filled('price_min')) {
|
||||||
|
// $query->where(
|
||||||
|
// 'price',
|
||||||
|
// '>=',
|
||||||
|
// $request->input('price_min')
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // حداکثر قیمت
|
||||||
|
// if ($request->filled('price_max')) {
|
||||||
|
// $query->where(
|
||||||
|
// 'price',
|
||||||
|
// '<=',
|
||||||
|
// $request->input('price_max')
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // مرتبسازی
|
||||||
|
// if ($request->filled('sort')) {
|
||||||
|
// $query->orderBy(
|
||||||
|
// 'price',
|
||||||
|
// $request->input('sort') === 'desc'
|
||||||
|
// ? 'desc'
|
||||||
|
// : 'asc'
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// $query->latest();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // صفحهبندی
|
||||||
|
// $tours = $query->paginate(9);
|
||||||
|
//
|
||||||
|
// // انواع سفر
|
||||||
|
// $travelTypes = TravelType::where('status', 1)->get();
|
||||||
|
//
|
||||||
|
// return view(
|
||||||
|
// 'tours.index',
|
||||||
|
// compact('tours', 'travelTypes')
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * حذف فیلترها
|
||||||
|
// */
|
||||||
|
// public function removeFilters()
|
||||||
|
// {
|
||||||
|
// return redirect()->route('tours.index');
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * نمایش جزئیات یک تور
|
||||||
|
// */
|
||||||
|
// public function show(Tour $tour)
|
||||||
|
// {
|
||||||
|
// // فقط تورهای فعال قابل مشاهده باشند
|
||||||
|
// if ($tour->status != 1) {
|
||||||
|
// abort(404);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // افزایش تعداد بازدید
|
||||||
|
// $tour->increment('views_count');
|
||||||
|
//
|
||||||
|
// // بارگذاری اطلاعات مورد نیاز
|
||||||
|
// $tour->load([
|
||||||
|
// 'flights',
|
||||||
|
// 'travelType',
|
||||||
|
// ]);
|
||||||
|
//
|
||||||
|
// // تورهای مرتبط
|
||||||
|
// $relatedTours = Tour::where('status', 1)
|
||||||
|
// ->where('travel_type_id', $tour->travel_type_id)
|
||||||
|
// ->where('id', '!=', $tour->id)
|
||||||
|
// ->latest()
|
||||||
|
// ->limit(4)
|
||||||
|
// ->get();
|
||||||
|
//
|
||||||
|
// $isFav = false;
|
||||||
|
//
|
||||||
|
// if (auth()->check()) {
|
||||||
|
// $isFav = Favorite::where('user_id', auth()->id())
|
||||||
|
// ->where('favoritable_type', Tour::class)
|
||||||
|
// ->where('favoritable_id', $tour->id)
|
||||||
|
// ->exists();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// return view(
|
||||||
|
// 'tours.show',
|
||||||
|
// compact('tour', 'relatedTours', 'isFav')
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * جستجوی پیشنهادی
|
||||||
|
// */
|
||||||
|
// public function searchSuggestion(Request $request)
|
||||||
|
// {
|
||||||
|
// $q = $request->input('q', '');
|
||||||
|
//
|
||||||
|
// $tours = Tour::where('status', 1)
|
||||||
|
// ->where(
|
||||||
|
// 'title',
|
||||||
|
// 'like',
|
||||||
|
// '%' . $q . '%'
|
||||||
|
// )
|
||||||
|
// ->limit(8)
|
||||||
|
// ->get([
|
||||||
|
// 'id',
|
||||||
|
// 'title',
|
||||||
|
// 'slug',
|
||||||
|
// 'price'
|
||||||
|
// ]);
|
||||||
|
//
|
||||||
|
// return response()->json($tours);
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|||||||
@@ -7,12 +7,10 @@ use App\Models\Airport;
|
|||||||
use App\Models\Comment;
|
use App\Models\Comment;
|
||||||
use App\Models\Favorite;
|
use App\Models\Favorite;
|
||||||
use App\Models\Flight;
|
use App\Models\Flight;
|
||||||
use App\Models\Payment;
|
|
||||||
use App\Models\Tour;
|
use App\Models\Tour;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
use App\Exports\VisitsExport;
|
use App\Exports\VisitsExport;
|
||||||
use App\Models\VisitStatistic;
|
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Hekmatinasser\Verta\Verta;
|
use Hekmatinasser\Verta\Verta;
|
||||||
|
|
||||||
@@ -21,45 +19,70 @@ class DashboardController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$usersCount = User::count();
|
$usersCount = User::count();
|
||||||
|
|
||||||
$toursCount = Tour::count();
|
$toursCount = Tour::count();
|
||||||
|
|
||||||
$flightsCount = Flight::count();
|
$flightsCount = Flight::count();
|
||||||
|
|
||||||
$airportsCount = Airport::count();
|
$airportsCount = Airport::count();
|
||||||
|
|
||||||
$commentsCount = Comment::count();
|
$commentsCount = Comment::count();
|
||||||
|
|
||||||
$favoritesCount = Favorite::count();
|
$favoritesCount = Favorite::count();
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| دادههای نمودار
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
$chartLabels = [];
|
||||||
|
$chartValues = [];
|
||||||
|
|
||||||
|
for ($i = 9; $i >= 0; $i--) {
|
||||||
|
|
||||||
|
$date = Carbon::now()
|
||||||
|
->subDays($i);
|
||||||
|
|
||||||
|
$chartLabels[] = Verta::instance($date)
|
||||||
|
->format('Y/m/d');
|
||||||
|
|
||||||
|
// فعلاً برای تست
|
||||||
|
$chartValues[] = rand(5, 100);
|
||||||
|
}
|
||||||
|
|
||||||
return view('admin.dashboard', compact(
|
return view('admin.dashboard', compact(
|
||||||
'usersCount',
|
'usersCount',
|
||||||
'toursCount',
|
'toursCount',
|
||||||
'flightsCount',
|
'flightsCount',
|
||||||
'airportsCount',
|
'airportsCount',
|
||||||
'commentsCount',
|
'commentsCount',
|
||||||
'favoritesCount'
|
'favoritesCount',
|
||||||
|
'chartLabels',
|
||||||
|
'chartValues'
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exportExcel()
|
public function exportExcel()
|
||||||
{
|
{
|
||||||
// ۱. لیست کاربران با فیلدهایی که واقعاً در جدول users داری
|
$users = User::select(
|
||||||
$users = User::select('id', 'first_name', 'last_name', 'email', 'mobile', 'created_at')->get();
|
'id',
|
||||||
|
'first_name',
|
||||||
|
'last_name',
|
||||||
|
'email',
|
||||||
|
'mobile',
|
||||||
|
'created_at'
|
||||||
|
)->get();
|
||||||
|
|
||||||
|
$rows = $users->map(fn ($user) => [
|
||||||
// ۲. تبدیل به آرایه برای اکسل
|
|
||||||
$rows = $users->map(fn($user) => [
|
|
||||||
$user->id,
|
$user->id,
|
||||||
$user->first_name,
|
$user->first_name,
|
||||||
$user->last_name,
|
$user->last_name,
|
||||||
$user->email,
|
$user->email,
|
||||||
$user->mobile,
|
$user->mobile,
|
||||||
$user->created_at ? Verta::instance($user->created_at)->format('Y/m/d') : '-',
|
$user->created_at
|
||||||
|
? Verta::instance($user->created_at)->format('Y/m/d')
|
||||||
|
: '-',
|
||||||
])->toArray();
|
])->toArray();
|
||||||
|
|
||||||
// ۳. تغییر کلاس اکسل و اسم فایل
|
return Excel::download(
|
||||||
return Excel::download(new VisitsExport($rows), 'users-report-' . now()->format('Y-m-d') . '.xlsx');
|
new VisitsExport($rows),
|
||||||
|
'users-report-' . now()->format('Y-m-d') . '.xlsx'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,9 +12,7 @@ use Illuminate\Support\Facades\Hash;
|
|||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
|
||||||
* لیست + جستجوی چندپارامتری
|
|
||||||
*/
|
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
// چک دسترسی: فقط مدیرانی که مجوز «مشاهده کاربران» دارند
|
// چک دسترسی: فقط مدیرانی که مجوز «مشاهده کاربران» دارند
|
||||||
@@ -25,7 +23,7 @@ class UserController extends Controller
|
|||||||
// جستجوی کلی: نام / ایمیل / موبایل
|
// جستجوی کلی: نام / ایمیل / موبایل
|
||||||
if ($request->filled('search')) {
|
if ($request->filled('search')) {
|
||||||
$query->where(function ($q) use ($request) {
|
$query->where(function ($q) use ($request) {
|
||||||
$q->where('name', 'like', '%' . $request->search . '%')
|
$q->where('first_name', 'like', '%' . $request->search . '%')
|
||||||
->orWhere('email', 'like', '%' . $request->search . '%')
|
->orWhere('email', 'like', '%' . $request->search . '%')
|
||||||
->orWhere('mobile', 'like', '%' . $request->search . '%');
|
->orWhere('mobile', 'like', '%' . $request->search . '%');
|
||||||
});
|
});
|
||||||
@@ -89,7 +87,7 @@ class UserController extends Controller
|
|||||||
return view('admin.users.change-password', compact('user'));
|
return view('admin.users.change-password', compact('user'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updatePassword(UserPasswordUpdateRequest $request, User $user)
|
public function updatePassword(UserUpdateRequest $request, User $user)
|
||||||
{
|
{
|
||||||
abort_unless(auth('admin')->user()->canManageUsers('password'), 403);
|
abort_unless(auth('admin')->user()->canManageUsers('password'), 403);
|
||||||
|
|
||||||
@@ -101,151 +99,3 @@ class UserController extends Controller
|
|||||||
->with('success', 'رمز عبور کاربر با موفقیت تغییر کرد.');
|
->with('success', 'رمز عبور کاربر با موفقیت تغییر کرد.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//namespace App\Http\Controllers\Admin;
|
|
||||||
//
|
|
||||||
//use App\Http\Controllers\Controller;
|
|
||||||
//use App\Http\Requests\UserPasswordUpdateRequest;
|
|
||||||
//use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
|
||||||
//use App\Http\Requests\UserUpdateRequest;
|
|
||||||
//use App\Models\User;
|
|
||||||
//use Illuminate\Http\Request;
|
|
||||||
//use Illuminate\Support\Facades\Hash;
|
|
||||||
//
|
|
||||||
//class UserController extends Controller
|
|
||||||
//{
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * لیست + جستجوی چندپارامتری
|
|
||||||
// */
|
|
||||||
// public function index(Request $request)
|
|
||||||
// {
|
|
||||||
// // چک دسترسی: فقط مدیرانی که مجوز «مشاهده کاربران» دارند
|
|
||||||
// $this->authorize('users.view');
|
|
||||||
//
|
|
||||||
// $query = User::query();
|
|
||||||
//
|
|
||||||
// // جستجوی کلی: نام / ایمیل / موبایل
|
|
||||||
// if ($request->filled('search')) {
|
|
||||||
// $query->where(function ($q) use ($request) {
|
|
||||||
// $q->where('name', 'like', '%' . $request->search . '%')
|
|
||||||
// ->orWhere('email', 'like', '%' . $request->search . '%')
|
|
||||||
// ->orWhere('mobile', 'like', '%' . $request->search . '%');
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // فیلتر وضعیت
|
|
||||||
// if ($request->filled('status')) {
|
|
||||||
// $query->where('status', $request->status);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // فیلتر تاریخ عضویت
|
|
||||||
// if ($request->filled('from_date')) {
|
|
||||||
// $query->whereDate('created_at', '>=', $request->from_date);
|
|
||||||
// }
|
|
||||||
// if ($request->filled('to_date')) {
|
|
||||||
// $query->whereDate('created_at', '<=', $request->to_date);
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// // withQueryString => فیلترها هنگام صفحهبندی حفظ میشوند
|
|
||||||
// $users = $query->latest()->paginate(10)->withQueryString();
|
|
||||||
//
|
|
||||||
// return view('admin.users.index', compact('users'));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// public function edit(User $user)
|
|
||||||
// {
|
|
||||||
// $this->authorize('users.edit');
|
|
||||||
//
|
|
||||||
// return view('admin.users.edit', compact('user'));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function update(UserUpdateRequest $request, User $user)
|
|
||||||
// {
|
|
||||||
// $data = $request->validated();
|
|
||||||
//
|
|
||||||
// // اگر رمز خالی بود تغییرش نده (گزینهای)
|
|
||||||
// unset($data['password']);
|
|
||||||
//
|
|
||||||
// $user->update($data);
|
|
||||||
//
|
|
||||||
// return redirect()->route('admin.users.index')
|
|
||||||
// ->with('success', 'اطلاعات کاربر با موفقیت ویرایش شد.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// public function destroy(User $user)
|
|
||||||
// {
|
|
||||||
// $this->authorize('users.delete');
|
|
||||||
//
|
|
||||||
// $user->delete();
|
|
||||||
//
|
|
||||||
// return redirect()->route('admin.users.index')
|
|
||||||
// ->with('success', 'کاربر با موفقیت حذف شد.');
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function changePassword(User $user)
|
|
||||||
// {
|
|
||||||
// $this->authorize('users.change-password');
|
|
||||||
//
|
|
||||||
// return view('admin.users.change-password', compact('user'));
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// public function updatePassword(UserPasswordUpdateRequest $request, User $user)
|
|
||||||
// {
|
|
||||||
// $user->update([
|
|
||||||
// 'password' => Hash::make($request->password),
|
|
||||||
// ]);
|
|
||||||
//
|
|
||||||
// return redirect()->route('admin.users.index')
|
|
||||||
// ->with('success', 'رمز عبور کاربر با موفقیت تغییر کرد.');
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
////
|
|
||||||
////namespace App\Http\Controllers\Admin;
|
|
||||||
////
|
|
||||||
////use App\Http\Controllers\Controller;
|
|
||||||
////use App\Http\Requests\UserStoreRequest;
|
|
||||||
////use App\Models\User;
|
|
||||||
////
|
|
||||||
////class UserController extends Controller
|
|
||||||
////{
|
|
||||||
//// public function index()
|
|
||||||
//// {
|
|
||||||
//// $users = User::latest()->paginate(15);
|
|
||||||
////
|
|
||||||
//// return view('admin.users.index', compact('users'));
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// public function show(User $user)
|
|
||||||
//// {
|
|
||||||
//// return view('admin.users.show', compact('user'));
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// public function edit(User $user)
|
|
||||||
//// {
|
|
||||||
//// return view('admin.users.edit', compact('user'));
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// public function update(UserStoreRequest $request, User $user)
|
|
||||||
//// {
|
|
||||||
//// $user->update($request->validated());
|
|
||||||
////
|
|
||||||
//// return redirect()
|
|
||||||
//// ->route('admin.users.index')
|
|
||||||
//// ->with('success', 'کاربر با موفقیت بروزرسانی شد.');
|
|
||||||
//// }
|
|
||||||
////
|
|
||||||
//// public function destroy(User $user)
|
|
||||||
//// {
|
|
||||||
//// $user->delete();
|
|
||||||
////
|
|
||||||
//// return redirect()
|
|
||||||
//// ->route('admin.users.index')
|
|
||||||
//// ->with('success', 'کاربر با موفقیت حذف شد.');
|
|
||||||
//// }
|
|
||||||
////}
|
|
||||||
|
|||||||
+5
-10
@@ -5,15 +5,14 @@ namespace App\Http\Requests;
|
|||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|
||||||
class UserPasswordUpdateRequest extends FormRequest
|
class CommentStoreRequest extends FormRequest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Determine if the user is authorized to make this request.
|
* Determine if the user is authorized to make this request.
|
||||||
*/
|
*/
|
||||||
public function authorize(): bool
|
public function authorize(): bool
|
||||||
{
|
{
|
||||||
// return true;
|
return true;
|
||||||
return auth('admin')->user()->can('users.change-password');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,16 +23,12 @@ class UserPasswordUpdateRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'password' =>
|
'body' =>
|
||||||
[
|
[
|
||||||
'required',
|
'required',
|
||||||
'string',
|
'string',
|
||||||
'min:8',
|
'min:3',
|
||||||
'confirmed'
|
'max:1000'
|
||||||
],
|
|
||||||
'password_confirmation' =>
|
|
||||||
[
|
|
||||||
'required'
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -22,35 +22,44 @@ class EditProfilePostRequest extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
|
// دریافت آیدی کاربر از طریق سشن لاگین
|
||||||
|
$userId = auth()->id();
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
'name' =>
|
'first_name' =>
|
||||||
[
|
[
|
||||||
'required',
|
|
||||||
'string',
|
|
||||||
'max:255'
|
|
||||||
],
|
|
||||||
'username' =>
|
|
||||||
[
|
|
||||||
'required',
|
'required',
|
||||||
'string',
|
'string',
|
||||||
'max:255',
|
'max:100'
|
||||||
'unique:users,username,' . $user->id,
|
|
||||||
],
|
],
|
||||||
'email' => [
|
'last_name' =>
|
||||||
|
[
|
||||||
'required',
|
'required',
|
||||||
'email',
|
'string',
|
||||||
'max:255',
|
'max:100'
|
||||||
'unique:users,email,' . $user->id,
|
|
||||||
],
|
],
|
||||||
'password' =>
|
'username' =>
|
||||||
|
[
|
||||||
|
'required',
|
||||||
|
'string',
|
||||||
|
'max:50',
|
||||||
|
'unique:users,username,' . $userId,
|
||||||
|
],
|
||||||
|
'email' => [
|
||||||
|
'required',
|
||||||
|
'email',
|
||||||
|
'max:150',
|
||||||
|
'unique:users,email,' . $userId,
|
||||||
|
],
|
||||||
|
'password' =>
|
||||||
|
|
||||||
[
|
[
|
||||||
'nullable',
|
'nullable',
|
||||||
'string',
|
'string',
|
||||||
'min:8',
|
'min:8',
|
||||||
'confirmed'
|
'confirmed'
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,6 +75,16 @@ class Tour extends Model
|
|||||||
->withPivot('id')
|
->withPivot('id')
|
||||||
->withTimestamps();
|
->withTimestamps();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// در فایل App\Models\Tour.php و App\Models\Flight.php
|
||||||
|
|
||||||
|
public function comments()
|
||||||
|
{
|
||||||
|
return $this->morphMany(Comment::class, 'commentable');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($tour) {
|
static::creating(function ($tour) {
|
||||||
|
|||||||
@@ -0,0 +1,532 @@
|
|||||||
|
-- phpMyAdmin SQL Dump
|
||||||
|
-- version 5.2.3
|
||||||
|
-- https://www.phpmyadmin.net/
|
||||||
|
--
|
||||||
|
-- Host: 127.0.0.1:3308
|
||||||
|
-- Generation Time: Aug 20, 2026 at 01:33 PM
|
||||||
|
-- Server version: 8.4.7
|
||||||
|
-- PHP Version: 8.3.28
|
||||||
|
|
||||||
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
|
||||||
|
START TRANSACTION;
|
||||||
|
SET time_zone = "+00:00";
|
||||||
|
|
||||||
|
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
|
/*!40101 SET NAMES utf8mb4 */;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Database: `airline_agency`
|
||||||
|
--
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `admins`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `admins`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `admins` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`full_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`username` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '1' COMMENT '0:disable 1:enable',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `admins`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `admins` (`id`, `full_name`, `username`, `email`, `mobile`, `password`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(2, 'شهرزاد زندی', 'shahrzad', 'shahrzad.zandi@gmail.com', '09359359350', '$2y$12$KpHLJK1kIz/TxVUOn4FV7udVA3xGLLDtEknPZyfh13Z2WPkRmHwni', 1, '2026-08-17 07:24:19', '2026-08-17 07:24:19'),
|
||||||
|
(3, 'مدیر سیستم', 'admin', 'admin@gmail.com', '09123456789', '$2y$12$ElsUA1CqyK6euG6adWhXRuayR/Jzcq1zH28eoN3ypfeVrmTIr/zAe', 1, '2026-08-17 07:44:25', '2026-08-17 09:12:14');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `admin_permission`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `admin_permission`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `admin_permission` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`admin_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`permission_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_admin_permission` (`permission_id`),
|
||||||
|
KEY `fk2_admin_permission` (`admin_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `airports`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `airports`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `airports` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`city` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`province` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `airports`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `airports` (`id`, `name`, `city`, `province`, `code`, `created_at`, `updated_at`) VALUES
|
||||||
|
(1, 'فرودگاه بینالمللی اهواز', 'اهواز', 'خوزستان', 'AWZ', '0000-00-00 00:00:00', '0000-00-00 00:00:00');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `bookings`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `bookings`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `bookings` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`tour_id` bigint UNSIGNED DEFAULT NULL,
|
||||||
|
`flight_id` bigint UNSIGNED DEFAULT NULL,
|
||||||
|
`booking_code` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`first_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`last_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`national_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`email` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`passengers` int UNSIGNED NOT NULL DEFAULT '1',
|
||||||
|
`price` decimal(15,2) NOT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`payment_status` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`notes` text COLLATE utf8mb4_unicode_ci,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_bookings` (`user_id`),
|
||||||
|
KEY `fk2_bookings` (`tour_id`),
|
||||||
|
KEY `fk3_bookings` (`flight_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `cities`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `cities`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `cities` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`province_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NULL DEFAULT NULL,
|
||||||
|
`updated_at` timestamp NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_cities` (`province_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `cities`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `cities` (`id`, `province_id`, `name`, `created_at`, `updated_at`) VALUES
|
||||||
|
(7, 2, 'ساری', NULL, NULL),
|
||||||
|
(8, 1, 'تهران', NULL, NULL),
|
||||||
|
(9, 5, 'شیراز', NULL, NULL),
|
||||||
|
(10, 4, 'اصفهان', NULL, NULL),
|
||||||
|
(11, 1, 'ری', NULL, NULL),
|
||||||
|
(12, 2, 'آمل', NULL, NULL);
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `comments`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `comments`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `comments` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`commentable_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`commentable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`body` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '0',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_ comments` (`user_id`),
|
||||||
|
KEY `fk2_ comments` (`commentable_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `comments`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `comments` (`id`, `user_id`, `commentable_id`, `commentable_type`, `body`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(2, 1, 3, 'App\\Models\\Tour', 'بسیار خوب بود', 1, '2026-08-20 10:15:43', '2026-08-20 10:15:43'),
|
||||||
|
(3, 1, 3, 'App\\Models\\Tour', 'خیلی هم عالی', 1, '2026-08-20 10:17:07', '2026-08-20 10:17:07'),
|
||||||
|
(4, 1, 3, 'App\\Models\\Tour', 'من این تور را پسندیدم.', 1, '2026-08-20 13:15:04', '2026-08-20 13:15:04');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `favorites`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `favorites`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `favorites` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`favoritable_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`favoritable_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_favorites` (`user_id`),
|
||||||
|
KEY `fk2_favorites` (`favoritable_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `favorites`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `favorites` (`id`, `user_id`, `favoritable_id`, `favoritable_type`, `created_at`, `updated_at`) VALUES
|
||||||
|
(3, 1, 3, 'App\\Models\\Tour', '2026-08-19 16:05:52', '2026-08-19 16:05:52');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `files`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `files`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `files` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`fileable_id` bigint DEFAULT NULL,
|
||||||
|
`fileable_type` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`extension` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`size` bigint UNSIGNED NOT NULL,
|
||||||
|
`original_name` varchar(350) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`path` varchar(300) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `flights`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `flights`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `flights` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`travel_type_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`flight_number` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`airline_name` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`origin` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`destination` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`departure_date` date NOT NULL,
|
||||||
|
`departure_time` time NOT NULL,
|
||||||
|
`arrival_date` date NOT NULL,
|
||||||
|
`arrival_time` time NOT NULL,
|
||||||
|
`duration` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`price` decimal(12,2) NOT NULL,
|
||||||
|
`capacity` int UNSIGNED NOT NULL,
|
||||||
|
`status` tinyint NOT NULL DEFAULT '1',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `flights`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `flights` (`id`, `travel_type_id`, `flight_number`, `airline_name`, `origin`, `destination`, `departure_date`, `departure_time`, `arrival_date`, `arrival_time`, `duration`, `price`, `capacity`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(1, 2, 'IR-725', 'ایران ایر', 'تهران', 'مشهد', '1405-06-03', '14:30:00', '1405-06-03', '16:00:00', '1 ساعت و 30 دقیقه', 2500000.00, 180, 0, '2026-08-17 13:52:44', '2026-08-17 13:56:00'),
|
||||||
|
(2, 3, 'TK-182', 'ترکیش ایرلاینز', 'تهران', 'استانبول', '2026-08-28', '20:00:00', '2026-08-29', '07:31:00', '11 ساعت و 31', 18500000.00, 220, 1, '2026-08-17 14:01:19', '2026-08-17 14:01:19'),
|
||||||
|
(3, 4, 'CH-401', 'وارش', 'تهران', 'کیش', '2026-09-01', '10:30:00', '2026-09-01', '20:33:00', '10 ساعت و3 دقیقه', 4200000.00, 160, 1, '2026-08-17 14:04:34', '2026-08-17 14:04:34'),
|
||||||
|
(4, 2, 'ia33', 'test', 'test', 'test', '1405-05-06', '20:12:00', '1405-05-06', '22:06:00', '2', 850000.00, 2, 1, '2026-08-19 13:38:25', '2026-08-19 13:38:25');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `payments`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `payments`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `payments` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`user_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`payable_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`amount` decimal(12,2) NOT NULL,
|
||||||
|
`authority` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`transaction_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`status` tinyint NOT NULL COMMENT 'pending:0 | success:1| failed:2 | canceled:3',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `permissions`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `permissions`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `permissions` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`slug` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`created_at` timestamp NULL DEFAULT NULL,
|
||||||
|
`updated_at` timestamp NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `slug` (`slug`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `provinces`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `provinces`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `provinces` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NULL DEFAULT NULL,
|
||||||
|
`updated_at` timestamp NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `provinces`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `provinces` (`id`, `name`, `created_at`, `updated_at`) VALUES
|
||||||
|
(1, 'تهران', NULL, NULL),
|
||||||
|
(2, 'مازندران', NULL, NULL),
|
||||||
|
(3, 'گیلان', NULL, NULL),
|
||||||
|
(4, 'اصفهان', NULL, NULL),
|
||||||
|
(5, 'فارس', NULL, NULL),
|
||||||
|
(6, 'یزد', NULL, NULL),
|
||||||
|
(7, 'آذربایجان غربی', NULL, NULL),
|
||||||
|
(8, 'آذربایجان شرقی', NULL, NULL);
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `settings`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `settings`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `settings` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`value` text COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `tours`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `tours`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `tours` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`travel_type_id` bigint UNSIGNED DEFAULT NULL,
|
||||||
|
`title` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`slug` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`description` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci,
|
||||||
|
`duration` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`start_date` date DEFAULT NULL,
|
||||||
|
`end_date` date DEFAULT NULL,
|
||||||
|
`price` decimal(12,2) NOT NULL,
|
||||||
|
`capacity` int UNSIGNED DEFAULT NULL,
|
||||||
|
`views_count` int NOT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '1',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_tours` (`travel_type_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `tours`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `tours` (`id`, `travel_type_id`, `title`, `slug`, `image`, `description`, `duration`, `start_date`, `end_date`, `price`, `capacity`, `views_count`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(3, NULL, 'تور سهروزه اصفهان با راهنمای تخصصی', 'tor-shrozh-asfhan-ba-rahnmay-tkhssy', 'tours/1787037667.tour-image56011.jpg', NULL, NULL, NULL, NULL, 2850000.00, NULL, 63, 1, '2026-08-18 07:21:07', '2026-08-20 13:15:04'),
|
||||||
|
(4, NULL, 'تور لوکس پنجروزه کیش با پرواز مستقیم', 'tor-loks-pngrozh-kysh-ba-proaz-mstkym', 'tours/1787037718.tour-image49479.jpg', NULL, NULL, NULL, NULL, 12500000.00, NULL, 36, 1, '2026-08-18 07:21:58', '2026-08-20 08:02:13'),
|
||||||
|
(5, NULL, 'تور خانوادگی پنجروزه قشم و هرمز', 'tor-khanoadgy-pngrozh-kshm-o-hrmz', 'tours/1787138709.tour-image35820.jpg', NULL, NULL, NULL, NULL, 9750000.00, NULL, 0, 0, '2026-08-19 11:25:09', '2026-08-19 11:25:11'),
|
||||||
|
(6, NULL, 'تور ششروزه رم و فلورانس', 'tor-shshrozh-rm-o-florans', 'tours/1787138776.tour-image35964.jpg', NULL, NULL, NULL, NULL, 76500000.00, NULL, 0, 0, '2026-08-19 11:26:16', '2026-08-19 11:26:16'),
|
||||||
|
(7, NULL, 'تور لوکس هفتروزه پاریس', 'tor-loks-hftrozh-parys', 'tours/1787138834.tour-image66216.jpg', NULL, NULL, NULL, NULL, 89000000.00, NULL, 0, 0, '2026-08-19 11:27:14', '2026-08-19 11:27:14'),
|
||||||
|
(8, NULL, 'تور اقتصادی چهارروزه باکو', 'tor-aktsady-chharrozh-bako', 'tours/1787138868.tour-image42665.jpg', NULL, NULL, NULL, NULL, 15800000.00, NULL, 0, 0, '2026-08-19 11:27:48', '2026-08-19 11:27:48'),
|
||||||
|
(9, NULL, 'test', 'test', 'tours/1787146812.tour-image88373.jpg', NULL, NULL, NULL, NULL, 2000000.00, NULL, 0, 0, '2026-08-19 13:40:12', '2026-08-19 13:40:14');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `tour_flights`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `tour_flights`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `tour_flights` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`tour_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`flight_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `fk1_tour_flights` (`flight_id`),
|
||||||
|
KEY `fk2_tour_flights` (`tour_id`)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `travel_types`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `travel_types`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `travel_types` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`title` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`slug` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '1',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `slug` (`slug`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `travel_types`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `travel_types` (`id`, `title`, `slug`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(2, 'تور داخلی', 'domestic-tour', 1, '2026-08-17 11:36:22', '2026-08-17 11:36:22'),
|
||||||
|
(3, 'تور خارجی', 'international-tour', 1, '2026-08-17 11:46:33', '2026-08-17 11:46:33'),
|
||||||
|
(4, 'تور چارتر', 'charter-tour', 1, '2026-08-17 11:46:59', '2026-08-17 11:46:59'),
|
||||||
|
(5, 'تور ترکیبی', 'combined-tour', 1, '2026-08-17 11:47:41', '2026-08-17 11:47:41'),
|
||||||
|
(6, 'پرواز خارجی', 'international-flight', 1, '2026-08-17 11:48:19', '2026-08-17 11:48:19'),
|
||||||
|
(7, 'پرواز داخلی', 'domestic-flight', 1, '2026-08-17 11:48:44', '2026-08-17 11:48:44'),
|
||||||
|
(8, 'تور لحظه آخری', 'last-minute', 1, '2026-08-17 11:49:11', '2026-08-17 11:49:11'),
|
||||||
|
(9, 'پیشنویس نمونه', 'draft-sample', 0, '2026-08-17 11:49:33', '2026-08-17 11:56:13');
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Table structure for table `users`
|
||||||
|
--
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `users`;
|
||||||
|
CREATE TABLE IF NOT EXISTS `users` (
|
||||||
|
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`first_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`last_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`email` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`national_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`birth_date` date DEFAULT NULL,
|
||||||
|
`gender` tinyint(1) NOT NULL COMMENT '1:Male | 2:Female',
|
||||||
|
`marital_status` tinyint(1) NOT NULL COMMENT '1:Single | 2:Married | 3:Divorced/Separated',
|
||||||
|
`spouse_name` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
|
||||||
|
`username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
|
||||||
|
`province_id` bigint UNSIGNED NOT NULL,
|
||||||
|
`city_id` bigint UNSIGNED DEFAULT NULL,
|
||||||
|
`status` tinyint UNSIGNED NOT NULL DEFAULT '1',
|
||||||
|
`created_at` timestamp NOT NULL,
|
||||||
|
`updated_at` timestamp NOT NULL,
|
||||||
|
PRIMARY KEY (`id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Dumping data for table `users`
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO `users` (`id`, `first_name`, `last_name`, `email`, `mobile`, `password`, `national_code`, `birth_date`, `gender`, `marital_status`, `spouse_name`, `image`, `username`, `province_id`, `city_id`, `status`, `created_at`, `updated_at`) VALUES
|
||||||
|
(1, 'شهرزاد', 'زندی', 'shahrzad2020@gmail.com', '09118909120', '$2y$12$LzDaglfvgypwHT20MAffJOnjpIePJbwJjIcbnoRW8tLy53wNbfFqa', '2080706640', NULL, 2, 1, NULL, 'avatars/FevHjQ0JjviBzlNOGXiI0k1JmshmUIxrDXF3xBAC.jpg', 'shahrzad011', 2, NULL, 1, '2026-08-19 01:09:30', '2026-08-20 13:16:51'),
|
||||||
|
(2, 'حاتمه', 'اندرزا', 'hatame19@gmail.com', '09119533286', '$2y$12$6AxXNTIpJAK0czNU78PeAObgC.Nl0dTbqKyyMHSGTUrr0GynKyfhq', '2081391693', NULL, 2, 1, NULL, 'users/MU5t6XmUmS558EO4EPQUdO2kDL7XSeDEtoeP83LD.jpg', 'hatame19', 2, NULL, 1, '2026-08-19 06:23:09', '2026-08-19 06:23:09');
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for dumped tables
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `admin_permission`
|
||||||
|
--
|
||||||
|
ALTER TABLE `admin_permission`
|
||||||
|
ADD CONSTRAINT `fk1_admin_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
|
ADD CONSTRAINT `fk2_admin_permission` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `bookings`
|
||||||
|
--
|
||||||
|
ALTER TABLE `bookings`
|
||||||
|
ADD CONSTRAINT `fk1_bookings` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
|
ADD CONSTRAINT `fk2_bookings` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
|
ADD CONSTRAINT `fk3_bookings` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `cities`
|
||||||
|
--
|
||||||
|
ALTER TABLE `cities`
|
||||||
|
ADD CONSTRAINT `fk1_cities` FOREIGN KEY (`province_id`) REFERENCES `provinces` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `comments`
|
||||||
|
--
|
||||||
|
ALTER TABLE `comments`
|
||||||
|
ADD CONSTRAINT `fk1_ comments` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `favorites`
|
||||||
|
--
|
||||||
|
ALTER TABLE `favorites`
|
||||||
|
ADD CONSTRAINT `fk1_favorites` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `tours`
|
||||||
|
--
|
||||||
|
ALTER TABLE `tours`
|
||||||
|
ADD CONSTRAINT `fk1_tours` FOREIGN KEY (`travel_type_id`) REFERENCES `travel_types` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Constraints for table `tour_flights`
|
||||||
|
--
|
||||||
|
ALTER TABLE `tour_flights`
|
||||||
|
ADD CONSTRAINT `fk1_tour_flights` FOREIGN KEY (`flight_id`) REFERENCES `flights` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
|
ADD CONSTRAINT `fk2_tour_flights` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||||
|
COMMIT;
|
||||||
|
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
/* ================================================
|
||||||
|
استایلهای صفحه حساب کاربری (account pages)
|
||||||
|
================================================ */
|
||||||
|
|
||||||
|
/* ---------- کارت پروفایل (سایدبار) ---------- */
|
||||||
|
.profile-sidebar {
|
||||||
|
background: linear-gradient(145deg, #ffffff, #f8fbff);
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.06);
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 0 12px 35px rgba(0, 82, 165, 0.10);
|
||||||
|
padding: 30px 20px;
|
||||||
|
transition: transform .3s ease;
|
||||||
|
}
|
||||||
|
.profile-sidebar:hover {
|
||||||
|
transform: translateY(-4px);
|
||||||
|
}
|
||||||
|
.profile-avatar {
|
||||||
|
width: 120px;
|
||||||
|
height: 120px;
|
||||||
|
border-radius: 50%;
|
||||||
|
object-fit: cover;
|
||||||
|
border: 4px solid #e8f0fe;
|
||||||
|
box-shadow: 0 6px 18px rgba(0, 123, 255, .25);
|
||||||
|
}
|
||||||
|
.profile-name {
|
||||||
|
font-weight: 700;
|
||||||
|
color: #1f2d3d;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.profile-username {
|
||||||
|
color: #6c757d;
|
||||||
|
font-size: .85rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- تبها ---------- */
|
||||||
|
.nav-tabs .nav-link {
|
||||||
|
color: #6c757d;
|
||||||
|
font-weight: 600;
|
||||||
|
border-radius: 12px 12px 0 0;
|
||||||
|
padding: 10px 18px;
|
||||||
|
}
|
||||||
|
.nav-tabs .nav-link.active {
|
||||||
|
color: #007bff;
|
||||||
|
border-color: #dee2e6 #dee2e6 #fff;
|
||||||
|
background: #f8fbff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- فرمها ---------- */
|
||||||
|
.form-card {
|
||||||
|
background: #ffffff;
|
||||||
|
border: 1px solid rgba(0, 0, 0, 0.05);
|
||||||
|
border-radius: 20px;
|
||||||
|
box-shadow: 0 5px 22px rgba(0, 0, 0, 0.05);
|
||||||
|
padding: 25px;
|
||||||
|
}
|
||||||
|
.form-card .form-control {
|
||||||
|
border-radius: 12px;
|
||||||
|
border: 2px solid #e9ecef;
|
||||||
|
padding: 11px 15px;
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
.form-card .form-control:focus {
|
||||||
|
border-color: #007bff;
|
||||||
|
box-shadow: 0 0 0 .2rem rgba(0, 123, 255, .15);
|
||||||
|
}
|
||||||
|
.form-label {
|
||||||
|
font-weight: 600;
|
||||||
|
color: #495057;
|
||||||
|
font-size: .9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- علاقهمندیها ---------- */
|
||||||
|
.favorite-item {
|
||||||
|
background: #fff3f5;
|
||||||
|
color: #d63384;
|
||||||
|
border: 1.5px solid #f7c8d4;
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 9px 18px;
|
||||||
|
margin: 4px;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: .9rem;
|
||||||
|
transition: all .25s;
|
||||||
|
}
|
||||||
|
.favorite-item i { font-size: .95rem; }
|
||||||
|
.favorite-item:hover {
|
||||||
|
background: #d63384;
|
||||||
|
color: #fff;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- کامنتها ---------- */
|
||||||
|
.comment-box {
|
||||||
|
background: #f8f9fa;
|
||||||
|
border-right: 4px solid #17a2b8;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 14px 16px;
|
||||||
|
color: #495057;
|
||||||
|
}
|
||||||
|
.comment-box small {
|
||||||
|
color: #17a2b8;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- دکمه ذخیره ---------- */
|
||||||
|
.btn-save {
|
||||||
|
background: linear-gradient(135deg, #007bff, #0d6efd);
|
||||||
|
border: none;
|
||||||
|
border-radius: 12px;
|
||||||
|
padding: 12px 28px;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 600;
|
||||||
|
box-shadow: 0 6px 15px rgba(0, 123, 255, .3);
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
.btn-save:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 9px 20px rgba(0, 123, 255, .4);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
@@ -0,0 +1,277 @@
|
|||||||
|
/* ==========================================
|
||||||
|
استایل صفحات آرشیو تورها و پروازها
|
||||||
|
========================================== */
|
||||||
|
|
||||||
|
.archive-page {
|
||||||
|
background: #f6f8fb;
|
||||||
|
min-height: 60vh;
|
||||||
|
padding: 50px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* هدر صفحه آرشیو */
|
||||||
|
.archive-header {
|
||||||
|
background: linear-gradient(135deg, #1e3a8a, #3b82f6);
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 28px 30px;
|
||||||
|
margin-bottom: 35px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 15px;
|
||||||
|
box-shadow: 0 8px 24px rgba(30, 58, 138, 0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-header h4 {
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 700;
|
||||||
|
margin: 0;
|
||||||
|
font-size: 1.4rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-header .btn-back {
|
||||||
|
background: rgba(255, 255, 255, 0.15);
|
||||||
|
color: #fff;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.4);
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 7px 22px;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-header .btn-back:hover {
|
||||||
|
background: #fff;
|
||||||
|
color: #1e3a8a;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* کارت تور */
|
||||||
|
.tour-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 14px;
|
||||||
|
overflow: hidden;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
|
||||||
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card:hover {
|
||||||
|
transform: translateY(-6px);
|
||||||
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-image-wrap {
|
||||||
|
position: relative;
|
||||||
|
height: 200px;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-image-wrap img {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
transition: transform 0.5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card:hover .tour-image-wrap img {
|
||||||
|
transform: scale(1.08);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-body {
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-title {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: 700;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-title a {
|
||||||
|
color: #1e3a8a;
|
||||||
|
text-decoration: none;
|
||||||
|
transition: color 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-title a:hover {
|
||||||
|
color: #3b82f6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-desc {
|
||||||
|
color: #6c757d;
|
||||||
|
font-size: 0.88rem;
|
||||||
|
line-height: 1.8;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
min-height: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-top: 1px dashed #e5e7eb;
|
||||||
|
padding-top: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-price {
|
||||||
|
background: #eef2ff;
|
||||||
|
color: #4338ca;
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 5px 16px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* کارت پرواز */
|
||||||
|
.flight-card {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 14px;
|
||||||
|
border: none;
|
||||||
|
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
|
||||||
|
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card:hover {
|
||||||
|
transform: translateY(-6px);
|
||||||
|
box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-body {
|
||||||
|
padding: 22px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-route {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-city {
|
||||||
|
text-align: center;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-city span {
|
||||||
|
display: block;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: #9ca3af;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-city strong {
|
||||||
|
font-size: 1.05rem;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-line {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
color: #3b82f6;
|
||||||
|
font-size: 1.1rem;
|
||||||
|
padding: 0 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-line .plane-icon {
|
||||||
|
margin: 0 6px;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-info {
|
||||||
|
background: #f8fafc;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 12px 15px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: #475569;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-info p {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-info p:last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.flight-card .flight-price {
|
||||||
|
background: #eef2ff;
|
||||||
|
color: #4338ca;
|
||||||
|
border-radius: 50px;
|
||||||
|
padding: 5px 16px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
font-weight: 600;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* صفحهبندی */
|
||||||
|
.archive-pagination {
|
||||||
|
margin-top: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-pagination .pagination {
|
||||||
|
justify-content: center;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-pagination .page-item .page-link {
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid #e5e7eb;
|
||||||
|
color: #475569;
|
||||||
|
padding: 8px 15px;
|
||||||
|
min-width: 42px;
|
||||||
|
text-align: center;
|
||||||
|
transition: all 0.3s;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-pagination .page-item .page-link:hover {
|
||||||
|
background: #eef2ff;
|
||||||
|
color: #4338ca;
|
||||||
|
border-color: #c7d2fe;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-pagination .page-item.active .page-link {
|
||||||
|
background: #1e3a8a;
|
||||||
|
border-color: #1e3a8a;
|
||||||
|
color: #fff;
|
||||||
|
box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* پیام خالی */
|
||||||
|
.archive-empty {
|
||||||
|
background: #fff;
|
||||||
|
border: 2px dashed #d1d5db;
|
||||||
|
border-radius: 14px;
|
||||||
|
padding: 60px 20px;
|
||||||
|
text-align: center;
|
||||||
|
color: #9ca3af;
|
||||||
|
}
|
||||||
|
|
||||||
|
.archive-empty i {
|
||||||
|
font-size: 3rem;
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #cbd5e1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ریسپانسیو */
|
||||||
|
@media (max-width: 575.98px) {
|
||||||
|
.archive-header {
|
||||||
|
flex-direction: column;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tour-card .tour-image-wrap {
|
||||||
|
height: 180px;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
@switch($status)
|
||||||
|
@case(1)
|
||||||
|
<span class="badge bg-success text-white">تایید شده</span>
|
||||||
|
@break
|
||||||
|
@case(2)
|
||||||
|
<span class="badge bg-warning text-dark">در انتظار بررسی</span>
|
||||||
|
@break
|
||||||
|
@default
|
||||||
|
<span class="badge bg-secondary">نامشخص</span>
|
||||||
|
@endswitch
|
||||||
Reference in New Issue
Block a user