{{-- ICTHospital - hospital departments. Inline edit, one form per row, declared above the table and referenced by the HTML form attribute. A form element cannot wrap a table row, and nesting them in the cells makes the browser reparent the markup and post the wrong row. Copyright (c) DEVtrust Part of ICTHospital Licensed under the GNU General Public License v3.0. --}} @extends('layouts.master') @section('style') @stop @section('content') @if (Session::get('success'))
{{ Session::get('success') }}
@endif @if (Session::get('error'))
{{ Session::get('error') }}
@endif

Departments

@if (count($errors) > 0)
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if ($unlisted->isNotEmpty())

{{ $unlisted->count() }} department(s) are in use by doctors but not on this list: {{ $unlisted->implode(', ') }}.

They were typed into the doctor form before this screen existed. Adopting them puts them on the list so they can be renamed properly from here.

{{ csrf_field() }}
@endif @foreach ($departments as $department)
{{ csrf_field() }}
{{ csrf_field() }}
@endforeach @if ($departments->isEmpty())

No departments yet. The doctor form offers this list, so filling it in keeps the spelling consistent across the register.

@else

Renaming a department here moves every doctor in it to the new name, because the doctor record stores the department as text.

@foreach ($departments as $department) @endforeach
Department Description Doctors
@php($n = $usage[$department->name] ?? 0) @if ($n > 0) {{ $n }} @else 0 @endif
@endif

Add a department

{{ csrf_field() }}
@stop @section('script') @stop