<?php

class AgreementController extends \BaseController {

	/**
	 * Display a listing of the resource.
	 *
	 * @return Response
	 */
	public function index()
	{
		//
			$user = Auth::user();
		$title = "Agreement";
	return View::make('global.agreement',compact( 'title', 'user'));
	}


	/**
	 * Show the form for creating a new resource.
	 *
	 * @return Response
	 */
	public function agree()
	{
// 		var_dump(Input::get('submitbutton'));exit();
		if(Input::get('submitbutton')=="Agree")
		{
			switch (Auth::user()->role) {
		case 1:
			return Redirect::intended('administrator');
			break;

		case 2:
			return Redirect::intended('school-coordinator');
			break;

		case 3:
			return Redirect::intended('program-coordinator');
			break;

		case 4:
			return Redirect::intended('professor');
			break;
		}
		}
		else
		{
			return Redirect::intended('logout');

		}
	

		//
	}


	/**
	 * Store a newly created resource in storage.
	 *
	 * @return Response
	 */
	public function store()
	{
		//
	}


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


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


	/**
	 * Update the specified resource in storage.
	 *
	 * @param  int  $id
	 * @return Response
	 */
	public function update($id)
	{
		//
	}


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


}
