<?php

class HorarioController extends \BaseController {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function descargar()
	{
		try{
			$alumno = Auth::user();
			$file= public_path(). "/descargas/".$alumno->inscripcion->grupo->CvePlan."/".$alumno->inscripcion->grupo->CveGrupo."/horario.pdf";
			$headers = array(
				'Content-Type: application/pdf',
				);
			return Response::download($file, 'horario.pdf', $headers);
		}catch(Exception $e){
			$parametros = array();
			$parametros['alumno'] = Auth::user();;
			$parametros['menu_activo'] = '';
			return Response::view('errors.descarga', $parametros, 500);
		}
		
		
	}

}
