<?php

namespace App\Http\Controllers;

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

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

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

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

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