Compare commits
23 Commits
feature/Ne
...
feature/Ma
| Author | SHA1 | Date | |
|---|---|---|---|
| a0ee7cccd3 | |||
| 25e2883e9c | |||
| 23dd62550d | |||
| e3b49ebbb3 | |||
| 7d7507411d | |||
| e0edcf6db2 | |||
| 893edea5a9 | |||
| 57d59b79b4 | |||
| 9f394abc3e | |||
|
|
08db103f26 | ||
| a5cf79cd1b | |||
| ad70874bde | |||
|
|
6a1513a72f | ||
| f798d05a3c | |||
| 96960f5e8f | |||
| 3ca710228f | |||
| a1bca2d80f | |||
| 048219f92e | |||
| d833f4dc0d | |||
| a7fce4ca94 | |||
| 5f19a26f67 | |||
| 4c6f6d66f4 | |||
| dff218541c |
72
Dockerfile
72
Dockerfile
@@ -1,58 +1,32 @@
|
|||||||
FROM alpine:3.18
|
FROM dunglas/frankenphp:1.11.1-php8.2
|
||||||
|
|
||||||
RUN apk update && apk add --no-cache\
|
RUN apt-get update \
|
||||||
bash \
|
&& apt-get install -y --no-install-recommends default-mysql-client \
|
||||||
wget \
|
|
||||||
curl \
|
|
||||||
nano \
|
|
||||||
unzip \
|
unzip \
|
||||||
libzip-dev \
|
zip \
|
||||||
libxml2 \
|
&& install-php-extensions pdo_mysql \
|
||||||
libxml2-dev \
|
&& install-php-extensions zip \
|
||||||
git \
|
&& install-php-extensions gd \
|
||||||
zlib-dev \
|
&& install-php-extensions pcntl \
|
||||||
libpng-dev \
|
&& apt-get clean \
|
||||||
php81 \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
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
|
|
||||||
|
|
||||||
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
|
# Install Composer
|
||||||
|
COPY --from=docker.arvancloud.ir/composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
WORKDIR /var/www/app
|
|
||||||
|
|
||||||
|
# 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;\
|
CMD composer install;\
|
||||||
php artisan key:generate;\
|
php artisan key:generate;\
|
||||||
# php artisan migrate ;\
|
php artisan migrate;\
|
||||||
# php artisan db:seed;\
|
php artisan db:seed;\
|
||||||
# php artisan storege:link;\
|
cd public;\
|
||||||
php artisan serve --host=0.0.0.0
|
frankenphp php-server
|
||||||
@@ -46,7 +46,7 @@ class SendContractSmsNotification extends Command
|
|||||||
foreach ($contractSubItems as $key => $value) {
|
foreach ($contractSubItems as $key => $value) {
|
||||||
$message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir";
|
$message = "سلام،\n پروژه راهداری با کد یکتای {$value->unique_code} با مسئولیت شما، به مدت بیشتر از یک ماه به روزرسانی نشده است. لطفا نسبت به روز رسانی دقیق پیشرفت پروژه در سامانه اقدام نمایید.\n rms.rmto.ir";
|
||||||
|
|
||||||
self::sms_sender($value->operator_phone, $message);
|
// self::sms_sender($value->operator_phone, $message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,11 +15,11 @@ enum MissionStates: int
|
|||||||
public static function name(int $state): string
|
public static function name(int $state): string
|
||||||
{
|
{
|
||||||
$mapArray = [
|
$mapArray = [
|
||||||
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد نقلیه است',
|
1 => 'درخواست ایجاد شد و در حال بررسی توسط واحد تایید کننده است',
|
||||||
2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
|
2 => 'خودرو اختصاص داده شد و درخواست توسط واحد کنترل در حال بررسی است',
|
||||||
3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
|
3 => 'درخواست توسط واحد کنترل تایید شد و ماموریت آغاز می شود',
|
||||||
4 => 'اتمام ماموریت',
|
4 => 'اتمام ماموریت',
|
||||||
5 => 'عدم تخصیص خودرو توسط واحد نقلیه و بازگشت درخواست به کارتابل کاربر',
|
5 => 'عدم تخصیص خودرو توسط واحد تایید کننده و بازگشت درخواست به کارتابل کاربر',
|
||||||
6 => 'ماموریت لغو شد',
|
6 => 'ماموریت لغو شد',
|
||||||
7 => 'ماموریت بدون فرایند ثبت شد'
|
7 => 'ماموریت بدون فرایند ثبت شد'
|
||||||
];
|
];
|
||||||
|
|||||||
73
app/Exports/V3/Mission/Report/Machine/machineReport.php
Normal file
73
app/Exports/V3/Mission/Report/Machine/machineReport.php
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\Mission\Report\Machine;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Maatwebsite\Excel\Concerns\FromView;
|
||||||
|
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||||
|
use Maatwebsite\Excel\Concerns\WithEvents;
|
||||||
|
use Maatwebsite\Excel\Events\AfterSheet;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Exception;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||||
|
|
||||||
|
class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
|
||||||
|
{
|
||||||
|
public function __construct(private array $data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{ $exportRows = [];
|
||||||
|
|
||||||
|
foreach ($this->data as $r) {
|
||||||
|
$exportRows[] = [
|
||||||
|
'city_name' => $r->c_name ?? '',
|
||||||
|
'province_name' => $r->p_name ?? '',
|
||||||
|
'missions' => $r->missions ?? 0,
|
||||||
|
'distance' => (int) ($r->distance ?? 0),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.Mission.Report.Machine.ActivityReport', [
|
||||||
|
'rows' => $exportRows,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public function drawings(): array
|
||||||
|
{
|
||||||
|
$drawing = new Drawing();
|
||||||
|
$drawing->setName('Logo');
|
||||||
|
$drawing->setDescription('This is my logo');
|
||||||
|
$drawing->setPath(public_path('/dist/logo.png'));
|
||||||
|
$drawing->setWidth(50);
|
||||||
|
$drawing->setHeight(50);
|
||||||
|
$drawing->setOffsetX(5);
|
||||||
|
$drawing->setOffsetY(5);
|
||||||
|
$drawing->setCoordinates('A1');
|
||||||
|
|
||||||
|
$drawing2 = new Drawing();
|
||||||
|
$drawing2->setName('Logo');
|
||||||
|
$drawing2->setDescription('This is my logo');
|
||||||
|
$drawing2->setPath(public_path('/dist/141icon.png'));
|
||||||
|
$drawing2->setWidth(50);
|
||||||
|
$drawing2->setHeight(50);
|
||||||
|
$drawing2->setOffsetX(5);
|
||||||
|
$drawing2->setOffsetY(5);
|
||||||
|
$drawing2->setCoordinates('D1');
|
||||||
|
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -29,9 +29,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
|||||||
$national = [
|
$national = [
|
||||||
'province_name' => $name,
|
'province_name' => $name,
|
||||||
'total' => (int) ($r->total ?? 0),
|
'total' => (int) ($r->total ?? 0),
|
||||||
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
|
||||||
'gps' => (int) ($r->gps ?? 0),
|
'gps' => (int) ($r->gps ?? 0),
|
||||||
'durations' => (int) ($r->durations ?? 0),
|
'durations' => (int) ($r->durations ?? 0),
|
||||||
|
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
||||||
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
||||||
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
||||||
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
||||||
@@ -50,9 +50,9 @@ class CountryReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
|
|||||||
}
|
}
|
||||||
|
|
||||||
$grid[$pid]['total'] = (int) ($r->total ?? 0);
|
$grid[$pid]['total'] = (int) ($r->total ?? 0);
|
||||||
$grid[$pid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
|
||||||
$grid[$pid]['gps'] = (int) ($r->gps ?? 0);
|
$grid[$pid]['gps'] = (int) ($r->gps ?? 0);
|
||||||
$grid[$pid]['durations'] = (int) ($r->durations ?? 0);
|
$grid[$pid]['durations'] = (int) ($r->durations ?? 0);
|
||||||
|
$grid[$pid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
||||||
$grid[$pid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
$grid[$pid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
||||||
$grid[$pid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
|
$grid[$pid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
|
||||||
$grid[$pid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
|
$grid[$pid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
|
||||||
|
|||||||
@@ -30,9 +30,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
|
|||||||
$province = [
|
$province = [
|
||||||
'city_name' => $name,
|
'city_name' => $name,
|
||||||
'total' => (int) ($r->total ?? 0),
|
'total' => (int) ($r->total ?? 0),
|
||||||
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
|
||||||
'gps' => (int) ($r->gps ?? 0),
|
'gps' => (int) ($r->gps ?? 0),
|
||||||
'durations' => (int) ($r->durations ?? 0),
|
'durations' => (int) ($r->durations ?? 0),
|
||||||
|
'khareg_mahdode' => (int) ($r->khareg_mahdode ?? 0),
|
||||||
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
'bafarayand_saeti' => (int) ($r->far_h ?? 0),
|
||||||
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
'bafarayand_rozaneh' => (int) ($r->far_d ?? 0),
|
||||||
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
'bedon_bafarayand_saeti' => (int) ($r->un_far_h ?? 0),
|
||||||
@@ -51,9 +51,9 @@ class ProvinceReport implements FromView, ShouldAutoSize, WithDrawings, WithEven
|
|||||||
}
|
}
|
||||||
|
|
||||||
$grid[$cid]['total'] = (int) ($r->total ?? 0);
|
$grid[$cid]['total'] = (int) ($r->total ?? 0);
|
||||||
$grid[$cid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
|
||||||
$grid[$cid]['gps'] = (int) ($r->gps ?? 0);
|
$grid[$cid]['gps'] = (int) ($r->gps ?? 0);
|
||||||
$grid[$cid]['durations'] = (int) ($r->durations ?? 0);
|
$grid[$cid]['durations'] = (int) ($r->durations ?? 0);
|
||||||
|
$grid[$cid]['khareg_mahdode'] = ($r->khareg_mahdode ?? 0);
|
||||||
$grid[$cid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
$grid[$cid]['bafarayand_saeti'] = (int) ($r->far_h ?? 0);
|
||||||
$grid[$cid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
|
$grid[$cid]['bafarayand_rozaneh'] = (int) ($r->far_d ?? 0);
|
||||||
$grid[$cid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
|
$grid[$cid]['bedon_bafarayand_saeti'] = (int) ($r->un_far_h ?? 0);
|
||||||
|
|||||||
@@ -12,28 +12,28 @@ class SmsClass
|
|||||||
{
|
{
|
||||||
public function sendSms($mobile, $msg)
|
public function sendSms($mobile, $msg)
|
||||||
{
|
{
|
||||||
if (App::environment('production')) {
|
// if (App::environment('production')) {
|
||||||
|
//
|
||||||
|
//
|
||||||
$client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
|
// $client = new SoapClient("http://172.30.5.36/webservice/sms.asmx?WSDL");
|
||||||
$date = date('d-m-y h:i:s');
|
// $date = date('d-m-y h:i:s');
|
||||||
$date = str_replace(" ", "T", $date);
|
// $date = str_replace(" ", "T", $date);
|
||||||
$result = $client->Send(
|
// $result = $client->Send(
|
||||||
array(
|
// array(
|
||||||
'Username' => 'admin',
|
// 'Username' => 'admin',
|
||||||
'Password' => 'admin141',
|
// 'Password' => 'admin141',
|
||||||
'ShortCode' => '1000141',
|
// 'ShortCode' => '1000141',
|
||||||
'Cellphones' => $mobile,
|
// 'Cellphones' => $mobile,
|
||||||
'Message' => $msg,
|
// 'Message' => $msg,
|
||||||
'Farsi' => true,
|
// 'Farsi' => true,
|
||||||
// 'SendDate' => $date
|
// // 'SendDate' => $date
|
||||||
// 'uTopic' => false,
|
// // 'uTopic' => false,
|
||||||
// 'uFlash' => false
|
// // 'uFlash' => false
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
|
//
|
||||||
return $result->SendResult;
|
// return $result->SendResult;
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
// $client = new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
||||||
|
|||||||
@@ -609,25 +609,25 @@ class ContractSubItemsController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function sms_sender($mobile, $msg)
|
// public function sms_sender($mobile, $msg)
|
||||||
{
|
// {
|
||||||
$client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
// $client=new SoapClient("http://sms1000.ir/webservice/smspro.asmx?WSDL");
|
||||||
$result=$client->doSendSMS(
|
// $result=$client->doSendSMS(
|
||||||
array(
|
// array(
|
||||||
'uUsername' => 'rmto',
|
// 'uUsername' => 'rmto',
|
||||||
'uPassword' => 'Rahdari8
|
// 'uPassword' => 'Rahdari8
|
||||||
',
|
// ',
|
||||||
'uNumber' => '1000141',
|
// 'uNumber' => '1000141',
|
||||||
'uCellphones' => $mobile,
|
// 'uCellphones' => $mobile,
|
||||||
'uMessage' => $msg,
|
// 'uMessage' => $msg,
|
||||||
'uFarsi' => true,
|
// 'uFarsi' => true,
|
||||||
'uTopic' => false,
|
// 'uTopic' => false,
|
||||||
'uFlash' => false
|
// 'uFlash' => false
|
||||||
)
|
// )
|
||||||
);
|
// );
|
||||||
$x = $result->doSendSMSResult;
|
// $x = $result->doSendSMSResult;
|
||||||
return $x;
|
// return $x;
|
||||||
}
|
// }
|
||||||
|
|
||||||
public function get_way_id_from_nominatim($lat, $lng)
|
public function get_way_id_from_nominatim($lat, $lng)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -434,6 +434,7 @@ class UserController extends Controller
|
|||||||
|
|
||||||
$user->password = Hash::make($request->password);
|
$user->password = Hash::make($request->password);
|
||||||
$user->national_code = $request->national_code;
|
$user->national_code = $request->national_code;
|
||||||
|
$user->station_id = $request->station_id;
|
||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
if (auth()->user()) {
|
if (auth()->user()) {
|
||||||
|
|||||||
@@ -70,19 +70,20 @@ class ControlUnitController extends Controller
|
|||||||
'state_name' => MissionStates::name($state),
|
'state_name' => MissionStates::name($state),
|
||||||
'finish_time' => $request->time,
|
'finish_time' => $request->time,
|
||||||
'mission_duration' => strtotime($request->time) - strtotime($mission->start_time),
|
'mission_duration' => strtotime($request->time) - strtotime($mission->start_time),
|
||||||
|
'end_km' => $request->end_km,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$getErrorRateService->setInputParameters($mission);
|
// $getErrorRateService->setInputParameters($mission);
|
||||||
$responseData = $getErrorRateService->run();
|
// $responseData = $getErrorRateService->run();
|
||||||
|
//
|
||||||
$mission->update([
|
// $mission->update([
|
||||||
'in_area_duration' => $responseData['timeInAreaSeconds'],
|
// 'in_area_duration' => $responseData['timeInAreaSeconds'],
|
||||||
'first_enter' => $responseData['firstEnter'],
|
// 'first_enter' => $responseData['firstEnter'],
|
||||||
'last_exit' => $responseData['lastExit'],
|
// 'last_exit' => $responseData['lastExit'],
|
||||||
'point_number_sent' => $responseData['noOfPointsInMission'],
|
// 'point_number_sent' => $responseData['noOfPointsInMission'],
|
||||||
'fms_result_code' => $responseData['resultCode'],
|
// 'fms_result_code' => $responseData['resultCode'],
|
||||||
'fms_result_message' => FMSResultCode::name($responseData['resultCode']),
|
// 'fms_result_message' => FMSResultCode::name($responseData['resultCode']),
|
||||||
]);
|
// ]);
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($mission->category_id == 2) {
|
if ($mission->category_id == 2) {
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers\V3\Dashboard\Mission\Report;
|
||||||
|
|
||||||
|
use App\Exports\V3\Mission\Report\Machine\machineReport;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Traits\ApiResponse;
|
||||||
|
use App\Models\Province;
|
||||||
|
use App\Services\Cartables\Mission\Report\ReportMachineService;
|
||||||
|
use Illuminate\Http\JsonResponse;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Maatwebsite\Excel\Facades\Excel;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Exception;
|
||||||
|
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
||||||
|
|
||||||
|
class ReportMachineController extends Controller
|
||||||
|
{
|
||||||
|
use ApiResponse;
|
||||||
|
|
||||||
|
public function activity(Request $request, ReportMachineService $reportMachineService): JsonResponse
|
||||||
|
{
|
||||||
|
return $this->successResponse([
|
||||||
|
'activities' => $reportMachineService->activity($request),
|
||||||
|
'provinces' => Province::all(['id', 'name_fa']),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws Exception
|
||||||
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
|
*/
|
||||||
|
public function excelActivity(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
|
||||||
|
{
|
||||||
|
$data = $reportMachineService->activity($request);
|
||||||
|
$name = 'گزارش کل تردد یک ماشین '.verta()->now()->format('Y-m-d H-i').'.xlsx';
|
||||||
|
|
||||||
|
return Excel::download(new machineReport($data), $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -38,6 +38,15 @@ class RoadMaintenanceStationController extends Controller
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function findByCity(Request $request): JsonResponse
|
||||||
|
{
|
||||||
|
$stations = RahdariPoint::query()
|
||||||
|
->where('city_id', $request->query('city_id'))
|
||||||
|
->get();
|
||||||
|
|
||||||
|
return $this->successResponse($stations);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Store a newly created resource in storage.
|
* Store a newly created resource in storage.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Http\Requests\V3\Mission\ControlUnit;
|
|||||||
use App\Enums\MissionStates;
|
use App\Enums\MissionStates;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
class FinishRequest extends FormRequest
|
class FinishRequest extends FormRequest
|
||||||
{
|
{
|
||||||
@@ -25,6 +26,28 @@ class FinishRequest extends FormRequest
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'time' => 'required|date',
|
'time' => 'required|date',
|
||||||
|
'end_km' => 'required',
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function after(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
function (Validator $validator) {
|
||||||
|
$mission = $this->mission;
|
||||||
|
if (strtotime($this->time) < strtotime($mission->start_time)) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'time',
|
||||||
|
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if ($this->end_km < $mission->km) {
|
||||||
|
$validator->errors()->add(
|
||||||
|
'end_km',
|
||||||
|
'کیلومتر پایان باید بزرگتر از کیلومتر شروع باشد.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Cartables\Mission\Report;
|
||||||
|
|
||||||
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
|
use App\Models\MissionViolation;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
class ReportMachineService
|
||||||
|
{
|
||||||
|
public function activity(Request $request): array
|
||||||
|
{
|
||||||
|
$code = $request->machine_code;
|
||||||
|
$from = $request->from_date ?? today()->startOfDay();
|
||||||
|
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
|
||||||
|
|
||||||
|
$sql = "
|
||||||
|
SELECT*
|
||||||
|
m.city_name AS c.name,
|
||||||
|
m.city_id AS c_id,
|
||||||
|
m.province_name AS p_name,
|
||||||
|
m.province_id AS p_id,
|
||||||
|
COUNT(m.id) As missions,
|
||||||
|
(SUM(m.end_km)-SUM(m.km)) AS distance
|
||||||
|
|
||||||
|
FROM missions m
|
||||||
|
WHERE m.machine_code = :machineCode
|
||||||
|
AND m.created_at >= :from
|
||||||
|
AND m.created_at <= :to;
|
||||||
|
";
|
||||||
|
|
||||||
|
return DB::select($sql, [
|
||||||
|
'from' => $from,
|
||||||
|
'to' => $to,
|
||||||
|
'machineCode' => $code,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ class ReportTradodService
|
|||||||
public function countryActivity(Request $request): array
|
public function countryActivity(Request $request): array
|
||||||
{
|
{
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$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 = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -37,8 +37,8 @@ class ReportTradodService
|
|||||||
-1 AS province_id,
|
-1 AS province_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
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.in_area_duration)/3600, 0) AS gps,
|
||||||
COALESCE(SUM(m.mission_duration), 0) AS durations,
|
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 = 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 = 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,
|
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,
|
p.id AS province_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
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.in_area_duration)/3600, 0) AS gps,
|
||||||
COALESCE(SUM(m.mission_duration), 0) AS durations,
|
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 = 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 = 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,
|
COALESCE(SUM(CASE WHEN m.type = 3 THEN 1 ELSE 0 END), 0) AS un_far_h,
|
||||||
@@ -88,7 +88,7 @@ class ReportTradodService
|
|||||||
{
|
{
|
||||||
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$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 = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -98,8 +98,8 @@ class ReportTradodService
|
|||||||
-1 AS city_id,
|
-1 AS city_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
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.in_area_duration)/3600, 0) AS gps,
|
||||||
COALESCE(SUM(m.mission_duration), 0) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
|
||||||
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
||||||
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
||||||
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
||||||
@@ -118,8 +118,8 @@ class ReportTradodService
|
|||||||
c.id AS city_id,
|
c.id AS city_id,
|
||||||
COUNT(m.id) AS total,
|
COUNT(m.id) AS total,
|
||||||
COALESCE(SUM(m.mission_duration != m.in_area_duration), 0) AS khareg_mahdode,
|
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.in_area_duration)/3600, 0) AS gps,
|
||||||
COALESCE(SUM(m.mission_duration), 0) AS durations,
|
COALESCE(SUM(m.mission_duration)/3600, 0) AS durations,
|
||||||
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
COALESCE(SUM(m.type = 1), 0) AS far_h,
|
||||||
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
COALESCE(SUM(m.type = 2), 0) AS far_d,
|
||||||
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
COALESCE(SUM(m.type = 3), 0) AS un_far_h,
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class ReportViolationService
|
|||||||
public function countryActivity(Request $request): array
|
public function countryActivity(Request $request): array
|
||||||
{
|
{
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$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 = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
@@ -81,7 +81,7 @@ class ReportViolationService
|
|||||||
{
|
{
|
||||||
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
$provinceId = $request->province_id ?? auth()->user()->province_id;
|
||||||
$from = $request->from_date ?? today()->startOfDay();
|
$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 = "
|
$sql = "
|
||||||
SELECT*
|
SELECT*
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class PaymentService
|
|||||||
);
|
);
|
||||||
|
|
||||||
$ch = curl_init();
|
$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_RETURNTRANSFER, true);
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
||||||
@@ -59,7 +59,7 @@ class PaymentService
|
|||||||
);
|
);
|
||||||
|
|
||||||
$ch = curl_init();
|
$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_RETURNTRANSFER, true);
|
||||||
// curl_setopt($ch, CURLOPT_POST, true);
|
// curl_setopt($ch, CURLOPT_POST, true);
|
||||||
// curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
// curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->string('end_km')->nullable();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('missions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('end_km');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
33
docker-compose.yml
Normal file
33
docker-compose.yml
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
services:
|
||||||
|
mariadb:
|
||||||
|
image: mariadb:10.11.8
|
||||||
|
container_name: rms-mariadb
|
||||||
|
ports:
|
||||||
|
- "3307:3306"
|
||||||
|
environment:
|
||||||
|
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:
|
||||||
|
- 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
|
||||||
@@ -61,9 +61,6 @@ function errorHandler(error) {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
console.error("Error trace object");
|
|
||||||
console.log("Error object:");
|
|
||||||
console.log(error);
|
|
||||||
Swal.fire({
|
Swal.fire({
|
||||||
icon: "error",
|
icon: "error",
|
||||||
title: "خطا",
|
title: "خطا",
|
||||||
@@ -417,6 +414,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('<option value="0"></option>');
|
||||||
|
cities = result.data;
|
||||||
|
|
||||||
|
for (let index = 0; index < cities.length; index++) {
|
||||||
|
|
||||||
|
$(`#${dom_id}`).append(
|
||||||
|
`<option value=${cities[index].id}>${cities[index].name}</option>`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
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) {
|
function getCityOfficeByCity(city_id, dom_id, selected_id = 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: "/public/contents/edarateShahri/" + city_id,
|
url: "/public/contents/edarateShahri/" + city_id,
|
||||||
@@ -923,7 +957,6 @@ $(document).on('click', '#report_btn', function () {
|
|||||||
var tr = $(this).closest("tr");
|
var tr = $(this).closest("tr");
|
||||||
var row = table.row(tr);
|
var row = table.row(tr);
|
||||||
$("#report_modal").modal('show');
|
$("#report_modal").modal('show');
|
||||||
console.log(row.data().id);
|
|
||||||
$("#selected_user_for_report").val(row.data().id);
|
$("#selected_user_for_report").val(row.data().id);
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -1003,7 +1036,6 @@ $(document).on('click', '#activity_report', function () {
|
|||||||
showLoaderScreen()
|
showLoaderScreen()
|
||||||
},
|
},
|
||||||
success: function (result) {
|
success: function (result) {
|
||||||
console.log(result);
|
|
||||||
|
|
||||||
$("#activity_time").text(result.activity_time);
|
$("#activity_time").text(result.activity_time);
|
||||||
$("#average_activity_time").text(result.average_activity_time);
|
$("#average_activity_time").text(result.average_activity_time);
|
||||||
@@ -1042,9 +1074,6 @@ $(document).on('click', '.permission-control', function () {
|
|||||||
modal.find('.permission-label').removeClass('text-muted')
|
modal.find('.permission-label').removeClass('text-muted')
|
||||||
modal.find('.all-permission-by-type').prop('checked', false)
|
modal.find('.all-permission-by-type').prop('checked', false)
|
||||||
modal.find('#user_id').val(row.data().id)
|
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) => {
|
modal.find('.permission-input').each((index, element) => {
|
||||||
if ($(element).data('needProvince') == 1) {
|
if ($(element).data('needProvince') == 1) {
|
||||||
if (row.data().province_id == null) {
|
if (row.data().province_id == null) {
|
||||||
@@ -1625,7 +1654,6 @@ $("table").on("click", "tbody tr", function () {
|
|||||||
|
|
||||||
|
|
||||||
$('#user_data_table').on('change', ".user-finder-all", function () {
|
$('#user_data_table').on('change', ".user-finder-all", function () {
|
||||||
console.log(checkedItemsId);
|
|
||||||
|
|
||||||
var thiz = $(this);
|
var thiz = $(this);
|
||||||
if (thiz.is(':checked')) {
|
if (thiz.is(':checked')) {
|
||||||
@@ -1642,7 +1670,6 @@ $('#user_data_table').on('change', ".user-finder-all", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#user_data_table').on('change', ".user-finder", function () {
|
$('#user_data_table').on('change', ".user-finder", function () {
|
||||||
console.log(checkedItemsId);
|
|
||||||
|
|
||||||
const checkedItemId = $(this).data("idUser");
|
const checkedItemId = $(this).data("idUser");
|
||||||
|
|
||||||
@@ -2104,7 +2131,6 @@ $("#edit_province_office").change(function () {
|
|||||||
|
|
||||||
|
|
||||||
$("#edit_city_office").change(function () {
|
$("#edit_city_office").change(function () {
|
||||||
console.log("this is ok");
|
|
||||||
setUserName("edit");
|
setUserName("edit");
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -2386,6 +2412,19 @@ $("#add_province_office").change(function () {
|
|||||||
setUserName();
|
setUserName();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#add_simple_city").change(function () {
|
||||||
|
|
||||||
|
if ($("#add_simple_city").val() == -1) {
|
||||||
|
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
enableDOM("add_simple_tollhouse")
|
||||||
|
getTollhouseByCity($("#add_simple_city").val(), "add_simple_tollhouse")
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
// $("#edit_city").change(function () {
|
// $("#edit_city").change(function () {
|
||||||
|
|
||||||
// if ($(this).val() == 0) {
|
// if ($(this).val() == 0) {
|
||||||
@@ -2396,15 +2435,6 @@ $("#add_province_office").change(function () {
|
|||||||
// setUserName("edit");
|
// 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 () {
|
// $("#add_city").change(function () {
|
||||||
|
|
||||||
@@ -2581,6 +2611,9 @@ $('#add_simple_user_show_modal').on('click', function () {
|
|||||||
enableDOM("add_simple_city")
|
enableDOM("add_simple_city")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city").append('<option value="0" selected disabled>ابتدا استان را انتخاب کنید</option>');
|
$("#add_simple_city").append('<option value="0" selected disabled>ابتدا استان را انتخاب کنید</option>');
|
||||||
|
enableDOM("add_simple_tollhouse")
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
$("#add_simple_tollhouse").append('<option value="0" selected disabled>ابتدا شهر را انتخاب کنید</option>');
|
||||||
enableDOM("add_simple_city_office")
|
enableDOM("add_simple_city_office")
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
$("#add_simple_city_office").append('<option value="0" selected disabled></option>');
|
$("#add_simple_city_office").append('<option value="0" selected disabled></option>');
|
||||||
@@ -2594,8 +2627,10 @@ $("#add_simple_province").change(function () {
|
|||||||
|
|
||||||
disableDOM("add_simple_city")
|
disableDOM("add_simple_city")
|
||||||
disableDOM("add_simple_city_office")
|
disableDOM("add_simple_city_office")
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($("#add_simple_province_office").val() == 0) {
|
if ($("#add_simple_province_office").val() == 0) {
|
||||||
@@ -2622,8 +2657,10 @@ $("#add_simple_province_office").change(function () {
|
|||||||
|
|
||||||
disableDOM("add_simple_city")
|
disableDOM("add_simple_city")
|
||||||
disableDOM("add_simple_city_office")
|
disableDOM("add_simple_city_office")
|
||||||
|
disableDOM("add_simple_tollhouse")
|
||||||
$("#add_simple_city").empty();
|
$("#add_simple_city").empty();
|
||||||
$("#add_simple_city_office").empty();
|
$("#add_simple_city_office").empty();
|
||||||
|
$("#add_simple_tollhouse").empty();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
|
if ($("#add_simple_province").val() == 0 || $("#add_simple_province").val() == -1) {
|
||||||
@@ -2657,6 +2694,7 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
|
var edarate_shahri_id = $("#add_simple_city_office").children("option:selected").val();
|
||||||
var national_code = $("#add_simple_national_code").val();
|
var national_code = $("#add_simple_national_code").val();
|
||||||
var city_id = $("#add_simple_city").children("option:selected").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) {
|
if (edarate_ostani_id <= 0 && edarate_shahri_id <= 0) {
|
||||||
@@ -2695,6 +2733,12 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
} else {
|
} else {
|
||||||
$("#add_simple_city").removeClass("validity-checker");
|
$("#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) {
|
if (province_id < 0) {
|
||||||
$("#add_simple_province").addClass("validity-checker");
|
$("#add_simple_province").addClass("validity-checker");
|
||||||
@@ -2734,6 +2778,10 @@ $("#add_simple_submit_form").on("click", function () {
|
|||||||
formData.append("city_id", city_id);
|
formData.append("city_id", city_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (tollhouse_id != undefined) {
|
||||||
|
formData.append("station_id", tollhouse_id);
|
||||||
|
}
|
||||||
|
|
||||||
formData.append("password_confirmation", repass);
|
formData.append("password_confirmation", repass);
|
||||||
if (edarate_ostani_id != 0) {
|
if (edarate_ostani_id != 0) {
|
||||||
formData.append("edarate_ostani_id", edarate_ostani_id);
|
formData.append("edarate_ostani_id", edarate_ostani_id);
|
||||||
|
|||||||
@@ -125,11 +125,13 @@
|
|||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format(
|
$(".letter-body").find("#accident_date").text(moment(jsonServer.data.accident_date).format(
|
||||||
"jYYYY/jMM/jDD"));
|
"jYYYY/jMM/jDD"));
|
||||||
const plaque = jsonServer.data.plaque.split("-");
|
const plaque = jsonServer?.data?.plaque?.split("-");
|
||||||
|
if (plaque) {
|
||||||
$("#plaque1").text(plaque[0]);
|
$("#plaque1").text(plaque[0]);
|
||||||
$("#plaque2").text(plaque[1]);
|
$("#plaque2").text(plaque[1]);
|
||||||
$("#plaque3").text(plaque[2]);
|
$("#plaque3").text(plaque[2]);
|
||||||
$("#plaque4").text(plaque[3]);
|
$("#plaque4").text(plaque[3]);
|
||||||
|
}
|
||||||
let row_counter;
|
let row_counter;
|
||||||
let i;
|
let i;
|
||||||
for (i = 0; i < damages.length; i++) {
|
for (i = 0; i < damages.length; i++) {
|
||||||
|
|||||||
@@ -0,0 +1,78 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>گزارش کل تردد های یک ماشین </title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
table,
|
||||||
|
th,
|
||||||
|
td {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body dir="rtl" style="text-align: center;">
|
||||||
|
@php
|
||||||
|
// show a dot if key missing or value is 0/empty
|
||||||
|
function cell($row, $key) {
|
||||||
|
return array_key_exists($key, $row) ? ($row[$key] ?: '0') : '0';
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right: 1px solid black;font-weight:bolder;">
|
||||||
|
تاریخ دریافت گزارش: {{ verta()->now()->format('Y/m/d H:i') }}
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th colspan="4"
|
||||||
|
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
||||||
|
گزارش ماشین های ماموریت رفته
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th rowspan="1"
|
||||||
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
|
استان
|
||||||
|
</th>
|
||||||
|
<th rowspan="1"
|
||||||
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
|
شهر
|
||||||
|
</th>
|
||||||
|
<th rowspan="1"
|
||||||
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
|
تعداد ماموریت </th>
|
||||||
|
<th rowspan="1"
|
||||||
|
style="text-align: center;border: 1px solid black;background-color: #EBF1DE;font-weight: bold;">
|
||||||
|
جمع کارکرد
|
||||||
|
</th>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
@foreach ($rows as $item)
|
||||||
|
<tr>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['distance'] ?? '-' }}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -93,9 +93,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['province_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
||||||
|
|||||||
@@ -93,9 +93,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['city_name'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['total'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['gps'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['durations'] ?? '-' }}</td>
|
||||||
|
<td style="border: 1px solid black;text-align: center;">{{ $item['khareg_mahdode'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_saeti'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bafarayand_rozaneh'] ?? '-' }}</td>
|
||||||
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
<td style="border: 1px solid black;text-align: center;">{{ $item['bedon_bafarayand_saeti'] ?? '-' }}</td>
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
<button id="add_patrol" class="positive-cta float-left my-2" disabled>ثبت گشت</button>
|
<button id="add_patrol" class="positive-cta float-left my-2" disabled>ثبت گشت</button>
|
||||||
<!-- all modals -->
|
<!-- all modals -->
|
||||||
<!-- otp token -->
|
<!-- otp token -->
|
||||||
<div class="modal fade" id="otpToken_modal" tabindex="-1" role="dialog">
|
{{-- <div class="modal fade" id="otpToken_modal" tabindex="-1" role="dialog">--}}
|
||||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header align-items-center">
|
<div class="modal-header align-items-center">
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{-- </div>--}}
|
||||||
<!-- end otp token -->
|
<!-- end otp token -->
|
||||||
<!-- user info -->
|
<!-- user info -->
|
||||||
<div class="modal fade" id="userInfo_modal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="userInfo_modal" tabindex="-1" role="dialog">
|
||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4 px-2 form-group">
|
<div class="col-12 col-md-4 px-2 form-group">
|
||||||
<label for="user_phone">شماره مامور:</label>
|
<label for="user_phone">شماره مامور:</label>
|
||||||
<input type="number" class="form-control clean-input value-important" readonly autocomplete="off" name="user-phone" id="user_phone">
|
<input type="number" class="form-control clean-input value-important" autocomplete="off" name="user-phone" id="user_phone">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12 col-md-4 px-2 form-group">
|
<div class="col-12 col-md-4 px-2 form-group">
|
||||||
<label for="plaque-number">شماره انتظامی وسیله نقلیه</label>
|
<label for="plaque-number">شماره انتظامی وسیله نقلیه</label>
|
||||||
|
|||||||
@@ -675,6 +675,11 @@
|
|||||||
id="add_simple_city_office">
|
id="add_simple_city_office">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group col-md-12">
|
||||||
|
<label>راهدارخانه</label>
|
||||||
|
<select class="form-control tollhouse" name="add_simple_tollhouse" id="add_simple_tollhouse">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label> نام کاربری</label>
|
<label> نام کاربری</label>
|
||||||
<span style="color: crimson">*</span>
|
<span style="color: crimson">*</span>
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ use App\Http\Controllers\V3\Dashboard\Harim\TechnicalDeputyController;
|
|||||||
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
|
use App\Http\Controllers\V3\Dashboard\ItemsManagementController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
|
use App\Http\Controllers\V3\Dashboard\Mission\ControlUnitController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
|
use App\Http\Controllers\V3\Dashboard\Mission\DetailController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportMachineController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportTradodController;
|
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportTradodController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportViolationController;
|
use App\Http\Controllers\V3\Dashboard\Mission\Report\ReportViolationController;
|
||||||
use App\Http\Controllers\V3\Dashboard\Mission\RequestPortalController;
|
use App\Http\Controllers\V3\Dashboard\Mission\RequestPortalController;
|
||||||
@@ -475,6 +476,7 @@ Route::prefix('road_maintenance_station')
|
|||||||
Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
Route::get('/', 'index')->name('index')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
||||||
Route::post('/', 'store')->name('store');
|
Route::post('/', 'store')->name('store');
|
||||||
Route::get('/map', 'map')->name('map');
|
Route::get('/map', 'map')->name('map');
|
||||||
|
Route::get('/search_by_city', 'findByCity')->name('findByCity');
|
||||||
Route::get('/images/{rahdariPoint}', 'images')->name('images');
|
Route::get('/images/{rahdariPoint}', 'images')->name('images');
|
||||||
Route::get('/{rahdariPoint}', 'show')->name('show')->middleware('permission:show-tollhouse|show-tollhouse-province');
|
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');
|
Route::post('/{rahdariPoint}', 'update')->name('update')->middleware('permission:edit-tollhouse|edit-tollhouse-province');
|
||||||
@@ -537,7 +539,7 @@ Route::prefix('missions')
|
|||||||
});
|
});
|
||||||
Route::prefix('report_violation')
|
Route::prefix('report_violation')
|
||||||
->name('reportsViolation.')
|
->name('reportsViolation.')
|
||||||
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
->controller(ReportViolationController::class)
|
->controller(ReportViolationController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
@@ -547,7 +549,7 @@ Route::prefix('missions')
|
|||||||
});
|
});
|
||||||
Route::prefix('report_taradod')
|
Route::prefix('report_taradod')
|
||||||
->name('reportsTaradod.')
|
->name('reportsTaradod.')
|
||||||
->middleware(['permission:mission-report-province', 'permission:mission-report-country'])
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
->controller(ReportTradodController::class)
|
->controller(ReportTradodController::class)
|
||||||
->group(function () {
|
->group(function () {
|
||||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
@@ -555,6 +557,14 @@ Route::prefix('missions')
|
|||||||
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||||
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||||
});
|
});
|
||||||
|
Route::prefix('report_machine')
|
||||||
|
->name('reportsMachine.')
|
||||||
|
->middleware(['permission:mission-report-province|mission-report-country'])
|
||||||
|
->controller(ReportMachineController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/activity', 'activity')->name('Activity');
|
||||||
|
Route::get('/excel_activity', 'excelActivity')->name('ProvinceActivity');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('harim')
|
Route::prefix('harim')
|
||||||
|
|||||||
Reference in New Issue
Block a user