Files

124 lines
5.7 KiB
PHP

@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" />
<style type="text/css">
.color-bordered-table.success-bordered-table {
border-top: 0px;
}
</style>
@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">{{ __('risks.risk') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('risks.dashboard') }}</a></li>
<li><a href="{{ route('risks.create') }}">{{ __('risks.risk') }}</a></li>
<li class="active">{{ __('risks.index') }}</li>
</ol>
</div>
</div>
@include('insurance::risks.menu')
<div class="row">
<div class="col-sm-12">
@include('flash::message')
<div class="white-box">
@if (session('success'))
<div class="alert alert-success">
{{ session('success') }}
</div>
@endif
<p class="text-muted m-b-30">{{ __('risks.export_data_to_csv_excel_print') }}</p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table">
<thead>
<tr>
<th>#</th>
<th>{{ __('risks.risk_name') }}</th>
<th>{{ __('risks.risk_code') }}</th>
<th>{{ __('risks.risk_factor') }}</th>
<th>{{ __('risks.risk_amount') }}</th>
<th>{{ __('risks.creator') }}</th>
<th>{{ __('risks.date') }}</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
@php $counter = 1; @endphp
@foreach($risks as $risk)
<tr>
<td>{{ $counter }}</td>
<td>{{ $risk->name }}</td>
<td>{{ $risk->code }}</td>
<td>{{ $risk->factor }}</td>
<td>{{ ugandan_shillings($risk->amount) }}</td>
<td>{{ get_full_name($risk->created_by, "id", 'first_name', 'last_name', 'users') }}</td>
<td>{{ streamline_date_time_short($risk->created_at) }}</td>
<td>
@if (Auth::user()->can('insurance-risk-edit'))
<a class="btn btn-sm btn-warning btn-rounded" href="{{ route('risks.edit',$risk->id) }}"><i class="fa fa-pencil"></i> {{ __('risks.edit') }}</a>
@endif
<a class="btn btn-sm btn-rounded btn-info" href="{{ route('risks.show',$risk->id) }}"><i class="fa fa-info-circle"></i> {{ __('risks.view') }}</a>
@if (Auth::user()->can('insurance-risk-delete'))
{{ Form::model($risk->id ,['method' => 'DELETE', 'route' => ['risks.destroy', $risk->id]]) }}
<button type="submit" class="btn btn-sm btn-rounded btn-danger" onclick="return confirm('<?php echo __('risks.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('risks.delete') }}</button>
{{ Form::close() }}
@endif
</td>
</tr>
@php $counter++; @endphp
@endforeach
</tbody>
<tfoot>
<tr>
<th>#</th>
<th>{{ __('risks.risk_name') }}</th>
<th>{{ __('risks.risk_code') }}</th>
<th>{{ __('risks.risk_factor') }}</th>
<th>{{ __('risks.risk_amount') }}</th>
<th>{{ __('risks.creator') }}</th>
<th>{{ __('risks.date') }}</th>
<th>Actions</th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<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>
$('.table').DataTable({
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
],
pageLength: 10,
order: [],
});
</script>
@endpush