<?php

namespace App\Http\Controllers;

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

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

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

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

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