Files
streamline-emr/docker/_streamline-src/resources/views/audit_trail/index.blade.php
T

307 lines
12 KiB
PHP
Executable File

@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.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/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
type="text/css" />
<style>
th,
td {
white-space: nowrap;
}
,
table {
width: 100%
}
td {
white-space: nowrap;
}
.td-truncate {
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
max-width: 0;
word-break: break-all;
cursor: pointer;
}
,
.td-truncate:hover {
overflow: visible;
white-space: normal;
height: auto;
/* just added this line */
}
</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">{{ __('audit_trail.audit_trail') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('audit_trail.dashboard') }}</a></li>
<li class="active">{{ __('audit_trail.audit_trail') }}</li>
</ol>
</div>
</div>
@include('audit_trail.menu')
<div class="white-box">
{{ Form::open(['route' => 'audit_trail.search']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::label('user_id', __('audit_trail.staff_member')) }}
{{ Form::select('user_id', $user_id, null, ['class' => 'user_id form-control compulsory', 'required'])
}}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('action_performed',__('audit_trail.action_performed')) }}
{{ Form::select('action_performed', $action_performed, null, ['class' => 'action_performed form-control
compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('records_affected', __('audit_trail.records_affected')) }}
{{ Form::select('records_affected', $records_affected, null, ['class' => 'records_affected form-control
compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
{{ Form::label('date_range', __('audit_trail.select_the_date')) }}
<select class="form-control compulsory required" name="dates" id="dates" required>
<option value="ALL">{{ __('audit_trail.all_dates') }}</option>
<option value="today" selected>{{ __('audit_trail.today') }}</option>
<option value="yesterday">{{ __('audit_trail.yesterday') }}</option>
<option value="week">{{ __('audit_trail.last_7') }}</option>
<option value="month">{{ __('audit_trail.last_30') }}</option>
<option value="custom-date">{{ __('audit_trail.custom_date') }}</option>
<option value="custom-range">{{ __('audit_trail.date_range') }}</option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6"></div>
<div class="col-md-3" style="display: none;" id="start-date-div">
<div class="form-group">
{{ Form::label('start_date', __('audit_trail.date_from')) }}
<div class="input-group">
{{ Form::text('start_date', '', ['class' => 'form-control compulsory', 'required', 'readonly', 'id'
=> 'datepicker-from']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="end-date-div">
<div class="form-group">
{{ Form::label('end_date', __('audit_trail.date_to')) }}
<div class="input-group">
{{ Form::text('end_date', '', ['class' => 'form-control compulsory', 'required', 'readonly', 'id' =>
'datepicker-to']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-10">
<Code>Colors Codes</Code>
<span style="color:black" class="badge badge-danger">Deleted</span>
<span style="color:black" class="badge badge-success">Created</span>
<span style="color:black" class="badge badge-info">Updated</span>
<span style="color:black" class="badge badge-warning">Restored</span>
</div>
<div class="col-md-0">
{{ Form::button(__('audit_trail.search'), ['type' => 'submit', 'class' => 'btn btn-success waves-effect
waves-light m-r-10']) }}
</div>
</div>
{{ Form::close() }}
<div class="row">
<div class="col-md-0">
{{ Form::open(['method'=>'post','route' => 'audit_trail_print']) }}
{{ Form::hidden('data', json_encode($audits)) }}
{{ Form::submit('Print', ['style' => 'float: right;', 'class'=>'btn btn-success btn-success']) }}
{{ Form::close() }}
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('No.') }}</th>
<th>{{ __('audit_trail.date_and_time') }}</th>
<th>{{ __('audit_trail.action_performed') }}</th>
<th>{{ __('Old Values') }}</th>
<th>{{ __('New Values') }}</th>
{{-- <th>{{ __('audit_trail.device') }}</th> --}}
<th>{{ __('audit_trail.computer_ip_address') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($audits as $audit)
<tr @class([
'text-success' => $audit->event === "created",
'text-primary' => $audit->event === "updated",
'text-danger' => $audit->event === "deleted",
'text-warning' => $audit->event === "restored",
])>
<td>
{{ $loop->iteration }}
</td>
<td>
{{ streamline_date_time_short($audit->created_at) }}
</td>
<td>
{{
get_audit_trail_action_description(
$audit->auditable_type,
$audit->user_id,
$audit->auditable_id,
$audit->url,
$audit->event,
$audit->record_affected
)
}}
</td>
<td>
{!! format_audit_trail_values($audit, 'old') !!}
</td>
<td>
{!! format_audit_trail_values($audit, 'new') !!}
</td>
{{-- <td class="td-truncate">{{ $audit->user_agent }}</td> --}}
<td>{{ $audit->ip_address }}</td>
<td>
<a
href="/audit_trail/audit_trail_details/{{ $audit->id }}"
class="btn btn-success btn-rounded btn-sm">
{{ __('audit_trail.details') }}
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $audits->links() }}
</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 src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<script type="text/javascript">
function hide(id) {
document.getElementById(id).style.display = 'none';
}
function show(id) {
if (document.getElementById(id).style.display === 'none') {
document.getElementById(id).style.display = '';
}
}
$('#datepicker-from, #datepicker-to').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd-mm-yyyy',
});
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [{
extend: 'copy',
exportOptions: {
columns: [0, 1, 2, 3, 4]
},
title: 'Audit Trail'
},
{
extend: 'csv',
exportOptions: {
columns: [0, 1, 2, 3, 4]
},
title: 'Audit Trail'
},
{
extend: 'pdf',
exportOptions: {
columns: [0, 1, 2, 3, 4]
},
title: 'Audit Trail'
},
{
extend: 'print',
exportOptions: {
columns: [0, 1, 2, 3, 4]
},
title: 'Audit Trail'
}
]
});
$('#dates').change(function() {
var val = $(this).val();
switch (val) {
case 'custom-date':
$('#end-date-div').hide();
$('#start-date-div').show();
break;
case 'custom-range':
$('#end-date-div').show();
$('#start-date-div').show();
break;
default:
$('#end-date-div').hide();
$('#start-date-div').hide();
break;
}
});
$('.user_id,.action_performed,.records_affected,#dates').select2({
placeholder: "-select-"
});
</script>
@endpush