<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Metier\GestSession ;
use App\Metier\GestStage ;
use Illuminate\Support\Facades\Input;

class ObserverController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    protected $gestSession ;
    protected $gestStage ;

   
    public function __construct(GestSession $gestSession,GestStage $gestStage){
       $this->gestSession = $gestSession ;
       $this->gestStage = $gestStage ;  
    }
    public function index(Request $request)
    {
        $etudiants = $this->gestStage->getEtudiants(Input::get('rech'));
         return $etudiants ;
    }

    /**
     * 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)
    {
         $observers = $this->gestSession->getMedObserver(Input::get('rech'));
         return $observers ;
    }
    public function showRech(Request $request){
        $enseignant = $this->gestStage->getEnseignant(Input::get('rech'));
        return $enseignant;
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * 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)
    {
        //
    }
}
