HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/ivs.kaunokolegija.lt/laravel/resources/views/admin/expertActivities/edit.blade.php
@extends('layouts.admin')
@section('content')

<div class="card">
    <div class="card-header">
        {{ trans('global.edit') }}
    </div>

    <div class="card-body">
        <form method="POST" action="{{ route("admin.expert-activities.update", [$expertActivity->id]) }}" enctype="multipart/form-data">
            @method('PUT')
            @csrf
            <div class="form-group">
                <label class="required" for="scientists">{{ trans('cruds.expertActivity.fields.scientist') }}</label>
                <div style="padding-bottom: 4px">
                    <span class="btn btn-info btn-xs select-all" style="border-radius: 0">{{ trans('global.select_all') }}</span>
                    <span class="btn btn-info btn-xs deselect-all" style="border-radius: 0">{{ trans('global.deselect_all') }}</span>
                </div>
                <select class="form-control select2 {{ $errors->has('scientists') ? 'is-invalid' : '' }}" name="scientists[]" id="scientists" multiple required>
                    @foreach($scientists as $id => $scientist)
                        <option value="{{ $id }}" {{ (in_array($id, old('scientists', [])) || $expertActivity->scientists->contains($id)) ? 'selected' : '' }}>{{ $scientist }}</option>
                    @endforeach
                </select>
                @if($errors->has('scientists'))
                    <span class="text-danger">{{ $errors->first('scientists') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.scientist_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required">{{ trans('cruds.expertActivity.fields.activity_type') }}</label>
                <select class="form-control {{ $errors->has('activity_type') ? 'is-invalid' : '' }}" name="activity_type" id="activity_type" required>
                    <option value disabled {{ old('activity_type', null) === null ? 'selected' : '' }}>{{ trans('global.pleaseSelect') }}</option>
                    @foreach(App\Models\ExpertActivity::ACTIVITY_TYPE_SELECT as $key => $label)
                        <option value="{{ $key }}" {{ old('activity_type', $expertActivity->activity_type) === (string) $key ? 'selected' : '' }}>{{ $label }}</option>
                    @endforeach
                </select>
                @if($errors->has('activity_type'))
                    <span class="text-danger">{{ $errors->first('activity_type') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.activity_type_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required" for="period_from">{{ trans('cruds.expertActivity.fields.period_from') }}</label>
                <input class="form-control date {{ $errors->has('period_from') ? 'is-invalid' : '' }}" type="text" name="period_from" id="period_from" value="{{ old('period_from', $expertActivity->period_from) }}" required>
                @if($errors->has('period_from'))
                    <span class="text-danger">{{ $errors->first('period_from') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.period_from_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="period_to">{{ trans('cruds.expertActivity.fields.period_to') }}</label>
                <input class="form-control date {{ $errors->has('period_to') ? 'is-invalid' : '' }}" type="text" name="period_to" id="period_to" value="{{ old('period_to', $expertActivity->period_to) }}">
                @if($errors->has('period_to'))
                    <span class="text-danger">{{ $errors->first('period_to') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.period_to_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required" for="institution">{{ trans('cruds.expertActivity.fields.institution') }}</label>
                <input class="form-control {{ $errors->has('institution') ? 'is-invalid' : '' }}" type="text" name="institution" id="institution" value="{{ old('institution', $expertActivity->institution) }}" required>
                @if($errors->has('institution'))
                    <span class="text-danger">{{ $errors->first('institution') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.institution_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required" for="position">{{ trans('cruds.expertActivity.fields.position') }}</label>
                <input class="form-control {{ $errors->has('position') ? 'is-invalid' : '' }}" type="text" name="position" id="position" value="{{ old('position', $expertActivity->position) }}" required>
                @if($errors->has('position'))
                    <span class="text-danger">{{ $errors->first('position') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.expertActivity.fields.position_helper') }}</span>
            </div>
            <div class="form-group">
                <button class="btn btn-success" type="submit">
                    {{ trans('global.save') }}
                </button>
            </div>
        </form>
    </div>
</div>



@endsection