resolved conflicts

This commit is contained in:
2025-03-31 03:46:05 +03:00
6454 changed files with 1520539 additions and 9 deletions
@@ -0,0 +1,207 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
@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">{{ __('wards.add_ward') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('wards.dashboard') }}</a></li>
<li><a href="{{ route('wards.index') }}">{{ __('wards.wards') }}</a></li>
<li class="active">{{ __('wards.create') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('ward_management::wards.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
@if (session()->has('streamline_setup'))
<h3><font color="blue">{{ __('wards.streamline_setup') }}</font></h3>
<div class="row">
<div class="col-sm-6">
{{ Form::open(['route' => 'wards.store']) }}
<div class="row" id="optionsList">
<div class="col-sm-3">
<div class="form-group">
{{ Form::label('name', __('wards.ward_name')) }}
{{ Form::text('name', '', ['class' => 'form-control',]) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{{ Form::label('beds', __('wards.ward_beds')) }}
{{ Form::number('beds', '', ['class' => 'form-control',]) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{{ Form::label('type', __('wards.hmis_ward')) }}
{{-- {{ Form::number('type', 0, ['class' => 'form-control',]) }} --}}
<select class="form-control " id="type" name="type" >
<option value="" selected disabled>{{ __('wards.select_type') }}</option>
@foreach ($ward_types as $ward_type)
<option value="{{ $ward_type['id'] }}">{{ $ward_type['name'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
{{ Form::label("ward_type", __("wards.type")) }}
<select class="form-control" id="ward_type" name="ward_type">
<option value="" selected disabled>{{ __("wards.select_ward_type") }}</option>
@foreach ($actual_ward_types as $key => $actual_ward_type)
<option value="{{ $key }}">{{ $actual_ward_type }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<a href="#" id="addOption">{{ __('wards.add_another') }}</a><br><br>
</div>
<div class="col-sm-6" style="background: #eceeef;">
<h4>{{ __('wards.select_any') }}</h4>
@for($i=0; $i < count($wards); $i++)
<div class="form-group">
{{ Form::checkbox('selected_wards[]', $wards[$i], false) }} {{ $wards[$i] }} &nbsp;&nbsp;
</div>
@endfor
</div>
</div>
{{ Form::button(__('wards.next'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 next']) }}
{{ Form::button(__('wards.skip'),['type'=>'submit','name' => 'skip', 'value' => 'skip','class'=>'btn btn-default waves-effect waves-light m-r-10']) }}
@else
{{ Form::open(['route' => 'wards.store', 'data-toggle' => 'validator']) }}
<div class="row" id="optionsList">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('name', __('wards.ward_name')) }}
{{ Form::text('name', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('beds', __('wards.ward_beds')) }}
{{ Form::number('beds', '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('type', __('wards.hmis_ward')) }}
<select class="form-control compulsory required" id="type" name="type" required>
<option value="" selected disabled>{{ __('wards.select_type') }}</option>
@foreach ($ward_types as $ward_type)
<option value="{{ $ward_type['id'] }}">{{ $ward_type['name'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('available',__('wards.is_ward_available'), ["class"=>'col-md-12']) }}
&nbsp;&nbsp;{{ __('wards.yes') }} {{ Form::radio('available', 1, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;&nbsp;{{ __('wards.no') }} {{ Form::radio('available', 0, false, ['class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
{{ Form::label('ward_type', __('wards.type')) }}
<select class="form-control" id="ward_type" name="ward_type">
<option value="" selected disabled>{{ __('wards.select_ward_type') }}</option>
@foreach ($actual_ward_types as $key => $actual_ward_type)
<option value="{{ $key }}">{{ $actual_ward_type }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
{{ Form::button(__('wards.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10 submit-btn']) }}
{{ Form::button(__('wards.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
@endif
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<!-- icheck -->
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
<script type="text/javascript">
$('#type, #ward_type').select2();
var ward_types= {!! json_encode($ward_types) !!};
var actual_ward_types = {!! json_encode($actual_ward_types) !!};
$(function() {
$("#addOption").click(function(e) {
e.preventDefault();
$("#optionsList").append("<br>");
$("#optionsList").append("<div class='col-sm-3'><div class='form-group'> <input type='text' name='other_wards[]' placeholder='' class='form-control compulsory'/></div></div>");
$("#optionsList").append("<div class='col-sm-3'><div class='form-group'> <input type='number' name='other_ward_beds[]' value='0' class='form-control compulsory'/></div></div>");
$("#optionsList").append(`<div class='col-sm-3'><div class='form-group'> <select class="form-control compulsory required" id="type" name="other_ward_types[]" required>
<option value="" selected disabled>{{ __('wards.select_type') }}</option>
@foreach ($ward_types as $ward_type)<option value="{{ $ward_type['id'] }}">{{ $ward_type['name'] }}</option>
@endforeach</select></div></div>`);
$("#optionsList").append(`<div class="col-sm-3"><div class="form-group">{{ Form::label("ward_type", __("wards.type")) }}
<select class="form-control" id="ward_type" name="ward_type"><option value="" selected disabled>{{ __("wards.select_ward_type") }}</option>
@foreach ($actual_ward_types as $key => $actual_ward_type)<option value="{{ $key }}">{{ $actual_ward_type }}</option>@endforeach
</select><div class="help-block with-errors"></div></div></div>`);
});
$(".next,.submit-btn").click(function (e) { // make sure that all compulsory fields have been filled out
var empty_compulsory_fields = [];
$(".compulsory").each(function () {
if ($(this).val() == "") {
var textname = $(this).attr('name');
$(this).focus();
empty_compulsory_fields.push(textname);
$(this).css('border','1px solid #F08080');
}
});
/* check if the array containing empty compulsory fields is not empty then return false */
if (empty_compulsory_fields.length != 0) {
alert("Please fill in all compulsory fields");
console.log(empty_compulsory_fields);
e.preventDefault();
return false;
}
});
});
</script>
@endpush
@@ -0,0 +1,240 @@
@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" />
<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">Ward Drugs Stock Sheet</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Ward Drugs Stock Sheet</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-12">
{{ Form::open(['url' => 'ward_drugs_stock_sheet', 'method'=>'ANY', 'role'=>'search']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('ward_id', 'Wards') }}
{{ Form::select('ward_id', $wards, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
<div class="col-md-4">
Showing results from :
<br><h3 style="color: #0060BF; font-weight: bolder;"> {{ is_null($ward_id) ? 'No ward selected' : get_name($ward_id, 'id', 'name', 'wards') }} </h3>
</div>
</div>
{{ Form::close() }}
</div>
<div class="col-sm-12">
<form action="{{ route('wards.update_drugs_stock_sheet') }}" method="POST" name="stock_form" id="stock_form" style="width: 100%">
{{ csrf_field() }}
<input type="hidden" name="ward_id" value="{{ $ward_id }}">
<p class="text-muted m-b-30">Export data to Copy, CSV, Excel, PDF & Print</p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-hover table-striped">
<thead>
<tr>
<th>Drug Name</th>
<th>Batch Details</th>
<th>{{ !is_null($ward_id) ? get_name($ward_id, "id", "name", "wards") : "" }} Stock</th>
<th>Cost Value</th>
<th>Cash Price</th>
<th>Sale Value</th>
</tr>
</thead>
<tbody>
@php $total_cost_value=0; $total_sale_value=0; @endphp
@foreach($ward_stock_records as $record)
@php
$drug = \Streamline\Models\Drug::withTrashed()->find($record->item_id);
$batch_records = \Streamline\Models\ItemBatchWatcher::where(['item_type' => 1, 'item_id' => $record->item_id])->whereRaw('FIND_IN_SET(' . $ward_id . ',ward_id)')->get();
$drug_ward_stock = 0;//dd($batch_records);
$item_cost_value = 0;
@endphp
<tr>
<td>
@if($drug->insurance_coverage == 1)
<span style="color: green;"> {{ $drug->name }} </span>
@else
<span style="color: orange;"> {{ $drug->name }} </span>
@endif
</td>
<td>
@if (count($batch_records) > 0)
@foreach ($batch_records as $record)
@php
$exploded_ward_stocks = $record->ward_stock ? explode(",",$record->ward_stock) : [];
$exploded_ward_ids = $record->ward_id ? explode(",", $record->ward_id) : [];
$ward_id_key = array_search($ward_id, $exploded_ward_ids);
$this_wardz_stock = 0;
if($ward_id_key !== false){
//the ward stock already exists so get it and add this amount
$this_wardz_stock = $exploded_ward_stocks[$ward_id_key] ?? 0;
}
@endphp
<div class="row shown_input" style="background-color: #e1e1ef; border-radius: 5px 5px; border: 2px #c4b7b7 solid; margin-bottom: 2px;">
<div class="col-sm-12" style="word-wrap: break-word; padding: 0px; font-size: 10px">
<b>{{ __('stores.batch') }}: </b>{{ $record->batch_number }}
</div>
<div class="col-sm-12" style="word-wrap: break-word; padding: 0px; font-size: 10px">
<b>{{ __('stores.quantity') }}: </b>{{ $this_wardz_stock }}<br>
@php
$drug_ward_stock += $this_wardz_stock;
$item_cost_value += $record->cost_price * $this_wardz_stock;
@endphp
<b>{{ __('stores.expiry_date') }}: </b>{{ $record->expiry_date }}
</div>
<div class="col-sm-12" style="word-wrap: break-word; padding: 0px; font-size: 10px">
<b>{{ __('stores.unit_cost') }}: </b>{{ $record->cost_price }}
</div>
</div>
<div class="hidden_input" style="display: none;">
<input type="hidden" name="batch_drug_id[]" value="{{ $drug->id }}">
<div class="col-sm-6" style="word-wrap: break-word; padding: 0px; font-size: 10px">
<b>{{ __('stores.batch') }}: </b>{{ $record->batch_number }}
<input type="hidden" name="batch_number[]" value="{{ $record->batch_number }}">
<input type="hidden" name="item_batch_watcher_id[]" value="{{ $record->id }}">
<input type="hidden" name="batch_unit_cost[]" value="{{ $record->cost_price }}">
<input type="hidden" name="batch_expiry_date[]" value="{{ $record->expiry_date }}">
</div>
<div class="col-sm-6" style="word-wrap: break-word; padding: 0px; font-size: 10px">
<input type="text" name="batch_quantity[]" class="form-control" value="{{ $this_wardz_stock }}">
</div>
</div>
@endforeach
@endif
</td>
<td>
<div class="">
{{ $drug_ward_stock }}
</div>
{{-- <div class="hidden_input" style="display: none;">
<input type="hidden" name="drug_id[]" value="{{ $drug->id }}">
<input type="text" name="quantity[]" class="form-control" value="{{ $drug_ward_stock }}">
</div> --}}
</td>
<td>
{{ ugandan_shillings($item_cost_value) }}
</td>
<td>{{ ugandan_shillings($drug->non_insured_price) }}</td>
<td>
{{ ugandan_shillings($drug->non_insured_price * $drug_ward_stock) }}
</td>
@php
$total_cost_value += $item_cost_value;
$total_sale_value += ($drug->non_insured_price * $drug_ward_stock);
@endphp
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th>Drug Name</th>
<th>Batch Details</th>
<th>{{ !is_null($ward_id) ? get_name($ward_id, "id", "name", "wards") : "" }} Stock</th>
<th>Cost Value</th>
<th>Cash Price</th>
<th>Sale Value</th>
</tr>
<tr>
<th></th>
<th></th>
<th>Total:</th>
<th>{{ ugandan_shillings($total_cost_value) }}</th>
<th></th>
<th>{{ ugandan_shillings($total_sale_value) }}</th>
</tr>
</tfoot>
</table>
<div class="hidden_input" style="display: none;">
<br>
{{ Form::label('account_id', __('stores.general_comment')) }}
{{ Form::textarea('general_comment','',['class' => 'form-control', 'placeholder' => __('pharmacy.add_general_comment'), 'rows' => 4]) }}
</div>
<div style="padding: 10px; float: right;">
@if( Auth::user()->can('edit-ward-drug-stock-sheet'))
<button class="btn btn-rounded btn-default" id="cancel_edit" style="display: none;">Cancel</button>
<button class="btn btn-rounded btn-success" id="edit_stock">Edit stock</button>
<input type="submit" value="Save stock" class="btn btn-rounded btn-success" id="save_stock" style="display: none;">
@endif
</div>
</div>
</form>
</div>
</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 src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#edit_stock').click(function(e){
e.preventDefault();
$('.hidden_input,#save_stock').show();
$('.shown_input').hide();
$(this).hide();
});
$('.expiry_date_input').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
</script>
@endpush
@@ -0,0 +1,102 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<link href="{{ asset('elite/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
@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">{{ __('wards.edit_ward') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('wards.dashboard') }}</a></li>
<li><a href="{{ route('wards.index') }}">{{ __('wards.wards') }}</a></li>
<li class="active">{{ __('wards.edit') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('ward_management::wards.menu')
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
{{ Form::model($ward, ['method' => 'PUT', 'route' => ['wards.update',$ward], 'data-toggle' => 'validator']) }}
<div class="form-group">
{{ Form::label('name', __('wards.ward_name')) }}
{{ Form::text('name', $ward->name, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('beds', __('wards.ward_beds')) }}
{{ Form::text('beds', $ward->beds, ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('type', __('wards.hmis_ward')) }}
{{-- {{ Form::text('type', $ward->slug, ['class' => 'form-control compulsory', 'required']) }} --}}
<select class="form-control compulsory required" id="type" name="type" required>
@if (empty($selected_ward_type))
<option value="" selected disabled>{{ __('wards.select_type') }}</option>
@else
@foreach ($selected_ward_type as $selected_ward )
<option value="{{ $selected_ward['id'] }}" selected>{{ $selected_ward['name'] }}</option>
@endforeach
@endif
@foreach ($other_ward_types as $ward_type)
<option value="{{ $ward_type['id'] }}">{{ $ward_type['name'] }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('', __('wards.is_ward_available'), ["class"=>'col-md-12']) }}
&nbsp;&nbsp;{{ __('wards.yes') }} {{ Form::radio('available', 1, $ward->available == 1, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
&nbsp;&nbsp;{{ __('wards.no') }} {{ Form::radio('available', 0, $ward->available == 0, ["required", 'class' => 'check form-control', 'data-radio'=>'iradio_flat-green']) }}
<div class="help-block with-errors"></div>
</div>
<div class="form-group">
{{ Form::label('ward_type', __('wards.type')) }}
<select class="form-control" id="ward_type" name="ward_type">
@if (empty($ward->type))
<option value="" selected disabled>{{ __('wards.select_ward_type') }}</option>
@endif
@foreach ($actual_ward_types as $key => $actual_ward_type)
<option value="{{ $key }}" @php if($key == $ward->type) echo 'selected' @endphp>{{ $actual_ward_type }}</option>
@endforeach
</select>
<div class="help-block with-errors"></div>
</div>
{{ Form::button(__('wards.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10']) }}
{{ Form::button(__('wards.cancel'),['type'=>'reset','class'=>'btn btn-default waves-effect waves-light']) }}
{{ Form::close() }}
</div>
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/js/validator.js') }}"></script>
<script src="{{ asset('elite/bower_components/select2/select2.min.js') }}"></script>
<!-- icheck -->
<script src="{{ asset('elite/bower_components/icheck/icheck.min.js') }}"></script>
<script src="{{ asset('elite/bower_components/icheck/icheck.init.js') }}"></script>
<script type="text/javascript">
$('#type, #ward_type').select2();
</script>
@endpush
@@ -0,0 +1,92 @@
@extends('layouts.main')
@section('content')
<div class="row bg-title">
<div class="col-md-4">
<h4 class="page-title">{{ __('wards.wards_home') }}</h4>
</div>
<div class="col-md-8">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}"><i class="fa fa-boxes"></i> {{ __('home.dashboard') }}</a></li>
<li class="active">{{ __('wards.wards_home') }}</li>
</ol>
</div>
</div>
<div class="white-box">
@include('flash::message')
<div class="row">
<div class="col-md-4">
<h3 class="box-title">{{ __('wards.patient_management') }}</h3>
<ul class="feeds">
@if( Auth::user()->can('ward-list'))
<a href="{{ route('wards.select') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('wards.ward_patient_list') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('pharmacy-ward-dispensing-per-chart'))
<a href="{{ route('pharmacy.ward_dispensing_per_chart') }}">
<li>
<div class="bg-success"><i class="fa fa-plus-circle text-white"></i></div> {{ __('layout.ward_dispensing_per_chart') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-4">
<h3 class="box-title">{{ __('stores.stock_management') }}</h3>
<ul class="feeds">
@if( Auth::user()->can('create-ward-item-request'))
<a href="{{ route('ward_item_request.ward_item_requests') }}">
<li>
<div class="bg-info"><i class="fa fa-medkit text-white"></i></div> {{ __('layout.ward_item_request') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('view-incoming-ward-dispensing-per-chart'))
<a href="{{ url('incoming_ward_charts') }}">
<li>
<div class="bg-info"><i class="fa fa-medkit text-white"></i></div> {{ __('layout.incoming_ward_charts') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('view-incoming-ward-item-requests'))
<a href="{{ route('ward_item_request.incoming_ward_requests') }}">
<li>
<div class="bg-info"><i class="fa fa-medkit text-white"></i></div> {{ __('layout.incoming_ward_item_request') }}<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
<div class="col-md-4">
<h3 class="box-title">{{ __('stores.reports') }}</h3>
<ul class="feeds">
@if( Auth::user()->can('view-ward-drug-stock-sheet'))
<a href="{{ url('ward_drugs_stock_sheet') }}">
<li>
<div class="bg-info"><i class="fa fa-book text-white"></i></div> Ward Drugs Stock Sheet<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
@if( Auth::user()->can('view-ward-sundry-stock-sheet'))
<a href="{{ url('ward_sundries_stock_sheet') }}">
<li>
<div class="bg-info"><i class="fa fa-book text-white"></i></div> Ward Sundries Stock Sheet<i class="fa fa-angle-right float-right" style="padding-top: 12.5px;"></i>
</li>
</a>
@endif
</ul>
</div>
</div>
</div>
@endsection
@@ -0,0 +1,91 @@
@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">{{ __('wards.activate_wards') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('wards.dashboard') }}</a></li>
<li><a href="{{ route('wards.index') }}">{{ __('wards.wards') }}</a></li>
<li class="active">{{ __('wards.activate') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('ward_management::wards.menu')
</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>{{ __('wards.ward_name') }}</th>
<th>{{ __('wards.ward_beds') }}</th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('wards.ward_name') }}</th>
<th>{{ __('wards.ward_beds') }}</th>
<th></th>
</tr>
</tfoot>
<tbody>
@foreach($wards as $ward)
<tr>
<td>{{ $ward->name }}</td>
<td>{{ $ward->beds }}</td>
<td>
{{ Form::model($ward->id ,['method' => 'POST', 'route' => ['wards.activate', $ward->id]]) }}
<button type="submit" class="btn btn-warning" onclick="return confirm('<?php echo __('wards.are_you_sure');?>')"><i class="fa fa-check"></i> {{ __('wards.activate') }}</button>
{{ Form::close() }}
</td>
</tr>
@endforeach
</tbody>
</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'
]
});
</script>
@endpush
@@ -0,0 +1,141 @@
@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">{{ __('wards.wards') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('wards.dashboard') }}</a></li>
<li class="active">{{ __('wards.wards') }}</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
@include('ward_management::wards.menu')
</div>
</div>
@include('flash::message')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('wards.ward_name') }}</th>
<th>{{ __('wards.hmis_ward') }}</th>
<th>{{ __('wards.type') }}</th>
<th>{{ __('wards.ward_beds') }}</th>
<th></th>
<th></th>
</tr>
</thead>
<tfoot>
<tr>
<th>{{ __('wards.ward_name') }}</th>
<th>{{ __('wards.hmis_ward') }}</th>
<th>{{ __('wards.type') }}</th>
<th>{{ __('wards.ward_beds') }}</th>
<th></th>
<th></th>
</tr>
</tfoot>
<tbody>
@foreach($wards as $ward)
<tr>
<td>{{ $ward->name }}</td>
<td>{{ $ward->hmis_ward }}</td>
<td>{{ $ward_types[$ward->type]?? '' }}</td>
<td>{{ $ward->beds }}</td>
<td>
<a href="/wards/{{ $ward->id }}/edit/" class="btn btn-info"><i class="fa fa-pencil"></i> {{ __('wards.edit') }}</a>
</td>
<td>
@if (empty($inpatient_wards[$ward->id]))
{{ Form::model($ward->id ,['method' => 'DELETE', 'route' => ['wards.destroy', $ward->id]]) }}
<button type="submit" class="btn btn-danger" onclick="return confirm('<?php echo __('wards.are_you_sure');?>')"><i class="fa fa-trash"></i> {{ __('wards.delete') }}</button>
{{ Form::close() }}
@else
<b class="text-success">Ward in use</b>
@endif
</td>
</tr>
@endforeach
</tbody>
</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 src="{{ asset('elite/tables/js/buttons.colVis.min.js') }}"></script>
<script type="text/javascript">
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 20,
order: [],
buttons: [
'copy',
{extend: 'csv',
message: '<?php echo __('wards.list_of_wards');?>'
},
{extend: 'excel',
message: '<?php echo __('wards.list_of_wards');?>',
exportOptions: {
columns: [0, 1]
},
sheetName: '<?php echo __('wards.list_of_wards');?>'
},
{extend: 'pdf',
message: '<?php echo __('wards.list_of_wards');?>',
orientation: 'portrait',
pageSize: 'LETTER',
exportOptions: {
columns: [0, 1]
},
customize: function (doc) {
doc.defaultStyle.fontSize = 10;
// doc.styles.tableHeader.alignment = 'left';
}
},
{extend: 'print',
message: '<?php echo __('wards.list_of_wards');?>',
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 table-bordered')
.css('font-size', 'inherit');
}
}
]
});
</script>
@endpush
@@ -0,0 +1,7 @@
<div class="panel panel-default">
<div class="panel-body">
<a href="{{ route('wards.create') }}" class="nav-item btn btn-default ti-plus"> {{ __('wards.add_ward') }}</a>
<a href="{{ route('wards.index') }}" class="nav-item btn btn-default ti-pencil"> {{ __('wards.view_wards') }}</a>
<a href="{{ route('wards.inactive') }}" class="nav-item btn btn-default ti-trash"> {{ __('wards.activate_wards') }}</a>
</div>
</div>
@@ -0,0 +1,724 @@
@extends('layouts.main')
@push('styles')
<link href="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.css') }}" rel="stylesheet"
type="text/css" />
<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('js/gritter/css/jquery.gritter.css') }}" rel="stylesheet" type="text/css" />
<link href="{{ asset('elite/bower_components/select2/select2.min.css') }}" rel="stylesheet" />
<style type="text/css">
.color-tr {
background: #FFFF99;
}
/* The container */
.contained {
display: block;
position: relative;
/*padding-left: 35px;*/
/*margin-bottom: 12px;*/
cursor: pointer;
/*font-size: 22px;*/
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Hide the browser's default radio button */
.contained input {
/*position: absolute;*/
opacity: 0;
cursor: pointer;
}
/* Create a custom radio button */
.checkmark {
position: absolute;
top: 0;
left: 0;
height: 25px;
width: 25px;
background-color: #eee;
border-radius: 50%;
}
/* On mouse-over, add a grey background color */
.contained:hover input~.checkmark {
background-color: #ccc;
}
/* When the radio button is checked, add a blue background */
.contained input:checked~.checkmark {
background-color: #2196F3;
}
/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
content: "";
position: absolute;
display: none;
}
/* Show the indicator (dot/circle) when checked */
.contained input:checked~.checkmark:after {
display: block;
}
/* Style the indicator (dot/circle) */
.contained .checkmark:after {
top: 9px;
left: 9px;
width: 8px;
height: 8px;
border-radius: 50%;
background: white;
}
</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">{{ __('wards.select_ward') }}</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">{{ __('wards.dashboard') }}</a></li>
<li><a href="{{ route('wards.index') }}">{{ __('wards.wards') }}</a></li>
<li class="active">{{ __('wards.select') }}</li>
</ol>
</div>
</div>
@include('flash::message')
@include ('errors.list')
<div class="row">
<div class="col-sm-12">
<div class="white-box">
{{ Form::open(['route' => 'wards.select', 'class' => 'typeahead', 'method' => 'ANY', 'role' => 'search']) }}
{{ Form::hidden('patient_id', 0, ['id' => 'patient_id']) }}
<div class="row">
<div class="col-md-3">
<div class="form-group">
{{ Form::label('ward_id', __('wards.wards')) }}
{{ Form::select('ward_id', $wards, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-2">
<div class="form-group" id="searchby">
{{ Form::label('search_by', __('wards.date')) }}
{{ Form::select('search_by', ['' => '--select--', 0 => 'All Records', 1 => __('wards.today'), 2 => __('wards.yesterday'), 3 => __('wards.custom_date'), 4 => __('wards.custom_range')], '', ['class' => 'form-control','id'=>'search_by', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_search">
<div class="form-group" id="reg_date" style="padding-top: 23px;">
<div class="input-group">
{{ Form::text('reg_date','',['class' => 'form-control compulsory',
'required','readonly','id'=>'datepicker-autoclose']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-3" style="display: none;" id="date_range_search">
<div class="row">
<div class="col-md-6">
<div class="form-group">
{{ Form::label('start_date', __('wards.from')) }}
<div class="input-group">
{{ Form::text('start_date','',['class' => 'form-control
compulsory','readonly','id'=>'datepicker-autoclose-1']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group" id="reg_date">
{{ Form::label('end_date', __('wards.to')) }}
<div class="input-group">
{{ Form::text('end_date','',['class' => 'form-control
compulsory','readonly','id'=>'datepicker-autoclose-2']) }}
<span class="input-group-addon"><i class="icon-calender"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-3">
{{ Form::label('search_patient', __('investigations.search_by_patient')) }}
<div class="input-group">
<select class="form-control" name="patient_number" id="patient_number"></select>
</div>
</div>
<div class="col-md-1">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button(__('wards.submit'),['type'=>'submit','class'=>'btn btn-success waves-effect
waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
</div>
<br>
<h3 style="color: #0060BF; font-weight: bolder;">{{ $search_text }}</h3>
{{ Form::close() }}
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
{{ Form::open(['route' => 'wards.route_patient_episode']) }}
<div class="white-box">
<div class="table-responsive">
<table class="table color-table success-table table-sm">
<thead>
<tr>
<th width="5%">{{ __('wards.bed') }}</th>
<th style="display: none">{{ __('wards.bed') }}</th>
<th width="16%" style="padding-left: 1px; padding-right: 1px;">{{ __('wards.bed_category')
}}</th>
<th width="5%" style="padding-left: 0px; padding-right: 0px;">{{ __('wards.admission') }}
</th>
<th width="20%">{{ __('wards.names') }}</th>
<th width="2%">{{ __('wards.sex') }}</th>
<th width="2%">{{ __('wards.age') }}</th>
<th width="10%">{{ __('wards.triage') }}</th>
<th width="17%">{{ __('wards.primary_diagnosis') }}</th>
<th width="22%">{{ __('wards.comments') }}</th>
<th style="display: none">{{ __('wards.comments') }}</th>
<th width="1%">&nbsp;</th>
</tr>
</thead>
<tbody>
@foreach($inpatients as $inpatient)
@if(\Streamline\Models\PatientEpisode::find($inpatient->episode_id))
<tr id="my_row{{ $inpatient->episode_id }}">
<td style="padding-left: 0px;">
<!-- used for ordering this column -->
<p style="display: none">{{ $inpatient->bed_no }}</p>
<input type="hidden" class="inpatient_id" value="{{ $inpatient->id }}">
<input type="hidden" class="bed_patient_id" value="{{ $inpatient->patient_id }}">
<input class="android-input" name="bed_no" value="{{ $inpatient->bed_no }}" id="bed_no"
onchange="change_bed_number(this.value, <?php echo $inpatient->id ?>)"
style="width: 100%; color: maroon; font-weight: bold; height: 60px; text-align: center;">
<input type="hidden" class="bed_episode_id" value="{{ $inpatient->episode_id }}">
</td>
<td style="display: none">
<!-- used for the print -->
<p>{{ $inpatient->bed_no }}</p>
</td>
<td>
<!-- used for ordering this column -->
<p style="display: none">{{ $inpatient->bed_category }}</p>
<select name="bed_category" class="android-input-select"
onchange="update_bed_category(this.value, <?php echo $inpatient->id ?>)"
style="width: 100%; height: 60px; color: maroon; text-align: center;">
{!! custom_dropdown_selected("inpatient_bed_categories", "id", "name",
$inpatient->bed_category_id) !!}
</select>
</td>
<td style="padding-left: 0px; padding-right: 0px;">
<?php
$admitted_on = new Carbon\Carbon($inpatient->admitted_on);
echo streamline_date($inpatient->admitted_on) . '<br>';
echo "<span style='font-size: smaller; color: #0a776c; font-weight: bold;'>" . $admitted_on->diffInDays(Carbon\Carbon::now()) . ' days</span>';
?>
</td>
<td style="padding-left: 0px;">
<?php
echo insurance_flag($inpatient->patient_id) . '<br>';
echo "<span style='font-size: smaller; color: #0a776c; font-weight: bold;'>" . $inpatient->number . '</span>';
?>
</td>
<td>{{ $inpatient->gender == 1 ? __('wards.male') : __('wards.female') }}</td>
<td>{{ get_patients_age($inpatient->date_of_birth) }}</td>
<td>
@php
$severe_grade = !empty($inpatient->severe_grade)?
severe_grade($inpatient->severe_grade):'N/A';
echo $severe_grade;
@endphp
</td>
<td style="padding-left: 0px; padding-right: 0px;">{{ $inpatient->primary_diagnosis_name ??
'N/A' }}</td>
<td>
<!-- used for ordering this column -->
<p style="display: none">{{ $inpatient->comments }}</p>
<input type="hidden" class="bed_patient_id" value="{{ $inpatient->patient_id }}">
<!--<input value="" >-->
<textarea class="change_comments android-input"
style="color: maroon; width: 100%; padding: 0px; margin: 0px; height: 60px">{{ $inpatient->comments }}</textarea>
<input type="hidden" class="bed_episode_id" value="{{ $inpatient->episode_id }}">
</td>
<td style="display: none">
<!-- used for the print -->
<p>{{ $inpatient->comments }}</p>
</td>
<td>
@if($inpatient->slug == "maternity")
<input type="radio" onchange="show('menu_maternity'), hide('inpatient_buttons_menu')"
class="radio-option-inpatient center" name="episode_id" id="episode_id"
value="{{ $inpatient->episode_id }}" />
@else
<input class="radio-option-inpatient"
onchange="show('inpatient_buttons_menu'), hide('menu_maternity')" type="radio"
name="episode_id" id="episode_id" value="{{ $inpatient->episode_id }}">
@endif
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
<!-- start the show menu buttons divs when a patient is selected -->
<div id="inpatient_buttons_menu" style="display: none;">
<div class="row">
@if(Auth::user()->can('perform-triage') && !is_add_attendance_to_consultation_enabled())
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="triage">{{
__('wards.triage') }}</button>
</div>
@endif
@if(Auth::user()->can('create-consultation'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm" value="consultation">{{
__('wards.consultation') }}</button>
</div>
@endif
@if(Auth::user()->can('view-inpatient-sheet'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm"
value="inpatient_sheet">{{ __('wards.inpatient_sheet') }}</button>
</div>
@endif
@if(Auth::user()->can('view-inpatient-billing'))
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-success btn-block btn-sm"
value="inpatient_billing">{{ __('wards.inpatient_billing') }}</button>
</div>
@endif
<div class="col-sm-2">
<button type="submit" name="submit" class="btn btn-primary btn-block btn-sm"
value="treatment_sheet">{{ __('patient_episode.treatment_sheet') }}</button>
</div>
</div>
</div>
<div class="white-box" id="menu_maternity" style="display: none;">
{{--
<div class="row">
@if(Auth::user()->can('view-maternity-admission'))
<div class="col-sm-3">
<button name="submit" value="maternity_admission" class="btn btn-success pull-right col-sm-12">{{
__('wards.maternity_admission') }}</button>
</div>
@endif
@if(Auth::user()->can('view-delivery-record'))
<div class="col-sm-2">
<button name="submit" value="delivery_record" class="btn btn-success col-sm-12">{{
__('wards.delivery_record') }}</button>
</div>
@endif
@if(Auth::user()->can('view-inpatient-billing'))
<div class="col-sm-3">
<button name="submit" value="maternity_summary" class="btn btn-success col-sm-12">{{
__('wards.inpatient_sheet') }}</button>
</div>
@endif
<div class="col-sm-2"></div>
<div class="col-sm-2">
@if(Auth::user()->can('create-theatre-surgery') || Auth::user()->can('create-theatre-anaesthesia'))
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown"
class="btn btn-info dropdown-toggle waves-effect waves-light col-sm-12" type="button">{{
__('patient_episode.theatre') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
<li><button type="submit" name="submit" value="create_anaesthetics"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.theatre_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="anaesthetics_history"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.historical_anaesthetics') }}</button></li>
<li><button type="submit" name="submit" value="create_surgery"
class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery')
}}</button></li>
<li><button type="submit" name="submit" value="surgery_index"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.historical_surgeries') }}</button></li>
</ul>
</div>
@endif
</div>
</div>
--}}
{{-- Maternity and delivery buttons --}}
{{-- maternity buttons row 1 --}}
<div class="row">
@if (Auth::user()->can('view-maternity-admission'))
<div class="col-sm-2">
<button name="submit" value="maternity_admission" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.maternity_admission') }}</button>
</div>
@endif
@if (Auth::user()->can('view-delivery-record'))
<div class="col-sm-2">
<button name="submit" value="delivery_record" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.delivery_record') }}</button>
</div>
@endif
@if (Auth::user()->can('view-inpatient-sheet'))
<div class="col-sm-2">
<button name="submit" value="maternity_summary" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.inpatient_sheet') }}</button>
</div>
@endif
@if (Auth::user()->can('view-birth-report'))
<div class="col-sm-2">
<button name="submit" value="birth_report" class="btn btn-sm btn-inverse btn-block">NIRA
{{ __('patient_episode.birth_report') }}</button>
</div>
@endif
<div class="col-sm-2"></div>
<div class="col-sm-2">
<div class="btn-group dropup m-r-10 col-sm-12">
<button aria-expanded="false" data-toggle="dropdown"
class="btn btn-sm btn-info dropdown-toggle waves-effect waves-light btn-block"
type="button">{{ __('patient_episode.theatre') }} <span class="caret"></span></button>
<ul role="menu" class="dropdown-menu">
@if (Auth::user()->can('create-anaesthetics'))
<li><button type="submit" name="submit" value="create_anaesthetics"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.theatre_anaesthetics') }}</button>
</li>
@endif
@if (Auth::user()->can('view-anaesthetics-history'))
<li><button type="submit" name="submit" value="anaesthetics_history"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.historical_anaesthetics') }}</button>
</li>
@endif
@if (Auth::user()->can('create-surgery'))
<li><button type="submit" name="submit" value="create_surgery"
class="btn btn-default btn-sm btn-link">{{ __('patient_episode.theatre_surgery')
}}</button>
</li>
@endif
@if (Auth::user()->can('view-surgery'))
<li><button type="submit" name="submit" value="surgery_index"
class="btn btn-default btn-sm btn-link">{{
__('patient_episode.historical_surgeries') }}</button>
</li>
@endif
</ul>
</div>
</div>
</div>
{{-- end of maternity buttons row 1 --}}
{{-- maternity buttons row 2 --}}
<div class="row" style="margin-top:10px;">
@php
$episode_id_id = session()->get('episode_id');
$patient_episode_details = \Streamline\Models\PatientEpisode::find($episode_id_id);
// $patient_id_id = $patient_episode_details->patient_id;
$check_if_labour_admission_exists = \Streamline\Models\LabourWardAdmission::where(
'patient_id',
$patient_id ?? '',
)
->where('episode_id', $episode_id_id)
->first();
@endphp
@if (Auth::user()->can('labour-ward-admission'))
{{-- <div class="col-sm-2">
<button name="submit" value="labour_ward_admission" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.labour_ward_admission') }}</button> --}}
<div class="col-sm-2">
{{-- <button name="submit" value="labour_ward_admission"
class="btn btn-success btn-sm btn-block">{{ __('patient_episode.labour_ward_admission') }}
</button> --}}
{{-- @if (!empty($check_if_labour_admission_exists->complete))
@if ($check_if_labour_admission_exists->complete == 0)
<button name="submit" value="edit_labour_ward_admission_sheet"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@endif
@if ($check_if_labour_admission_exists->complete == 1)
<button name="submit" value="labour_ward_admission_sheet_details"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@endif
@else
<button name="submit" value="labour_ward_admission" class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@endif --}}
{{--
@if ($check_if_labour_admission_exists->complete == 0)
<button name="submit" value="edit_labour_ward_admission_sheet"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@elseif ($check_if_labour_admission_exists->complete == 1)
<button name="submit" value="labour_ward_admission_sheet_details"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@else
<button name="submit" value="labour_ward_admission" class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}</button>
@endif --}}
@if ($check_if_labour_admission_exists !== null)
@if ($check_if_labour_admission_exists->complete == 0)
<button name="submit" value="edit_labour_ward_admission_sheet"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}
</button>
@elseif ($check_if_labour_admission_exists->complete == 1)
<button name="submit" value="labour_ward_admission_sheet_details"
class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}
</button>
@else
<button name="submit" value="labour_ward_admission" class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}
</button>
@endif
@else
<!-- Handle the case where $check_if_labour_admission_exists is null -->
<button name="submit" value="labour_ward_admission" class="btn btn-success btn-sm btn-block">
{{ __('patient_episode.labour_ward_admission') }}
</button>
@endif
</div>
@endif
@if (Auth::user()->can('safe-delivery'))
<div class="col-sm-2">
<button name="submit" value="delivery_record" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.safe_delivery') }}</button>
</div>
@endif
@if (Auth::user()->can('partogram'))
<div class="col-sm-2">
<button name="submit" value="maternity_summary" class="btn btn-success btn-sm btn-block">{{
__('patient_episode.partogram') }}</button>
</div>
@endif
@if (Auth::user()->can('labour-ward-overview'))
<div class="col-sm-2">
<button name="submit" value="birth_report" class="btn btn-sm btn-inverse btn-block">{{
__('patient_episode.labour_ward_overview') }}</button>
</div>
@endif
</div>
{{-- End maternity buttons row 2 --}}
{{-- End of Maternity and delivery buttons --}}
</div>
<!-- end of buttons divs that show when a patient is selected -->
{{ Form::close() }}
</div>
</div>
@endsection
@push('scripts')
<script src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.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/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/select2/select2.min.js') }}"></script>
<script type="text/javascript">
$('#search_by').change(function () {
if ($(this).val() == 3) {
$('#date_search').show();
$('#date_range_search').hide();
} else if ($(this).val() == 4) {
$('#date_range_search').show();
$('#date_search').hide();
} else {
$('#date_search,#date_range_search').hide();
}
});
$('#patient_number').change(function () {
let id = $('#patient_number').val();
$('#patient_id').val(id);
});
$('#patient_number').select2({
placeholder: 'Search by patient details (names and number)',
ajax: {
url: '/patients/search_patient_by_name_number',
dataType: 'json',
delay: 250,
processResults: function (data) {
return {
results: $.map(data, function (item) {
return {
text: item.first_name + " " + item.last_name + " (" + item.number + ")",
id: item.id
}
})
};
},
cache: true
}
});
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 50,
buttons: [
{extend: 'print',
exportOptions: {
stripHtml: false,
columns: [1, 3, 4, 5, 6, 7, 8, 10]
},
title: '{{ __('wards.ward_patient_list') }}'
},
{
extend: 'pdf',
exportOptions: {
columns: [1, 3, 4, 5, 6, 7, 8, 10]
},
title: '{{ __('wards.ward_patient_list') }}'
}
]
});
$('.sorting').removeClass('sorting');//remove the sorting class
$('.sorting_asc').removeClass('sorting_asc');//remove the sorting class
$('#datepicker-autoclose,#datepicker-autoclose-1,#datepicker-autoclose-2').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
$('.radio-option-inpatient').change(function(){
//this is to highlight the clicked episode row
let episode_id = $(this).val();
if (this.checked) {
// remove the class that highlights the selected row
$('[id^=my_row]').css("background-color", "transparent");
$('#my_row'+episode_id).css("background", "#FFFF99");
}
});
$('#datepicker-autoclose').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy'
});
function change_bed_number(bed_no, inpatient_id) {
var data = "bed_no=" + bed_no + "&inpatient_id=" + inpatient_id;
$.ajax({
type: "POST",
url: "/submit_bed_number",
data: data,
cache: false,
success: function (result) {
if (result === "success") {
alert('<?php echo __('wards.bed_no_saved'); ?>');
} else {
alert("<?php echo __('wards.error_occurred'); ?>");
}
}
});
}
//start update of ward comment
$('.change_comments').each(function () {
$(this).change(function () {
var comment = $(this).val();
var patient_id = $(this).prev(".bed_patient_id").val();
var episode_id = $(this).next(".bed_episode_id").val();
var data = "comment=" + comment + "&patient_id=" + patient_id + "&episode_id=" + episode_id;
$.ajax({
type: "POST",
url: "/submit_ward_message",
data: data,
cache: false,
success: function (result) {
if (result === "success") {
alert('<?php echo __('wards.comments_saved'); ?>');
} else {
alert("<?php echo __('wards.error_occurred'); ?>");
}
}
});
});
});
//end update of ward comment
function update_bed_category(category_id, inpatient_id) {
var data = "bed_category=" + category_id + "&inpatient_id=" + inpatient_id;
$.ajax({
type: "POST",
url: "/submit_bed_category",
data: data,
cache: false,
success: function (result) {
if (result === "success") {
alert("<?php echo __('wards.bed_category_saved'); ?>");
} else {
alert("<?php echo __('wards.error_occurred'); ?>");
}
}
});
}
function show(id) {
if (document.getElementById(id).style.display === 'none') {
document.getElementById(id).style.display = '';
}
}
function hide(id) {
document.getElementById(id).style.display = 'none';
}
</script>
@endpush
@@ -0,0 +1,156 @@
@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" />
<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">Ward Sundries Stock Sheet</h4>
</div>
<div class="col-lg-9 col-sm-8 col-md-8 col-xs-12">
<ol class="breadcrumb">
<li><a href="{{ route('home') }}">Dashboard</a></li>
<li class="active">Ward Sundries Stock Sheet</li>
</ol>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<!--Flash messages at the top -->
@include('flash::message')
<div class="white-box">
<div class="row">
<div class="col-sm-12">
{{ Form::open(['url' => 'ward_sundries_stock_sheet','method'=>'ANY','role'=>'search']) }}
<div class="row">
<div class="col-md-4">
<div class="form-group">
{{ Form::label('ward_id', 'Wards') }}
{{ Form::select('ward_id', $wards, '', ['class' => 'form-control compulsory', 'required']) }}
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-4">
<div class="form-group" style="padding-top: 5px;"><br>
{{ Form::button('Submit',['type'=>'submit','class'=>'btn btn-success waves-effect waves-light m-r-10', 'id'=>'select_patient']) }}
</div>
</div>
<div class="col-md-4">
Showing results from :
<br><h3 style="color: #0060BF; font-weight: bolder;"> {{ is_null($ward_id) ? 'No ward selected' : get_name($ward_id, 'id', 'name', 'wards') }} </h3>
</div>
</div>
{{ Form::close() }}
</div>
<div class="col-sm-12">
<form action="{{ route('wards.update_sundries_stock_sheet') }}" method="POST" name="stock_form" id="stock_form" style="width: 100%">
{{ csrf_field() }}
<input type="hidden" name="ward_id" value="{{ $ward_id }}">
<p class="text-muted m-b-30">Export data to Copy, CSV, Excel, PDF & Print</p>
<div class="table-responsive">
<table class="table color-bordered-table success-bordered-table table-hover table-striped">
<thead>
<tr>
<th>Sundry Name</th>
<th>{{ !is_null($ward_id) ? get_name($ward_id, "id", "name", "wards") : "" }} Stock</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Sundry Name</th>
<th>{{ !is_null($ward_id) ? get_name($ward_id, "id", "name", "wards") : "" }} Stock</th>
</tr>
</tfoot>
<tbody>
@foreach($ward_stock_records as $record)
@php
$sundry = \Streamline\Models\Sundry::withTrashed()->find($record->item_id);
if (!$sundry) {
continue;
}
@endphp
<tr>
<td>
@if($sundry->insurance_coverage == 1)
<span style="color: green;"> {{ $sundry->name }} </span>
@else
<span style="color: orange;"> {{ $sundry->name }} </span>
@endif
</td>
<td>
<div class="shown_input">
{{ $record->ward_item_stock }}
</div>
<div class="hidden_input" style="display: none;">
<input type="hidden" name="sundry_id[]" value="{{ $sundry->id }}">
<input type="text" name="quantity[]" class="form-control" value="{{ $record->ward_item_stock }}">
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
<div style="padding: 10px; float: right;">
@if( Auth::user()->can('edit-ward-sundry-stock-sheet'))
<button class="btn btn-rounded btn-default" id="cancel_edit" style="display: none;">Cancel</button>
<button class="btn btn-rounded btn-success" id="edit_stock">Edit stock</button>
<input type="submit" value="Save stock" class="btn btn-rounded btn-success" id="save_stock" style="display: none;">
@endif
</div>
</div>
</form>
</div>
</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 src="{{ asset('elite/bower_components/bootstrap-datepicker/bootstrap-datepicker.min.js') }}"></script>
<script type="text/javascript">
$('.table').DataTable({
dom: 'Bfrtip',
pageLength: 100,
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print'
]
});
$('#edit_stock').click(function(e){
e.preventDefault();
$('.hidden_input,#save_stock').show();
$('.shown_input').hide();
$(this).hide();
});
$('.expiry_date_input').datepicker({
autoclose: true,
todayHighlight: true,
format: 'yyyy-mm-dd',
});
</script>
@endpush