@extends('layouts.vertical') @php $is_update = false; if(isset($event) && !empty($event)){ $is_update = true; } @endphp @section('css') @endsection @section('breadcrumb')

{{ $is_update ? "Edit details" : "Add new event" }}

@endsection @section('content')
@csrf @if($is_update) @endif
Event details
@if($errors->has('name')) @endif
image) style="display: none" @endif> image) src="{{ $event->image }}" @endif alt="">
@if($errors->has('image')) @endif
image) style="display: none" @endif>
@if($errors->has('start_date')) @endif
@if($errors->has('end_date')) @endif
@if($errors->has('location')) @endif
eventFor)) checked @endif data-error="eventFor-error" @if ($is_update && in_array(3, $event->eventFor)) disabled @endif>
eventFor)) checked @endif data-error="eventFor-error" @if ($is_update && in_array(3, $event->eventFor)) disabled @endif>
eventFor)) checked @endif data-error="eventFor-error">
@foreach ($rooms as $key => $room)
_id, old('rooms', $is_update ? $event->rooms->pluck('room')->toArray() : [])) ? 'checked' : '' }}>
@endforeach
rooms) == 0) style="display: none" @elseif (!$is_update || ($is_update && in_array(3, $event->eventFor))) style="display: none" @endif>
Select specific teachers and parents @if ($is_update) @endif
rooms) == 0) style="display: none" @elseif (!$is_update || ($is_update && in_array(3, $event->eventFor))) style="display: none" @endif> @if(isset($rooms) && !empty($rooms)) @php $activeRoom = false; @endphp
@php $activeRoom = false; @endphp @foreach ($rooms as $key => $room) @php $selectedRoom = $is_update ? $event->rooms->firstWhere('room', $room->_id) : null; @endphp
_id][applyToAll]", $selectedRoom ? ($selectedRoom->applyToAll ? 'true' : 'false') : 'true') }}"> @php $count = 0; if ($selectedRoom && !$activeRoom) { $activeRoom = true; } @endphp @foreach ($teachers as $key => $teacher) @if (in_array($room->_id, $teacher->rooms))
@php $count += 1; @endphp @endif @endforeach @foreach ($children as $key => $child) @if ($room->_id == $child->room)
@php $count += 1; @endphp @endif @endforeach @if ($count == 0)
Child not found in this room. Please add child in this room.
@endif
@endforeach
@else

Please create a room before setup billing for children.

Add room
@endif
@endsection @section('script-bottom') @endsection