<?php

namespace App\Http\Controllers\Dosen;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

use App\Models\Proposal;
use App\Models\Kelompok;
use App\Models\Periode;
use App\Models\Jenis;

use Session;
use Alert;
use Auth;

class MonevController extends Controller
{
    public function monevsatu()
    {
        $title    = 'Monev Internal I';
        $bio      = auth()->user()->rBiodata;
        $nim      = $bio->noidentitas;

        $proposal = Proposal::with(['rKelompok', 'rJenis'])
                    ->whereHas('rKelompok', function ($query) use($bio){
                        $query->where('nidn_dosen', $bio->noidentitas);
                    })
                    ->orderBy('kelompok_id')
                    ->get();

        $data = [
            'proposal'  => $proposal,
            'title'     => $title,
        ];

        return view('backend.dosen.monev.indexmonev1', $data);
    }

    public function monevdua()
    {
        $title    = 'Monev Internal I';
        $bio      = auth()->user()->rBiodata;
        $nim      = $bio->noidentitas;

        $proposal = Proposal::with(['rKelompok', 'rJenis'])
                    ->whereHas('rKelompok', function ($query) use($bio){
                        $query->where('nidn_dosen', $bio->noidentitas);
                    })
                    ->orderBy('kelompok_id')
                    ->get();

        $data = [
            'proposal'  => $proposal,
            'title'     => $title,
        ];

        return view('backend.dosen.monev.indexmonev2', $data);
    }

    public function monevtiga()
    {
        $title    = 'Monev Internal I';
        $bio      = auth()->user()->rBiodata;
        $nim      = $bio->noidentitas;

        $proposal = Proposal::with(['rKelompok', 'rJenis'])
                    ->whereHas('rKelompok', function ($query) use($bio){
                        $query->where('nidn_dosen', $bio->noidentitas);
                    })
                    ->orderBy('kelompok_id')
                    ->get();
        $data = [
            'proposal'  => $proposal,
            'title'     => $title,
        ];

        return view('backend.dosen.monev.indexmonev3', $data);
    }
}
