Kaynağa Gözat

added page for pro text shortcuts

Josh 4 yıl önce
ebeveyn
işleme
d5fcf67b0c

+ 8 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -7,6 +7,7 @@ use App\Models\Bill;
 use App\Models\Client;
 use App\Models\Note;
 use App\Models\ProRate;
+use App\Models\ProTextShortcut;
 use App\Models\ProTransaction;
 use Illuminate\Http\Request;
 
@@ -126,6 +127,13 @@ class PracticeManagementController extends Controller
         return view('app.practice-management.bills', compact('bills', 'filter'));
     }
 
+    public function myTextShortcuts(Request $request)
+    {
+        $performer = $this->performer();
+        $myTextShortcuts = ProTextShortcut::where('pro_id', $performer->pro_id)->get();
+        return view('app.practice-management.my-text-shortcuts', compact('myTextShortcuts'));
+    }
+
 
     // video call page (RHS)
     // generic call handle (no uid)

+ 4 - 0
app/Models/ProTextShortcut.php

@@ -9,4 +9,8 @@ class ProTextShortcut extends Model
 
     protected $table = 'pro_text_shortcut';
 
+    public function pro() {
+        return $this->hasOne(Pro::class, 'pro_id', 'id');
+    }
+
 }

+ 49 - 0
resources/views/app/practice-management/my-text-shortcuts.blade.php

@@ -0,0 +1,49 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user-injured"></i>
+                Text Shortcuts
+            </strong>
+           
+        </div>
+        <div class="card-body p-0">
+            <table class="table table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th class="px-3 border-0 w-25">Shortcut</th>
+                    <th class="border-0">Text</th>
+                    <th class="border-0 w-25">&nbsp;</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach($myTextShortcuts as $textShortcut)
+                    <tr>
+                        <td class="px-3">{{ $textShortcut->shortcut }}</td>
+                        <td>{{ $textShortcut->text }}</td>
+                        <td>
+                            <div moe>
+                                <a start show>Update</a>
+                                <form url="/api/clientSms/assignIncomingSmsToClient">
+                                    <input type="hidden" name="uid" value="{{$textShortcut->uid}}">
+                                   
+                                    <div class="form-group m-0">
+                                        <button submit class="btn btn-primary btn-sm">submit</button>
+                                    </div>
+                                </form>
+                            </div>
+                        </td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+        </div>
+    </div>
+    </div>
+
+@endsection

+ 1 - 0
resources/views/layouts/practice-management.blade.php

@@ -17,6 +17,7 @@
                         <li class="nav-item"><a class="nav-link" href="{{ route('practice-management.previousBills') }}">Previous Bills</a></li>
                         <li class="nav-item"><a class="nav-link" href="{{ route('practice-management.financialTransactions') }}">Financial Transactions</a></li>
                         <li class="nav-item"><a class="nav-link" href="{{ route('practice-management.pendingBillsToSign') }}">Pending Bills to Sign</a></li>
+                        <li class="nav-item"><a class="nav-link" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a></li>
                         <li class="nav-item"><a class="nav-link" href="{{ route('practice-management.hr') }}">HR</a></li>
                     </ul>
                 </div>

+ 1 - 0
resources/views/layouts/template.blade.php

@@ -74,6 +74,7 @@
                         <a class="dropdown-item" href="/practice-management/notes/not-yet-signed">Pending Notes to Sign</a>
                         <a class="dropdown-item" href="{{ route('unmapped-sms') }}">Unmapped SMS</a>
                         {{--<a class="dropdown-item" href="/practice-management/hr">HR</a>--}}
+                        <a class="dropdown-item" href="{{ route('practice-management.myTextShortcuts') }}">My Text Shortcuts</a>
                     </div>
                 </li>
             </ul>

+ 1 - 0
routes/web.php

@@ -70,6 +70,7 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('contract', 'PracticeManagementController@contract')->name('contract');
         Route::get('notes/{filter?}', 'PracticeManagementController@notes')->name('notes');
         Route::get('bills/{filter?}', 'PracticeManagementController@bills')->name('bills');
+        Route::get('my-text-shortcuts', 'PracticeManagementController@myTextShortcuts')->name('myTextShortcuts');
     });
 
     Route::name('patients.view.')->prefix('patients/view/{patient}')->group(function () {