Rapport-Laravel/resources/views/report/bfsummary.blade.php

1735 lines
89 KiB
PHP

@extends('layouts.vertical', ['page_title' => 'Datatables'])
@section('css')
<!-- third party css -->
<link href="{{ asset('assets/libs/datatables/datatables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('assets/libs/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
type="text/css" />
<script src="https://cdn.jsdelivr.net/npm/ag-grid-community/dist/ag-grid-community.min.js"></script>
<!-- third party css end -->
<meta name="csrf-token" content="{{ csrf_token() }}" />
<style type="text/css">
.ag-theme-alpine {
--ag-header-column-separator-display: block;
--ag-header-column-separator-height: 20%;
--ag-header-column-separator-width: 1px;
--ag-header-column-separator-color: rgb(0, 0, 0);
}
</style>
@endsection
@section('content')
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row">
<div class="col-md-6 p-2">
<h4 class="page-title">Summary Report</h4>
</div>
</div>
<!-- end page title -->
@if (session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
@if (session()->has('error'))
<div class="alert alert-danger">
{{ session()->get('error') }}
</div>
@endif
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div>
<a href="/report/export" class="btn btn-sm btn-primary" style="margin-bottom: 5px; font-weight: bold">
Export to Excel
</a>
</div>
<div id="myGrid" style="" class="ag-theme-alpine"></div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
<style type="text/css">
.img-thumbnail {
max-width: 100px
}
</style>
@endsection
@section('script')
<!-- third party js -->
<script src="{{ asset('assets/libs/datatables/datatables.min.js') }}"></script>
<script src="{{ asset('assets/libs/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.0/xlsx.full.min.js"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
const columnDefs = [{
headerName: 'RM',
field: 'name',
pinned: 'left',
width: 240,
suppressSizeToFit: true,
filter: 'agTextColumnFilter',
floatingFilter: true,
sortable: true,
},
{
headerName: 'Doctor & Clinic - PT',
children: [{
headerName: 'No of Doctor',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
field: 'pt_doctor_{{$ts}}',
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'pt_doctor_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'pt_doctor_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'No. of Clinic',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'pt_no_of_clinic_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'pt_no_of_clinic_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'pt_no_of_clinic_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
]
},
{
headerName: 'Doctor & Clinic-FT',
children: [{
headerName: 'No of Doctor',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
field: 'ft_doctor_{{$ts}}',
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ft_doctor_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'ft_doctor_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'No. of Clinic',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'ft_no_of_clinic_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ft_no_of_clinic_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'ft_no_of_clinic_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
]
},
{
headerName: 'Patient',
children: [{
headerName: 'New',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'new_patient_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'new_patient_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'new_patient_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'Old',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'old_patient_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'old_patient_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'old_patient_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'Total',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'total_patient_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'total_patient_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'total_patient_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
]
},
{
headerName: 'Patient Per Clinic (High Patient Clinic)',
children: [{
headerName: 'Zero',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'ppc_0_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ppc_0_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'Mar Gr%',
field: 'ppc_0_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: '1 To 4',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'ppc_1-4_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ppc_1-4_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'ppc_1-4_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: '5 To 9',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'ppc_5-9_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ppc_5-9_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'ppc_5-9_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: '10 & Above',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'ppc_10_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'ppc_10_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'ppc_10_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
]
},
{
headerName: 'Business (* Lac)',
children: [{
headerName: 'Cipla',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'business_cipla_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'business_cipla_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'business_cipla_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'Cipla - Others',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'business_cipla_others_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'business_cipla_others_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'business_cipla_others_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'Competitor',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'business_competitor_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'business_competitor_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'business_competitor_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
}
]
},
{
headerName: 'Speciality Wise Doctor Count',
children: [
@foreach($specialities as $speciality)
{
headerName: '{{$speciality->speciality}}',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
@endforeach
]
},
{
headerName: 'Speciality Wise Patient Count',
children: [
@foreach($specialities as $speciality)
{
headerName: '{{$speciality->speciality}}',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'patient_speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'patient_speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'patient_speciality_{{strtolower(str_replace(" ","_",$speciality->speciality))}}_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
@endforeach
]
},
{
headerName: 'Devices (Qty.)',
children: [
@foreach($devices as $device)
{
headerName: '{{str_replace("Activity Devices (Quantity)-", "", $device->name)}}',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: '{{$device->description}}_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: '{{$device->description}}_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: '{{$device->description}}_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
@endforeach
]
},
{
headerName: 'Device Business',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: 'device_total_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: 'device_total_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: 'device_total_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
{
headerName: 'PPE & NI Business Insight (*lac)',
children: [
@foreach($brands as $brand)
{
headerName: '{{str_replace("Activity PPE Brand (Business)-", "", str_replace("Activity NI Brand (Business)-", "", $brand->name))}}',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: '{{$brand->description}}_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: '{{$brand->description}}_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: '{{$brand->description}}_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
@endforeach
@foreach($teams as $team)
{
headerName: '{{str_replace("Activity Team wise PPP & NI Brand Business-", "", $team->name)}}',
children: [
@foreach($days as $ts => $date)
{
headerName: '{{str_replace("1 ","",$date)}}',
field: '{{$team->description}}_{{$ts}}',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
},
@endforeach
{
headerName: 'LM Gr%',
field: '{{$team->description}}_lm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
},
{
headerName: 'First Gr%',
field: '{{$team->description}}_fm',
filter: 'agNumberColumnFilter',
floatingFilter: true,
width: 140,
sortable: true,
valueFormatter: params => {
return params.value + '%'
},
cellStyle: params => {
if (params.value <= 0) {
return {
color: 'white',
backgroundColor: 'red'
};
} else if (params.value >= 10 && params.value <= 15) {
return {
color: 'black',
backgroundColor: 'yellow'
};
} else if (params.value >= 15) {
return {
color: 'black',
backgroundColor: 'green'
};
}
return null;
}
}
]
},
@endforeach
]
},
]
const gridOptions = {
columnDefs: columnDefs,
defaultColDef: {
resizable: true,
},
//rowData: rowData,
domLayout: 'autoHeight',
};
const gridDiv = document.querySelector('#myGrid');
new agGrid.Grid(gridDiv, gridOptions);
$.ajax({
type: "GET",
url: '/report/ajaxdatabfsummary',
processData: false,
contentType: false,
success: function(data) {
gridOptions.api.setRowData(data);
$("#pageloader").fadeOut();
},
});
});
</script>
<!-- end demo js-->
@endsection