Browse Source

added my-flyers

= 3 years ago
parent
commit
70730c1720

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

@@ -2862,5 +2862,28 @@ ORDER BY c.name_last, c.name_first
 
     }
 
+    public function myFlyers(Request $request){
+        $pro = $this->performer->pro;
+        $slug = $pro->slug ?? $pro->uid;
+        $url = config('app.stagfe6_url') . '/flyers/json-list?slug=' . $slug;
+
+        dd($url);
+
+        $arrContextOptions=array(
+            "ssl"=>array(
+                "verify_peer"=>false,
+                "verify_peer_name"=>false,
+            ),
+        );        
+        $response = @file_get_contents($url, false, stream_context_create($arrContextOptions));
+        $response = @json_decode($response);
+        $flyerTemplates = [];
+        if(isset($response->data)){
+            $flyerTemplates = $response->data;
+        }
+        return view('app.my-flyers', compact('pro','flyerTemplates'));
+
+    }
+
    
 }

+ 45 - 0
resources/views/app/my-flyers.blade.php

@@ -0,0 +1,45 @@
+@extends ('layouts/template')
+
+@section('inner-content')
+<div class="card-body">
+
+    <div class="mcp-theme-1">
+
+        <div class="card">
+
+            <div class="card-header px-3 py-2 d-flex align-items-center">
+                <strong class="text-nowrap">
+                    <i class="fas fa-clipboard"></i>
+                    Flyers
+                </strong>
+            </div>
+            <div class="card-body p-0">
+
+                <table class="table table-sm table-striped p-0 m-0">
+                    <thead class="bg-light">
+                        <tr>
+                            <th class="border-0">Title</th>
+                            <th class="border-0">template</th>
+                            <th class="border-0">url</th>
+                            <th class="border-0">Status</th>
+                            <th class="border-0">&nbsp;</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach($flyerTemplates as $flyer)
+                        <tr>
+                            <td>{{ $flyer->title }}</td>
+                            <td>{{ $flyer->template }}</td>
+                            <td><a href="{{ $flyer->url }}" target="_blank" native>{{ $flyer->url }}</a></td>
+                            <td>{{ $flyer->active ? 'ACTIVE':'INACTIVE' }}</td>
+                            <td></td>
+                        </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            </div>
+        </div>
+
+    </div>
+</div>
+@endsection

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

@@ -219,7 +219,7 @@
                             <a class="dropdown-item" href="{{ route('dna.myBills') }}">My Bills</a>
                             <a class="dropdown-item" href="{{ route('dna.myClinicalTeams') }}">My Clinical Teams</a>
                         @endif
-
+                        <a class="dropdown-item" href="{{ route('practice-management.my-flyers') }}">My Flyers</a>
                     </div>
                 </li>
             </ul>

+ 3 - 0
routes/web.php

@@ -216,6 +216,9 @@ Route::middleware('pro.auth')->group(function () {
 
     Route::name('practice-management.')->prefix('practice-management')->group(function () {
 
+
+        Route::get('my-flyers', 'PracticeManagementController@myFlyers')->name('my-flyers');
+
         Route::get('rpm-matrix', 'PracticeManagementController@rpmMatrix')->name('rpmMatrix');
 
         // rpm work matrix - latest patient with unstamped measurements