<?php

namespace App\Exports\Maintanance;

use Maatwebsite\Excel\Concerns\WithMultipleSheets;
use App\Exports\Maintanance\RoadMaintanance;
use App\Exports\Maintanance\summaryAcidentPerformanceProvince;
use App\Exports\Maintanance\summaryAcidentPerformanceCity;
use App\Exports\Maintanance\summaryAcidentPerformanceProject;
use App\Exports\Maintanance\CompareProgramAndFunction;

class allSheet implements WithMultipleSheets
{
    public function __construct($fromDate = null, $toDate = null, $province = null, $last_status_id = null)
    {
        $this->fromDate = $fromDate ?? null;
        $this->toDate = $toDate ?? null;
        $this->province = $province ?? null;
        $this->last_status_id = $last_status_id ?? null;
    }

    public function sheets(): array
    {
        return [
            0 => new RoadMaintanance($this->fromDate, $this->toDate, $this->province, $this->last_status_id),
            1 => new summaryAcidentPerformanceProvince($this->fromDate, $this->toDate, $this->province, $this->last_status_id),
            2 => new summaryAcidentPerformanceCity($this->fromDate, $this->toDate, $this->province, $this->last_status_id),
            3 => new summaryAcidentPerformanceProject($this->fromDate, $this->toDate, $this->province, $this->last_status_id),
            4 => new CompareProgramAndFunction($this->fromDate, $this->toDate, $this->province, $this->last_status_id)
        ];
    }
}
