Files
streamline-emr/docker/streamline-src/Modules/ClinicalData/Resources/views/sundries/expiring_sundries.blade.php
T

112 lines
5.4 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" />
@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">{{ __('drugs.expired_drugs') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('drugs.dashboard') }}</a></li>
<li><a href="{{ route('drugs.index') }}">{{ __('drugs.drugs') }}</a></li>
<li class="active">{{ __('drugs.expiring') }}</li>
</ol>
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-body">
{{ Form::open(['route' => 'sundries.expiring_sundries']) }}
<div class="form-group">
{{ Form::label('time_period', __('drugs.expiring_with_in')) }}
{{ Form::select('time_period', ['1' => __('drugs.1_week'), '2' => __('drugs.2_weeks'), '4' => __('drugs.1_month'), '0' => __('drugs.expired_drugs')], null, ['class' => 'form-control']) }}
</div>
{{ Form::button(__('drugs.submit'),['type'=>'submit','class'=>'btn btn-success btn-rounded waves-effect waves-light m-r-10']) }}
{{ Form::close() }}
</div>
</div>
</div>
<div class="col-md-8">
<div class="panel panel-default">
<div class="panel-body">
<div class="table-responsive">
<table id="table" class="table table-striped">
<thead>
<tr>
<th>{{ __('drugs.drug_name') }}</th>
<th>{{ __('drugs.store_stock') }}</th>
<th class="shown_input">{{ __('drugs.batch_details') }}</th>
<th>Expiry Date</th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('drugs.drug_name') }}</th>
<th>{{ __('drugs.store_stock') }}</th>
<th class="shown_input">{{ __('drugs.batch_details') }}</th>
<th>Expiry Date</th>
</tr>
</tfoot>
<tbody>
@foreach($sundries as $sundry)
<tr>
<td>{{ get_drug_name($sundry->id) }}</td>
<td>{{ $sundry->store_stock}}</td>
<td>
@php
$quotation_records = get_all_batches_for_this_drug_with_balances($sundry->id, $item_type = 2);
$details_of_batch_in_use = details_of_batch_currently_in_use_sundries($sundry->id);
@endphp
@if(count($quotation_records) > 0)
@foreach($quotation_records as $record)
<div class="row" @if(($record->batch_number == $details_of_batch_in_use['batch_number']) && ($record->id == $details_of_batch_in_use['quotation_id'])) style="background-color: #e1e1ef; border-radius: 5px 5px; padding: 5px 0px;" @endif>
<div class="col-sm-4">
<b>{{ __('drugs.quantity') }} </b>{{ $record->batch_balance }}
</div>
<div class="col-sm-3">
<b>{{ __('drugs.batch') }} </b>{{ $record->batch_number }}
</div>
<div class="col-sm-5">
<b>{{ __('drugs.expiry_date') }} </b>{{ streamline_date($record->expiry_date) }}
</div>
</div><br>
@endforeach
@endif
</td>
<td>{{ streamline_date($sundry->expiry_date) }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/datatables/jquery.dataTables.min.js') }}"></script>
<script>
$('#table').DataTable({
pageLength: 100,
});
</script>
@endpush