1025 lines
42 KiB
PHP
1025 lines
42 KiB
PHP
@extends('layouts.vertical', ['page_title' => 'Datatables'])
|
|
|
|
@section('css')
|
|
<!-- third party css -->
|
|
<link href="{{asset('assets/libs/select2/select2.min.css')}}" rel="stylesheet" type="text/css" />
|
|
<link href="{{ asset('assets/libs/flatpickr/flatpickr.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')
|
|
<div id="pageloader">
|
|
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
|
|
</div>
|
|
<!-- Start Content-->
|
|
<div class="container-fluid">
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-md-6 p-2">
|
|
<h4 class="page-title">Activity Wise 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 class="row justify-content-between">
|
|
<div class="col-10 filter-section">
|
|
<form class="align-items-center" id="report-form">
|
|
@csrf
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<label for="status-select" class="me-2">Team</label>
|
|
<div class="me-sm-3">
|
|
<select class="form-control select2-multiple" data-toggle="select2" data-width="100%" multiple="multiple" id="team" name="team">
|
|
<option value="team-1">Team 1</option>
|
|
<option value="team-2">Team 2</option>
|
|
<option value="copd">COPD</option>
|
|
<option value="team-4">Team 4</option>
|
|
<option value="orals">Orals</option>
|
|
<option value="arise">Arise</option>
|
|
<option value="neb-1">Neb 1</option>
|
|
<option value="neb-2">Neb 2</option>
|
|
<option value="ph-care">Ph Care</option>
|
|
<option value="misc">Misc</option>
|
|
<option value="neb-misc">Neb Misc</option>
|
|
<option value="inhalation-device">Inhalation Device</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<label for="status-select" class="me-2">Brand</label>
|
|
<div class="me-sm-3">
|
|
<select class="form-control select2-multiple" data-toggle="select2" data-width="100%" multiple="multiple" id="brand" name="brand">
|
|
<option value="ppe-brand-business-seroflo">Seroflo</option>
|
|
<option value="ppe-brand-business-levolin">Levolin</option>
|
|
<option value="ppe-brand-business-foracort">Foracort</option>
|
|
<option value="ppe-brand-business-maxiflo">Maxiflo</option>
|
|
<option value="ppe-brand-business-glycohale-f">Glycohale F</option>
|
|
<option value="ppe-brand-business-duolin">Duolin</option>
|
|
<option value="ppe-brand-business-aerocort">Aerocort</option>
|
|
<option value="ppe-brand-business-budecort">Budecort</option>
|
|
<option value="ppe-brand-business-montair-lc">Montair LC</option>
|
|
<option value="ppe-brand-business-furamist">Furamist</option>
|
|
<option value="ppe-brand-business-budecort-respules">Budecort Respules</option>
|
|
<option value="ppe-brand-business-glycohale-respules">Glycohale Respules</option>
|
|
<option value="ppe-brand-business-levolin-respules">Levolin Respules</option>
|
|
<option value="ppe-brand-business-inhalex-respules">Inhalex Respules</option>
|
|
<option value="ppe-brand-business-foracort-respules">Foracort Respules</option>
|
|
<option value="ppe-brand-business-duolin-respules">Duolin Respules</option>
|
|
<option value="ppe-brand-business-endobloc">Endobloc</option>
|
|
<option value="ppe-brand-business-assurans">Assurans</option>
|
|
<option value="ppe-brand-business-pirfenex">Pirfenex</option>
|
|
|
|
<option value="ppe-brand-business-seroflo-sb">Seroflo SB</option>
|
|
<option value="ppe-brand-business-seroflo-ciphaler">Seroflo Ciphaler</option>
|
|
<option value="ppe-brand-business-levolin-sb">Levolin SB</option>
|
|
<option value="ppe-brand-business-voltido">Voltido</option>
|
|
<option value="ppe-brand-business-foracort-sb">Foracort SB</option>
|
|
<option value="ppe-brand-business-maxiflo-sb">Maxiflo SB</option>
|
|
<option value="ppe-brand-business-glycohale-fb">Glycohale FB</option>
|
|
<option value="ppe-brand-business-nistami">Nistami</option>
|
|
<option value="ppe-brand-business-ablung">Ablung</option>
|
|
<option value="ppe-brand-business-nintib">Nintib</option>
|
|
<option value="ppe-brand-business-hyperneb-respules">Hyperneb Respules</option>
|
|
<option value="ppe-brand-business-foratec-respules">Foratec Respules</option>
|
|
<option value="ppe-brand-business-seromune">Seromune</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6 mt-2">
|
|
<label for="status-select" class="me-2">Region</label>
|
|
<div class="me-sm-3">
|
|
<select class="form-control select2-multiple" data-toggle="select2" data-width="100%" multiple="multiple" id="region" name="region">
|
|
@foreach($regions as $region)
|
|
<option value="{{$region->region}}">{{$region->region}}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6 mt-2">
|
|
<label for="status-select" class="me-2">Select Month</label>
|
|
<div class="me-sm-3">
|
|
<select class="form-control" data-toggle="select2" data-width="100%" id="month" name="month">
|
|
<option selected="July 2023">July 2023</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>
|
|
<div class="col-2">
|
|
<div class="text-lg-end my-1 my-lg-0">
|
|
<button class="btn btn-danger waves-effect waves-light" id="btn-fetch"><i
|
|
class="mdi mdi-search-web me-1"></i>Fetch</button>
|
|
</div>
|
|
</div><!-- end col-->
|
|
</div> <!-- end row -->
|
|
</div>
|
|
</div> <!-- end card -->
|
|
</div> <!-- end col-->
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div>
|
|
<button id="btn-export" class="btn btn-sm btn-primary"
|
|
style="margin-bottom: 5px; font-weight: bold">
|
|
Export to Excel
|
|
</button>
|
|
</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">
|
|
#pageloader {
|
|
background: rgba( 255, 255, 255, 0.8 );
|
|
display: none;
|
|
height: 100%;
|
|
position: fixed;
|
|
width: 100%;
|
|
z-index: 9999;
|
|
}
|
|
|
|
#pageloader img {
|
|
left: 50%;
|
|
margin-left: -32px;
|
|
margin-top: -32px;
|
|
position: absolute;
|
|
top: 50%;
|
|
}
|
|
.img-thumbnail {max-width: 100px}
|
|
.filter-section .form-select {max-width: 150px}
|
|
.filter-section .form-control {max-width: 120px}
|
|
.header-cell {background-color: #a6e1ec;text-align: center;}
|
|
.quarters-cell {background-color: #5bc0de;}
|
|
.row-header {}
|
|
.cell-span {background-color: #f4f7f8;}
|
|
</style>
|
|
|
|
@endsection
|
|
|
|
@section('script')
|
|
<!-- third party js -->
|
|
<script src="{{ asset('assets/libs/flatpickr/flatpickr.min.js') }}"></script>
|
|
<script src="{{ asset('assets/libs/datatables/datatables.min.js') }}"></script>
|
|
<script src="{{ asset('assets/libs/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
|
|
<script src="{{asset('assets/libs/select2/select2.min.js')}}"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.0/xlsx.full.min.js"></script>
|
|
|
|
<script type="text/javascript">
|
|
$('[data-toggle="select2"]').select2();
|
|
$('.datetime').flatpickr({
|
|
dateFormat: "Y-m-d"
|
|
});
|
|
|
|
const columnDefs = [{
|
|
headerName: 'Month',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'month',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Data Type',
|
|
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'data-type',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Activity Type',
|
|
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'activity-type',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Activity Date',
|
|
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'activity-date',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Activity ID',
|
|
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'activity-id',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'RM',
|
|
field: 'rm',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'AM',
|
|
field: 'am',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'EDM',
|
|
field: 'edm',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Zone',
|
|
field: 'zone',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'State Name',
|
|
field: 'state-name',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Mini Region Name',
|
|
field: 'mini-region-name',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Work Location',
|
|
field: 'work-location',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Educator Code',
|
|
field: 'educator-code',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Educator Name',
|
|
field: 'educator-name',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Employee Type',
|
|
field: 'employee-type',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'New MSL Code',
|
|
field: 'msl-code',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Doctor Name',
|
|
field: 'doctor-name',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Doctor Speciality',
|
|
field: 'doctor-speciality',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Pincode',
|
|
field: 'pincode',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'New Patient',
|
|
field: 'new-patient',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Old Patient',
|
|
field: 'old-patient',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'COD',
|
|
field: 'cod',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Synchrobreathe',
|
|
field: 'synchrobreathe',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Respules',
|
|
field: 'respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'New + MDI',
|
|
field: 'new-mdi',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Devices (Quantity)',
|
|
children: [{
|
|
headerName: 'Breathe O Meter',
|
|
field: 'devices-quantity-breathe-o-meter',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Rotahaler',
|
|
field: 'devices-quantity-rotahaler',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Huf Puf Kit',
|
|
field: 'devices-quantity-huf-puf-kit',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Infant Mask Device',
|
|
field: 'devices-quantity-infant-mask-device',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'New Baby Mask',
|
|
field: 'devices-quantity-new-baby-mask',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'New Revolizer',
|
|
field: 'devices-quantity-new-revolizer',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Zerostat Spacer',
|
|
field: 'devices-quantity-zerostat-spacer',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Zerostat VT Spacer',
|
|
field: 'devices-quantity-zerostat-vt-spacer',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Mini Zerostat Spacer',
|
|
field: 'devices-quantity-mini-zerostat-spacer',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
],
|
|
},
|
|
{
|
|
headerName: 'PPE Brand (Business)',
|
|
children: [{
|
|
headerName: 'Seroflo',
|
|
field: 'ppe-brand-business-seroflo',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Levolin',
|
|
field: 'ppe-brand-business-levolin',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Foracort',
|
|
field: 'ppe-brand-business-foracort',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Maxiflo',
|
|
field: 'ppe-brand-business-maxiflo',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Glycohale F',
|
|
field: 'ppe-brand-business-glycohale-f',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Duolin',
|
|
field: 'ppe-brand-business-duolin',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Aerocort',
|
|
field: 'ppe-brand-business-aerocort',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Budecort',
|
|
field: 'ppe-brand-business-budecort',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Montair LC',
|
|
field: 'ppe-brand-business-montair-lc',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Furamist',
|
|
field: 'ppe-brand-business-furamist',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Budecort Respules',
|
|
field: 'ppe-brand-business-budecort-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Glycohale Respules',
|
|
field: 'ppe-brand-business-glycohale-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Levolin Respules',
|
|
field: 'ppe-brand-business-levolin-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Inhalex Respules',
|
|
field: 'ppe-brand-business-inhalex-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Foracort Respules',
|
|
field: 'ppe-brand-business-foracort-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Duolin Respules',
|
|
field: 'ppe-brand-business-duolin-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Endobloc',
|
|
field: 'ppe-brand-business-endobloc',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Assurans',
|
|
field: 'ppe-brand-business-assurans',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Pirfenex',
|
|
field: 'ppe-brand-business-pirfenex',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
],
|
|
},
|
|
{
|
|
headerName: 'NI Brand (Business)',
|
|
children: [{
|
|
headerName: 'Seroflo SB',
|
|
field: 'ni-brand-business-seroflo-sb',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Seroflo Ciphaler',
|
|
field: 'ni-brand-business-seroflo-ciphaler',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Levolin SB',
|
|
field: 'ni-brand-business-levolin-sb',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Voltido',
|
|
field: 'ni-brand-business-voltido',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Foracort SB',
|
|
field: 'ni-brand-business-foracort-sb',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Maxiflo SB',
|
|
field: 'ni-brand-business-maxiflo-sb',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Glycohale FB',
|
|
field: 'ni-brand-business-glycohale-fb',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Nistami',
|
|
field: 'ni-brand-business-nistami',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Ablung',
|
|
field: 'ni-brand-business-ablung',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Nintib',
|
|
field: 'ni-brand-business-nintib',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Hyperneb Respules',
|
|
field: 'ni-brand-business-hyperneb-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Foratec Respules',
|
|
field: 'ni-brand-business-foratec-respules',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Seromune',
|
|
field: 'ni-brand-business-seromune',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
|
|
]
|
|
},
|
|
{
|
|
headerName: 'Team wise PPP & NI Brand Business',
|
|
children: [{
|
|
headerName: 'Team 1',
|
|
field: 'team-wise-ppp-and-ni-brand-business-team-1',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Team 2',
|
|
field: 'team-wise-ppp-and-ni-brand-business-team-2',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'COPD',
|
|
field: 'team-wise-ppp-and-ni-brand-business-copd',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Team 4',
|
|
field: 'team-wise-ppp-and-ni-brand-business-team-4',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Orals',
|
|
field: 'team-wise-ppp-and-ni-brand-business-orals',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Arise',
|
|
field: 'team-wise-ppp-and-ni-brand-business-arise',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Neb 1',
|
|
field: 'team-wise-ppp-and-ni-brand-business-neb-1',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Neb 2',
|
|
field: 'team-wise-ppp-and-ni-brand-business-neb-2',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'PH Care',
|
|
field: 'team-wise-ppp-and-ni-brand-business-ph-care',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
|
|
]
|
|
},
|
|
{
|
|
headerName: 'Team wise (Business)',
|
|
children: [{
|
|
headerName: 'Team 1',
|
|
field: 'team-wise-business-team-1',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Team 2',
|
|
field: 'team-wise-business-team-2',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'COPD',
|
|
field: 'team-wise-business-copd',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Team 4',
|
|
field: 'team-wise-business-team-4',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Orals',
|
|
field: 'team-wise-business-orals',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Arise',
|
|
field: 'team-wise-business-arise',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Neb 1',
|
|
field: 'team-wise-business-neb-1',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Neb 2',
|
|
field: 'team-wise-business-neb-2',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Ph Care',
|
|
field: 'team-wise-business-ph-care',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Misc',
|
|
field: 'team-wise-business-misc',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Neb Misc',
|
|
field: 'team-wise-business-neb-misc',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Resp_Inh_Div',
|
|
field: 'team-wise-business-inhalation-device',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
|
|
]
|
|
},
|
|
{
|
|
headerName: 'Business',
|
|
children: [{
|
|
headerName: 'Cipla',
|
|
field: 'business-cipla',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Cipla - Others',
|
|
field: 'business-cipla-others',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
},
|
|
{
|
|
headerName: 'Competitor',
|
|
field: 'business-competitor',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
width: 170,
|
|
}
|
|
]
|
|
},
|
|
{
|
|
headerName: 'No of Patients',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'no_of_patients',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'No of Device',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'no_of_device',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Cipla Business',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'cipla_business',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Patients Score',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'patients_score',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Device Score',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'device_score',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Business Score',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'business_score',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Total Score',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'total_score',
|
|
width: 140,
|
|
|
|
},
|
|
{
|
|
headerName: 'Clinic Grade',
|
|
filter: 'agTextColumnFilter',
|
|
floatingFilter: true,
|
|
field: 'clinic_grade',
|
|
width: 140,
|
|
}
|
|
|
|
];
|
|
|
|
$('#btn-export').on('click', function() {
|
|
gridOptions.api.exportDataAsCsv();
|
|
});
|
|
|
|
const gridOptions = {
|
|
columnDefs: columnDefs,
|
|
pagination: true,
|
|
|
|
// sets 10 rows per page (default is 100)
|
|
paginationPageSize: 10,
|
|
defaultColDef: {
|
|
resizable: true,
|
|
sortable: true,
|
|
},
|
|
rowData: [],
|
|
domLayout: 'autoHeight',
|
|
};
|
|
|
|
const gridDiv = document.querySelector('#myGrid');
|
|
new agGrid.Grid(gridDiv, gridOptions);
|
|
|
|
function getData(ajaxurl) {
|
|
return $.ajax({
|
|
url: ajaxurl,
|
|
type: 'GET',
|
|
});
|
|
};
|
|
|
|
let final_data = []
|
|
$('#btn-fetch').click(function(){
|
|
$("#pageloader").fadeIn();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: '/report/ajaxdatabfactivitywise', // ?type=regular&month='+$('#month').val()+'&team='+$('#team').val()+'&brand='+$('#brand').val()+'®ion='+$('#region').val()
|
|
processData: false,
|
|
data: new FormData($('#report-form')[0]),
|
|
contentType: false,
|
|
success: function(data) {
|
|
gridOptions.api.setRowData(data.jsondata);
|
|
$("#pageloader").fadeOut();
|
|
final_data = final_data.concat(data.jsondata)
|
|
|
|
for (var i=0; i<data.total; i+=5000) {
|
|
if(i > 0) {
|
|
$.ajax({
|
|
type: "GET",
|
|
async: false,
|
|
url: '/report/ajaxdatabfactivitywise?type=nextpage&fileno=' + (i/5000),
|
|
processData: false,
|
|
contentType: false,
|
|
success: function(data) {
|
|
final_data = final_data.concat(data)
|
|
},
|
|
});
|
|
}
|
|
}
|
|
gridOptions.api.setRowData(final_data);
|
|
|
|
|
|
// let count = 1; let data_finished = false; let i=0;
|
|
// while(!data_finished) {
|
|
// let jobfinished = false
|
|
// $.ajax({
|
|
// type: "GET",
|
|
// url: '/report/ajaxdatabfactivitywise?type=nextpage',
|
|
// processData: false,
|
|
// contentType: false,
|
|
// success: function(data) {
|
|
// console.log(data)
|
|
// jobfinished = true
|
|
// //gridOptions.api.setRowData(data);
|
|
// //$("#pageloader").fadeOut();
|
|
// },
|
|
// });
|
|
|
|
// while(jobfinished == false) {
|
|
// await new Promise(resolve => setTimeout(resolve, 100));
|
|
// }
|
|
|
|
// }
|
|
},
|
|
});
|
|
})
|
|
</script>
|
|
@endsection
|