|
@@ -1,97 +1,106 @@
|
|
|
@extends ('layouts/template')
|
|
|
|
|
|
@section('content')
|
|
|
-<link href="/select2/select2.min.css" rel="stylesheet" />
|
|
|
-<script src="/select2/select2.min.js"></script>
|
|
|
+ <link href="/select2/select2.min.css" rel="stylesheet" />
|
|
|
+ <script src="/select2/select2.min.js"></script>
|
|
|
|
|
|
-<div class="p-3 mcp-theme-1" id="patients-list">
|
|
|
- <div class="card">
|
|
|
- <div class="card-header px-3 py-2">
|
|
|
- <div class="d-flex align-items-start justify-content-between">
|
|
|
- <div>
|
|
|
- <strong class="mr-4">
|
|
|
- <i class="fas fa-clipboard-list"></i>
|
|
|
- Surveys
|
|
|
- </strong>
|
|
|
+ <div class="p-3 mcp-theme-1" id="patients-list">
|
|
|
+ <div class="card">
|
|
|
+ <div class="card-header px-3 py-2">
|
|
|
+ <div class="d-flex align-items-start justify-content-between">
|
|
|
+ <div>
|
|
|
+ <strong class="mr-4">
|
|
|
+ <i class="fas fa-clipboard-list"></i>
|
|
|
+ Surveys
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ @include('app.admin.surveys.partials.create')
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- @include("app.admin.surveys.partials.create")
|
|
|
- </div>
|
|
|
- </div>
|
|
|
|
|
|
- </div>
|
|
|
- {{-- <div class="p-3">
|
|
|
+ </div>
|
|
|
+ {{-- <div class="p-3">
|
|
|
filter blade
|
|
|
</div> --}}
|
|
|
- <table class="table table-hover bg-white p-0 m-0 table-bordered table-sm border-top border-bottom ">
|
|
|
- <thead class="bg-light">
|
|
|
- <tr>
|
|
|
- <th class="border-0" style="width:150px">Created At</th>
|
|
|
- <th class="border-0" style="width:150px">Title</th>
|
|
|
- <th class="border-0" style="width:200px">Internal Name</th>
|
|
|
- <th class="border-0" style="width:200px">Entity Type</th>
|
|
|
- <th class="border-0">Entity</th>
|
|
|
- <th class="border-0" style="width:180px">Survey Completed</th>
|
|
|
- <th class="border-0" style="width:150px">Access Granted</th>
|
|
|
- <th class="border-0" style="width:200px">Access Link</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- @foreach($records as $record)
|
|
|
- <tr>
|
|
|
- <td>{{ friendly_date($record->created_at) }}</td>
|
|
|
- <td>{{ $record->title }}</td>
|
|
|
- <td>{{ $record->internal_name }}</td>
|
|
|
- <td>{{ $record->entity_type }}</td>
|
|
|
- <td>
|
|
|
- @if($record->entity_type === 'Client')
|
|
|
- {{ $record->getEntity()->displayName() }}
|
|
|
- @else
|
|
|
- ---
|
|
|
- @endif
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- @if($record->survey_data)
|
|
|
- <span class="text-success">Yes</span>
|
|
|
- @include('app.admin.surveys.partials.survey-results')
|
|
|
- @else
|
|
|
- <span class="text-danger">No</span>
|
|
|
- @endif
|
|
|
- </td>
|
|
|
- {{-- <td><?= parseRender(json_decode($record->survey_data ?? '{}')) ?></td> --}}
|
|
|
- <td>
|
|
|
- @if($record->is_accessible_to_target)
|
|
|
- <span class="text-success">Yes</span>
|
|
|
- @else
|
|
|
- <span class="text-danger">No</span>
|
|
|
- @endif
|
|
|
- </td>
|
|
|
- <td>
|
|
|
- @if($record->is_accessible_to_target)
|
|
|
- <a href="{{ route('view-survey-form', $record->access_key) }}" target="_blank" class="mr-2" native>Open Link</a>
|
|
|
- @include("app.admin.surveys.partials.revoke-access-to-target")
|
|
|
- @else
|
|
|
- @include("app.admin.surveys.partials.grant-access-to-target")
|
|
|
- @endif
|
|
|
- </td>
|
|
|
+ <table class="table table-hover bg-white p-0 m-0 table-bordered table-sm border-top border-bottom ">
|
|
|
+ <thead class="bg-light">
|
|
|
+ <tr>
|
|
|
+ <th class="border-0" style="width:150px">Created At</th>
|
|
|
+ <th class="border-0" style="width:150px">Title</th>
|
|
|
+ <th class="border-0" style="width:200px">Internal Name</th>
|
|
|
+ <th class="border-0" style="width:200px">Entity Type</th>
|
|
|
+ <th class="border-0">Entity</th>
|
|
|
+ <th class="border-0" style="width:180px">Survey Completed</th>
|
|
|
+ <th class="border-0" style="width:150px">Access Granted</th>
|
|
|
+ <th class="border-0" style="width:200px">Access Link</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach ($records as $record)
|
|
|
+ <tr>
|
|
|
+ <td>{{ friendly_date($record->created_at) }}</td>
|
|
|
+ <td>{{ $record->title }}</td>
|
|
|
+ <td>{{ $record->internal_name }}</td>
|
|
|
+ <td>{{ $record->entity_type }}</td>
|
|
|
+ <td>
|
|
|
+ @if ($record->entity_type === 'Client')
|
|
|
+ {{ $record->getEntity()->displayName() }}
|
|
|
+ @else
|
|
|
+ ---
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ @if ($record->survey_data)
|
|
|
+ <span class="text-success">Yes</span>
|
|
|
+ @include('app.admin.surveys.partials.survey-results')
|
|
|
+ @else
|
|
|
+ <span class="text-danger">No</span>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ {{-- <td><?= parseRender(json_decode($record->survey_data ?? '{}')) ?></td> --}}
|
|
|
+ <td>
|
|
|
+ @if ($record->is_accessible_to_target)
|
|
|
+ <span class="text-success">Yes</span>
|
|
|
+ @else
|
|
|
+ <span class="text-danger">No</span>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ @if ($record->is_accessible_to_target)
|
|
|
+ <a href="{{ route('view-survey-form', $record->access_key) }}" target="_blank"
|
|
|
+ class="mr-2" native>Open Link</a>
|
|
|
+ @include('app.admin.surveys.partials.revoke-access-to-target')
|
|
|
+ @else
|
|
|
+ @include('app.admin.surveys.partials.grant-access-to-target')
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
|
|
|
- </tr>
|
|
|
- @endforeach
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
|
|
|
- @if(count($records) === 0)
|
|
|
- <tr>
|
|
|
- <td colspan="8">No records found!</td>
|
|
|
- </tr>
|
|
|
- @endif
|
|
|
- </tbody>
|
|
|
+ @if (count($records) === 0)
|
|
|
+ <tr>
|
|
|
+ <td colspan="8">No records found!</td>
|
|
|
+ </tr>
|
|
|
+ @endif
|
|
|
+ </tbody>
|
|
|
|
|
|
- </table>
|
|
|
- </div>
|
|
|
- <div class="p-3">
|
|
|
- {{$records->withQueryString()->links()}}
|
|
|
- </div>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+ <div class="p-3">
|
|
|
+ {{ $records->withQueryString()->links() }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
-</div>
|
|
|
-</div>
|
|
|
-</div>
|
|
|
+ <script>
|
|
|
+ (function($){
|
|
|
+ $('[show-survey-results]').click(function(){
|
|
|
+ var uid = $(this).attr('show-survey-results');
|
|
|
+ $.get("/survey/"+uid+"/preview", {}, function(response){
|
|
|
+ $('#'+uid).html(response);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ })(jQuery);
|
|
|
+ </script>
|
|
|
@endsection
|