<?php namespace App\Http\Controllers;

use Illuminate\Support\Facades\Auth;
use Auth\AuthController;
use App\Models\Employeur;
use App\Models\Beneficiaire;
use App\Models\Beneftype;
use App\Models\Benefstatut;
use App\Models\Versement_hg;
use App\Models\User;
use App\Models\Role2;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Redirect;
use View;
use DB;

use Response;



class VersementsHGController extends Controller {

    private $menu='beneficiaires';
    private $submenu='allocations';
    private $menu_home="allocations";
    /**
     * Liste des versements
     */
    public function index($beneficiaire_id)
    {
        if(!($user=Auth::user())) return Redirect::route( 'login' );
        $versements_hg = Versement_hg::where('benum','=',$beneficiaire_id)->get();
        $beneficiaire=Beneficiaire::find($beneficiaire_id);
        return View::make('prestations.versements_h.index_hg', [
            'user' => $user,'menu' => $this->menu,'submenu' => $this->submenu,'menu_home' => $this->menu_home,
            'versements_hg' => $versements_hg,
            'beneficiaire' => $beneficiaire,
        ]);
    }


}
