Files
streamline-emr/docker/streamline-src/Modules/Investigations/Resources/views/dentals/dental_requisition.blade.php
T

222 lines
12 KiB
PHP

@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" />
@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">{{ __('dentals.dental_requisitions') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('labs.dashboard') }}</a></li>
<li><a href="{{ url('labs') }}">{{ __('dentals.dentals') }}</a></li>
<li class="active">{{ __('dentals.dental_requisitions') }}</li>
</ol>
</div>
</div>
@include('investigations::dentals.menu')
@include('flash::message')
<div class="row">
<div class="col-sm-8">
<div class="row">
<div class="col-sm-12">
<div class="panel">
<div class="panel-heading">{{ __('dentals.dental_requisitions') }}</div>
<div class="panel-body">
{{ Form::open(['route' => 'dentals.dentals_requisition_search', 'method' => 'ANY', 'role' => 'search']) }}
<div class="row">
<div class="col-md-6">
<div class="form-group" id="drug_names">
<input type="hidden" name="item_type" value="4">
{{ Form::select('items_ids[]',$labs,'',['id'=>'labs_ids', 'multiple'=>true, 'class' => 'form-control col-sm-8 labs_ids']) }}
</div>
</div>
<div class="col-md-6">
<button type="submit" class="btn btn-info"><span class="glyphicon glyphicon-search"></span> {{ __('labs.select_requisition_items') }}</button>
</div>
</div>
@if(isset($criteria) && isset($resultCount))
<p>
{{ __('labs.search_criteria') }} : <code>{{ $criteria }}</code> &nbsp;&nbsp;&nbsp;{{ __('labs.total_results') }} : <code>{{ $resultCount }}</code> &nbsp;&nbsp;&nbsp;<a href="{{ route('drugs.index') }}">{{ __('labs.clear_search') }}</a>
</p>
@endif
{{ Form::close() }}
{{ Form::open(['method' => 'post', 'route'=>'dentals.store_dental_requisitions'])}}
<input type="hidden" name="item_type" value="3">
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-striped table-hover"">
<thead>
<tr>
<th style="width: 5%">#</th>
<th style="width: 65%">{{ __('labs.name') }}</th>
<th style="width: 30%">{{ __('labs.quantity_requested') }}</th>
</tr>
</thead>
<tbody>
@if(count($results) > 0)
@php $count = 0; @endphp
@foreach($results as $result)
@php $count++; @endphp
<tr>
<td>{{ $count }}</td>
<td>
{{ $result->name }}
<input type="hidden" name="drug_id[]" value="{{ $result->id }}">
</td>
<td>
<input type="number" name="quantity[]" min="0" class="form-control col-sm-12 compulsory">
</td>
</tr>
@endforeach
@else
<td colspan="3"><span style="color: red;">{{ __('labs.search_records') }}</span></td>
@endif
</tbody>
</table>
</div>
@if(count($results) > 0)
{{ Form::button(__('labs.complete_request'),['type'=>'submit','name'=>'complete_request','value'=>'1','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
@endif
</div>
</div>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="panel">
<div class="panel-heading">{{ __('dentals.previous_dental_requisitions') }}</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th>{{ __('labs.requisition') }} #</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.date_requested') }}</th>
<th>{{ __('labs.status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@if(count($previous_requisitions_results) > 0)
@foreach($previous_requisitions_results as $result)
<tr>
<td># {{ sprintf('%04u', $result->id) }}</td>
<td>
<?php
$drug_id_explode = explode(",", $result->drug_id);
?>
{{ count($drug_id_explode) }} {{ __('labs.items') }}
</td>
<td>
{{ streamline_date($result->created_at) }}
</td>
<td>
@if($result->issue_status == 1)
<label class="label label-success">{{ __('labs.approved') }}</label>
@else
<label class="label label-danger">{{ __('labs.not_approved') }}</label>
@endif
</td>
<td>
<form name="bill_form" action="{{ url('previous_issued_items_details') }}" method="post">
{{ csrf_field() }}
<input type="hidden" name="requisition_id" value="{{ $result->id }}"/>
<input type="hidden" name="item_type" value="4">
<button type="submit" name="add_bill_button" class="btn btn-sm btn-rounded btn-info">
<i class="fa fa-info-circle"></i>
<span style="margin-left: 10px;">{{ __('labs.details') }}</span>
</button>
</form>
</td>
</tr>
@endforeach
@else
<td colspan="7"><span style="color: red;">{{ __('labs.search_records') }}</span></td>
@endif
</tbody>
<tfoot>
<tr>
<th>{{ __('labs.requisition') }} #</th>
<th>{{ __('labs.quantity') }}</th>
<th>{{ __('labs.date_requested') }}</th>
<th>{{ __('labs.status') }}</th>
<th></th>
</tr>
</tfoot>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/select2/select2.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/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/js/mask.js') }}"></script>
<!-- data time piker dependency -->
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<!-- -->
<script>
$('.labs_ids').select2({
placeholder: "Select"
});
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);
};
};
$('#datepicker-autoclose1,#datepicker-autoclose2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
setDate: new Date(),
readOnly: true
});
$('.table').DataTable({
"pageLength": 10,
order: [],
});
</script>
@endpush