Files

237 lines
11 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/typeahead.js-master/dist/typehead-min.css') }}" rel="stylesheet">
<link href="{{ asset('/elite/bower_components/datatables/jquery.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/tables/css/buttons.dataTables.min.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
@endpush
@section('content')
<div class="row bg-title">
<div class="col-lg-3 col-md-4 col-sm-4 col-xs-12">
<h4 class="page-title">{{ __('insurance_members.insurance_members') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('insurance_members.dashboard') }}</a></li>
<li><a href="/insurance/scheme_administration">{{ __('insurance.scheme_administration') }}</a></li>
<li><a href="/insurance_members/">{{ __('insurance_members.insurance_members') }}</a></li>
</ol>
</div>
</div>
@include('flash::message')
@include('insurance::insurance_members.menu')
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-md-4">
<table class="table table-striped table-bordered">
<tr>
<th><b>{{ __('insurance_members.currently_registered_members') }}</b></th>
<td>{{ $total_registered }}</td>
</tr>
<tr>
<th><b>{{ __('insurance_members.members_with_active_insurance') }}</b></th>
<td>{{ $total_active_insurance }}</td>
</tr>
<tr>
<th><b>{{ __('insurance_members.members_with_expired_insurance') }}</b></th>
<td>{{ $total_inactive_insurance }}</td>
</tr>
</table>
</div>
<div class="col-md-8">
{{ Form::open(['route' => 'insurance_members.search', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group" id="full_names">
{{ Form::text('full_name', '', ['class' => 'form-control typeahead', 'placeholder' => 'Patient Name', 'autocomplete' => 'off', 'spellcheck' => false]) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::select('group_id',$insurance_groups_select,'',['class' => 'form-control', 'id' => 'insurance_groups']) }}
</div>
</div>
<div class="col-md-4">
<div class="form-group">
{{ Form::select('member_type',[0 => 'All Members', 1 => __('insurance_members.members_with_active_insurance'), 2 => __('insurance_members.members_with_expired_insurance')],0,['class' => 'form-control']) }}
</div>
</div>
</div>
<div class="row">
<div class="col-md-9">
@if(isset($criteria))
<p>{{ __('insurance_members.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('insurance_members.index') }}">{{ __('insurance_members.clear_search') }}</a></p>
@endif
</div>
<div class="col-md-3">
<button type="submit" class="btn btn-success pull-right"><span class="glyphicon glyphicon-search"></span> {{ __('insurance_members.search') }}</button>
</div>
</div>
{{ Form::close() }}
</div>
</div>
<hr>
<div class="table-responsive">
<table id="table" class="table table-striped color-bordered-table success-bordered-table table-hover">
<thead>
<tr>
<th>{{ __('insurance_members.patient_number') }}</th>
<th>{{ __('insurance_members.name') }}</th>
<th>{{ __('insurance.premium') }}</th>
<th>{{ __('insurance.plan') }}</th>
<th>{{ __('insurance_members.group_name') }}</th>
<th>{{ __('insurance_members.family') }}</th>
<th>{{ __('insurance_members.relationship_to_head') }}</th>
<th>{{ __('insurance_members.patient_category') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($insurance_members as $insurance_member)
<tr>
<td>{{ $insurance_member->number }}</td>
<td>{!! insurance_flag($insurance_member->patient_id) !!}</td>
<td>{{ ugandan_shillings($insurance_member->premium) }}</td>
<td>{{ $plans[$insurance_member->chi_plan] ?? 'N/A' }}</td>
<td>{{ $insurance_groups[$insurance_member->group_id] ?? 'N/A' }}</td>
<td>{{ $insurance_family[$insurance_member->family_id] ?? 'N/A' }}</td>
<td>{{ $relations[$insurance_member->relationship_to_head] ?? 'N/A' }}</td>
<td>{{ $patient_categories[$insurance_member->category_id] ?? 'N/A' }}</td>
<td>
<a href="/insurance_members/{{ $insurance_member->id }}/edit/" class="btn btn-rounded btn-info btn-sm"><i class="fa fa-pencil"></i> {{ __('insurance_members.edit') }}</a>
</td>
<td>
{{ Form::model($insurance_member->id ,['method' => 'DELETE', 'route' => ['insurance_members.destroy', $insurance_member->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger btn-sm" onclick="return confirm('<?php echo __("insurance_members.are_you_sure")?>')"><i class="fa fa-trash"></i> {{ __('insurance_members.delete') }}</button>
{{ Form::close() }}
</td>
<td>
<a href="/insurance_members/details/{{ $insurance_member->id }}" class="btn btn-rounded btn-info btn-sm">{{ __('insurance_members.details') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/typeahead.js-master/dist/typeahead.bundle.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/dataTables.buttons.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.flash.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/jszip.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/pdfmake.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/vfs_fonts.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.html5.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.print.min.js') }}"></script>
<script src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#insurance_groups').select2({
placeholder: "-- select group --"
});
var substringMatcher = function (strs) {
return function findMatches(q, cb) {
var matches, substringRegex;
// an array that will be populated with substring matches
matches = [];
// regex used to determine if a string contains the substring `q`
substrRegex = new RegExp(q, 'i');
// iterate through the pool of strings and for any string that
// contains the substring `q`, add it to the `matches` array
$.each(strs, function (i, str) {
if (substrRegex.test(str)) {
matches.push(str);
}
});
cb(matches);
};
};
$('#full_names .typeahead').typeahead(
{
hint: true,
highlight: true,
minLength: 1
},
{
name: 'full_names',
source: substringMatcher(<?php echo json_encode($full_names); ?>)
}
);
$('.sorting').removeClass('sorting');//remove the sorting class
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
$('#table').DataTable({
dom: 'Bfrtip',
pageLength:20,
buttons: [
'copy',
{extend: 'csv',
message: 'LIST OF INSURANCE MEMBERS'
},
{extend: 'excel',
message: 'LIST OF DRUGS',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
sheetName: 'LIST OF INSURANCE MEMBERS'
},
{extend: 'pdf',
message: 'LIST OF INSURANCE MEMBERS',
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
}
},
{extend: 'print',
message: 'LIST OF INSURANCE MEMBERS',
exportOptions: {
columns: [0, 1, 2, 3, 4, 5]
},
customize: function (win) {
$(win.document.body)
.css('font-size', '10pt')
.css('background', '#fff')
.prepend(
'<img src="<?php echo asset('uploads/logo/logo-sm.png'); ?>" style="position:absolute; top:0; right:0;" />'
);
$(win.document.body).find('table')
.addClass('compact')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush