<?php

use App\Models\ReportQuarter;
use App\Models\ConseilSchool;
use App\Services\Chapter3Service;
use Livewire\Component;

return new class extends Component
{
    public $data = [];
    public $input = [];
    public $user = [];
    public $type = 2;
    public $school;
    public $cutting;

    public function mount() {
        $report = ReportQuarter::where('school_id', $this->school)->where('cutting_school_year_id', $this->cutting)->first();
        $dts = $report ? ConseilSchool::where('report_quarter_id', $report->id)->where('type', $this->type)->orderBy('order')->get():[];
        $this->data = $dts;
    }

    public function myInput(Chapter3Service $service) {
        $this->user = $service->getUsers($this->school);
        $this->input = $this->data;
    }

    protected function view($data = [])
    {
        return app('view')->file('C:\Users\EDUCAS\Desktop\App\V4_001\storage\framework/views/livewire/views/fca8dbd4.blade.php', $data);
    }
};
