Roman_applicant-site/resources/views/admin/catalog/direction/edit.blade.php

311 lines
18 KiB
PHP

@extends('layouts.admin_layout')
@section('content')
@auth()
<h1 class=""> Изменить Направление</h1>
{{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => 'ffff needs-validation', 'novalidate']) }}
<div class="row">
<div class="col">
<div class="mt-3">
{{ Form::label('department_id', 'Кафедра', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
<div class="invalid-feedback">
Поле "Кафедра" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('department_id') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('education_level_id', 'Увовень образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('education_level_id') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('education_form_id', 'Форма образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('education_form_id') }}
@endif
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="mt-3">
{{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::number('position', $direction->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('position') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('code', 'Код', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code')]) }}
</div>
<div class="mt-1">
{{ Form::text('code', $direction->code, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('code') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
</div>
<div class="mt-1">
{{ Form::text('slug', $direction->slug, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('slug') }}
@endif
</div>
</div>
<div class="mt-3">
{{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::text('name', $direction->name, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-3">
{{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.description')]) }}
</div>
<div class="mt-1">
{{ Form::text('description', $direction->description, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('description') }}
@endif
</div>
<div class="row">
<div class="col">
<div class="mt-3">
{{ Form::label('budget_places', 'Кол-во бюджетных мест', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('budget_places') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('quota', 'Квота', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::number('quota', $direction->quota, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('quota') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('paid_places', 'Кол-во мест по договорам', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('paid_places') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('cost_paid_place', 'Стоимость обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::number('cost_paid_place', $direction->cost_paid_place, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('cost_paid_place') }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('period', 'Период обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::text('period', $direction->period, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('period') }}
@endif
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="mt-3">
{{ Form::label('direction_profile', 'Профиль подготовки', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile')]) }}
<span class="text-danger">*</span>
</div>
<div class="mt-1">
{{ Form::select('direction_profiles[]', $directionProfiles, $direction->directionProfiles, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first('direction_profile') }}
@endif
</div>
</div>
</div>
<div class="d-flex mt-3">
<h4 class="mt-3 m-2 d-inline-block">Добавить вступительные испытания</h4>
<button type="button" class="btn btn-success m-2 d-inline-block btn-sm" name="add" id="add">Добавить
</button>
</div>
<div class="text-center align-items-center entrance-examination" id="entrance-examination"
name="entrance-examination">
@foreach($direction->entranceExaminations as $entranceExamination)
<div class="row field">
<div class="col">
<div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][examination_type_id]", 'Тип экзамена', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id')]) }}
</div>
<div class="mt-1">
{{ Form::select("entrance-examination[{$entranceExamination->id}][examination_type_id]", $examination_types, $entranceExamination->examinationType->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][examination_type_id]") }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][subject_id]", 'Предмет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id')]) }}
</div>
<div class="mt-1 col">
{{ Form::select("entrance-examination[{$entranceExamination->id}][subject_id]", $subjects, $entranceExamination->subject->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_id]") }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][subject_type_id]", 'Тип предмета', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id')]) }}
</div>
<div class="mt-1 col">
{{ Form::select("entrance-examination[{$entranceExamination->id}][subject_type_id]", $subjectTypes, $entranceExamination->subjectType->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_type_id]") }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][scores]", 'Кол-во баллов', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores')]) }}
</div>
<div class="mt-1 col">
{{ Form::text("entrance-examination[{$entranceExamination->id}][scores]", $entranceExamination->scores, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][scores]") }}
@endif
</div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][position]", 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position')]) }}
</div>
<div class="mt-1 col">
{{ Form::text("entrance-examination[{$entranceExamination->id}][position]", $entranceExamination->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }}
</div>
<div class="text-danger">
@if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][position]") }}
@endif
</div>
</div>
<div class="col align-items-end">
<div class="mt-3">
{{ Form::label('btn', 'Действия') }}
</div>
<button type="button" class="btn btn-danger col remove-examination-row"
data-id="{{$entranceExamination->id}}">Удалить
</button>
</div>
</div>
@endforeach
</div>
<div class="mt-3 mb-3">
{{ Form::submit('Изменить Направление', ['class' => 'btn btn-primary']) }}
</div>
{{ Form::close() }}
</div>
@include('admin.catalog.direction.edit_script')
@endauth
@endsection