<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/


Route::get('password', function(){
	$hola =  Hash::make('password');

	if (Hash::check('password', $hola))
	{
		return $hola;
	}
});

Route::any('/login', array('uses' => 'AutenticacionController@login'));
Route::get('/logout', array('uses' => 'AutenticacionController@logout', 'before' => 'auth'));

Route::group(array('before'=>'auth'), function(){
	Route::get('/', array('uses' => 'DashboardController@index'));
	Route::get('calificaciones', array('uses' => 'CalificacionesController@index'));
	Route::get('imprimir-calificaciones', array('uses' => 'CalificacionesPDFController@index'));
	Route::get('horario', array('uses' => 'HorarioController@descargar'));
	Route::get('calendario-de-examenes', array('uses' => 'CalendarioExamenesController@descargar'));
	//Route::get('horario', array('uses' => 'HorarioController@descargar'));
	//Route::get('asistencia', array('uses' => 'AsistenciaController@index'));
	//Route::get('cargos-pendientes', array('uses' => 'EstadoCuentaController@index'));
	//Route::get('historial-pagos', array('uses' => 'HistorialPagosController@index'));
});



App::missing(function($exception)
{
	if (!Auth::check()) {
		return Redirect::to('login');
	}
	$usuario = Auth::user();
	$parametros = array();
	$parametros['alumno'] = $usuario;
	$parametros['menu_activo'] = '';
	return Response::view('errors.404', $parametros, 404);

});
