Ver código fonte

Added team flyers views

Samson Mutunga 3 anos atrás
pai
commit
a7059d0629

+ 19 - 0
app/Http/Controllers/DnaController.php

@@ -288,6 +288,25 @@ class DnaController extends Controller
         $records = $pro->supplyOrdersPendingHcpApprovalRecordsAsDna();
         return view('app.dna.dashboard.supply_orders_pending_hcp_approval', compact('records'));
     }
+
+    public function teamDashboard(ProTeam $team){
+        $slug = $team->slug ?? $team->uid;
+        $url = config('app.stagfe6_url') . '/flyers/json-list?slug=' . $slug;
+
+        $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.dna.teams.dashboard', compact('team','flyerTemplates'));
+    }
     
 
 }

+ 1 - 1
resources/views/app/dna/my-clinical-teams.blade.php

@@ -28,7 +28,7 @@
                 <tbody>
                     @foreach($teams as $team)
                     <tr>
-                        <td>{{ $team->internal_name }}</td>
+                        <td><a href="{{ route('dna.my-clinical-teams.view.team-dashboard', $team) }}">{{ $team->internal_name }}</a></td>
                         <td></td>
                         <td></td>
                         <td></td>

+ 43 - 0
resources/views/app/dna/teams/dashboard.blade.php

@@ -0,0 +1,43 @@
+@extends('app.dna.teams.single')
+@section('inner-content')
+
+<?php #dump($flyerTemplates); 
+?>
+
+<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>
+			Team 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>
+
+
+@endsection

+ 57 - 0
resources/views/app/dna/teams/single.blade.php

@@ -0,0 +1,57 @@
+@extends(request()->input('popupmode') ? 'layouts.empty' : 'layouts.template')
+<?php
+	$routeName = request()->route()->getName();
+?>
+@section('content')
+<div class="container-fluid h-100 popup-content-container">
+	<div class="main-row h-100">
+		<nav id="sidebarMenu" class="d-block bg-light sidebar collapse px-0">
+			<div class="sidebar-sticky pt-3">
+				<ul class="nav flex-column mcp-theme-1">
+					<li class="nav-item">
+						<a class="nav-link {{ strpos($routeName, 'dna.my-clinical-teams.view.team-dashboard') === 0 ? 'active' : '' }}" href="{{ route('dna.my-clinical-teams.view.team-dashboard', $team) }}">Dashboard</a>
+					</li>
+				</ul>
+				<div class="mt-3 mcp-theme-1">
+					@yield('left-nav-content')
+				</div>
+			</div>
+		</nav>
+		<main role="main" class="w-100 p-0">
+			<div class="card card m-0 rounded-0" id="patient-header">
+				<div id="patient-header-content">
+					<div class="card-header  py-1 hide-inside-ticket-popup">
+						<div class="z">
+							<div class=header>
+
+								<div class="hbox mr-auto">
+									<section>
+										<div class="hbox">
+											<h4 class="pt-name">{{ $team->internal_name }}</h4>
+											<div class="d-inline-flex align-items-baseline">
+												<i class="chart mr-2">{{ $team->slug }}</i>
+												<span class="on-hover-show d-inline-block on-hover-opaque">
+													<i class="fa fa-info-circle ml-1 text-primary"></i>
+													<div class="on-hover-content py-2 pl-3 text-nowrap">
+														{{ $team->web_display_name }}
+													</div>
+												</span>
+											</div>
+										</div>
+									</section>
+								</div>
+							</div>
+						</div>
+					</div>
+				</div>
+				<div class="card-body">
+					<div class="mcp-theme-1">
+						@yield('inner-content')
+					</div>
+				</div>
+			</div>
+		</main>
+	</div>
+</div>
+
+@endsection

+ 5 - 0
routes/web.php

@@ -162,6 +162,11 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('financial-transactions', 'DnaController@financialTransactions')->name('financialTransactions');
             Route::get('my-bills', 'DnaController@myBills')->name('myBills');
             Route::get('my-clinical-teams', 'DnaController@myClinicalTeams')->name('myClinicalTeams');
+            Route::get('my-clinical-teams', 'DnaController@myClinicalTeams')->name('myClinicalTeams');
+            
+            Route::name('my-clinical-teams.view.')->prefix('my-clinical-teams/view/{team}')->group(function () {
+                Route::get('dashboard', 'DnaController@teamDashboard')->name('team-dashboard');
+            });
 
             Route::get('bills', 'DnaController@bills')->name('bills');
             Route::get('erx-and-orders', 'DnaController@erx_and_orders')->name('erx_and_orders');