Przeglądaj źródła

added note templates

Josh 4 lat temu
rodzic
commit
9b584bd78c

+ 22 - 0
app/Http/Controllers/pros_SINGLE_Controller.php

@@ -442,6 +442,18 @@ class pros_SINGLE_Controller extends Controller
 		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_note_templates
+	public function SUB_note_templates(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_note_templates');
+		}
+		$subRecords = DB::table('note_template_pro')->where('pro_id', $record->id)->get();
+		$result_note_templates = DB::select("select id, title from note_template");
+		return response()->view('admin/pros_SINGLE/SUB_note_templates', compact('record', 'subRecords', 'result_note_templates'), 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();
@@ -576,6 +588,16 @@ class pros_SINGLE_Controller extends Controller
 		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_note_template_pro
+	public function ACTION_add_new_note_template_pro(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_note_template_pro');
+		}
+		return response()->view('admin/pros_SINGLE/ACTION_add_new_note_template_pro', 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();

+ 8 - 0
generatecv/tree.txt

@@ -1081,6 +1081,14 @@ ADMIN
                     responsibility:select:HCP,NA,CM,RME,RMM
                     code*
                     amount:number
+            note_templates
+                id=note_template_pro.pro_id
+                !inc:note_template
+                !qry:note_templates:select id, title from note_template
+                !col:note_template:NoteTemplate:~note_templates:title:id,=,$$note_template_id:all
+                add_new:note_template_pro:create
+                    proUid:hidden=uid
+                    noteTemplateUid:record:note_template:uid,title
             clients
             pro_access
                 id=client_pro_access.pro_id=>/pro_access/view/UID

+ 4 - 0
resources/views/admin/bdt_measurements/index.blade.php

@@ -31,6 +31,8 @@
 <th>Created At</th>
 <th>Created By Session Id</th>
 <th>Type</th>
+<th>Diastolic Bp In Mm Hg</th>
+<th>Systolic Bp In Mm Hg</th>
             </tr>
             </thead>
             <tbody>
@@ -55,6 +57,8 @@
 <td><?= friendly_date_time($record->created_at) ?></td>
 <td><?= $record->created_by_session_id ?></td>
 <td><?= $record->type ?></td>
+<td><?= $record->diastolic_bp_in_mm_hg ?></td>
+<td><?= $record->systolic_bp_in_mm_hg ?></td>
                 </tr>
             @endforeach
             </tbody>

+ 1 - 0
resources/views/admin/pros/subs.blade.php

@@ -1,5 +1,6 @@
 <a href='/pros/view/<?= $record->uid ?>/SUB_dashboard' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_dashboard' ? 'bg-secondary text-white font-weight-bold' : '' }}{{ strpos(request()->route()->getActionMethod(), 'ACTION_') === 0 ? 'bg-secondary text-white font-weight-bold' : '' }}'>Dashboard</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_pro_rates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_pro_rates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Pro Rates</a>
+<a href='/pros/view/<?= $record->uid ?>/SUB_note_templates' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_note_templates' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Note Templates</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_clients' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_clients' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Clients</a>
 <a href='/pros/view/<?= $record->uid ?>/SUB_pro_access' class='d-block px-3 py-2 border-bottom stag-sublink {{ request()->route()->getActionMethod() === 'SUB_pro_access' ? 'bg-secondary text-white font-weight-bold' : '' }}'>Pro Access</a>
 <a href='/pros/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>

+ 48 - 0
resources/views/admin/pros_SINGLE/ACTION_add_new_note_template_pro.blade.php

@@ -0,0 +1,48 @@
+@extends('admin.pros.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 Note Template Pro</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/noteTemplatePro/create">
+        <input type="hidden" name="_success" value="{{route('pros_SINGLE-SUB_note_templates', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('pros_SINGLE-ACTION_add_new_note_template_pro', ['uid' => $record->uid])}}">
+        <input class='form-control' type='hidden' name='proUid' value='{{ old('proUid') ? old('proUid') : $record->uid }}' >
+<div class='form-group mb-3'>
+<label class='control-label'>Note Template </label>
+<select class='form-control' name='noteTemplateUid' value='{{ old('noteTemplateUid') ? old('noteTemplateUid') : '' }}' >
+<option value=''>-- Select --</option>
+<?php $dbOptions = \Illuminate\Support\Facades\DB::table('note_template')->get(); ?>
+<?php foreach($dbOptions as $o): ?>
+<option <?= $o->uid === (old('noteTemplateUid') ? old('noteTemplateUid') : '') ? 'selected' : '' ?> value='<?= $o->uid ?>'><?= $o->title ?> (<?= $o->uid ?>)</option>
+<?php endforeach; ?>
+</select>
+</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('pros_SINGLE-SUB_note_templates', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 38 - 0
resources/views/admin/pros_SINGLE/SUB_note_templates.blade.php

@@ -0,0 +1,38 @@
+<?php /* DO NOT GENERATE */ ?>
+
+@extends('admin.pros.view')
+@section('content-inner')
+
+<div class="pb-3">
+
+    <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
+        <div>Note Templates</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('pros_SINGLE-ACTION_add_new_note_template_pro', ['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>NoteTemplate</th>
+                    <th></th>
+                </tr>
+            </thead>
+            <tbody class="sortable" data-url="/api/noteTemplatePro/sort">
+                @foreach($subRecords as $subRecord)
+                <tr data-uid="{{$subRecord->uid}}">
+                    <td><a href=""><i class="fas fa-share-square"></i></a></td>
+                    <td><?= value_from_rs($result_note_templates, 'title', [['id', '=', $subRecord->note_template_id],], 'all'); ?></td>
+                    <td><a href=""><i class="fa fa-bars"></i></a></td>
+                </tr>
+                @endforeach
+            </tbody>
+        </table>
+    </div>
+
+</div>
+
+@endsection

+ 38 - 0
resources/views/pro/clients_SINGLE/ACTION_add_new_note_template_pro.blade.php

@@ -0,0 +1,38 @@
+@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 Note Template Pro</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/noteTemplatePro/create">
+        <input type="hidden" name="_success" value="{{route('clients_SINGLE-SUB_note_template_pro', ['uid' => $record->uid])}}">
+        <input type="hidden" name="_return" value="{{route('clients_SINGLE-ACTION_add_new_note_template_pro', ['uid' => $record->uid])}}">
+        <input class='form-control' type='hidden' name='noteTemplateUid' value='{{ old('noteTemplateUid') ? old('noteTemplateUid') : $record->uid }}' >
+        <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_note_template_pro', ['uid' => $record->uid])}}" class="btn btn-sm btn-default px-5" up-close>Cancel</a>
+        </div>
+    </form>
+
+    </div></div>
+
+@endsection

+ 52 - 0
resources/views/pro/clients_SINGLE/SUB_note_template_pro.blade.php

@@ -0,0 +1,52 @@
+@extends('pro.clients.view')
+@section('content-inner')
+
+<div class="pb-3">
+
+    <h5 class='my-3 d-flex stag-heading stag-heading-sub'>
+        <div>Note Template Pro</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_note_template_pro', ['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>Note Template Id</th>
+                    <th>Pro Id</th>
+                    <th>Position Index</th>
+                    <th>Created By Session Id</th>
+                    <th>Created At</th>
+                    <th>Type</th>
+                    <th>Is Removed</th>
+                    <th>Removed At</th>
+                    <th>Removed By Session Id</th>
+                    <th>Removal Memo</th>
+                </tr>
+            </thead>
+            <tbody>
+                @foreach($subRecords as $subRecord)
+                <tr>
+                    <td><a href="/note_template/view/{{ $subRecord->uid }}"><i class="fas fa-share-square"></i></a></td>
+                    <td><?= $subRecord->note_template_id ?></td>
+                    <td><?= $subRecord->pro_id ?></td>
+                    <td><?= $subRecord->position_index ?></td>
+                    <td><?= $subRecord->created_by_session_id ?></td>
+                    <td><?= friendly_date_time($subRecord->created_at) ?></td>
+                    <td><?= $subRecord->type ?></td>
+                    <td><?= $subRecord->is_removed ?></td>
+                    <td><?= friendly_date_time($subRecord->removed_at) ?></td>
+                    <td><?= $subRecord->removed_by_session_id ?></td>
+                    <td><?= $subRecord->removal_memo ?></td>
+                </tr>
+                @endforeach
+            </tbody>
+        </table>
+    </div>
+
+</div>
+
+@endsection

+ 2 - 0
routes/generated.php

@@ -381,6 +381,7 @@ Route::prefix('/pros/view/{uid}')->group(function () {
 	Route::get('ACTION_setProType', 'pros_SINGLE_Controller@ACTION_setProType')->name('pros_SINGLE-ACTION_setProType');
 	Route::get('SUB_dashboard', 'pros_SINGLE_Controller@SUB_dashboard')->name('pros_SINGLE-SUB_dashboard');
 	Route::get('SUB_pro_rates', 'pros_SINGLE_Controller@SUB_pro_rates')->name('pros_SINGLE-SUB_pro_rates');
+	Route::get('SUB_note_templates', 'pros_SINGLE_Controller@SUB_note_templates')->name('pros_SINGLE-SUB_note_templates');
 	Route::get('SUB_clients', 'pros_SINGLE_Controller@SUB_clients')->name('pros_SINGLE-SUB_clients');
 	Route::get('SUB_pro_access', 'pros_SINGLE_Controller@SUB_pro_access')->name('pros_SINGLE-SUB_pro_access');
 	Route::get('SUB_mcp_updates', 'pros_SINGLE_Controller@SUB_mcp_updates')->name('pros_SINGLE-SUB_mcp_updates');
@@ -394,6 +395,7 @@ Route::prefix('/pros/view/{uid}')->group(function () {
 	Route::get('SUB_sessions', 'pros_SINGLE_Controller@SUB_sessions')->name('pros_SINGLE-SUB_sessions');
 	Route::get('SUB_audit_log', 'pros_SINGLE_Controller@SUB_audit_log')->name('pros_SINGLE-SUB_audit_log');
 	Route::get('ACTION_add_new_pro_rate', 'pros_SINGLE_Controller@ACTION_add_new_pro_rate')->name('pros_SINGLE-ACTION_add_new_pro_rate');
+	Route::get('ACTION_add_new_note_template_pro', 'pros_SINGLE_Controller@ACTION_add_new_note_template_pro')->name('pros_SINGLE-ACTION_add_new_note_template_pro');
 	Route::get('ACTION_add_new_client_pro_access', 'pros_SINGLE_Controller@ACTION_add_new_client_pro_access')->name('pros_SINGLE-ACTION_add_new_client_pro_access');
 	Route::get('ACTION_add_new_credit_pro_transaction', 'pros_SINGLE_Controller@ACTION_add_new_credit_pro_transaction')->name('pros_SINGLE-ACTION_add_new_credit_pro_transaction');
 	Route::get('ACTION_add_new_debit_pro_transaction', 'pros_SINGLE_Controller@ACTION_add_new_debit_pro_transaction')->name('pros_SINGLE-ACTION_add_new_debit_pro_transaction');