<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Auth;

class handouts_Controller extends Controller
{
    public $selfName = 'handouts_Controller';
    public $dashboardName = 'dashboard';

	// GET /handouts
	public function index(Request $request) {
		$records = DB::table('handout')->get();
		return response()->view('admin/handouts/index', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /handouts/add_new
	public function add_new(Request $request) {
		$records = DB::table('handout')->get();
		return response()->view('admin/handouts/add_new', compact('records'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /handouts/view/{uid}
	public function view(Request $request, $uid) {
		return redirect("/handouts/view/$uid/SUB_dashboard");
	}
}
