diff --git a/app/Http/Controllers/Admin/ActivityLogController.php b/app/Http/Controllers/Admin/ActivityLogController.php index 2572782..9f8aacc 100644 --- a/app/Http/Controllers/Admin/ActivityLogController.php +++ b/app/Http/Controllers/Admin/ActivityLogController.php @@ -11,7 +11,7 @@ class ActivityLogController extends Controller public function index() { $logs=ActivityLog::with('admin') - ->latest() + ->orderByDesc('created_at') ->paginate(4); return view('admin.activityLog.index',compact('logs')); diff --git a/app/Http/Controllers/Admin/TourController.php b/app/Http/Controllers/Admin/TourController.php index 8d45415..f422298 100644 --- a/app/Http/Controllers/Admin/TourController.php +++ b/app/Http/Controllers/Admin/TourController.php @@ -121,7 +121,7 @@ class TourController extends Controller ActivityLog::create([ 'admin_id' => auth('admin')->id(), - 'action' => 'create', + 'action' => 'update', 'model' => 'Tour', 'model_id' => $tour->id, 'description' => 'ویرایش تور', @@ -153,7 +153,7 @@ class TourController extends Controller ActivityLog::create([ 'admin_id' => auth('admin')->id(), - 'action' => 'create', + 'action' => 'delete', 'model' => 'Tour', 'model_id' => $tour->id, 'description' => 'حذف تور', diff --git a/artisan.zip b/artisan.zip new file mode 100644 index 0000000..b3f4034 Binary files /dev/null and b/artisan.zip differ diff --git a/database/backup/airline_agency (4).sql b/database/backup/airline_agency (4).sql new file mode 100644 index 0000000..31ad5a4 --- /dev/null +++ b/database/backup/airline_agency (4).sql @@ -0,0 +1,606 @@ +-- phpMyAdmin SQL Dump +-- version 5.2.3 +-- https://www.phpmyadmin.net/ +-- +-- Host: 127.0.0.1:3306 +-- Generation Time: Aug 22, 2026 at 10:31 AM +-- 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 `activity_logs` +-- + +DROP TABLE IF EXISTS `activity_logs`; +CREATE TABLE IF NOT EXISTS `activity_logs` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `admin_id` bigint UNSIGNED DEFAULT NULL, + `action` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `model` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `model_id` bigint UNSIGNED NOT NULL, + `description` text COLLATE utf8mb4_unicode_ci, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `admin_id` (`admin_id`) +) ENGINE=MyISAM AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `activity_logs` +-- + +INSERT INTO `activity_logs` (`id`, `admin_id`, `action`, `model`, `model_id`, `description`, `created_at`, `updated_at`) VALUES +(1, 2, 'create', 'Flight', 5, 'ثبت پرواز جدید', '2026-08-19 11:06:42', '2026-08-19 11:06:42'), +(2, 2, 'create', 'Tour', 7, 'ثبت تور جدید', '2026-08-19 15:48:20', '2026-08-19 15:48:20'), +(3, 2, 'create', 'Flight', 6, 'ثبت پرواز جدید', '2026-08-19 15:53:31', '2026-08-19 15:53:31'), +(4, 2, 'create', 'Flight', 7, 'ثبت پرواز جدید', '2026-08-20 05:25:06', '2026-08-20 05:25:06'), +(5, 2, 'create', 'Tour', 7, 'ویرایش تور', '2026-08-20 05:31:43', '2026-08-20 05:31:43'), +(6, 2, 'update', 'Flight', 3, 'ویرایش اطلاعات پرواز', '2026-08-20 06:01:46', '2026-08-20 06:01:46'), +(7, 2, 'update', 'Flight', 2, 'ویرایش اطلاعات پرواز', '2026-08-20 06:45:23', '2026-08-20 06:45:23'), +(8, 2, 'update', 'Flight', 1, 'ویرایش اطلاعات پرواز', '2026-08-20 06:50:12', '2026-08-20 06:50:12'), +(9, 2, 'create', 'Tour', 3, 'ویرایش تور', '2026-08-20 06:50:38', '2026-08-20 06:50:38'), +(10, 2, 'create', 'Tour', 4, 'ویرایش تور', '2026-08-20 06:50:51', '2026-08-20 06:50:51'), +(11, 2, 'create', 'Tour', 5, 'حذف تور', '2026-08-20 06:52:02', '2026-08-20 06:52:02'), +(12, 2, 'create', 'Tour', 5, 'ویرایش تور', '2026-08-20 06:52:48', '2026-08-20 06:52:48'), +(13, 2, 'create', 'Tour', 3, 'ویرایش تور', '2026-08-20 11:36:16', '2026-08-20 11:36:16'), +(14, 2, 'update', 'Flight', 5, 'ویرایش اطلاعات پرواز', '2026-08-22 06:22:20', '2026-08-22 06:22:20'), +(15, 2, 'update', 'Flight', 2, 'ویرایش اطلاعات پرواز', '2026-08-22 06:22:48', '2026-08-22 06:22:48'), +(16, 2, 'update', 'Flight', 1, 'ویرایش اطلاعات پرواز', '2026-08-22 06:23:51', '2026-08-22 06:23:51'), +(17, 2, 'create', 'Tour', 2, 'ویرایش تور', '2026-08-22 06:26:36', '2026-08-22 06:26:36'), +(18, 2, 'create', 'Tour', 3, 'ویرایش تور', '2026-08-22 06:27:25', '2026-08-22 06:27:25'), +(19, 2, 'create', 'Tour', 4, 'ویرایش تور', '2026-08-22 06:29:13', '2026-08-22 06:29:13'), +(20, 2, 'create', 'Tour', 5, 'ویرایش تور', '2026-08-22 06:30:22', '2026-08-22 06:30:22'), +(21, 2, 'create', 'Tour', 8, 'ثبت تور جدید', '2026-08-22 09:04:42', '2026-08-22 09:04:42'), +(22, 2, 'create', 'Tour', 8, 'حذف تور', '2026-08-22 09:05:21', '2026-08-22 09:05:21'), +(23, 2, 'create', 'Tour', 9, 'ثبت تور جدید', '2026-08-22 09:10:30', '2026-08-22 09:10:30'), +(24, 2, 'update', 'Tour', 9, 'ویرایش تور', '2026-08-22 09:10:55', '2026-08-22 09:10:55'), +(25, 2, 'delete', 'Tour', 9, 'حذف تور', '2026-08-22 09:11:12', '2026-08-22 09:11:12'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `admins` +-- + +DROP TABLE IF EXISTS `admins`; +CREATE TABLE IF NOT EXISTS `admins` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `first_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `last_name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `mobile` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL, + `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `status` tinyint NOT NULL DEFAULT '1' COMMENT 'Status: Inactive=0, Active=1, Blocked=2', + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `email` (`email`), + UNIQUE KEY `mobile` (`mobile`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `admins` +-- + +INSERT INTO `admins` (`id`, `first_name`, `last_name`, `username`, `email`, `mobile`, `password`, `image`, `status`, `created_at`, `updated_at`) VALUES +(2, 'hatame', 'andarza', 'hatame14', 'hatame14@gmail.com', '09119533286', '$2y$12$3ms35N3wjROPUQkTL9hYA.Gd7V4qZqKkKimkWbhApqoZFA7w/UDmy', NULL, 1, '2026-08-18 08:03:58', '2026-08-18 09:14:58'), +(3, 'melika', 'ghobadi', 'melika14', 'hatame@gmail.com', '09119533278', '$2y$12$K9m6JWglserBUoJYg233wupQTIRmP066QQ3jUzSYmCxwJgU3qo.CS', NULL, 1, '2026-08-18 10:23:53', '2026-08-20 11:34:39'), +(4, 'کمند', 'گرزین', 'kamand20', 'kamand20@gmail.com', '09119533234', '$2y$12$cT7u.C0PVgDTnKa6jHRdeO78.rh3HtMuAe9awkElF8WHJ28nP7MeG', NULL, 1, '2026-08-20 11:33:12', '2026-08-20 11:33:12'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `admin_roles` +-- + +DROP TABLE IF EXISTS `admin_roles`; +CREATE TABLE IF NOT EXISTS `admin_roles` ( + `admin_id` bigint UNSIGNED NOT NULL, + `role_id` bigint UNSIGNED NOT NULL, + PRIMARY KEY (`admin_id`,`role_id`), + KEY `fk_admin_roles_role` (`role_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `admin_roles` +-- + +INSERT INTO `admin_roles` (`admin_id`, `role_id`) VALUES +(2, 1), +(3, 2); + +-- -------------------------------------------------------- + +-- +-- 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(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `cities` +-- + +INSERT INTO `cities` (`id`, `province_id`, `name`, `created_at`, `updated_at`) VALUES +(3, 3, 'گرگان', '2026-08-20 13:26:22', '2026-08-20 13:26:22'), +(4, 2, 'تهران', '2026-08-22 08:13:53', '2026-08-22 08:13:53'), +(5, 5, 'کلات', '2026-08-22 08:14:22', '2026-08-22 08:14:22'), +(6, 6, 'کردستان', '2026-08-22 08:15:02', '2026-08-22 08:15:02'); + +-- -------------------------------------------------------- + +-- +-- 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 DEFAULT NULL, + `tour_id` bigint UNSIGNED DEFAULT NULL, + `flight_id` bigint UNSIGNED DEFAULT NULL, + `rating` tinyint NOT NULL, + `comment` text COLLATE utf8mb4_unicode_ci, + `status` tinyint NOT NULL DEFAULT '0' COMMENT 'Status: 0=Pending, 1=Approved, 2=Rejected', + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `tour_id` (`tour_id`), + KEY `user_id` (`user_id`), + KEY `comments_ibfk_3` (`flight_id`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `comments` +-- + +INSERT INTO `comments` (`id`, `user_id`, `tour_id`, `flight_id`, `rating`, `comment`, `status`, `created_at`, `updated_at`) VALUES +(17, NULL, 2, NULL, 5, 'عالیی', 0, '2026-08-18 04:38:26', '2026-08-18 04:38:26'), +(19, NULL, 5, NULL, 5, 'خیلی تور خوبی بود', 0, '2026-08-18 08:37:10', '2026-08-18 08:37:10'), +(22, 8, 2, NULL, 3, NULL, 0, '2026-08-20 08:14:57', '2026-08-20 08:14:57'), +(30, NULL, 3, NULL, 5, 'عالی بود حرف نداشت', 0, '2026-08-22 06:38:39', '2026-08-22 06:38:39'), +(31, 13, NULL, 5, 5, 'سفر خیلی خوبی بود \r\nممنونم از سفر خوبتون', 0, '2026-08-22 07:22:22', '2026-08-22 07:22:22'), +(32, NULL, 2, NULL, 5, 'فوق العاده بود', 0, '2026-08-22 09:24:03', '2026-08-22 09:24:03'); + +-- -------------------------------------------------------- + +-- +-- 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_type` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `favoritable_id` bigint UNSIGNED NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `unique_favorite` (`user_id`,`favoritable_type`,`favoritable_id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `favorites` +-- + +INSERT INTO `favorites` (`id`, `user_id`, `favoritable_type`, `favoritable_id`, `created_at`) VALUES +(6, 6, 'App\\Models\\Tour', 2, '2026-08-18 11:59:38'), +(7, 6, 'App\\Models\\Tour', 5, '2026-08-18 12:11:45'), +(8, 6, 'App\\Models\\Tour', 3, '2026-08-18 15:09:57'), +(10, 10, 'App\\Models\\Tour', 2, '2026-08-21 11:14:41'), +(11, 11, 'App\\Models\\Flight', 5, '2026-08-22 04:26:44'), +(12, 11, 'App\\Models\\Tour', 3, '2026-08-22 04:26:55'), +(13, 11, 'App\\Models\\Tour', 2, '2026-08-22 04:35:46'), +(15, 13, 'App\\Models\\Flight', 5, '2026-08-22 07:21:43'), +(16, 13, 'App\\Models\\Tour', 3, '2026-08-22 07:21:46'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `files` +-- + +DROP TABLE IF EXISTS `files`; +CREATE TABLE IF NOT EXISTS `files` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `extension` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `size` bigint UNSIGNED NOT NULL, + `original_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `path` varchar(255) 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, + `airline` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `flight_number` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `origin` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `destination` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `departure_date` date DEFAULT NULL, + `departure_time` time DEFAULT NULL, + `arrival_time` time DEFAULT NULL, + `flight_class` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `capacity` int DEFAULT NULL, + `price` decimal(10,2) DEFAULT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `views` int DEFAULT NULL, + `type` int NOT NULL COMMENT 'internal=0\r\n,external=2\r\n,charter=3', + `status` tinyint DEFAULT NULL COMMENT 'Status: 0=Draft, 1=Active, 2=Inactive, 3=Finished, 4=Cancelled', + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `flights` +-- + +INSERT INTO `flights` (`id`, `airline`, `flight_number`, `origin`, `destination`, `departure_date`, `departure_time`, `arrival_time`, `flight_class`, `capacity`, `price`, `image`, `views`, `type`, `status`, `created_at`, `updated_at`) VALUES +(1, 'ایران ایر', 'IR123', 'تهران', 'مشهد', '2026-08-20', '00:53:00', '10:53:00', 'Economy', 150, 2500000.00, 'flights/QL6KvTrhaA43Xdag0hDpXs62pM3LepW4NIkRrNsv.jpg', 52, 0, 1, '2026-08-17 04:29:53', '2026-08-22 06:23:51'), +(2, 'کیش ایر', 'QR450', 'تهران', 'دوحه', '2026-09-05', '00:52:00', '00:52:00', 'Business', 100, 12000000.00, 'flights/WEayM29AXfBCSgxKFq7BkQnm2lP271fcm6yE56KR.jpg', 49, 0, 1, '2026-08-17 04:32:47', '2026-08-22 06:22:48'), +(5, 'کیش ایر', 'QR432', 'گیلان', 'مازندران', '2026-09-03', '00:52:00', '11:52:00', 'Economy', 3, 1234567.00, 'flights/HDrlnjOvIeNHHtYsDglIzKcAUWyR3lxF9KDNOtDe.jpg', 92, 0, 1, '2026-08-19 11:06:42', '2026-08-22 09:34:06'); + +-- -------------------------------------------------------- + +-- +-- 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 CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `uq_permissions_name` (`name`), + UNIQUE KEY `uq_permissions_slug` (`slug`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `permissions` +-- + +INSERT INTO `permissions` (`id`, `name`, `slug`, `description`, `created_at`, `updated_at`) VALUES +(1, ' درج پرواز\r\n \r\n', ' flight_create \r\n', ' اجازه ثبت پرواز\r\n', '2026-08-18 10:04:41', '2026-08-18 10:04:41'), +(2, 'مدیریت نقشها', 'roles.manage', 'اجازه مدیریت نقشها', '2026-08-20 10:18:50', '2026-08-20 10:18:50'); + +-- -------------------------------------------------------- + +-- +-- 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(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `provinces` +-- + +INSERT INTO `provinces` (`id`, `name`, `created_at`, `updated_at`) VALUES +(2, 'تهران', NULL, NULL), +(3, 'گلستان', NULL, NULL), +(5, 'مشهد', NULL, NULL), +(6, 'سنندج', '2026-08-19 14:42:37', '2026-08-22 08:14:47'), +(7, 'کاشان', '2026-08-20 11:41:29', '2026-08-20 11:41:29'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `reservations` +-- + +DROP TABLE IF EXISTS `reservations`; +CREATE TABLE IF NOT EXISTS `reservations` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `user_id` bigint UNSIGNED NOT NULL, + `reservable_id` bigint UNSIGNED NOT NULL, + `reservable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `price` int NOT NULL, + `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT 'pending', + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `reservations_user_id_foreign` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `reservations` +-- + +INSERT INTO `reservations` (`id`, `user_id`, `reservable_id`, `reservable_type`, `price`, `status`, `created_at`, `updated_at`) VALUES +(7, 6, 2, 'App\\Models\\Flight', 12000000, 'pending', '2026-08-18 12:00:15', '2026-08-18 12:00:15'), +(8, 6, 2, 'App\\Models\\Flight', 12000000, 'pending', '2026-08-18 12:03:56', '2026-08-18 12:03:56'), +(9, 6, 1, 'App\\Models\\Flight', 2500000, 'pending', '2026-08-18 12:11:58', '2026-08-18 12:11:58'), +(11, 8, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-20 08:03:49', '2026-08-20 08:03:49'), +(12, 8, 5, 'App\\Models\\Flight', 1234567, 'pending', '2026-08-20 08:04:45', '2026-08-20 08:04:45'), +(13, 8, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-20 08:24:24', '2026-08-20 08:24:24'), +(14, 10, 5, 'App\\Models\\Flight', 1234567, 'pending', '2026-08-21 11:13:17', '2026-08-21 11:13:17'), +(15, 11, 5, 'App\\Models\\Flight', 1234567, 'pending', '2026-08-22 04:26:08', '2026-08-22 04:26:08'), +(16, 13, 2, 'App\\Models\\Tour', 4500000, 'pending', '2026-08-22 07:22:43', '2026-08-22 07:22:43'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `roles` +-- + +DROP TABLE IF EXISTS `roles`; +CREATE TABLE IF NOT EXISTS `roles` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `slug` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL, + `description` text COLLATE utf8mb4_unicode_ci NOT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + UNIQUE KEY `slug` (`slug`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `roles` +-- + +INSERT INTO `roles` (`id`, `name`, `slug`, `description`, `created_at`, `updated_at`) VALUES +(1, 'مدیر پرواز', 'flight_manager', 'مدیریت بخش پرواز', '2026-08-18 10:03:15', '2026-08-18 10:03:15'), +(2, 'مدیر تور', 'Tour_management', 'مدیریت بخش تور', '2026-08-18 10:25:58', '2026-08-18 10:25:58'), +(3, 'مدیر کل', 'super_admin', '', '2026-08-20 10:21:57', '2026-08-20 10:21:57'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `role_permissions` +-- + +DROP TABLE IF EXISTS `role_permissions`; +CREATE TABLE IF NOT EXISTS `role_permissions` ( + `role_id` bigint UNSIGNED NOT NULL, + `permission_id` bigint UNSIGNED NOT NULL, + PRIMARY KEY (`role_id`,`permission_id`), + KEY `fk_role_permissions_permission` (`permission_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `role_permissions` +-- + +INSERT INTO `role_permissions` (`role_id`, `permission_id`) VALUES +(1, 1), +(2, 1), +(3, 1), +(2, 2), +(3, 2); + +-- -------------------------------------------------------- + +-- +-- 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(150) 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=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `settings` +-- + +INSERT INTO `settings` (`id`, `code`, `value`, `created_at`, `updated_at`) VALUES +(1, 'phone', '02146621888', '2026-08-20 09:26:34', '2026-08-20 09:26:34'), +(2, 'address', 'تهران – فرودگاه مهرآباد – ساختمان مرکزی هواپیمائی جمهوری اسلامی ایران', '2026-08-20 09:31:05', '2026-08-20 09:36:00'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tours` +-- + +DROP TABLE IF EXISTS `tours`; +CREATE TABLE IF NOT EXISTS `tours` ( + `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, + `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `summary` text COLLATE utf8mb4_unicode_ci NOT NULL, + `description` longtext COLLATE utf8mb4_unicode_ci NOT NULL, + `image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, + `travel_type_id` tinyint UNSIGNED NOT NULL, + `price` decimal(12,2) NOT NULL, + `views` int DEFAULT NULL, + `departure_date` date NOT NULL, + `status` tinyint NOT NULL COMMENT 'Draft=0|Active=1|Inactive=2|Finished=3||Cancelled=4', + `created_by` bigint UNSIGNED DEFAULT NULL, + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `tours` +-- + +INSERT INTO `tours` (`id`, `title`, `summary`, `description`, `image`, `travel_type_id`, `price`, `views`, `departure_date`, `status`, `created_by`, `created_at`, `updated_at`) VALUES +(2, 'تور 7 روزه مشهد', 'سفر زیارتی به مشهد مقدس با هتل 4 ستاره', 'تور کامل مشهد شامل اقامت، ترانسفر و خدمات گردشگری', 'tours/t7USmlsTAzrMiwyUjDh628oOG7zgGJTyhHMLg7YP.webp', 1, 4500000.00, 114, '2026-08-25', 1, NULL, '2026-08-17 07:13:38', '2026-08-22 09:26:37'), +(3, 'تور کیش 5 روزه', 'تور تفریحی کیش با هتل نزدیک دریا', 'سفر به جزیره کیش همراه با اقامت و خدمات ویژه', 'tours/CbFZAde85cxT42FDyI4DmvIgRJj2ZyEIkjQkHubJ.webp', 1, 6500000.00, 19, '2026-09-05', 1, NULL, '2026-08-17 07:13:38', '2026-08-22 06:38:39'), +(4, 'تور استانبول 6 روزه', 'تور خارجی استانبول با پرواز رفت و برگشت', 'اقامت در هتل، ترانسفر فرودگاهی و گشت شهری', 'tours/qBxD8aisdcuYU6kLA5x8j8lbNsITp5Si1CW8MVzZ.jpg', 1, 18500000.00, 1, '2026-09-15', 1, NULL, '2026-08-17 07:13:38', '2026-08-22 06:29:13'), +(5, 'تور شمال 3 روزه', 'سفر طبیعت گردی به شمال ایران', 'اقامت در ویلا و بازدید از جاذبه های گردشگری شمال', 'tours/QEmCuVjAdWqJ7fHJldQJYv6UW5icxqNGhgikwdwF.jpg', 1, 2800000.00, 4, '2026-08-28', 1, NULL, '2026-08-17 07:13:38', '2026-08-22 06:30:22'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `tour_flights` +-- + +DROP TABLE IF EXISTS `tour_flights`; +CREATE TABLE IF NOT EXISTS `tour_flights` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `tour_id` bigint NOT NULL, + `flight_id` bigint NOT NULL, + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + KEY `tour_id` (`tour_id`), + KEY `flight_id` (`flight_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, + `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `status` tinyint NOT NULL DEFAULT '1' COMMENT 'Status: 0=Inactive, 1=Active', + `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP, + `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- -------------------------------------------------------- + +-- +-- 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(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `last_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL, + `national_code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, + `gender` tinyint NOT NULL COMMENT 'male:0 | famale:1', + `marital_status` tinyint NOT NULL COMMENT 'single:0|Married:1|Separated:2', + `spouse_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `mobile` varchar(11) COLLATE utf8mb4_unicode_ci NOT NULL, + `email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, + `profile_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, + `username` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL, + `password` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `province_id` bigint UNSIGNED DEFAULT NULL, + `city_id` bigint UNSIGNED DEFAULT NULL, + `status` tinyint NOT NULL COMMENT 'Draft=0|Active=1|Inactive=2|Expired=3|Cancelled=4', + `created_at` timestamp NOT NULL, + `updated_at` timestamp NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`), + UNIQUE KEY `email` (`email`), + KEY `city_id` (`city_id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + +-- +-- Dumping data for table `users` +-- + +INSERT INTO `users` (`id`, `first_name`, `last_name`, `national_code`, `gender`, `marital_status`, `spouse_name`, `mobile`, `email`, `profile_image`, `username`, `password`, `province_id`, `city_id`, `status`, `created_at`, `updated_at`) VALUES +(1, 'حاتمه', 'اندرزا', '2081391694', 1, 0, NULL, '09119533286', 'hatame@gmail.com', NULL, 'hatame14', '$2y$12$DR06kacZidiPfbnGwmOqOeXRAbYgd8nvMcDjit9.v6gNUXAGoOj9a', NULL, NULL, 0, '2026-08-16 05:18:26', '2026-08-22 07:19:34'), +(2, 'شهرزاد', 'زندی', '2080706640', 1, 0, NULL, '09112345678', 'shahrzad@gmail.com', NULL, 'shahrzad', '$2y$12$X5fVgkc3d/aYaLnDl6g3lOp5vjJiB0ZEl.1eepjr2e34DnuZQ9fZa', NULL, NULL, 0, '2026-08-16 05:56:30', '2026-08-16 05:56:30'), +(3, 'مینا', 'اسمعیلی', '2011093232', 1, 1, 'مهدی', '09013921486', 'mina@gmail.com', NULL, 'mina14', '$2y$12$7MKYeFaQi0PC1g8q4jQYSe6mVMpPrmGMPLsKvHVVq6Q2Q7Xx4a6qe', NULL, NULL, 0, '2026-08-16 06:38:10', '2026-08-16 06:38:10'), +(6, 'سوگند', 'اصغری', '2150788772', 1, 0, NULL, '09032097811', 'sogand@gmail.com', '1787054360.jpg', 'sogand12', '$2y$12$595f7ziX9RVnQoLen4P11e6PSixIt02WAAi8oQRKGte0JuLN4FPBG', 1, NULL, 0, '2026-08-18 11:59:21', '2026-08-18 11:59:21'), +(8, 'کمند', 'گرزین', '2081391672', 1, 0, NULL, '09119533288', 'kamand19@gmail.com', NULL, 'kamand19', '$2y$12$bkZd2M8RMbGRxl3Naq1UmOmKe5warTAh8SRhE8NK6MwrkmpJHo8ze', 1, NULL, 0, '2026-08-20 07:59:23', '2026-08-20 07:59:23'), +(9, 'کمند', 'گرزین', '2081391623', 1, 0, NULL, '09119533234', 'kamand20@gmail.com', NULL, 'kamand20', '$2y$12$qkQJnRAQ4GdwOF4v8FpZV./zbSRAm8kw0b0JPm1FTd7lKCQ9AUW4q', 6, NULL, 0, '2026-08-20 10:54:47', '2026-08-20 10:54:47'), +(10, 'محمد', 'گرزین', '2080389327', 0, 1, 'فاطمه', '09112533940', 'mohammad@gmail.com', '1787310773.jpg', 'mohammad14', '$2y$12$lsYQDoX39/SZ6S59jIRuteiP7Lcc9o3swnaCELqdCh1.cpfiFlfku', 2, NULL, 0, '2026-08-21 11:12:54', '2026-08-21 11:12:54'), +(11, 'مهرسا', 'قدمی', '2081391594', 1, 1, 'جواد', '09119533239', 'mehrsa25@gmail.com', '1787373663.webp', 'mehrsa25', '$2y$12$PIS7t0DY8s/a8Chx4RoP2.MetqzXa2KZT8sBS9YdiuxUL2CGroHV6', 6, NULL, 0, '2026-08-22 04:25:54', '2026-08-22 04:41:03'), +(12, 'زهرا', 'افشاری', '2081391894', 1, 0, NULL, '09013921445', 'zahra14@gmail.com', '1787375691.jpg', 'zahra12', '$2y$12$4/NRDPOdKfIVelgIH.wGFeW4iPKCNv4yVn3Tl/8ItFaV5DFma5MwG', 3, 3, 0, '2026-08-22 05:14:51', '2026-08-22 05:14:51'), +(13, 'فاطمه', 'افشاری', '2081391321', 1, 1, 'محمد', '09119533236', 'fateme16@gmail.com', '1787382448.jpg', 'fatame16', '$2y$12$mn2Fz6GNe.LeU1bRH9nbHuSsx2gR/HorOMpt8YfJS.JAv2Rt0aq46', 3, 3, 0, '2026-08-22 07:07:29', '2026-08-22 07:07:29'); + +-- +-- Constraints for dumped tables +-- + +-- +-- Constraints for table `admin_roles` +-- +ALTER TABLE `admin_roles` + ADD CONSTRAINT `fk_admin_roles_admin` FOREIGN KEY (`admin_id`) REFERENCES `admins` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `fk_admin_roles_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- +-- Constraints for table `comments` +-- +ALTER TABLE `comments` + ADD CONSTRAINT `comments_ibfk_1` FOREIGN KEY (`tour_id`) REFERENCES `tours` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT, + ADD CONSTRAINT `comments_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `favorites` +-- +ALTER TABLE `favorites` + ADD CONSTRAINT `favorites_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `reservations` +-- +ALTER TABLE `reservations` + ADD CONSTRAINT `reservations_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT; + +-- +-- Constraints for table `role_permissions` +-- +ALTER TABLE `role_permissions` + ADD CONSTRAINT `fk_role_permissions_permission` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT `fk_role_permissions_role` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE ON UPDATE CASCADE; + +-- +-- Constraints for table `users` +-- +ALTER TABLE `users` + ADD CONSTRAINT `users_ibfk_1` FOREIGN KEY (`city_id`) REFERENCES `cities` (`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 */; diff --git a/public/.zip b/public/.zip new file mode 100644 index 0000000..6718966 Binary files /dev/null and b/public/.zip differ diff --git a/resources/views/components/tour.blade.php b/resources/views/components/tour.blade.php index 2575823..454df92 100644 --- a/resources/views/components/tour.blade.php +++ b/resources/views/components/tour.blade.php @@ -59,6 +59,10 @@ مشاهده +