Files

103 lines
4.8 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/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