|
@@ -1 +1,87 @@
|
|
|
-FILTER
|
|
|
+<?php
|
|
|
+ $filters = request()->all();
|
|
|
+ $cmFilterUrl = "/";
|
|
|
+?>
|
|
|
+<style>
|
|
|
+ #care-month-tiers-filters label {
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+
|
|
|
+ #care-month-tiers-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: 10px;
|
|
|
+ }
|
|
|
+ .sm-section {
|
|
|
+ width: 125px !important;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+</style>
|
|
|
+<form id="care-month-tiers-filters" method="GET" action="{{ $cmFilterUrl }}" class="filter-container" v-cloak>
|
|
|
+ <div class="sm-section">
|
|
|
+ <div class="">
|
|
|
+ <label>Care Month Date:</label>
|
|
|
+ <input type="month" name="cm_start_date" class="form-control input-sm" v-model="filters.cm_start_date">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <div class="">
|
|
|
+ <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('{{ $cmFilterUrl }}')" class="btn btn-link btn-sm text-danger">Clear</a>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</form>
|
|
|
+
|
|
|
+<?php
|
|
|
+$loadedFilters = @$filters;
|
|
|
+$allFilterKeys = [
|
|
|
+ 'cm_start_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: '#care-month-tiers-filters',
|
|
|
+ delimiters: ['@{{', '}}'],
|
|
|
+ data: {
|
|
|
+ filters: <?= json_encode($loadedFilters) ?>
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init: function() {
|
|
|
+
|
|
|
+ },
|
|
|
+ doSubmit: function() {
|
|
|
+ fastLoad("{{ $cmFilterUrl }}?" + $('#care-month-tiers-filters').serialize());
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted: function() {
|
|
|
+ console.log(this.filters);
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ addMCInitializer('care-month-tiers-filters', init, '#care-month-tiers-filters');
|
|
|
+ })();
|
|
|
+</script>
|