Files

151 lines
6.9 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" />
@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">{{ __('symptoms.symptoms') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('symptoms.dashboard') }}</a></li>
<li><a href="{{ route('clinical_data.index') }}">{{ __('symptoms.clinical_data_home') }}</a></li>
<li><a href="{{ route('symptoms.index') }}">{{ __('symptoms.symptoms') }}</a></li>
<li class="active">{{ __('symptoms.view') }}</li>
</ol>
</div>
</div>
@include('clinical_data::symptoms.menu')
@include('flash::message')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped table-hover color-bordered-table success-bordered-table">
<thead>
<tr>
<th>{{ __('symptoms.symptom') }}</th>
<th>{{ __('symptoms.prompt') }}</th>
<th>{{ __('symptoms.reference_text') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($symptoms as $symptom)
<tr>
<td>{{ $symptom->name }}</td>
<td>{{ $symptom->prompts }}</td>
<td>
@php
$reference_areas_array = explode(",", $symptom->reference_link);
$reference_names_array = explode(",", $symptom->reference_text);
@endphp
<ol>
@for ($x = 0; $x < count($reference_areas_array); $x++)
@if($reference_areas_array[$x] != '')
<li>
<a href="{{ $reference_areas_array[$x] }}" target="_blank">
{{ isset($reference_names_array[$x]) ? $reference_names_array[$x] : '' }}
</a>
</li>
@endif
@endfor
</ol>
</td>
<td>
<a href="/symptoms/{{ $symptom->id }}/edit/" class="btn btn-rounded btn-warning"><i class="fa fa-pencil"></i> {{ __('symptoms.edit') }}</a>
</td>
<td>
@if (!in_array($symptom->id, $symptom_data))
{{ Form::model($symptom->id ,['method' => 'DELETE', 'route' => ['symptoms.destroy', $symptom->id]]) }}
<button type="submit" class="btn btn-rounded btn-danger" onclick="return confirm('<?php echo __('symptoms.are_you_sure')?>')"><i class="fa fa-trash"></i> {{ __('symptoms.delete') }}</button>
{{ Form::close() }}
@else
<b class="text-success">Symptom recorded</b>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
{{ $symptoms->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/tables/js/buttons.colVis.min.js') }}"></script>
<script>
$('.table').DataTable({
dom: 'Bfrtip',
bInfo: false,
bPaginate: false,
buttons: [
'copy',
{extend: 'csv',
message: 'LIST OF SYMPTOMS'
},
{extend: 'excel',
message: 'LIST OF SYMPTOMS',
exportOptions: {
columns: [0, 1]
},
sheetName: 'LIST OF SYMPTOMS ON STREAMLINE'
},
{extend: 'pdf',
message: 'LIST OF SYMPTOMS',
orientation: 'landscape',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: 'LIST OF SYMPTOMS',
exportOptions: {
columns: [0, 1]
},
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