Josh 4 жил өмнө
parent
commit
e93ba022e8

+ 21 - 0
app/Http/Controllers/clients_SINGLE_Controller.php

@@ -831,6 +831,17 @@ class clients_SINGLE_Controller extends Controller
 		return response()->view('pro/clients_SINGLE/SUB_client_sms_numbers', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
 	}
 
+	// GET /clients/view/{uid}/SUB_client_documents
+	public function SUB_client_documents(Request $request, $uid) {
+		$record = DB::table('client')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('client')->where('id', $uid)->first();
+			if($record) return redirect('/clients/view/' . $record->uid . '/SUB_client_documents');
+		}
+		$subRecords = DB::table('client_document')->where('client_id', $record->id)->get();
+		return response()->view('pro/clients_SINGLE/SUB_client_documents', compact('record', 'subRecords'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
+
 	// GET /clients/view/{uid}/SUB_audit_log
 	public function SUB_audit_log(Request $request, $uid) {
 		$record = DB::table('client')->where('uid', $uid)->first();
@@ -920,4 +931,14 @@ class clients_SINGLE_Controller extends Controller
 		}
 		return response()->view('pro/clients_SINGLE/ACTION_add_new_erx_action_item', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
 	}
+
+	// GET /clients/view/{uid}/ACTION_add_new_client_document
+	public function ACTION_add_new_client_document(Request $request, $uid) {
+		$record = DB::table('client')->where('uid', $uid)->first();
+		if(!$record) {
+			$record = DB::table('client')->where('id', $uid)->first();
+			if($record) return redirect('/clients/view/' . $record->uid . '/ACTION_add_new_client_document');
+		}
+		return response()->view('pro/clients_SINGLE/ACTION_add_new_client_document', compact('record'), session('message') ? 500 : 200)->header('Content-Type', 'text/html');
+	}
 }

+ 12 - 0
generatecv/tree.txt

@@ -486,6 +486,18 @@ PRO
             client_sms_numbers
                 id=client_sms_number.client_id
                 !inc:id,sms_number
+            client_documents
+                id=client_document.client_id
+                !inc:id,file_name
+                add_new:client_document
+                    clientUid:hidden=uid
+                    title
+                    category
+                    status
+                    effectiveDate:date
+                    provider
+                    notes
+                    file:file
             audit_log
     notes|note|view|icon:file-alt
         !inc:effective_dateest,client_id,hcp_pro_id,reasons,is_signed_by_hcp,billed

+ 1 - 0
resources/views/pro/clients/subs.blade.php

@@ -15,4 +15,5 @@
 <a href='/clients/view/<?= $record->uid ?>/SUB_mcp_updates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_mcp_updates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Mcp Updates</a>
 <a href='/clients/view/<?= $record->uid ?>/SUB_client_sms' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_client_sms' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Client Sms</a>
 <a href='/clients/view/<?= $record->uid ?>/SUB_client_sms_numbers' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_client_sms_numbers' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Client Sms Numbers</a>
+<a href='/clients/view/<?= $record->uid ?>/SUB_client_documents' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_client_documents' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Client Documents</a>
 <a href='/clients/view/<?= $record->uid ?>/SUB_audit_log' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_audit_log' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Audit Log</a>

+ 66 - 0
resources/views/pro/clients_SINGLE/ACTION_add_new_client_document.blade.php

@@ -0,0 +1,66 @@
+@extends('pro.clients.view')
+@section('content-inner')
+
+    <div class="form-contents"><div class="failed-form-contents">
+
+    <h4 class="d-flex m-0 p-3 stag-heading stag-heading-modal">
+        <div>Add New Client Document</div>
+        <div class="ml-auto">
+            <a class="text-secondary" href="#" up-close>
+                <i class="fa fa-times"></i>
+            </a>
+        </div>
+    </h4>
+
+    <form action="/post-to-api"
+          up-target="#main-content" up-history="false" up-fail-target=".failed-form-contents" up-reveal="false"
+          method="post" enctype="multipart/form-data"
+          class="border-top px-3 pt-3 pb-1 custom-submit">
+        @csrf
+
+        @if (session('message'))
+            <div class="alert alert-danger">{{ session('message') }}</div>
+        @endif
+
+        <input type="hidden" name="_uid" value="{{ $record->uid }}">
+        <input type="hidden" name="_api" value="/api/clientDocument/create">
+        <input type="hidden" name="_success" value="{{route('clients_SINGLE-SUB_client_documents', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('clients_SINGLE-ACTION_add_new_client_document', ['uid' => $record->uid])}}">
+        <input class='form-control' type='hidden' name='clientUid' value='{{ old('clientUid') ? old('clientUid') : $record->uid }}' >
+<div class='form-group mb-3'>
+<label class='control-label'>Title </label>
+<input class='form-control' type='text' name='title' value='{{ old('title') ? old('title') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Category </label>
+<input class='form-control' type='text' name='category' value='{{ old('category') ? old('category') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Status </label>
+<input class='form-control' type='text' name='status' value='{{ old('status') ? old('status') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Effective Date </label>
+<input class='form-control' type='date' name='effectiveDate' value='{{ old('effectiveDate') ? old('effectiveDate') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Provider </label>
+<input class='form-control' type='text' name='provider' value='{{ old('provider') ? old('provider') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>Notes </label>
+<input class='form-control' type='text' name='notes' value='{{ old('notes') ? old('notes') : '' }}' >
+</div>
+<div class='form-group mb-3'>
+<label class='control-label'>File </label>
+<input class='form-control' type='file' name='file' value='{{ old('file') ? old('file') : '' }}' >
+</div>
+        <div class="form-group mb-3 d-flex justify-content-center">
+            <button class="btn btn-sm btn-primary mr-3 px-5">Submit</button>
+            <a href="{{route('clients_SINGLE-SUB_client_documents', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 34 - 0
resources/views/pro/clients_SINGLE/SUB_client_documents.blade.php

@@ -0,0 +1,34 @@
+@extends('pro.clients.view')
+@section('content-inner')
+
+    <div class="pb-3">
+
+        <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
+            <div>Client Documents</div>
+            <div class="ml-auto">
+                <a class="btn btn-primary btn-sm ml-2" up-modal=".form-contents" up-preload up-delay="25" up-width="800" up-history="false" href="{{route('clients_SINGLE-ACTION_add_new_client_document', ['uid' => $record->uid])}}?optimised=1"><i class='fa fa-plus-circle' aria-hidden='true'></i> Add New</a>
+            </div>
+        </h5>
+
+        <div class="table-responsive p-0 bg-white border stag-table stag-table-sub">
+            <table class="table table-hover text-nowrap">
+                <thead>
+                <tr>
+                    <th>&nbsp;</th>
+<th>File Name</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($subRecords as $subRecord)
+                    <tr>
+                        <td><a href=""><i class="fas fa-share-square"></i></a></td>
+<td><?= $subRecord->file_name ?></td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+
+    </div>
+
+@endsection

+ 2 - 0
routes/generated.php

@@ -96,6 +96,7 @@ Route::prefix('/clients/view/{uid}')->group(function () {
 	Route::get('SUB_mcp_updates', 'clients_SINGLE_Controller@SUB_mcp_updates')->name('clients_SINGLE-SUB_mcp_updates');
 	Route::get('SUB_client_sms', 'clients_SINGLE_Controller@SUB_client_sms')->name('clients_SINGLE-SUB_client_sms');
 	Route::get('SUB_client_sms_numbers', 'clients_SINGLE_Controller@SUB_client_sms_numbers')->name('clients_SINGLE-SUB_client_sms_numbers');
+	Route::get('SUB_client_documents', 'clients_SINGLE_Controller@SUB_client_documents')->name('clients_SINGLE-SUB_client_documents');
 	Route::get('SUB_audit_log', 'clients_SINGLE_Controller@SUB_audit_log')->name('clients_SINGLE-SUB_audit_log');
 	Route::get('ACTION_add_new_measurement', 'clients_SINGLE_Controller@ACTION_add_new_measurement')->name('clients_SINGLE-ACTION_add_new_measurement');
 	Route::get('ACTION_add_new_client_info_line', 'clients_SINGLE_Controller@ACTION_add_new_client_info_line')->name('clients_SINGLE-ACTION_add_new_client_info_line');
@@ -105,6 +106,7 @@ Route::prefix('/clients/view/{uid}')->group(function () {
 	Route::get('ACTION_add_new_care_month', 'clients_SINGLE_Controller@ACTION_add_new_care_month')->name('clients_SINGLE-ACTION_add_new_care_month');
 	Route::get('ACTION_add_new_action_item', 'clients_SINGLE_Controller@ACTION_add_new_action_item')->name('clients_SINGLE-ACTION_add_new_action_item');
 	Route::get('ACTION_add_new_erx_action_item', 'clients_SINGLE_Controller@ACTION_add_new_erx_action_item')->name('clients_SINGLE-ACTION_add_new_erx_action_item');
+	Route::get('ACTION_add_new_client_document', 'clients_SINGLE_Controller@ACTION_add_new_client_document')->name('clients_SINGLE-ACTION_add_new_client_document');
 });
 
 // --- pro: notes --- //