just for go enother work i donot no work or not
This commit is contained in:
83
app/Exports/V3/SafetyAndPrivacy/Country/AccessRoadReport.php
Normal file
83
app/Exports/V3/SafetyAndPrivacy/Country/AccessRoadReport.php
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Country;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class AccessRoadReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
public function __construct(private array $data){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedProvinces = array_keys($data);
|
||||||
|
|
||||||
|
foreach (Province::all() as $value) {
|
||||||
|
$provinceId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($provinceId, $existedProvinces)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'province_id' => $provinceId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Country.AccessRoadReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Country;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class ConstructionReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
|
||||||
|
public function __construct(private array $data){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedProvinces = array_keys($data);
|
||||||
|
|
||||||
|
foreach (Province::all() as $value) {
|
||||||
|
$provinceId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($provinceId, $existedProvinces)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'province_id' => $provinceId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Country.ConstructionReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Country;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use App\Models\Province;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class UtilityPassingReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
|
||||||
|
public function __construct(private array $data){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedProvinces = array_keys($data);
|
||||||
|
|
||||||
|
foreach (Province::all() as $value) {
|
||||||
|
$provinceId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($provinceId, $existedProvinces)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'province_id' => $provinceId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Country.UtilityPassingReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Province;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class AccessRoadReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
public function __construct(private array $data, public Request $request){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedCities = array_keys($data);
|
||||||
|
$edarat = EdarateShahri::query()->where('province_id', '=', $this->request->province_id)->get(['id', 'name_fa']);
|
||||||
|
|
||||||
|
foreach ($edarat as $value) {
|
||||||
|
$edareId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($edareId, $existedCities)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'edare_shahri_id' => $edareId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Province.AccessRoadReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Province;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class ConstructionReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
public function __construct(private array $data, public Request $request){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedCities = array_keys($data);
|
||||||
|
$edarat = EdarateShahri::query()->where('province_id', '=', $this->request->province_id)->get(['id', 'name_fa']);
|
||||||
|
|
||||||
|
foreach ($edarat as $value) {
|
||||||
|
$edareId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($edareId, $existedCities)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'edare_shahri_id' => $edareId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Province.ConstructionReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Exports\V3\SafetyAndPrivacy\Province;
|
||||||
|
|
||||||
|
use App\Models\EdarateShahri;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
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\Worksheet\Drawing;
|
||||||
|
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
|
||||||
|
|
||||||
|
class UtilityPassingReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||||
|
{
|
||||||
|
public function __construct(private array $data, public Request $request){}
|
||||||
|
|
||||||
|
public function view(): View
|
||||||
|
{
|
||||||
|
$data = $this->data;
|
||||||
|
$existedCities = array_keys($data);
|
||||||
|
$edarat = EdarateShahri::query()->where('province_id', '=', $this->request->province_id)->get(['id', 'name_fa']);
|
||||||
|
|
||||||
|
foreach ($edarat as $value) {
|
||||||
|
$edareId = $value->id;
|
||||||
|
|
||||||
|
if (!array_key_exists($edareId, $existedCities)) {
|
||||||
|
$data[] = (object) [
|
||||||
|
'edare_shahri_id' => $edareId,
|
||||||
|
'name_fa' => $value->name_fa,
|
||||||
|
'sum' => 0,
|
||||||
|
'axis_data' => [
|
||||||
|
'آزادراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'بزرگراه' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'اصلی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'فرعی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
'روستایی' => ['1' => 0, '2' => 0, '3' => 0],
|
||||||
|
],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return view('v3.Reports.SafetyAndPrivacy.Province.UtilityPassingReport', [
|
||||||
|
'data' => $data,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function registerEvents(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
AfterSheet::class => function (AfterSheet $event) {
|
||||||
|
$event->sheet->getDelegate()->setRightToLeft(true);
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
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('Q1');
|
||||||
|
return [$drawing, $drawing2];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -51,16 +51,6 @@ class OperatorController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function store(StoreRequest $request, NominatimService $nominatimService): JsonResponse
|
public function store(StoreRequest $request, NominatimService $nominatimService): JsonResponse
|
||||||
{
|
{
|
||||||
$activityDateTime = Carbon::parse($request->activity_date . ' ' . $request->activity_time);
|
|
||||||
$mission = Mission::findOrFail($request->mission_id);
|
|
||||||
if ($activityDateTime->lt($mission->start_date) || $activityDateTime->gt($mission->end_date)) {
|
|
||||||
throw ValidationException::withMessages([
|
|
||||||
'activity_date_time' => __('زمان گزارش باید بین :start تا :end (بازه مأموریت) باشد.', [
|
|
||||||
'start' => verta($mission->start_date)->format('Y/m/d H:i'),
|
|
||||||
'end' => verta($mission->end_date)->format('Y/m/d H:i'),
|
|
||||||
]),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
$info_item = InfoItem::query()->where('item', $request->item_id)
|
$info_item = InfoItem::query()->where('item', $request->item_id)
|
||||||
->where('sub_item', $request->sub_item_id)
|
->where('sub_item', $request->sub_item_id)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy;
|
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport;
|
||||||
|
|
||||||
use App\Exports\V3\SafetyAndPrivacy\CountryActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Country\AccessRoadReport as ExcelReport;
|
||||||
use App\Exports\V3\SafetyAndPrivacy\ProvinceActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Province\AccessRoadReport;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\EdarateShahri;
|
use App\Models\EdarateShahri;
|
||||||
@@ -44,14 +44,14 @@ class AccessRoadActivityController extends Controller
|
|||||||
{
|
{
|
||||||
$data = $operatorService->countryActivity($request);
|
$data = $operatorService->countryActivity($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 CountryActivityReport($data), $name);
|
return Excel::download(new ExcelReport($data), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
||||||
{
|
{
|
||||||
$data = $operatorService->provinceActivity($request);
|
$data = $operatorService->provinceActivity($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 ProvinceActivityReport($data, $request), $name);
|
return Excel::download(new AccessRoadReport($data, $request), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy;
|
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport;
|
||||||
|
|
||||||
use App\Exports\V3\SafetyAndPrivacy\CountryActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Country\ConstructionReport as ExcelReport;
|
||||||
use App\Exports\V3\SafetyAndPrivacy\ProvinceActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Province\ConstructionReport;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Traits\ApiResponse;
|
use App\Http\Traits\ApiResponse;
|
||||||
use App\Models\EdarateShahri;
|
use App\Models\EdarateShahri;
|
||||||
@@ -43,14 +43,14 @@ class ConstructionActivityController extends Controller
|
|||||||
{
|
{
|
||||||
$data = $operatorService->countryActivity($request);
|
$data = $operatorService->countryActivity($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 CountryActivityReport($data), $name);
|
return Excel::download(new ExcelReport($data), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
||||||
{
|
{
|
||||||
$data = $operatorService->provinceActivity($request);
|
$data = $operatorService->provinceActivity($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 ProvinceActivityReport($data, $request), $name);
|
return Excel::download(new ConstructionReport($data, $request), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy;
|
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport;
|
||||||
|
|
||||||
use App\Exports\V3\SafetyAndPrivacy\CountryActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Country\UtilityPassingReport as ExcelReport;
|
||||||
use App\Exports\V3\SafetyAndPrivacy\ProvinceActivityReport;
|
use App\Exports\V3\SafetyAndPrivacy\Province\UtilityPassingReport;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\EdarateShahri;
|
use App\Models\EdarateShahri;
|
||||||
use App\Models\Province;
|
use App\Models\Province;
|
||||||
@@ -41,14 +41,14 @@ class UtilityPassingActivityController extends Controller
|
|||||||
{
|
{
|
||||||
$data = $operatorService->countryActivity($request);
|
$data = $operatorService->countryActivity($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 CountryActivityReport($data), $name);
|
return Excel::download(new ExcelReport($data), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
||||||
{
|
{
|
||||||
$data = $operatorService->provinceActivity($request);
|
$data = $operatorService->provinceActivity($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 ProvinceActivityReport($data, $request), $name);
|
return Excel::download(new UtilityPassingReport($data, $request), $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy;
|
|
||||||
|
|
||||||
use App\Exports\V3\SafetyAndPrivacy\CountryActivityReport;
|
|
||||||
use App\Exports\V3\SafetyAndPrivacy\ProvinceActivityReport;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Traits\ApiResponse;
|
|
||||||
use App\Models\EdarateShahri;
|
|
||||||
use App\Models\Province;
|
|
||||||
use App\Services\Cartables\SafetyAndPrivacy\OperatorService;
|
|
||||||
use App\Services\Cartables\SafetyAndPrivacyTableService;
|
|
||||||
use Illuminate\Http\JsonResponse;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Maatwebsite\Excel\Facades\Excel;
|
|
||||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
|
|
||||||
|
|
||||||
class OperatorReportController extends Controller
|
|
||||||
{
|
|
||||||
use ApiResponse;
|
|
||||||
|
|
||||||
public function countryActivity(Request $request, OperatorService $operatorService): JsonResponse
|
|
||||||
{
|
|
||||||
$data = $operatorService->countryActivity($request);
|
|
||||||
return $this->successResponse([
|
|
||||||
'activities' => $data,
|
|
||||||
'provinces' => Province::all(['id', 'name_fa'])
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function provinceActivity(Request $request, OperatorService $operatorService): JsonResponse
|
|
||||||
{
|
|
||||||
$data = $operatorService->provinceActivity($request);
|
|
||||||
return $this->successResponse([
|
|
||||||
'activities' => $data,
|
|
||||||
'edarateShahri' => EdarateShahri::query()->where('province_id', '=', $request->province_id)->get(['id', 'name_fa']),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function countryExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
|
||||||
{
|
|
||||||
$data = $operatorService->countryActivity($request);
|
|
||||||
$name = 'گزارش از نگهداری حریم راه ' . verta()->now()->format('Y-m-d H-i') . '.xlsx';
|
|
||||||
return Excel::download(new CountryActivityReport($data), $name);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
|
|
||||||
{
|
|
||||||
$data = $operatorService->provinceActivity($request);
|
|
||||||
$name = 'گزارش از نگهداری حریم راه ' . verta()->now()->format('Y-m-d H-i') . '.xlsx';
|
|
||||||
return Excel::download(new ProvinceActivityReport($data, $request), $name);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,9 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\V3\RoadItem\Operator;
|
namespace App\Http\Requests\V3\RoadItem\Operator;
|
||||||
|
|
||||||
|
use App\Models\Mission;
|
||||||
|
use Carbon\Carbon;
|
||||||
use Illuminate\Contracts\Validation\ValidationRule;
|
use Illuminate\Contracts\Validation\ValidationRule;
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
|
use Illuminate\Validation\Validator;
|
||||||
|
|
||||||
class StoreRequest extends FormRequest
|
class StoreRequest extends FormRequest
|
||||||
{
|
{
|
||||||
@@ -48,4 +52,18 @@ class StoreRequest extends FormRequest
|
|||||||
'activity_time' => 'ساعت فعالیت',
|
'activity_time' => 'ساعت فعالیت',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
public function after(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
function (Validator $validator) {
|
||||||
|
$activityTime = Carbon::parse("{$this->activity_date} {$this->activity_time}");
|
||||||
|
|
||||||
|
if ($activityTime->lt($this->mission->start_date) || $activityTime->gt($this->mission->end_date)) {
|
||||||
|
$validator->errors()->add('activity_time', 'زمان گزارش باید بین بازه مأموریت باشد.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ namespace App\Services\Cartables\SafetyAndPrivacy;
|
|||||||
|
|
||||||
use App\Exceptions\ProhibitedAction;
|
use App\Exceptions\ProhibitedAction;
|
||||||
use App\Facades\DataTable\DataTableFacade;
|
use App\Facades\DataTable\DataTableFacade;
|
||||||
use App\Models\EdarateShahri;
|
|
||||||
use App\Models\SafetyAndPrivacy;
|
use App\Models\SafetyAndPrivacy;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class OperatorService
|
class OperatorService
|
||||||
{
|
{
|
||||||
@@ -33,126 +33,95 @@ class OperatorService
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function countryActivity(Request $request): array
|
public function countryActivity(int $info_id): array
|
||||||
{
|
{
|
||||||
$activities = [];
|
return DB::select("
|
||||||
$countryQuery = SafetyAndPrivacy::query()->selectRaw('COUNT(*) as qty,axis_type_id, step');
|
WITH combinations AS (
|
||||||
|
SELECT
|
||||||
$country = DataTableFacade::run(
|
axis_type_id,
|
||||||
$countryQuery,
|
step
|
||||||
$request,
|
FROM (
|
||||||
allowedFilters: ['*'],
|
SELECT 1 AS axis_type_id UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
|
||||||
allowedSortings: ['*'],
|
) a
|
||||||
allowedGroupBy: ['axis_type_id', 'step']
|
CROSS JOIN (
|
||||||
);
|
SELECT 1 AS step UNION ALL SELECT 2 UNION ALL SELECT 3
|
||||||
|
) s
|
||||||
$countryTotalSum = 0;
|
),
|
||||||
$countryData = [
|
provinces AS (
|
||||||
'name_fa' => 'کشوری',
|
SELECT DISTINCT province_fa FROM safety_and_privacy WHERE info_id = ?
|
||||||
'province_id' => -1,
|
),
|
||||||
'sum' => 0,
|
data AS (
|
||||||
'1' => ['1' => 0, '2' => 0, '3' => 0,],
|
SELECT
|
||||||
'2' => ['1' => 0, '2' => 0, '3' => 0,],
|
p.province_fa,
|
||||||
'3' => ['1' => 0, '2' => 0, '3' => 0,],
|
c.axis_type_id,
|
||||||
'4' => ['1' => 0, '2' => 0, '3' => 0,],
|
c.step,
|
||||||
'5' => ['1' => 0, '2' => 0, '3' => 0,],
|
COUNT(sp.id) AS total
|
||||||
];
|
FROM combinations c
|
||||||
foreach ($country['data'] as $key => $value) {
|
CROSS JOIN provinces p
|
||||||
$countryTotalSum += $value->qty;
|
LEFT JOIN safety_and_privacy sp
|
||||||
$countryData[$value->info_id][$value->step] = $value->qty;
|
ON sp.axis_type_id = c.axis_type_id
|
||||||
$countryData["sum"] = $countryTotalSum;
|
AND sp.step = c.step
|
||||||
}
|
AND sp.province_fa = p.province_fa
|
||||||
|
AND sp.info_id = ?
|
||||||
$activities[] = (object) $countryData;
|
GROUP BY p.province_fa, c.axis_type_id, c.step
|
||||||
$provinceQuery = SafetyAndPrivacy::query()->selectRaw('province_id, province_fa, COUNT(*) as qty,axis_type_id, step');
|
)
|
||||||
$provinces = DataTableFacade::run(
|
SELECT
|
||||||
$provinceQuery,
|
province_fa,
|
||||||
$request,
|
axis_type_id,
|
||||||
allowedFilters: ['*'],
|
step,
|
||||||
allowedSortings: ['*'],
|
total,
|
||||||
allowedGroupBy: ['axis_type_id', 'step', 'province_id', 'province_fa']
|
SUM(total) OVER (PARTITION BY province_fa) AS total_sum
|
||||||
);
|
FROM data
|
||||||
|
ORDER BY province_fa, axis_type_id, step
|
||||||
foreach ($provinces['data'] as $value)
|
", [$info_id, $info_id]);
|
||||||
{
|
|
||||||
$provinceId = $value->province_id;
|
|
||||||
if (!isset($activities[$provinceId])) {
|
|
||||||
$activities[$provinceId] = (object) [
|
|
||||||
'province_id' => $provinceId,
|
|
||||||
'name_fa' => $value->province_fa,
|
|
||||||
'sum' => 0,
|
|
||||||
'1' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'2' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'3' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'4' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'5' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$activities[$provinceId]->{$value->info_id}[$value->step] = $value->qty;
|
|
||||||
$activities[$provinceId]->sum += $value->qty;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_values($activities);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function provinceActivity(Request $request): array
|
public function provinceActivity(int $info_id, int $province_id): array
|
||||||
{
|
{
|
||||||
$activities = [];
|
return DB::select("
|
||||||
$provinceQuery = SafetyAndPrivacy::query()->selectRaw('COUNT(*) as qty,axis_type_id, step');
|
WITH combinations AS (
|
||||||
$province = DataTableFacade::run(
|
SELECT axis_type_id, step
|
||||||
$provinceQuery,
|
FROM (
|
||||||
$request,
|
SELECT 1 AS axis_type_id UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5
|
||||||
allowedFilters: ['*'],
|
) a
|
||||||
allowedSortings: ['*'],
|
CROSS JOIN (
|
||||||
allowedGroupBy: ['axis_type_id', 'step']
|
SELECT 1 AS step UNION ALL SELECT 2 UNION ALL SELECT 3
|
||||||
);
|
) s
|
||||||
|
),
|
||||||
$provinceTotalSum = 0;
|
edarat AS (
|
||||||
$provinceData = [
|
SELECT id AS edare_id, name_fa
|
||||||
'name_fa' => 'استانی',
|
FROM edarate_shahri
|
||||||
'edare_shahri_id' => -1,
|
WHERE province_id = :provinceId
|
||||||
'sum' => 0,
|
),
|
||||||
'1' => ['1' => 0, '2' => 0, '3' => 0,],
|
data AS (
|
||||||
'2' => ['1' => 0, '2' => 0, '3' => 0,],
|
SELECT
|
||||||
'3' => ['1' => 0, '2' => 0, '3' => 0,],
|
e.edare_id,
|
||||||
'4' => ['1' => 0, '2' => 0, '3' => 0,],
|
c.axis_type_id,
|
||||||
'5' => ['1' => 0, '2' => 0, '3' => 0,],
|
c.step,
|
||||||
];
|
COUNT(sp.id) AS total
|
||||||
foreach ($province['data'] as $key => $value) {
|
FROM combinations c
|
||||||
$provinceTotalSum += $value->qty;
|
CROSS JOIN edarat e
|
||||||
$provinceData["sum"] = $provinceTotalSum;
|
LEFT JOIN safety_and_privacy sp
|
||||||
$provinceData[$value->info_id][$value->step] = $value->qty;
|
ON sp.axis_type_id = c.axis_type_id
|
||||||
}
|
AND sp.step = c.step
|
||||||
$activities[] = (object) $provinceData;
|
AND sp.city_id = e.edare_id
|
||||||
|
AND sp.info_id = :infoId
|
||||||
$citiesQuery = SafetyAndPrivacy::query()->selectRaw('edare_shahri_id, COUNT(*) as qty,axis_type_id, step');
|
GROUP BY e.edare_id, c.axis_type_id, c.step
|
||||||
$cities = DataTableFacade::run(
|
)
|
||||||
$citiesQuery,
|
SELECT
|
||||||
$request,
|
e.edare_id,
|
||||||
allowedFilters: ['*'],
|
e.name_fa AS edare_name,
|
||||||
allowedSortings: ['*'],
|
d.axis_type_id,
|
||||||
allowedGroupBy: ['axis_type_id', 'step', 'edare_shahri_id']
|
d.step,
|
||||||
);
|
d.total,
|
||||||
|
SUM(d.total) OVER (PARTITION BY e.edare_id) AS total_sum
|
||||||
foreach ($cities['data'] as $value)
|
FROM data d
|
||||||
{
|
JOIN edarat e ON e.edare_id = d.edare_id
|
||||||
$cityId = $value->edare_shahri_id;
|
ORDER BY e.edare_id, d.axis_type_id, d.step
|
||||||
if (!isset($activities[$cityId])) {
|
",[
|
||||||
$activities[$cityId] = (object) [
|
'provinceId' => $province_id,
|
||||||
'edare_shahri_id' => $cityId,
|
'infoId' => $info_id,
|
||||||
'name_fa' => EdarateShahri::query()->find($cityId)->name_fa,
|
]);
|
||||||
'sum' => 0,
|
|
||||||
'1' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'2' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'3' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'4' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
'5' => ['1' => 0, '2' => 0, '3' => 0,],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
$activities[$cityId]->{$value->info_id}[$value->step] = $value->qty;
|
|
||||||
$activities[$cityId]->sum += $value->qty;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_values($activities);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
<!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>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body dir="rtl" style="text-align: center;">
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="11"
|
|
||||||
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="11"
|
|
||||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th colspan="11"
|
|
||||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
|
||||||
گزارش نگهداری حریم راه
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
|
|
||||||
<tr class="headercolortable">
|
|
||||||
<th rowspan="2" style="border:1px solid black;text-align:center;background-color: #C4D79B;">
|
|
||||||
اداره کل
|
|
||||||
</th>
|
|
||||||
<th rowspan="2" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
تعداد کل
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
ساخت و ساز غیر مجاز
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
راه دسترسی غیر مجاز
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
عبور تاسیسات زیربنایی غیر مجاز
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($data as $item)
|
|
||||||
<tr>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->name_fa }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->sum }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[3] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[3] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[3] }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -1,101 +0,0 @@
|
|||||||
<!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>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body dir="rtl" style="text-align: center;">
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th colspan="11"
|
|
||||||
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="11"
|
|
||||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;">
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th colspan="11"
|
|
||||||
style="background-color: #DAEEF3;text-align: center;border-right:1px solid black;font-weight:bolder;font-size: 13px;">
|
|
||||||
گزارش نگهداری حریم راه
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="headercolortable">
|
|
||||||
<th rowspan="2" style="border:1px solid black;text-align:center;background-color: #C4D79B;">
|
|
||||||
اداره کل
|
|
||||||
</th>
|
|
||||||
<th rowspan="2" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
تعداد کل
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
ساخت و ساز غیر مجاز
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
راه دسترسی غیر مجاز
|
|
||||||
</th>
|
|
||||||
<th colspan="3" style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
عبور تاسیسات زیربنایی غیر مجاز
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام اول (شناسایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام دوم (مستندات قضایی)
|
|
||||||
</th>
|
|
||||||
<th style="border:1px solid black;text-align:center;background-color: #EBF1DE;">
|
|
||||||
گام سوم (برخورد)
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($data as $item)
|
|
||||||
<tr>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->name_fa }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->sum }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'89'}[3] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'90'}[3] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[1] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[2] }}</td>
|
|
||||||
<td style="border:1px solid black;text-align: center;">{{ $item->{'91'}[3] }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -18,6 +18,9 @@ use App\Http\Controllers\V3\Dashboard\OtpManagementController;
|
|||||||
use App\Http\Controllers\V3\Dashboard\RoadMaintenanceStationController;
|
use App\Http\Controllers\V3\Dashboard\RoadMaintenanceStationController;
|
||||||
use App\Http\Controllers\V3\Dashboard\RoadPatrol\ReportController;
|
use App\Http\Controllers\V3\Dashboard\RoadPatrol\ReportController;
|
||||||
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorController;
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport\AccessRoadActivityController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport\ConstructionActivityController;
|
||||||
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReport\UtilityPassingActivityController;
|
||||||
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReportController;
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\OperatorReportController;
|
||||||
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\SupervisorController;
|
use App\Http\Controllers\V3\Dashboard\SafetyAndPrivacy\SupervisorController;
|
||||||
use App\Http\Controllers\V3\FMSVehicleManagementController;
|
use App\Http\Controllers\V3\FMSVehicleManagementController;
|
||||||
@@ -389,20 +392,36 @@ Route::prefix('safety_and_privacy')
|
|||||||
Route::post('/confirm/{safetyAndPrivacy}', 'confirm')->name('confirm');
|
Route::post('/confirm/{safetyAndPrivacy}', 'confirm')->name('confirm');
|
||||||
Route::post('/reject/{safetyAndPrivacy}', 'reject')->name('reject');
|
Route::post('/reject/{safetyAndPrivacy}', 'reject')->name('reject');
|
||||||
});
|
});
|
||||||
});
|
Route::prefix('operator_report')
|
||||||
|
->name('operatorReport.');
|
||||||
|
Route::prefix('access_road')
|
||||||
|
->name('accessRoad.')
|
||||||
|
->controller(AccessRoadActivityController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
|
Route::get('/province_activity', 'provinceActivity')->name('provinceActivity');
|
||||||
|
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||||
|
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||||
|
});
|
||||||
|
Route::prefix('construction_activity')
|
||||||
|
->name('constructionActivity.')
|
||||||
|
->controller(ConstructionActivityController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
|
Route::get('/province_activity', 'provinceActivity')->name('provinceActivity');
|
||||||
|
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||||
|
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||||
|
});
|
||||||
|
Route::prefix('utility_passing_activity')
|
||||||
|
->name('utilityPassingActivity.')
|
||||||
|
->controller(UtilityPassingActivityController::class)
|
||||||
|
->group(function () {
|
||||||
|
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
||||||
|
Route::get('/province_activity', 'provinceActivity')->name('provinceActivity');
|
||||||
|
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
||||||
|
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
||||||
|
});
|
||||||
|
|
||||||
Route::prefix('safety_and_privacy_report')
|
|
||||||
->name('SafetyAndPrivacyReport.')
|
|
||||||
->group(function () {
|
|
||||||
Route::prefix('operator')
|
|
||||||
->name('operator.')
|
|
||||||
->controller(OperatorReportController::class)
|
|
||||||
->group(function () {
|
|
||||||
Route::get('/country_activity', 'countryActivity')->name('countryActivity');
|
|
||||||
Route::get('/province_activity', 'provinceActivity')->name('provinceActivity');
|
|
||||||
Route::get('/country_excel_activity', 'countryExcelActivity')->name('countryExcelActivity');
|
|
||||||
Route::get('/province_excel_activity', 'provinceExcelActivity')->name('provinceExcelActivity');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::prefix('otp')
|
Route::prefix('otp')
|
||||||
|
|||||||
Reference in New Issue
Block a user