<?php

namespace App\Http\Controllers;

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

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

	// GET /client_documents
	public function index(Request $request) {
		$records = DB::table('client_document')->get();
		$result_clients = DB::select("SELECT id, concat(name_last, ', ', name_first) as name_display FROM client");
		return response()->view('admin/client_documents/index', compact('records', 'result_clients'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

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