<?php

namespace App\Http\Controllers;

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

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

	// GET /pros/view/{uid}/ACTION_sendCellNumberConfirmationMessage
	public function ACTION_sendCellNumberConfirmationMessage(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_sendCellNumberConfirmationMessage');
		}
		return response()->view('admin/pros_SINGLE/ACTION_sendCellNumberConfirmationMessage', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_adminResetPassword
	public function ACTION_adminResetPassword(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_adminResetPassword');
		}
		return response()->view('admin/pros_SINGLE/ACTION_adminResetPassword', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_confirmCellNumberWithConfirmationToken
	public function ACTION_confirmCellNumberWithConfirmationToken(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_confirmCellNumberWithConfirmationToken');
		}
		return response()->view('admin/pros_SINGLE/ACTION_confirmCellNumberWithConfirmationToken', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_putNewCellNumber
	public function ACTION_putNewCellNumber(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_putNewCellNumber');
		}
		return response()->view('admin/pros_SINGLE/ACTION_putNewCellNumber', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_confirmEmailAddressWithConfirmationToken
	public function ACTION_confirmEmailAddressWithConfirmationToken(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_confirmEmailAddressWithConfirmationToken');
		}
		return response()->view('admin/pros_SINGLE/ACTION_confirmEmailAddressWithConfirmationToken', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_putNewEmailAddress
	public function ACTION_putNewEmailAddress(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_putNewEmailAddress');
		}
		return response()->view('admin/pros_SINGLE/ACTION_putNewEmailAddress', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateName
	public function ACTION_updateName(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateName');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateName', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateProfession
	public function ACTION_updateProfession(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateProfession');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateProfession', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateEnrolledHcpInfo
	public function ACTION_updateEnrolledHcpInfo(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateEnrolledHcpInfo');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateEnrolledHcpInfo', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_putProfilePicture
	public function ACTION_putProfilePicture(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_putProfilePicture');
		}
		return response()->view('admin/pros_SINGLE/ACTION_putProfilePicture', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updatePhoneInfo
	public function ACTION_updatePhoneInfo(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updatePhoneInfo');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updatePhoneInfo', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateAddress
	public function ACTION_updateAddress(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateAddress');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateAddress', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updatePaymentProcessingDetail
	public function ACTION_updatePaymentProcessingDetail(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updatePaymentProcessingDetail');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updatePaymentProcessingDetail', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_uploadDriverLicense
	public function ACTION_uploadDriverLicense(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_uploadDriverLicense');
		}
		return response()->view('admin/pros_SINGLE/ACTION_uploadDriverLicense', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateDriverLicenseInfo
	public function ACTION_updateDriverLicenseInfo(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateDriverLicenseInfo');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateDriverLicenseInfo', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateSsn
	public function ACTION_updateSsn(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateSsn');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateSsn', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_sendEmailAddressConfirmationMessage
	public function ACTION_sendEmailAddressConfirmationMessage(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_sendEmailAddressConfirmationMessage');
		}
		return response()->view('admin/pros_SINGLE/ACTION_sendEmailAddressConfirmationMessage', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsHcpToTrue
	public function ACTION_setIsHcpToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsHcpToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsHcpToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsHcpToFalse
	public function ACTION_setIsHcpToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsHcpToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsHcpToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsEnrolledAsHcpToTrue
	public function ACTION_setIsEnrolledAsHcpToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsEnrolledAsHcpToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsEnrolledAsHcpToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsEnrolledAsHcpToFalse
	public function ACTION_setIsEnrolledAsHcpToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsEnrolledAsHcpToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsEnrolledAsHcpToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsEnrolledAsMcpToTrue
	public function ACTION_setIsEnrolledAsMcpToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsEnrolledAsMcpToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsEnrolledAsMcpToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsEnrolledAsMcpToFalse
	public function ACTION_setIsEnrolledAsMcpToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsEnrolledAsMcpToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsEnrolledAsMcpToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setHasAccessToNextPatientButtonToTrue
	public function ACTION_setHasAccessToNextPatientButtonToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setHasAccessToNextPatientButtonToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setHasAccessToNextPatientButtonToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setHasAccessToNextPatientButtonToFalse
	public function ACTION_setHasAccessToNextPatientButtonToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setHasAccessToNextPatientButtonToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setHasAccessToNextPatientButtonToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setCanCreateClientWithInvalidMcnToTrue
	public function ACTION_setCanCreateClientWithInvalidMcnToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setCanCreateClientWithInvalidMcnToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setCanCreateClientWithInvalidMcnToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setCanCreateClientWithInvalidMcnToFalse
	public function ACTION_setCanCreateClientWithInvalidMcnToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setCanCreateClientWithInvalidMcnToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setCanCreateClientWithInvalidMcnToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setCanAccessRmPortalToTrue
	public function ACTION_setCanAccessRmPortalToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setCanAccessRmPortalToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setCanAccessRmPortalToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setCanAccessRmPortalToFalse
	public function ACTION_setCanAccessRmPortalToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setCanAccessRmPortalToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setCanAccessRmPortalToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsVideoVisitAssistantToTrue
	public function ACTION_setIsVideoVisitAssistantToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsVideoVisitAssistantToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsVideoVisitAssistantToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsVideoVisitAssistantToFalse
	public function ACTION_setIsVideoVisitAssistantToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsVideoVisitAssistantToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsVideoVisitAssistantToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_removeProfilePicture
	public function ACTION_removeProfilePicture(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_removeProfilePicture');
		}
		return response()->view('admin/pros_SINGLE/ACTION_removeProfilePicture', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateW9Detail
	public function ACTION_updateW9Detail(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateW9Detail');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateW9Detail', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_updateSignedContractPdf
	public function ACTION_updateSignedContractPdf(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_updateSignedContractPdf');
		}
		return response()->view('admin/pros_SINGLE/ACTION_updateSignedContractPdf', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsPaymentProcessingDetailCompleteToTrue
	public function ACTION_setIsPaymentProcessingDetailCompleteToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsPaymentProcessingDetailCompleteToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsPaymentProcessingDetailCompleteToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsPaymentProcessingDetailCompleteToFalse
	public function ACTION_setIsPaymentProcessingDetailCompleteToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsPaymentProcessingDetailCompleteToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsPaymentProcessingDetailCompleteToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsDriverLicenseCompleteToTrue
	public function ACTION_setIsDriverLicenseCompleteToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsDriverLicenseCompleteToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsDriverLicenseCompleteToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsDriverLicenseCompleteToFalse
	public function ACTION_setIsDriverLicenseCompleteToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsDriverLicenseCompleteToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsDriverLicenseCompleteToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsSsnCompleteToTrue
	public function ACTION_setIsSsnCompleteToTrue(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsSsnCompleteToTrue');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsSsnCompleteToTrue', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setIsSsnCompleteToFalse
	public function ACTION_setIsSsnCompleteToFalse(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setIsSsnCompleteToFalse');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setIsSsnCompleteToFalse', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_setProType
	public function ACTION_setProType(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_setProType');
		}
		return response()->view('admin/pros_SINGLE/ACTION_setProType', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_dashboard
	public function SUB_dashboard(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_dashboard');
		}
		return response()->view('admin/pros_SINGLE/SUB_dashboard', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_pro_rates
	public function SUB_pro_rates(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_pro_rates');
		}
		$subRecords = DB::table('pro_rate')->where('pro_id', $record->id)->get();
		return response()->view('admin/pros_SINGLE/SUB_pro_rates', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_clients
	public function SUB_clients(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_clients');
		}
		return response()->view('admin/pros_SINGLE/SUB_clients', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_pro_access
	public function SUB_pro_access(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_pro_access');
		}
		$subRecords = DB::table('client_pro_access')->where('pro_id', $record->id)->get();
		return response()->view('admin/pros_SINGLE/SUB_pro_access', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_mcp_updates
	public function SUB_mcp_updates(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_mcp_updates');
		}
		return response()->view('admin/pros_SINGLE/SUB_mcp_updates', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_erx
	public function SUB_erx(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_erx');
		}
		return response()->view('admin/pros_SINGLE/SUB_erx', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_action_items
	public function SUB_action_items(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_action_items');
		}
		return response()->view('admin/pros_SINGLE/SUB_action_items', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_care_months
	public function SUB_care_months(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_care_months');
		}
		return response()->view('admin/pros_SINGLE/SUB_care_months', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_care_month_entries
	public function SUB_care_month_entries(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_care_month_entries');
		}
		return response()->view('admin/pros_SINGLE/SUB_care_month_entries', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_notes
	public function SUB_notes(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_notes');
		}
		return response()->view('admin/pros_SINGLE/SUB_notes', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_bills
	public function SUB_bills(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_bills');
		}
		return response()->view('admin/pros_SINGLE/SUB_bills', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_transactions
	public function SUB_transactions(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_transactions');
		}
		$subRecords = DB::table('pro_transaction')->where('pro_id', $record->id)->get();
		$result_clients = DB::select("select id, concat(name_last, ', ', name_first) as name_display from client");
		$result_pros = DB::select("select id, concat(name_last, ', ', name_first) as name_display from pro");
		return response()->view('admin/pros_SINGLE/SUB_transactions', compact('record', 'subRecords', 'result_clients', 'result_pros'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_sessions
	public function SUB_sessions(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_sessions');
		}
		return response()->view('admin/pros_SINGLE/SUB_sessions', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/SUB_audit_log
	public function SUB_audit_log(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/SUB_audit_log');
		}
		return response()->view('admin/pros_SINGLE/SUB_audit_log', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_add_new_pro_rate
	public function ACTION_add_new_pro_rate(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_add_new_pro_rate');
		}
		return response()->view('admin/pros_SINGLE/ACTION_add_new_pro_rate', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_add_new_client_pro_access
	public function ACTION_add_new_client_pro_access(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_add_new_client_pro_access');
		}
		return response()->view('admin/pros_SINGLE/ACTION_add_new_client_pro_access', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_add_new_credit_pro_transaction
	public function ACTION_add_new_credit_pro_transaction(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_add_new_credit_pro_transaction');
		}
		return response()->view('admin/pros_SINGLE/ACTION_add_new_credit_pro_transaction', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}

	// GET /pros/view/{uid}/ACTION_add_new_debit_pro_transaction
	public function ACTION_add_new_debit_pro_transaction(Request $request, $uid) {
		$record = DB::table('pro')->where('uid', $uid)->first();
		if(!$record) {
			$record = DB::table('pro')->where('id', $uid)->first();
			if($record) return redirect('/pros/view/' . $record->uid . '/ACTION_add_new_debit_pro_transaction');
		}
		return response()->view('admin/pros_SINGLE/ACTION_add_new_debit_pro_transaction', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
	}
}
