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/scientists/edit.blade.php
@extends('layouts.admin')
@section('content')

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

    <div class="card-body">
        <form method="POST" action="{{ route("admin.scientists.update", [$scientist->id]) }}" enctype="multipart/form-data">
            @method('PUT')
            @csrf
            <div class="form-group">
                <label class="required" for="name">{{ trans('cruds.scientist.fields.name') }}</label>
                <input class="form-control {{ $errors->has('name') ? 'is-invalid' : '' }}" type="text" name="name" id="name" value="{{ old('name', $scientist->name) }}" required>
                @if($errors->has('name'))
                    <span class="text-danger">{{ $errors->first('name') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.name_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="position">{{ trans('cruds.scientist.fields.position') }}</label>
                <input class="form-control {{ $errors->has('position') ? 'is-invalid' : '' }}" type="text" name="position" id="position" value="{{ old('position', $scientist->position) }}">
                @if($errors->has('position'))
                    <span class="text-danger">{{ $errors->first('position') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.position_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="email">{{ trans('cruds.scientist.fields.email') }}</label>
                <input class="form-control {{ $errors->has('email') ? 'is-invalid' : '' }}" type="email" name="email" id="email" value="{{ old('email', $scientist->email) }}">
                @if($errors->has('email'))
                    <span class="text-danger">{{ $errors->first('email') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.email_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="phone">{{ trans('cruds.scientist.fields.phone') }}</label>
                <input class="form-control {{ $errors->has('phone') ? 'is-invalid' : '' }}" type="text" name="phone" id="phone" value="{{ old('phone', $scientist->phone) }}">
                @if($errors->has('phone'))
                    <span class="text-danger">{{ $errors->first('phone') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.phone_helper') }}</span>
            </div>
            <div class="form-group">
                <div class="form-check {{ $errors->has('ismain') ? 'is-invalid' : '' }}">
                    <input type="hidden" name="ismain" value="0">
                    <input class="form-check-input" type="checkbox" name="ismain" id="ismain" value="1" {{ $scientist->ismain || old('ismain', 0) === 1 ? 'checked' : '' }}>
                    <label class="form-check-label" for="ismain">{{ trans('cruds.scientist.fields.ismain') }}</label>
                </div>
                @if($errors->has('ismain'))
                    <span class="text-danger">{{ $errors->first('ismain') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.ismain_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="groups">{{ trans('cruds.scientist.fields.group') }}</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('groups') ? 'is-invalid' : '' }}" name="groups[]" id="groups" multiple>
                    @foreach($groups as $id => $group)
                        <option value="{{ $id }}" {{ (in_array($id, old('groups', [])) || $scientist->groups->contains($id)) ? 'selected' : '' }}>{{ $group }}</option>
                    @endforeach
                </select>
                @if($errors->has('groups'))
                    <span class="text-danger">{{ $errors->first('groups') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.group_helper') }}</span>
            </div>
            <div class="form-group">
                <label for="subgroups">{{ trans('cruds.scientist.fields.subgroup') }}</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('subgroups') ? 'is-invalid' : '' }}" name="subgroups[]" id="subgroups" multiple>
                    @foreach($subgroups as $id => $subgroup)
                        <option value="{{ $id }}" {{ (in_array($id, old('subgroups', [])) || $scientist->subgroups->contains($id)) ? 'selected' : '' }}>{{ $subgroup }}</option>
                    @endforeach
                </select>
                @if($errors->has('subgroups'))
                    <span class="text-danger">{{ $errors->first('subgroups') }}</span>
                @endif
                <span class="help-block">{{ trans('cruds.scientist.fields.subgroup_helper') }}</span>
            </div>
            <div class="form-group">
                <button class="btn btn-danger" type="submit">
                    {{ trans('global.save') }}
                </button>
            </div>
        </form>
    </div>
</div>



@endsection