16 Commits

Author SHA1 Message Date
1be9315b73 Merge pull request 'feature/MachineTypesDetails' (#24) from feature/MachineTypesDetails into develop
Reviewed-on: #24
2026-06-14 10:45:44 +00:00
amirghasempoor
39752fd5ba create excel for report in mission 2026-06-14 14:14:30 +03:30
amirghasempoor
ab9838c1bc create 2026-06-14 14:13:44 +03:30
92d806497d Merge pull request 'change command signature' (#23) from feature/PolyLineEncoderCommand into develop
Reviewed-on: #23
2026-06-14 09:49:40 +00:00
7ac07692a2 change command signature 2026-06-14 13:19:56 +03:30
ca51f65da4 Merge pull request 'fix route' (#22) from feature/MachineTypesDetails into develop
Reviewed-on: #22
2026-06-14 08:09:14 +00:00
0f65437bfa remove exit station 2026-06-14 11:21:30 +03:30
5edb061a24 Merge pull request 'remove exit station' (#21) from feature/PolyLineEncoderCommand into develop
Reviewed-on: #21
2026-06-14 07:51:27 +00:00
amirghasempoor
75c649c48e fix route 2026-06-14 11:19:11 +03:30
amirghasempoor
5a2a477789 fix route 2026-06-14 10:46:31 +03:30
fc853d318e Merge pull request 'create two record for report' (#20) from feature/MachineTypesDetails into develop
Reviewed-on: #20
2026-06-14 07:16:11 +00:00
amirghasempoor
a45b4955db create two record for report 2026-06-14 10:40:54 +03:30
0b7b22ff87 fix the command 2026-06-14 10:05:13 +03:30
ace0b018e7 Merge pull request 'fix the command' (#19) from feature/PolyLineEncoderCommand into develop
Reviewed-on: #19
2026-06-14 06:34:52 +00:00
e7ced6267d Merge pull request 'use polyline encoder for command' (#18) from feature/MissionMachinesReport into develop
Reviewed-on: #18
2026-06-14 05:20:44 +00:00
55c736ac3e Merge pull request 'add extra reports' (#17) from feature/MissionMachinesReport into develop
Reviewed-on: #17
2026-06-13 10:53:24 +00:00
16 changed files with 448 additions and 43 deletions

View File

@@ -13,7 +13,7 @@ class EncodePolyLineCommand extends Command
*
* @var string
*/
protected $signature = 'app:encode-poly-line-command';
protected $signature = 'polyline:encode';
/**
* The console command description.
@@ -28,7 +28,8 @@ class EncodePolyLineCommand extends Command
public function handle(PolylineEncoder $polylineEncoder): void
{
Mission::query()->whereNotNull('area')->each(function ($mission) use ($polylineEncoder) {
$encodedValue = $polylineEncoder->encodePolyLine($mission, lng_lat_format:true);
$area = json_decode($mission->area, true);
$encodedValue = $polylineEncoder->encodePolyLine($area['coordinates'], lng_lat_format:true);
$mission->update([
'encoded_route' => $encodedValue,
]);

View File

@@ -0,0 +1,74 @@
<?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 machineDriverReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
{
public function __construct(private array $data)
{
}
public function view(): View
{
$exportRows = [];
foreach ($this->data as $r) {
$exportRows[] = [
'driver_id' => $r->driver_id ?? '',
'driver_name' => $r->driver_name ?? '',
'missions' => $r->missions ?? 0,
'func' => (int) ($r->func ?? 0),
];
}
return view('v3.Reports.Mission.Report.Machine.MachineDriverReport', [
'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];
}
}

View File

@@ -18,14 +18,16 @@ class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
}
public function view(): View
{ $exportRows = [];
{
$exportRows = [];
foreach ($this->data as $r) {
$exportRows[] = [
'city_name' => $r->c_name ?? '',
'province_name' => $r->p_name ?? '',
'machine_id' => $r->c_name ?? '',
'machine_code' => $r->machine_code ?? '',
'car_name' => $r->car_name ?? '',
'missions' => $r->missions ?? 0,
'distance' => (int) ($r->distance ?? 0),
'func' => (int) ($r->func ?? 0),
];
}
@@ -66,7 +68,7 @@ class machineReport implements FromView, ShouldAutoSize, WithDrawings, WithEvent
$drawing2->setHeight(50);
$drawing2->setOffsetX(5);
$drawing2->setOffsetY(5);
$drawing2->setCoordinates('D1');
$drawing2->setCoordinates('E1');
return [$drawing, $drawing2];
}

View 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 machineTypeReport implements FromView, ShouldAutoSize, WithDrawings, WithEvents
{
public function __construct(private array $data)
{
}
public function view(): View
{
$exportRows = [];
foreach ($this->data as $r) {
$exportRows[] = [
'car_type' => $r->car_type ?? '',
'missions' => $r->missions ?? 0,
'func' => (int) ($r->func ?? 0),
];
}
return view('v3.Reports.Mission.Report.Machine.MachineTypeReport', [
'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('C1');
return [$drawing, $drawing2];
}
}

View File

@@ -2,16 +2,20 @@
namespace App\Http\Controllers\V3\Dashboard\Mission\Report;
use App\Exports\V3\Mission\Report\Machine\machineDriverReport;
use App\Exports\V3\Mission\Report\Machine\machineReport;
use App\Exports\V3\Mission\Report\Machine\machineTypeReport;
use App\Facades\DataTable\DataTableFacade;
use App\Http\Controllers\Controller;
use App\Http\Traits\ApiResponse;
use App\Models\City;
use App\Models\CMMSMachine;
use App\Models\Mission;
use App\Models\Province;
use App\Services\Cartables\Mission\Report\ReportMachineService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Maatwebsite\Excel\Facades\Excel;
use PhpOffice\PhpSpreadsheet\Exception;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
@@ -43,7 +47,7 @@ class ReportMachineController extends Controller
public function provinceMachinesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->countryMachinesActivity($request),
'activities' => $reportMachineService->provinceMachinesActivity($request),
// 'city' => City::query()
// ->where('province_id', $request->province_id)
// ->where(function ($query) {
@@ -60,7 +64,7 @@ class ReportMachineController extends Controller
*/
public function provinceMachinesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->countryMachinesActivity($request);
$data = $reportMachineService->provinceMachinesActivity($request);
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineReport($data), $name);
@@ -81,9 +85,9 @@ class ReportMachineController extends Controller
public function countryMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->countryMachineTypesActivity($request);
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineReport($data), $name);
return Excel::download(new machineTypeReport($data), $name);
}
public function provinceMachineTypesActivity(Request $request, ReportMachineService $reportMachineService): JsonResponse
@@ -100,16 +104,16 @@ class ReportMachineController extends Controller
]);
}
public function machineDetailsReport(Request $request)
public function machineDetailsReport(Request $request, int $machine_id)
{
return DataTableFacade::run(
Mission::query()->where('machine_id', '=', $request->query('machine_id')),
Mission::query()->where('machine_id', '=', $machine_id),
$request,
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedSelects: [
'id', 'province_id', 'province_name', 'city_id', 'city_name',
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
'end_km', 'km', 'driver_name', 'state_id', 'station_name'
]
);
}
@@ -121,8 +125,83 @@ class ReportMachineController extends Controller
public function provinceMachineTypesActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->provinceMachineTypesActivity($request);
$name = 'گزارش ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineReport($data), $name);
return Excel::download(new machineTypeReport($data), $name);
}
public function countryMachineDriversActivity(Request $request, ReportMachineService $reportMachineService)
{
return $this->successResponse([
'activities' => $reportMachineService->countryMachineDriversActivity($request),
// 'provinces' => Province::all(['id', 'name_fa']),
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryMachineDriversActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->countryMachineDriversActivity($request);
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineDriverReport($data), $name);
}
public function provinceMachineDriversActivity(Request $request, ReportMachineService $reportMachineService)
{
return $this->successResponse([
'activities' => $reportMachineService->provinceMachineDriversActivity($request),
// 'city' => City::query()
// ->where('province_id', $request->province_id)
// ->where(function ($query) {
// $query->where('type_id', 1)
// ->orWhereIn('name_fa', ['اداره ماشين‌آلات', 'اداره نقلیه']);
// })
// ->get(['id', 'name_fa'])
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function provinceMachineDriversActivityExcel(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->provinceMachineDriversActivity($request);
$name = 'گزارش نوع ماشین آلات'.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new machineDriverReport($data), $name);
}
public function machineTypeDetailsReport(Request $request)
{
$machineIds = CMMSMachine::query()->where('car_type', '=', $request->query('car_type'))->pluck('machine_id');
return DataTableFacade::run(
Mission::query()->whereIn('machine_id', $machineIds),
$request,
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedSelects: [
'id', 'province_id', 'province_name', 'city_id', 'city_name',
'end_km', 'km', 'driver_name', 'state_name', 'station_name'
]
);
}
public function machineDriverDetailsReport(Request $request, int $driver_id)
{
return DataTableFacade::run(
Mission::query()->where('driver_id', '=', $driver_id),
$request,
allowedFilters: ['*'],
allowedSortings: ['*'],
allowedSelects: [
'id', 'province_id', 'province_name', 'city_id', 'city_name',
'end_km', 'km', 'driver_name', 'state_id', 'station_name'
]
);
}
}

View File

@@ -236,8 +236,8 @@ class RequestPortalController extends Controller
{
DB::transaction(function () use ($request, $violation) {
$start = Carbon::parse($violation->exit_station);
$end = Carbon::parse($violation->enter_station);
$start = Carbon::parse($violation->exit_time);
$end = Carbon::parse($violation->enter_time);
$type = $start->diffInMinutes($end) > 480 ? MissionTypes::NO_PROCESS_ROZANE->value : MissionTypes::NO_PROCESS_SAATY->value;
$user = auth()->user();
$zone = $request->zone;
@@ -257,14 +257,14 @@ class RequestPortalController extends Controller
'encoded_route' => $request->encoded_route,
'type' => $type,
'type_fa' => MissionTypes::name($type),
'start_date' => $violation->exit_station,
'end_date' => $violation->enter_station,
'start_date' => $violation->exit_time,
'end_date' => $violation->enter_time,
'end_point' => $request->end_point,
'category_id' => $request->category_id,
'category_name' => MissionCategory::name($request->category_id),
'start_time' => $violation->exit_station,
'finish_time' => $violation->enter_station,
'mission_duration' => strtotime($violation->enter_station) - strtotime($violation->exit_station),
'start_time' => $violation->exit_time,
'finish_time' => $violation->enter_time,
'mission_duration' => strtotime($violation->enter_time) - strtotime($violation->exit_time),
'state_id' => MissionStates::END_MISSION->value,
'state_name' => MissionStates::END_MISSION->label(),
'explanation' => $request->explanation,

View File

@@ -54,7 +54,7 @@ class ViolationManagementController extends Controller
'city_name' => $user->city_fa,
'station_id' => $user->station_id,
'station_name' => RahdariPoint::query()->find($user->station_id)->name,
'exit_station' => $request->exit_station,
'exit_time' => $request->exit_time,
]);
return $this->successResponse();
@@ -68,7 +68,7 @@ class ViolationManagementController extends Controller
public function update(UpdateRequest $request, MissionViolation $violation): JsonResponse
{
$violation->update([
'enter_station' => $request->enter_station,
'enter_time' => $request->enter_time,
'status' => MissionViolationStatus::BEDON_EGHDAM->value,
]);

View File

@@ -25,7 +25,7 @@ class StoreRequest extends FormRequest
public function rules(): array
{
return [
'exit_station' => 'required|date',
'exit_time' => 'required|date',
'machine_code' => 'required',
'km'=> 'string',
];

View File

@@ -26,7 +26,21 @@ class UpdateRequest extends FormRequest
public function rules(): array
{
return [
'enter_station' => 'required|date',
'enter_time' => 'required|date',
];
}
public function after(): array
{
return [
function (Validator $validator) {
if (strtotime($this->enter_time) < strtotime($this->violation->exit_time)) {
$validator->errors()->add(
'time',
'زمان پایان ماموریت باید بعد از زمان شروع ماموریت باشد.'
);
}
}
];
}
}

View File

@@ -38,10 +38,10 @@ class ReportMachineService
$to = $request->date_to ? Carbon::parse($request->date_to)->endOfDay() : today()->endOfDay();
$province = $request->province_id;
$sql = "SELECT machine_id, machine_code, cm.car_name, COUNT(*) AS missions, SUM(m.end_km - m.km) AS func
$sql = "SELECT m.machine_id, m.machine_code, cm.car_name, COUNT(*) AS missions, SUM(m.end_km - m.km) AS func
FROM missions m
JOIN cmms_machines cm ON cm.id = m.machine_id
WHERE m.state_id = 4 AND start_time >= :from AND finish_time <= :to AND province_id = :province_id
WHERE m.state_id = 4 AND start_time >= :from AND finish_time <= :to AND m.province_id = :province_id
GROUP BY machine_id;";
return DB::select($sql, [
@@ -83,7 +83,7 @@ class ReportMachineService
SUM(m.end_km - m.km) AS func
FROM missions m
JOIN cmms_machines cm ON cm.id = m.machine_id
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND province_id = :province_id
WHERE m.state_id = 4 AND m.start_time >= :from AND m.finish_time <= :to AND m.province_id = :province_id
GROUP BY cm.car_type;";
return DB::select($sql, [

View File

@@ -34,6 +34,7 @@ class RequestPortalService
'description', 'requested_machines', 'type', 'type_fa', 'start_date', 'state_id',
'end_date', 'request_date', 'end_point', 'encoded_route', 'zone', 'zone_fa', 'start_time', 'finish_time',
'code', 'category_id', 'category_name', 'explanation', 'city_id', 'city_name', 'province_id', 'station_name',
'driver_id', 'driver_name'
]
);
}

View File

@@ -12,8 +12,6 @@ return new class extends Migration
public function up(): void
{
Schema::table('mission_violations', function (Blueprint $table) {
$table->dateTime('exit_station')->nullable();
$table->dateTime('enter_station')->nullable();
$table->unsignedInteger('station_id')->nullable();
$table->string('station_name')->nullable();
});
@@ -25,7 +23,7 @@ return new class extends Migration
public function down(): void
{
Schema::table('mission_violations', function (Blueprint $table) {
$table->dropColumn(['exit_station', 'enter_station']);
$table->dropColumn(['station_id', 'station_name']);
});
}
};

View File

@@ -46,19 +46,23 @@
<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>
<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>
@@ -66,10 +70,11 @@
<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['machine_id'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['car_name'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['machine_code'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</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>

View File

@@ -0,0 +1,75 @@
<!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;">
car_type
</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['driver_id'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['driver_name'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,75 @@
<!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>
</tr>
</thead>
<tbody>
@foreach ($rows as $item)
<tr>
<td style="border: 1px solid black;text-align: center;">{{ $item['car_type'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['func'] ?? '-' }}</td>
<td style="border: 1px solid black;text-align: center;">{{ $item['missions'] ?? '-' }}</td>
</tr>
@endforeach
</tbody>
</table>
</body>
</html>

View File

@@ -571,8 +571,16 @@ Route::prefix('missions')
Route::get('/province_machines_activity', 'provinceMachinesActivity')->name('provinceMachinesActivity');
Route::get('/province_machines_activity_excel', 'provinceMachinesActivityExcel')->name('provinceMachinesActivityExcel');
Route::get('/country_machine_types_activity', 'countryMachineTypesActivity')->name('countryMachineTypesActivity');
Route::get('/country_machine_types_activity_excel', 'countryMachineTypesActivityExcel')->name('countryMachineTypesActivityExcel');
Route::get('/province_machine_types_activity', 'provinceMachineTypesActivity')->name('provinceMachineTypesActivity');
Route::get('/machine_details_report', 'machineDetailsReport')->name('machineDetailsReport');
Route::get('/province_machine_types_activity_excel', 'provinceMachineTypesActivityExcel')->name('provinceMachineTypesActivityExcel');
Route::get('/country_machine_drivers_activity', 'countryMachineDriversActivity')->name('countryMachineDriversActivity');
Route::get('/country_machine_drivers_activity_excel', 'countryMachineDriversActivityExcel')->name('countryMachineDriversActivityExcel');
Route::get('/province_machine_drivers_activity', 'provinceMachineDriversActivity')->name('provinceMachineDriversActivity');
Route::get('/province_machine_drivers_activity_excel', 'provinceMachineDriversActivityExcel')->name('provinceMachineDriversActivityExcel');
Route::get('/machine_details_report/{machine_id}', 'machineDetailsReport')->name('machineDetailsReport');
Route::get('/machine_driver_details_report/{driver_id}', 'machineDriverDetailsReport')->name('machineDriverDetailsReport');
Route::get('/machine_type_details_report', ' machineTypeDetailsReport')->name('machineTypeDetailsReport');
});
});