From dff218541c1ff2b2412e0382fb5bfff3ee9544e0 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 7 Feb 2026 13:35:54 +0330 Subject: [PATCH 01/11] dockerize the project --- Dockerfile | 69 ++++++++++++++-------------------------------- docker-compose.yml | 33 ++++++++++++++++++++++ 2 files changed, 53 insertions(+), 49 deletions(-) create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile index 54e60030..80fbb68c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,58 +1,29 @@ -FROM alpine:3.18 +FROM dunglas/frankenphp:1.11.1-php8.2 -RUN apk update && apk add --no-cache\ - bash \ - wget \ - curl \ - nano \ +RUN apt-get update \ + && apt-get install -y --no-install-recommends default-mysql-client \ unzip \ - libzip-dev \ - libxml2 \ - libxml2-dev \ - git \ - zlib-dev \ - libpng-dev \ - php81 \ - php81-common \ - php81-fpm \ - php81-pdo \ - php81-opcache \ - php81-soap \ - php81-zip \ - php81-phar \ - php81-iconv \ - php81-cli \ - php81-curl \ - php81-openssl \ - php81-mbstring \ - php81-tokenizer \ - php81-fileinfo \ - php81-json \ - php81-xml \ - php81-xmlwriter \ - php81-xmlreader \ - php81-simplexml \ - php81-dom \ - php81-pdo_mysql \ - php81-pdo_pgsql \ - php81-pdo_sqlite \ - php81-tokenizer \ - php81-pecl-redis \ - php81-gd + zip \ + && docker-php-ext-install pdo_mysql \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +WORKDIR /var/www/rms -ENV COMPOSER_ALLOW_SUPERUSER=1 +# Copy Laravel application +COPY . . -ARG MOUNT_PATH +# Give permissions to storage and bootstrap/cache +RUN chmod -R 777 storage bootstrap/cache -COPY . /var/www/app - -WORKDIR /var/www/app +# Install Composer +COPY --from=docker.arvancloud.ir/composer:latest /usr/bin/composer /usr/bin/composer +# Optional: Run migrations/seeds if you want +# CMD php artisan migrate && php artisan db:seed && frankenphp run --config /etc/frankenphp/config.prod.yaml CMD composer install;\ php artisan key:generate;\ -# php artisan migrate ;\ -# php artisan db:seed;\ -# php artisan storege:link;\ - php artisan serve --host=0.0.0.0 \ No newline at end of file + php artisan migrate;\ + php artisan db:seed;\ + cd public;\ + frankenphp php-server \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..85c90431 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,33 @@ +services: + mariadb: + image: mariadb:10.11.8 + container_name: rms-mariadb + ports: + - "3307:3306" + environment: + MARIADB_DATABASE: ${MARIADB_DATABASE} + MARIADB_USER: ${MARIADB_USER} + MARIADB_PASSWORD: ${MARIADB_PASSWORD} + MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} + volumes: + - ./2025-11-30:/var/lib/mysql + networks: + - rms + + backend: + build: + context: . + dockerfile: Dockerfile + container_name: rms + ports: + - "8003:80" + volumes: + - ./:/var/www/rms + depends_on: + - mariadb + networks: + - rms + +networks: + rms: + driver: bridge \ No newline at end of file From 5f19a26f67a4c33b50cb68afbdd8bd1cf1a7ae91 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 7 Feb 2026 14:21:53 +0330 Subject: [PATCH 02/11] debug the image --- Dockerfile | 5 ++++- docker-compose.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 80fbb68c..b118f592 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,10 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends default-mysql-client \ unzip \ zip \ - && docker-php-ext-install pdo_mysql \ + && install-php-extensions pdo_mysql \ + && install-php-extensions zip \ + && install-php-extensions gd \ + && install-php-extensions pcntl \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yml b/docker-compose.yml index 85c90431..462504d0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: MARIADB_PASSWORD: ${MARIADB_PASSWORD} MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} volumes: - - ./2025-11-30:/var/lib/mysql + - /var/www/rmsdb:/var/lib/mysql networks: - rms From d833f4dc0d5c4ad786afcef60da2426bbbd17172 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 7 Feb 2026 14:57:26 +0330 Subject: [PATCH 03/11] add db config --- docker-compose.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 462504d0..9afc5e76 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,10 +5,10 @@ services: ports: - "3307:3306" environment: - MARIADB_DATABASE: ${MARIADB_DATABASE} - MARIADB_USER: ${MARIADB_USER} - MARIADB_PASSWORD: ${MARIADB_PASSWORD} - MARIADB_ROOT_PASSWORD: ${MARIADB_ROOT_PASSWORD} + MARIADB_DATABASE: ${DB_DATABASE} + MARIADB_USER: ${DB_USERNAME} + MARIADB_PASSWORD: ${DB_PASSWORD} + MARIADB_ROOT_PASSWORD: ${DB_PASSWORD} volumes: - /var/www/rmsdb:/var/lib/mysql networks: From a1bca2d80fc140eb1bb99481040372e88e1753c6 Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Sat, 16 May 2026 09:18:50 +0330 Subject: [PATCH 04/11] fix view for receipt in insurance letter --- resources/views/receipt/insurance_letter.blade.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/resources/views/receipt/insurance_letter.blade.php b/resources/views/receipt/insurance_letter.blade.php index 9e10dfe0..962c45f9 100644 --- a/resources/views/receipt/insurance_letter.blade.php +++ b/resources/views/receipt/insurance_letter.blade.php @@ -125,11 +125,13 @@ $(document).ready(function() { $(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format( "jYYYY/jMM/jDD")); - const plaque = jsonServer.data.plaque.split("-"); - $("#plaque1").text(plaque[0]); - $("#plaque2").text(plaque[1]); - $("#plaque3").text(plaque[2]); - $("#plaque4").text(plaque[3]); + const plaque = jsonServer?.data?.plaque?.split("-"); + if (plaque) { + $("#plaque1").text(plaque[0]); + $("#plaque2").text(plaque[1]); + $("#plaque3").text(plaque[2]); + $("#plaque4").text(plaque[3]); + } let row_counter; let i; for (i = 0; i < damages.length; i++) { From 3ca710228f28ab9cf5835e4f2e6388567d3544b8 Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Sat, 16 May 2026 10:22:02 +0330 Subject: [PATCH 05/11] create new object for user --- app/Http/Controllers/UserController.php | 1 + .../V3/Dashboard/RoadMaintenanceStationController.php | 9 +++++++++ routes/v3.php | 1 + 3 files changed, 11 insertions(+) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index beb423c8..858e130d 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -434,6 +434,7 @@ class UserController extends Controller $user->password = Hash::make($request->password); $user->national_code = $request->national_code; + $user->station_id = $request->station_id; $user->save(); if (auth()->user()) { diff --git a/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php b/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php index 228bf825..b92ee60a 100644 --- a/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php +++ b/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php @@ -38,6 +38,15 @@ class RoadMaintenanceStationController extends Controller )); } + public function findByCity(Request $request): JsonResponse + { + $stations = RahdariPoint::query() + ->where('city_id', $request->city_id) + ->get(); + + return $this->successResponse($stations); + } + /** * Store a newly created resource in storage. */ diff --git a/routes/v3.php b/routes/v3.php index d17d2bd0..7d670fa5 100644 --- a/routes/v3.php +++ b/routes/v3.php @@ -475,6 +475,7 @@ Route::prefix('road_maintenance_station') Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province'); Route::post('/', 'store')->name('store'); Route::get('/map', 'map')->name('map'); + Route::get('/filter', 'findByCity')->name('findByCity'); Route::get('/images/{rahdariPoint}', 'images')->name('images'); Route::get('/{rahdariPoint}', 'show')->name('show')->middleware('permission:show-tollhouse|show-tollhouse-province'); Route::post('/{rahdariPoint}', 'update')->name('update')->middleware('permission:edit-tollhouse|edit-tollhouse-province'); From 96960f5e8fb890989e8041896349fc3a49935e2e Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Mon, 18 May 2026 10:52:29 +0330 Subject: [PATCH 06/11] create one item for mission and fix in another table --- .../Commands/SendContractSmsNotification.php | 2 +- app/Enums/MissionStates.php | 4 +- app/Facades/Sms/SmsClass.php | 44 +++++++++---------- .../Api/ContractSubItemsController.php | 38 ++++++++-------- .../Mission/ControlUnitController.php | 23 +++++----- .../V3/Mission/ControlUnit/FinishRequest.php | 1 + .../Mission/Report/ReportTradodService.php | 16 +++---- app/Services/PaymentService.php | 4 +- ...18_102119_add_end_km_to_missions_table.php | 29 ++++++++++++ .../road_patrols/operation_create.blade.php | 6 +-- routes/v3.php | 6 +-- 11 files changed, 102 insertions(+), 71 deletions(-) create mode 100644 database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php diff --git a/app/Console/Commands/SendContractSmsNotification.php b/app/Console/Commands/SendContractSmsNotification.php index 8b29c308..7786fb73 100644 --- a/app/Console/Commands/SendContractSmsNotification.php +++ b/app/Console/Commands/SendContractSmsNotification.php @@ -46,7 +46,7 @@ class SendContractSmsNotification extends Command foreach ($contractSubItems as $key => $value) { $message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir"; - self::sms_sender($value->operator_phone, $message); +// self::sms_sender($value->operator_phone, $message); } } diff --git a/app/Enums/MissionStates.php b/app/Enums/MissionStates.php index 44df6680..7abfdf04 100644 --- a/app/Enums/MissionStates.php +++ b/app/Enums/MissionStates.php @@ -15,11 +15,11 @@ enum MissionStates: int public static function name(int $state): string { $mapArray = [ - 1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد نقلیه است', + 1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد تایید کننده است', 2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است', 3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود', 4 => 'اتمام ماموریت', - 5 => 'عدم تخصیص خودرو توسط واحد نقلیه و بازگشت درخواست به کارتابل کاربر', + 5 => 'عدم تخصیص خودرو توسط واحد تایید کننده و بازگشت درخواست به کارتابل کاربر', 6 => 'ماموریت لغو شد', 7 => 'ماموریت بدون فرایند ثبت شد' ]; diff --git a/app/Facades/Sms/SmsClass.php b/app/Facades/Sms/SmsClass.php index ea950944..3ccd09b6 100644 --- a/app/Facades/Sms/SmsClass.php +++ b/app/Facades/Sms/SmsClass.php @@ -12,28 +12,28 @@ class SmsClass { public function sendSms($mobile, $msg) { - if (App::environment('production')) { - - - $client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL"); - $date = date('d-m-y h:i:s'); - $date = str_replace(" ", "T", $date); - $result = $client->Send( - array( - 'Username' => 'admin', - 'Password' => 'admin141', - 'ShortCode' => '1000141', - 'Cellphones' => $mobile, - 'Message' => $msg, - 'Farsi' => true, - // 'SendDate' => $date - // 'uTopic' => false, - // 'uFlash' => false - ) - ); - - return $result->SendResult; - } +// if (App::environment('production')) { +// +// +// $client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL"); +// $date = date('d-m-y h:i:s'); +// $date = str_replace(" ", "T", $date); +// $result = $client->Send( +// array( +// 'Username' => 'admin', +// 'Password' => 'admin141', +// 'ShortCode' => '1000141', +// 'Cellphones' => $mobile, +// 'Message' => $msg, +// 'Farsi' => true, +// // 'SendDate' => $date +// // 'uTopic' => false, +// // 'uFlash' => false +// ) +// ); +// +// return $result->SendResult; +// } // $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL"); diff --git a/app/Http/Controllers/Api/ContractSubItemsController.php b/app/Http/Controllers/Api/ContractSubItemsController.php index af3439c0..9f4a0ff1 100644 --- a/app/Http/Controllers/Api/ContractSubItemsController.php +++ b/app/Http/Controllers/Api/ContractSubItemsController.php @@ -609,25 +609,25 @@ class ContractSubItemsController extends Controller ]); } - public function sms_sender($mobile, $msg) - { - $client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL"); - $result=$client->doSendSMS( - array( - 'uUsername' => 'rmto', - 'uPassword' => 'Rahdari8 - ', - 'uNumber' => '1000141', - 'uCellphones' => $mobile, - 'uMessage' => $msg, - 'uFarsi' => true, - 'uTopic' => false, - 'uFlash' => false - ) - ); - $x = $result->doSendSMSResult; - return $x; - } +// public function sms_sender($mobile, $msg) +// { +// $client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL"); +// $result=$client->doSendSMS( +// array( +// 'uUsername' => 'rmto', +// 'uPassword' => 'Rahdari8 +// ', +// 'uNumber' => '1000141', +// 'uCellphones' => $mobile, +// 'uMessage' => $msg, +// 'uFarsi' => true, +// 'uTopic' => false, +// 'uFlash' => false +// ) +// ); +// $x = $result->doSendSMSResult; +// return $x; +// } public function get_way_id_from_nominatim($lat, $lng) { diff --git a/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php b/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php index 33e732b0..bcc7e1d9 100644 --- a/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php +++ b/app/Http/Controllers/V3/Dashboard/Mission/ControlUnitController.php @@ -70,19 +70,20 @@ class ControlUnitController extends Controller 'state_name' => MissionStates::name($state), 'finish_time' => $request->time, 'mission_duration' => strtotime($request->time) - strtotime($mission->start_time), + 'end_km' => $request->end_km, ]); - $getErrorRateService->setInputParameters($mission); - $responseData = $getErrorRateService->run(); - - $mission->update([ - 'in_area_duration' => $responseData['timeInAreaSeconds'], - 'first_enter' => $responseData['firstEnter'], - 'last_exit' => $responseData['lastExit'], - 'point_number_sent' => $responseData['noOfPointsInMission'], - 'fms_result_code' => $responseData['resultCode'], - 'fms_result_message' => FMSResultCode::name($responseData['resultCode']), - ]); +// $getErrorRateService->setInputParameters($mission); +// $responseData = $getErrorRateService->run(); +// +// $mission->update([ +// 'in_area_duration' => $responseData['timeInAreaSeconds'], +// 'first_enter' => $responseData['firstEnter'], +// 'last_exit' => $responseData['lastExit'], +// 'point_number_sent' => $responseData['noOfPointsInMission'], +// 'fms_result_code' => $responseData['resultCode'], +// 'fms_result_message' => FMSResultCode::name($responseData['resultCode']), +// ]); }); if ($mission->category_id == 2) { diff --git a/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php b/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php index 899b1bb0..bbc1d5b0 100644 --- a/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php +++ b/app/Http/Requests/V3/Mission/ControlUnit/FinishRequest.php @@ -25,6 +25,7 @@ class FinishRequest extends FormRequest { return [ 'time' => 'required|date', + 'end_km' => 'required', ]; } } diff --git a/app/Services/Cartables/Mission/Report/ReportTradodService.php b/app/Services/Cartables/Mission/Report/ReportTradodService.php index 2aacae97..341f0430 100644 --- a/app/Services/Cartables/Mission/Report/ReportTradodService.php +++ b/app/Services/Cartables/Mission/Report/ReportTradodService.php @@ -37,8 +37,8 @@ class ReportTradodService -1 AS province_id, COUNT(m.id) AS total, COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode, - COALESCE(SUM(m.in_area_duration), 0) AS gps, - COALESCE(SUM(m.mission_duration), 0) AS durations, + COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps, + COALESCE(SUM(m.mission_duration)/3600, 0) AS durations, COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h, COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d, COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h, @@ -56,8 +56,8 @@ class ReportTradodService p.id AS province_id, COUNT(m.id) AS total, COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode, - COALESCE(SUM(m.in_area_duration), 0) AS gps, - COALESCE(SUM(m.mission_duration), 0) AS durations, + COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps, + COALESCE(SUM(m.mission_duration)/3600, 0) AS durations, COALESCE(SUM(CASE WHEN m.type = 1 THEN 1 ELSE 0 END), 0) AS far_h, COALESCE(SUM(CASE WHEN m.type = 2 THEN 1 ELSE 0 END), 0) AS far_d, COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h, @@ -98,8 +98,8 @@ class ReportTradodService -1 AS city_id, COUNT(m.id) AS total, COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode, - COALESCE(SUM(m.in_area_duration), 0) AS gps, - COALESCE(SUM(m.mission_duration), 0) AS durations, + COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps, + COALESCE(SUM(m.mission_duration)/3600, 0) AS durations, COALESCE(SUM(m.type = 1), 0) AS far_h, COALESCE(SUM(m.type = 2), 0) AS far_d, COALESCE(SUM(m.type = 3), 0) AS un_far_h, @@ -118,8 +118,8 @@ class ReportTradodService c.id AS city_id, COUNT(m.id) AS total, COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode, - COALESCE(SUM(m.in_area_duration), 0) AS gps, - COALESCE(SUM(m.mission_duration), 0) AS durations, + COALESCE(SUM(m.in_area_duration)/3600, 0) AS gps, + COALESCE(SUM(m.mission_duration)/3600, 0) AS durations, COALESCE(SUM(m.type = 1), 0) AS far_h, COALESCE(SUM(m.type = 2), 0) AS far_d, COALESCE(SUM(m.type = 3), 0) AS un_far_h, diff --git a/app/Services/PaymentService.php b/app/Services/PaymentService.php index cfe90719..b8efeba8 100644 --- a/app/Services/PaymentService.php +++ b/app/Services/PaymentService.php @@ -27,7 +27,7 @@ class PaymentService ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://payment.rmto.ir/acc/rest/payid/gen"); + curl_setopt($ch, CURLOPT_URL, "https://payment.rmto.ir/acc/rest/payid/gen"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); @@ -59,7 +59,7 @@ class PaymentService ); $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, "http://payment.rmto.ir/acc/rest/payid/track2/" . env("PAYMENT_USERNAME") . "/" . env("PAYMENT_PASSWORD") . "/" . $bill_code); + curl_setopt($ch, CURLOPT_URL, "https://payment.rmto.ir/acc/rest/payid/track2/" . env("PAYMENT_USERNAME") . "/" . env("PAYMENT_PASSWORD") . "/" . $bill_code); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt($ch, CURLOPT_POST, true); // curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); diff --git a/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php b/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php new file mode 100644 index 00000000..f4afbb34 --- /dev/null +++ b/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php @@ -0,0 +1,29 @@ +string('end_km')->nullable(); + + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('missions', function (Blueprint $table) { + $table->dropColumn('km'); + }); + } +}; diff --git a/resources/views/version2/dashboard_pages/road_patrols/operation_create.blade.php b/resources/views/version2/dashboard_pages/road_patrols/operation_create.blade.php index 62546115..c0633708 100644 --- a/resources/views/version2/dashboard_pages/road_patrols/operation_create.blade.php +++ b/resources/views/version2/dashboard_pages/road_patrols/operation_create.blade.php @@ -38,7 +38,7 @@ - --}}
- +
diff --git a/routes/v3.php b/routes/v3.php index 7d670fa5..0ed1219e 100644 --- a/routes/v3.php +++ b/routes/v3.php @@ -475,7 +475,7 @@ Route::prefix('road_maintenance_station') Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province'); Route::post('/', 'store')->name('store'); Route::get('/map', 'map')->name('map'); - Route::get('/filter', 'findByCity')->name('findByCity'); + Route::get('/search_by_city', 'findByCity')->name('findByCity'); Route::get('/images/{rahdariPoint}', 'images')->name('images'); Route::get('/{rahdariPoint}', 'show')->name('show')->middleware('permission:show-tollhouse|show-tollhouse-province'); Route::post('/{rahdariPoint}', 'update')->name('update')->middleware('permission:edit-tollhouse|edit-tollhouse-province'); @@ -538,7 +538,7 @@ Route::prefix('missions') }); Route::prefix('report_violation') ->name('reportsViolation.') - ->middleware(['permission:mission-report-province', 'permission:mission-report-country']) + ->middleware(['permission:mission-report-province|permission:mission-report-country']) ->controller(ReportViolationController::class) ->group(function () { Route::get('/country_activity', 'countryActivity')->name('countryActivity'); @@ -548,7 +548,7 @@ Route::prefix('missions') }); Route::prefix('report_taradod') ->name('reportsTaradod.') - ->middleware(['permission:mission-report-province', 'permission:mission-report-country']) + ->middleware(['permission:mission-report-province|permission:mission-report-country']) ->controller(ReportTradodController::class) ->group(function () { Route::get('/country_activity', 'countryActivity')->name('countryActivity'); From f798d05a3c3e5b3019e047d8ac424f423456ecea Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Mon, 18 May 2026 11:01:20 +0330 Subject: [PATCH 07/11] create one item for mission and fix in another table --- .../V3/Dashboard/RoadMaintenanceStationController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php b/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php index b92ee60a..ded93c8b 100644 --- a/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php +++ b/app/Http/Controllers/V3/Dashboard/RoadMaintenanceStationController.php @@ -41,7 +41,7 @@ class RoadMaintenanceStationController extends Controller public function findByCity(Request $request): JsonResponse { $stations = RahdariPoint::query() - ->where('city_id', $request->city_id) + ->where('city_id', $request->query('city_id')) ->get(); return $this->successResponse($stations); From 6a1513a72fc70761c6b51c33424c536772fad72e Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Mon, 18 May 2026 08:09:27 +0000 Subject: [PATCH 08/11] add toll house to user management --- .../dashboard_pages/user_management/list.js | 69 ++++++++++++++++--- .../user_management/list.blade.php | 5 ++ 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/public/version2/js/dashboard_pages/user_management/list.js b/public/version2/js/dashboard_pages/user_management/list.js index 497d4261..0e3abf43 100644 --- a/public/version2/js/dashboard_pages/user_management/list.js +++ b/public/version2/js/dashboard_pages/user_management/list.js @@ -417,6 +417,43 @@ function getCityByProvince(province_id, dom_id, selected_id = 0) { } + +function getTollhouseByCity(city_id, dom_id, selected_id = 0) {$.ajax({ + url: `/api/v3/road_maintenance_station/search_by_city?city_id=${city_id}`, + type: "GET", + async: false, + beforeSend: function () { + $(`#${dom_id}`).empty(); + showLoaderScreen() + }, + success: function (result) { + $(`#${dom_id}`).append(''); + cities = result.data; + + for (let index = 0; index < cities.length; index++) { + + $(`#${dom_id}`).append( + `` + ); + } + + if (selected_id == null) { + disableDOM(dom_id); + } else if (selected_id != 0) { + enableDOM(dom_id); + $(`#${dom_id} option[value="${selected_id}"]`).attr("selected", true); + } + + hideLoaderScreen(); + }, + error: function (error) { + errorHandler(error); + hideLoaderScreen(); + }, + }); + +} + function getCityOfficeByCity(city_id, dom_id, selected_id = 0) { $.ajax({ url: "/public/contents/edarateShahri/" + city_id, @@ -2386,6 +2423,24 @@ $("#add_province_office").change(function () { setUserName(); }) +$("#add_simple_city").change(function () { + console.log("add_simple_city change happend"); + + console.log("valuee:", $(this).val()); + + if ($("#add_simple_city").val() == -1) { + console.log("value of city is or -1"); + + disableDOM("add_simple_tollhouse") + $("#add_simple_tollhouse").empty(); + } else { + console.log("tolls should send reqest"); + + enableDOM("add_simple_tollhouse") + getTollhouseByCity($("#add_simple_province").val(), "add_simple_tollhouse") + } +}) + // $("#edit_city").change(function () { // if ($(this).val() == 0) { @@ -2396,15 +2451,6 @@ $("#add_province_office").change(function () { // setUserName("edit"); // }) -// $("#add_simple_city").change(function () { - -// if ($(this).val() == 0) { -// $("#add_simple_city_office").empty(); -// } else { -// getCityOfficeByCity($(this).val(), "add_simple_city_office") -// } -// setUserName(); -// }) // $("#add_city").change(function () { @@ -2581,6 +2627,9 @@ $('#add_simple_user_show_modal').on('click', function () { enableDOM("add_simple_city") $("#add_simple_city").empty(); $("#add_simple_city").append(''); + enableDOM("add_simple_tollhouse") + $("#add_simple_tollhouse").empty(); + $("#add_simple_tollhouse").append(''); enableDOM("add_simple_city_office") $("#add_simple_city_office").empty(); $("#add_simple_city_office").append(''); @@ -2594,8 +2643,10 @@ $("#add_simple_province").change(function () { disableDOM("add_simple_city") disableDOM("add_simple_city_office") + disableDOM("add_simple_tollhouse") $("#add_simple_city").empty(); $("#add_simple_city_office").empty(); + $("#add_simple_tollhouse").empty(); } else { if ($("#add_simple_province_office").val() == 0) { diff --git a/resources/views/version2/dashboard_pages/user_management/list.blade.php b/resources/views/version2/dashboard_pages/user_management/list.blade.php index 868495d7..a77469ca 100644 --- a/resources/views/version2/dashboard_pages/user_management/list.blade.php +++ b/resources/views/version2/dashboard_pages/user_management/list.blade.php @@ -675,6 +675,11 @@ id="add_simple_city_office">
+
+ + +
* From ad70874bde0cc2c3f56326fd59779b8fd8f21bef Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Mon, 18 May 2026 11:39:30 +0330 Subject: [PATCH 09/11] fix migration --- .../2026_05_18_102119_add_end_km_to_missions_table.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php b/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php index f4afbb34..ecf5de6b 100644 --- a/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php +++ b/database/migrations/2026_05_18_102119_add_end_km_to_missions_table.php @@ -23,7 +23,7 @@ return new class extends Migration public function down(): void { Schema::table('missions', function (Blueprint $table) { - $table->dropColumn('km'); + $table->dropColumn('end_km'); }); } }; From 08db103f26ef11059c7b538c87b9d71ce38e95b7 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Mon, 18 May 2026 08:55:12 +0000 Subject: [PATCH 10/11] add station id to create user --- .../dashboard_pages/user_management/list.js | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/public/version2/js/dashboard_pages/user_management/list.js b/public/version2/js/dashboard_pages/user_management/list.js index 0e3abf43..7428edc6 100644 --- a/public/version2/js/dashboard_pages/user_management/list.js +++ b/public/version2/js/dashboard_pages/user_management/list.js @@ -61,9 +61,6 @@ function errorHandler(error) { break; default: - console.error("Error trace object"); - console.log("Error object:"); - console.log(error); Swal.fire({ icon: "error", title: "خطا", @@ -433,7 +430,7 @@ function getTollhouseByCity(city_id, dom_id, selected_id = 0) {$.ajax({ for (let index = 0; index < cities.length; index++) { $(`#${dom_id}`).append( - `` + `` ); } @@ -960,7 +957,6 @@ $(document).on('click', '#report_btn', function () { var tr = $(this).closest("tr"); var row = table.row(tr); $("#report_modal").modal('show'); - console.log(row.data().id); $("#selected_user_for_report").val(row.data().id); }) @@ -1040,7 +1036,6 @@ $(document).on('click', '#activity_report', function () { showLoaderScreen() }, success: function (result) { - console.log(result); $("#activity_time").text(result.activity_time); $("#average_activity_time").text(result.average_activity_time); @@ -1079,9 +1074,6 @@ $(document).on('click', '.permission-control', function () { modal.find('.permission-label').removeClass('text-muted') modal.find('.all-permission-by-type').prop('checked', false) modal.find('#user_id').val(row.data().id) - - console.log(row.data().province_id); - console.log(row.data().edarate_shahri_id); modal.find('.permission-input').each((index, element) => { if ($(element).data('needProvince') == 1) { if (row.data().province_id == null) { @@ -1662,7 +1654,6 @@ $("table").on("click", "tbody tr", function () { $('#user_data_table').on('change', ".user-finder-all", function () { - console.log(checkedItemsId); var thiz = $(this); if (thiz.is(':checked')) { @@ -1679,7 +1670,6 @@ $('#user_data_table').on('change', ".user-finder-all", function () { }); $('#user_data_table').on('change', ".user-finder", function () { - console.log(checkedItemsId); const checkedItemId = $(this).data("idUser"); @@ -2141,7 +2131,6 @@ $("#edit_province_office").change(function () { $("#edit_city_office").change(function () { - console.log("this is ok"); setUserName("edit"); }) @@ -2424,20 +2413,15 @@ $("#add_province_office").change(function () { }) $("#add_simple_city").change(function () { - console.log("add_simple_city change happend"); - - console.log("valuee:", $(this).val()); if ($("#add_simple_city").val() == -1) { - console.log("value of city is or -1"); disableDOM("add_simple_tollhouse") $("#add_simple_tollhouse").empty(); } else { - console.log("tolls should send reqest"); enableDOM("add_simple_tollhouse") - getTollhouseByCity($("#add_simple_province").val(), "add_simple_tollhouse") + getTollhouseByCity($("#add_simple_city").val(), "add_simple_tollhouse") } }) @@ -2673,8 +2657,10 @@ $("#add_simple_province_office").change(function () { disableDOM("add_simple_city") disableDOM("add_simple_city_office") + disableDOM("add_simple_tollhouse") $("#add_simple_city").empty(); $("#add_simple_city_office").empty(); + $("#add_simple_tollhouse").empty(); } else { if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) { @@ -2708,6 +2694,7 @@ $("#add_simple_submit_form").on("click", function () { var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val(); var national_code = $("#add_simple_national_code").val(); var city_id = $("#add_simple_city").children("option:selected").val(); + var tollhouse_id = $("#add_simple_tollhouse").children("option:selected").val(); if (edarate_ostani_id <= 0 && edarate_shahri_id <= 0) { @@ -2746,6 +2733,12 @@ $("#add_simple_submit_form").on("click", function () { } else { $("#add_simple_city").removeClass("validity-checker"); } + if (tollhouse_id == 0) { + $("#add_simple_tollhouse").addClass("validity-checker"); + form_validation_status = false; + } else { + $("#add_simple_tollhouse").removeClass("validity-checker"); + } if (province_id < 0) { $("#add_simple_province").addClass("validity-checker"); @@ -2785,6 +2778,10 @@ $("#add_simple_submit_form").on("click", function () { formData.append("city_id", city_id); } + if (tollhouse_id != undefined) { + formData.append("station_id", tollhouse_id); + } + formData.append("password_confirmation", repass); if (edarate_ostani_id != 0) { formData.append("edarate_ostani_id", edarate_ostani_id); From 9f394abc3ebb5ed4c75a4728ce5ecb3ac0800f72 Mon Sep 17 00:00:00 2001 From: faezehzafarbakhsh Date: Sat, 23 May 2026 10:10:52 +0330 Subject: [PATCH 11/11] change name for date az to_date in date_to --- app/Services/Cartables/Mission/Report/ReportTradodService.php | 4 ++-- .../Cartables/Mission/Report/ReportViolationService.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Services/Cartables/Mission/Report/ReportTradodService.php b/app/Services/Cartables/Mission/Report/ReportTradodService.php index 341f0430..c710cd6b 100644 --- a/app/Services/Cartables/Mission/Report/ReportTradodService.php +++ b/app/Services/Cartables/Mission/Report/ReportTradodService.php @@ -27,7 +27,7 @@ class ReportTradodService public function countryActivity(Request $request): array { $from = $request->from_date ?? today()->startOfDay(); - $to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay(); + $to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay(); $sql = " SELECT* @@ -88,7 +88,7 @@ class ReportTradodService { $provinceId = $request->province_id ?? auth()->user()->province_id; $from = $request->from_date ?? today()->startOfDay(); - $to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay(); + $to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay(); $sql = " SELECT* diff --git a/app/Services/Cartables/Mission/Report/ReportViolationService.php b/app/Services/Cartables/Mission/Report/ReportViolationService.php index 45ec40a1..1034ff4f 100644 --- a/app/Services/Cartables/Mission/Report/ReportViolationService.php +++ b/app/Services/Cartables/Mission/Report/ReportViolationService.php @@ -27,7 +27,7 @@ class ReportViolationService public function countryActivity(Request $request): array { $from = $request->from_date ?? today()->startOfDay(); - $to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay(); + $to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay(); $sql = " SELECT* @@ -81,7 +81,7 @@ class ReportViolationService { $provinceId = $request->province_id ?? auth()->user()->province_id; $from = $request->from_date ?? today()->startOfDay(); - $to = $request->to_date ? Carbon::parse($request->to_date)->endOfDay() : today()->endOfDay(); + $to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay(); $sql = " SELECT*