<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Http\Response as HttpResponse;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Models\Note_Station;
use App\Metier\GestNotes;

class StationNoteController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    protected $gestNotes;
    public function __construct(GestNotes $gestNotes){
        $this->gestNotes=$gestNotes;
    }
    public function index()
    {
        //
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($sessionId = null,$examenId = null,$examenNoteId = null,$stationNoteId = null)
    {
        if(is_null($stationNoteId)) {
            $note_Stations= $this->gestNotes->getNoteStations($examenNoteId);
            return view('noteStationView')
                ->with('note_Stations',$note_Stations)
                ->with('sessionId',$sessionId)
                ->with('examenId',$examenId)
                ->with('examenNoteId',$examenNoteId);
        } else {
            $note_Stations=$this->gestNotes->getNoteStation($stationNoteId);
            return is_null($note_Stations)? response()->
            json(['error' => 'Station Note not found'], HttpResponse::HTTP_NOT_FOUND) :$note_Stations;
        }
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
