<?php

namespace App\Http\Controllers;

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

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

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

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