Files

158 lines
6.7 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<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_groups.insurance_groups') }}</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_groups.dashboard') }}</a></li>
<li><a href="/insurance/scheme_administration">{{ __('insurance.scheme_administration') }}</a></li>
<li class="active">{{ __('insurance_groups.insurance_groups') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include('insurance::insurance_groups.menu')
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['route' => 'insurance_groups.search_by_group', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::select('group_id',$insurance_groups_select,'',['class' => 'form-control', 'required']) }}
</div>
</div>
<div class="col-md-2">
<button type="submit" class="btn btn-success pull-right"><span class="glyphicon glyphicon-search"></span> View Group Details</button>
</div>
<div class="col-md-7"></div>
</div>
{{ Form::close() }}
<hr>
@if(isset($criteria))
<div class="row">
<div class="col">
<p>{{ __('insurance_members.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('heads_of_family.index') }}">{{ __('insurance_members.clear_search') }}</a></p>
</div>
</div>
@endif
<p class="text-muted m-b-30">{{ __('insurance_groups.export_data_to_csv_and_excel') }}</p>
<div class="table-responsive">
<table id="table" class="table table-striped color-bordered-table success-bordered-table table-hover">
<thead>
<tr>
<th>{{ __('insurance_groups.group_name') }}</th>
<th>{{ __('insurance.risks') }}</th>
<th>{{ __('insurance_groups.contact_name') }}</th>
<th>{{ __('insurance_groups.contact_number') }}</th>
<th>{{ __('insurance_groups.start_date') }}</th>
<th>{{ __('insurance_groups.end_date') }}</th>
<th>{{ __('insurance.date_of_last_fees_billing') }}</th>
<th>{{ __('insurance.date_of_last_fees_payment') }}</th>
<th>{{ __('insurance_groups.insurance_status') }}</th>
<th>{{ __('insurance.email') }}</th>
<th></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($insurance_groups as $insurance_group)
@php
// get payment details for this group
$insurance_subscriptions_details = explode("/", check_insurance_group_status($insurance_group->id));
@endphp
<tr>
<td>{{ $insurance_group->name }}</td>
<td>
@php
$risk_ids_array = is_null($insurance_group->risk_ids) ? [] : explode(",", $insurance_group->risk_ids);
@endphp
@for ($i = 0; $i < count($risk_ids_array); $i++)
- {{ get_name($risk_ids_array[$i], "id", "name", "community_health_insurance_risks") }}
@endfor
</td>
<td>{{ $insurance_group->contact_name }}</td>
<td>{{ $insurance_group->contact_number }}</td>
<td>{{ (isset($insurance_subscriptions_details[1]) && $insurance_subscriptions_details[1] != "NA") ? streamline_date($insurance_subscriptions_details[1]) : "NA" }}</td>
<td>{{ (isset($insurance_subscriptions_details[2]) && $insurance_subscriptions_details[2] != "NA") ? streamline_date($insurance_subscriptions_details[2]) : "NA" }}</td>
<td>{{ is_null($insurance_group->last_fees_billing_date) ? '' : streamline_date($insurance_group->last_fees_billing_date) }}</td>
<td>{{ is_null($insurance_group->last_fees_payment_date) ? '' : streamline_date($insurance_group->last_fees_payment_date) }}</td>
<td>
@if($insurance_subscriptions_details[0] == 1)
<span style="color:green "><strong>{{ __('insurance_groups.active') }}</strong></span>
@else
<span style="color:red "><strong>{{ __('insurance_groups.inactive') }}</strong></span>
@endif
</td>
<td>{{ $insurance_group->group_email }}</td>
<td>
<a href="/insurance_groups/{{ $insurance_group->id }}/edit/" class="btn btn-rounded btn-warning btn-sm"><i class="fa fa-pencil"></i> {{ __('insurance_groups.edit') }}</a>
</td>
<td>
@if(!in_array($insurance_group->id, $used_groups))
{{ Form::model($insurance_group->id ,['method' => 'DELETE', 'route' => ['insurance_groups.destroy', $insurance_group->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger btn-sm" onclick="return confirm('<?php echo __('insurance_groups.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('insurance_groups.delete') }}</button>
{{ Form::close() }}
@endif
</td>
<td>
<a href="/insurance_groups/insurance_group_details/{{ $insurance_group->id }}" class="btn btn-rounded btn-info btn-sm"><i class="fa fa-info-circle"></i> {{ __('insurance_groups.details') }}</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $insurance_groups->links() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.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>
$('#table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
aaSorting:[],
columnDefs: [{
targets: [10,11, 12], /* column index */
orderable: false, /* true or false */
}],
});
$('#insurance_groups').select2();
</script>
@endpush