|
@@ -0,0 +1,189 @@
|
|
|
+@extends ('layouts/template')
|
|
|
+
|
|
|
+@section('content')
|
|
|
+<link href="/select2/select2.min.css" rel="stylesheet" />
|
|
|
+<script src="/select2/select2.min.js"></script>
|
|
|
+<style>
|
|
|
+ #hcp-note-activity-filters label {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ #hcp-note-activity-filters .mw-100px {
|
|
|
+ min-width: 100px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .filter-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ }
|
|
|
+
|
|
|
+ .filter-container>div {
|
|
|
+ width: 165px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .filter-container>div:not(:last-child) {
|
|
|
+ margin-right: 15px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .sm-section {
|
|
|
+ width: 125px !important;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+
|
|
|
+<div id="hcp-note-activity" class="p-3 mcp-theme-1">
|
|
|
+ <div class="card">
|
|
|
+
|
|
|
+ <div class="card-header px-2 py-1 d-flex align-items-center">
|
|
|
+ <strong class="mr-4">
|
|
|
+ <i class="fas fa-user"></i>
|
|
|
+ HCP Note Activity
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div class="card-body p-0 border-0 table-responsive">
|
|
|
+ <div class="m-2">
|
|
|
+
|
|
|
+ <form id="hcp-note-activity-filters" method="GET" action="{{ route('practice-management.hcp-note-activity') }}" class="filter-container" v-cloak>
|
|
|
+ <div class="sm-section" style="width: 250px !important;">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>Pros:</label>
|
|
|
+ <select id="searchForProInput" multiple name="pros_ids[]" class="form-control input-sm" v-model="filters.pros_ids">
|
|
|
+ @if(@$filters['pros_ids'])
|
|
|
+ @foreach($rows as $p)
|
|
|
+ <option value="{{ $p->id }}" selected>{{$p->name_first}} {{$p->name_last}}</option>
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="sm-section">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>From Date:</label>
|
|
|
+ <input type="date" name="from_date" class="form-control input-sm" v-model="filters.from_date">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="sm-section">
|
|
|
+ <div class="form-group">
|
|
|
+ <label>To Date:</label>
|
|
|
+ <input type="date" name="to_date" class="form-control input-sm" v-model="filters.to_date">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="form-group">
|
|
|
+ <label> </label>
|
|
|
+ <div class=" d-flex">
|
|
|
+ <button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
|
|
|
+ <a href="#" v-on:click.prevent="fastLoad('{{route('practice-management.hcp-note-activity')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <table class="table table-sm table-striped border-0 p-0 m-0 text-nowrap">
|
|
|
+ <thead class="bg-light">
|
|
|
+ <tr>
|
|
|
+ <th>First Name</th>
|
|
|
+ <th>Last Name</th>
|
|
|
+ <th>Last Note Created At</th>
|
|
|
+ <th># Notes This Month</th>
|
|
|
+ <th># Notes In the Period</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach ($rows as $row)
|
|
|
+ <tr class="{{false ? 'bg-light' : ''}}">
|
|
|
+ <td class="text-nowrap border-left-0">
|
|
|
+ {{$row->name_first}}
|
|
|
+ </td>
|
|
|
+ <td>{{$row->name_last}}</td>
|
|
|
+ <td>{{friendly_date_time($row->last_note_created_at)}}</td>
|
|
|
+ <td>{{$row->notes_this_month}}</td>
|
|
|
+ <td>{{$row->notes_this_period}}</td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="mt-3">
|
|
|
+ {{$rows->appends(request()->input())->links()}}
|
|
|
+ </div>
|
|
|
+
|
|
|
+</div>
|
|
|
+
|
|
|
+<?php
|
|
|
+$loadedFilters = $filters;
|
|
|
+$allFilterKeys = [
|
|
|
+ 'pros_ids',
|
|
|
+ 'from_date',
|
|
|
+ 'to_date'
|
|
|
+];
|
|
|
+for ($i = 0; $i < count($allFilterKeys); $i++) {
|
|
|
+ if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
|
|
|
+ $loadedFilters[$allFilterKeys[$i]] = '';
|
|
|
+ }
|
|
|
+}
|
|
|
+?>
|
|
|
+<script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ new Vue({
|
|
|
+ el: '#hcp-note-activity',
|
|
|
+ delimiters: ['@{{', '}}'],
|
|
|
+ data: {
|
|
|
+ filters: <?= json_encode($loadedFilters) ?>
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ initSelect2: function(){
|
|
|
+ var select2 = $("#searchForProInput").select2({
|
|
|
+ placeholder: "Search Pro(s) by Name",
|
|
|
+ minimumInputLength: 2,
|
|
|
+ ajax: {
|
|
|
+ url: '/pro-suggest',
|
|
|
+ dataType: 'json',
|
|
|
+ type: "GET",
|
|
|
+ quietMillis: 50,
|
|
|
+ data: function (params) {
|
|
|
+ return {
|
|
|
+ term: params.term,
|
|
|
+ json: true
|
|
|
+ };
|
|
|
+ },
|
|
|
+ results: function (data) {
|
|
|
+ return {
|
|
|
+ results: $.map(data, function (item) {
|
|
|
+ return {
|
|
|
+ text: item.completeName,
|
|
|
+ slug: item.slug,
|
|
|
+ id: item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ init: function() {
|
|
|
+ this.initSelect2();
|
|
|
+ },
|
|
|
+ doSubmit: function() {
|
|
|
+ fastLoad('{{ route("practice-management.hcp-note-activity") }}?' + $('#hcp-note-activity-filters').serialize());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ console.log(this.filters);
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ addMCInitializer('hcp-note-activity', init, '#hcp-note-activity');
|
|
|
+ })();
|
|
|
+</script>
|
|
|
+@endsection
|