reorganization direction resource
This commit is contained in:
parent
ade2422a4b
commit
bd8bb7e059
|
@ -7,6 +7,7 @@ use App\Http\Requests\admin\Catalog\StoreDirectionRequest;
|
|||
use App\Http\Requests\admin\Catalog\UpdateDirectionRequest;
|
||||
use App\Models\Department;
|
||||
use App\Models\Direction;
|
||||
use App\Models\DirectionProfile;
|
||||
use App\Models\EducationForm;
|
||||
use App\Models\EducationLevel;
|
||||
use App\Models\EntranceExamination;
|
||||
|
@ -35,12 +36,23 @@ class DirectionController extends Controller
|
|||
$examination_types = ExaminationType::pluck('name', 'id');
|
||||
$subjects = Subject::pluck('name', 'id');
|
||||
$subjectTypes = SubjectType::pluck('name', 'id');
|
||||
$directionProfiles = DirectionProfile::pluck('name', 'id');
|
||||
return view('admin.catalog.direction.create',
|
||||
compact('departments', 'levels', 'forms', 'examination_types', 'subjectTypes', 'subjects'));
|
||||
compact(
|
||||
'departments',
|
||||
'levels',
|
||||
'forms',
|
||||
'examination_types',
|
||||
'subjectTypes',
|
||||
'subjects',
|
||||
'directionProfiles',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function store(StoreDirectionRequest $request): RedirectResponse
|
||||
{
|
||||
|
||||
$validated = $request->validated();
|
||||
$direction = new Direction();
|
||||
$direction->name = $validated['name'];
|
||||
|
@ -52,19 +64,27 @@ class DirectionController extends Controller
|
|||
$direction->education_level_id = $validated['education_level_id'];
|
||||
$direction->education_form_id = $validated['education_form_id'];
|
||||
$direction->department_id = $validated['department_id'];
|
||||
$direction->budget_places = $validated['budget_places'];
|
||||
$direction->quota = $validated['quota'];
|
||||
$direction->paid_places = $validated['paid_places'];
|
||||
$direction->cost_paid_place = $validated['cost_paid_place'];
|
||||
$direction->period = $validated['period'];
|
||||
$direction->save();
|
||||
|
||||
if(array_key_exists('entrance-examination', $validated)) {
|
||||
foreach ($validated['entrance-examination'] as $data) {
|
||||
$entranceExamination = new EntranceExamination();
|
||||
$entranceExamination->examination_type_id = $data['examination_type_id'];
|
||||
$entranceExamination->direction_id = $direction->id;
|
||||
$entranceExamination->subject_id = $data['subject_id'];
|
||||
$entranceExamination->scores = $data['scores'];
|
||||
$entranceExamination->position = $data['position'];
|
||||
$entranceExamination->subject_type_id = $data['subject_type_id'];
|
||||
$entranceExamination->save();
|
||||
}
|
||||
foreach ($validated['entrance-examination'] as $data) {
|
||||
$entranceExamination = new EntranceExamination();
|
||||
$entranceExamination->examination_type_id = $data['examination_type_id'];
|
||||
$entranceExamination->direction_id = $direction->id;
|
||||
$entranceExamination->subject_id = $data['subject_id'];
|
||||
$entranceExamination->scores = $data['scores'];
|
||||
$entranceExamination->position = $data['position'];
|
||||
$entranceExamination->subject_type_id = $data['subject_type_id'];
|
||||
$entranceExamination->save();
|
||||
}
|
||||
|
||||
|
||||
if (array_key_exists('direction_profiles', $validated)) {
|
||||
$direction->directionProfiles()->attach($validated['direction_profiles']);
|
||||
}
|
||||
|
||||
return redirect()->route('directions.index');
|
||||
|
@ -92,23 +112,6 @@ class DirectionController extends Controller
|
|||
->where('examination_type_id', '=', '3')
|
||||
->pluck('scores', 'subject_id');
|
||||
|
||||
$budget = $direction
|
||||
->places
|
||||
->where('place_type_id', '=', '1')
|
||||
->sortBy('position')
|
||||
->pluck('amount', 'education_form_id');
|
||||
|
||||
$paid = $direction
|
||||
->places
|
||||
->where('place_type_id', '=', '2')
|
||||
->sortBy('position')
|
||||
->pluck('amount', 'education_form_id');
|
||||
|
||||
$costs = $direction
|
||||
->costs
|
||||
->sortBy('position')
|
||||
->pluck('cost', 'education_form_id');
|
||||
|
||||
return view(
|
||||
'admin.catalog.direction.show',
|
||||
compact(
|
||||
|
@ -119,9 +122,6 @@ class DirectionController extends Controller
|
|||
'ege',
|
||||
'spo',
|
||||
'magistracy',
|
||||
'budget',
|
||||
'paid',
|
||||
'costs',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -129,9 +129,24 @@ class DirectionController extends Controller
|
|||
public function edit(Direction $direction): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
|
||||
{
|
||||
$levels = EducationLevel::pluck('name', 'id');
|
||||
$departments = Department::pluck('name', 'id');
|
||||
$forms = EducationForm::pluck('name', 'id');
|
||||
return view('admin.catalog.direction.edit', compact('direction', 'departments', 'levels', 'forms'));
|
||||
$departments = Department::pluck('name', 'id');
|
||||
$examination_types = ExaminationType::pluck('name', 'id');
|
||||
$subjects = Subject::pluck('name', 'id');
|
||||
$subjectTypes = SubjectType::pluck('name', 'id');
|
||||
$directionProfiles = DirectionProfile::pluck('name', 'id');
|
||||
return view('admin.catalog.direction.edit',
|
||||
compact(
|
||||
'direction',
|
||||
'departments',
|
||||
'levels',
|
||||
'forms',
|
||||
'examination_types',
|
||||
'subjectTypes',
|
||||
'subjects',
|
||||
'directionProfiles',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function update(UpdateDirectionRequest $request, Direction $direction): RedirectResponse
|
||||
|
@ -157,6 +172,9 @@ class DirectionController extends Controller
|
|||
if ($direction->entranceExaminations()->exists()) {
|
||||
return back();
|
||||
}
|
||||
if ($direction->places()->exists()) {
|
||||
return back();
|
||||
}
|
||||
$direction->delete();
|
||||
return redirect()->route('directions.index');
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ class StoreDirectionProfileRequest extends FormRequest
|
|||
'name' => 'required|string|max:255|unique:direction_profiles,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255|unique:direction_profiles,slug',
|
||||
'direction_id' => 'required|int|numeric|max:255',
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ class UpdateDirectionProfileRequest extends FormRequest
|
|||
'name' => "required|string|max:255|unique:direction_profiles,name,{$this->direction_profile->id}",
|
||||
'description' => 'string',
|
||||
'slug' => "required|string|max:255|unique:direction_profiles,slug,{$this->direction_profile->id}",
|
||||
'direction_id' => 'required|int|numeric|max:255',
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -27,6 +27,12 @@ class StoreDirectionRequest extends FormRequest
|
|||
'entrance-examination.*.subject_type_id' => 'required|numeric|int|max:1000',
|
||||
'entrance-examination.*.scores' => 'required|numeric|int|max:1000',
|
||||
'entrance-examination.*.position' => 'required|numeric|int|max:1000',
|
||||
'budget_places' => 'required|int|numeric|max:255',
|
||||
'paid_places' => 'required|int|numeric|max:255',
|
||||
'quota' => 'required|int|numeric|max:255',
|
||||
'cost_paid_place' => 'required|int|numeric|max:255',
|
||||
'period' => 'required|string|max:255',
|
||||
'direction_profiles' => 'nullable|array'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Models;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Direction extends Model
|
||||
|
@ -41,23 +42,10 @@ class Direction extends Model
|
|||
return $this->hasMany('App\Models\EntranceExamination', 'direction_id');
|
||||
}
|
||||
|
||||
public function places(): HasMany
|
||||
{
|
||||
return $this->hasMany('App\Models\Place', 'direction_id');
|
||||
}
|
||||
|
||||
public function costs(): HasMany
|
||||
{
|
||||
return $this->hasMany('App\Models\Cost', 'direction_id');
|
||||
}
|
||||
|
||||
public function directionProfiles(): HasMany
|
||||
public function directionProfiles(): BelongsToMany
|
||||
{
|
||||
return $this->hasMany('App\Models\DirectionProfile', 'direction_id');
|
||||
}
|
||||
|
||||
public function periods(): HasMany
|
||||
{
|
||||
return $this->hasMany('App\Models\Period', 'direction_id');
|
||||
return $this->belongsToMany(DirectionProfile::class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,11 @@ class DirectionFactory extends Factory
|
|||
'department_id' => 1,
|
||||
'education_level_id' => 1,
|
||||
'education_form_id' => 1,
|
||||
'budget_places' => fake()->randomDigit(),
|
||||
'quota' => fake()->randomDigit(),
|
||||
'paid_places' => fake()->randomDigit(),
|
||||
'cost_paid_place' => fake()->randomDigit(),
|
||||
'period' => fake()->randomDigit(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,11 @@ return new class extends Migration
|
|||
$table->foreignId('department_id')->constrained('departments');
|
||||
$table->foreignId('education_level_id')->constrained('education_levels');
|
||||
$table->foreignId('education_form_id')->constrained('education_forms');
|
||||
$table->integer('budget_places');
|
||||
$table->integer('quota');
|
||||
$table->integer('paid_places');
|
||||
$table->integer('cost_paid_place');
|
||||
$table->float('period');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -32,11 +32,7 @@ class DatabaseSeeder extends Seeder
|
|||
SubjectTypeSeeder::class,
|
||||
DirectionSeeder::class,
|
||||
EntranceExaminationSeeder::class,
|
||||
PlaceTypeSeeder::class,
|
||||
PlaceSeeder::class,
|
||||
CostSeeder::class,
|
||||
DirectionProfileSeeder::class,
|
||||
PeriodSeeder::class,
|
||||
]);
|
||||
|
||||
$this->call([
|
||||
|
|
|
@ -21,6 +21,11 @@ class DirectionSeeder extends Seeder
|
|||
'department_id' => 1,
|
||||
'education_level_id' => 1,
|
||||
'education_form_id' => 1,
|
||||
'budget_places' => 30,
|
||||
'quota' => 10,
|
||||
'paid_places' => 20,
|
||||
'cost_paid_place' => 20,
|
||||
'period' => 4.5
|
||||
],
|
||||
[
|
||||
'name' => 'фармация',
|
||||
|
@ -32,6 +37,11 @@ class DirectionSeeder extends Seeder
|
|||
'department_id' => 1,
|
||||
'education_level_id' => 2,
|
||||
'education_form_id' => 2,
|
||||
'budget_places' => 40,
|
||||
'quota' => 20,
|
||||
'paid_places' => 30,
|
||||
'cost_paid_place' => 30,
|
||||
'period' => 5,
|
||||
],
|
||||
[
|
||||
'name' => 'строительство',
|
||||
|
@ -43,6 +53,11 @@ class DirectionSeeder extends Seeder
|
|||
'department_id' => 1,
|
||||
'education_level_id' => 3,
|
||||
'education_form_id' => 3,
|
||||
'budget_places' => 50,
|
||||
'quota' => 20,
|
||||
'paid_places' => 30,
|
||||
'cost_paid_place' => 30,
|
||||
'period' => 5,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,47 @@
|
|||
@auth()
|
||||
<h1 class=""> Создать Направление</h1>
|
||||
{{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => '']) }}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('department_id', 'Кафедра') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('department_id', $departments, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('department_id') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_level_id', 'Увовень образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_level_id', $levels, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_level_id') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_form_id', 'Форма образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_form_id') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
|
@ -67,48 +108,94 @@
|
|||
{{ $errors->first('description') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('department_id', 'Кафедра') }}
|
||||
{{ Form::label('budget_places', 'Кол-во бюджетных мест') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('department_id', $departments, null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('budget_places', null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('department_id') }}
|
||||
{{ $errors->first('budget_places') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_level_id', 'Увовень образования') }}
|
||||
{{ Form::label('quota', 'Квота') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_level_id', $levels, null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('quota', null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_level_id') }}
|
||||
{{ $errors->first('quota') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_form_id', 'Форма образования') }}
|
||||
{{ Form::label('paid_places', 'Кол-во мест по договорам') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('paid_places', null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_form_id') }}
|
||||
{{ $errors->first('paid_places') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('cost_paid_place', 'Стоимость обучения') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('cost_paid_place', null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('cost_paid_place') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('period', 'Период обучения') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('period', null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('period') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('direction_profile', 'Профиль подготовки') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('direction_profiles[]', $directionProfiles, null, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('direction_profile') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="mt-3">Добавить вступительные испытания</h4>
|
||||
|
||||
|
@ -188,6 +275,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 mb-3">
|
||||
{{ Form::submit('Создать Направление', ['class' => 'btn btn-primary']) }}
|
||||
</div>
|
||||
|
|
|
@ -1,112 +1,288 @@
|
|||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
|
||||
@auth()
|
||||
<h1 class=""> Создать Направление</h1>
|
||||
{{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => '']) }}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="">Изменить направление</h1>
|
||||
{{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => '']) }}
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('position', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('position', $direction->position, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('position') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('code', 'Код') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('code', $direction->code, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('code') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('name', 'Название') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('name', $direction->name, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('name') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('description', 'Описание') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('description', $direction->description, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('description') }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ Form::label('department_id', 'Факультет') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('department_id') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_level_id', 'Увовень образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_level_id') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_form_id', 'Увовень образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_form_id') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('slug', 'URL') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('slug', $direction->slug, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('slug') }}
|
||||
@endif
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ Form::submit('Изменить', ['class' => 'btn btn-primary']) }}
|
||||
</div>
|
||||
<div class="mt-3">
|
||||
{{ Form::label('department_id', 'Кафедра') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('department_id') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_level_id', 'Увовень образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_level_id') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('education_form_id', 'Форма образования') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('education_form_id') }}
|
||||
@endif
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('position', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('position', $direction->position, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('position') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('code', 'Код') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('code', $direction->code, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('code') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('slug', 'URL') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('slug', $direction->slug, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('slug') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('name', 'Название') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('name', $direction->name, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('name') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('description', 'Описание') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('description', $direction->description, ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('description') }}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('budget_places', 'Кол-во бюджетных мест') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('budget_places') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('quota', 'Квота') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('quota', $direction->quota, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('quota') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('paid_places', 'Кол-во мест по договорам') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('paid_places') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('cost_paid_place', 'Стоимость обучения') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::number('cost_paid_place', $direction->cost_paid_place, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('cost_paid_place') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('period', 'Период обучения') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('period', $direction->period, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('period') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('direction_profile', 'Профиль подготовки') }}
|
||||
</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']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('direction_profile') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="mt-3">Добавить вступительные испытания</h4>
|
||||
|
||||
<div class="text-center align-items-center entrance-examination" id="entrance-examination"
|
||||
name="entrance-examination">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][examination_type_id]', 'Тип экзамена') }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('entrance-examination[0][examination_type_id]') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][subject_id]', 'Предмет') }}
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::select('entrance-examination[0][subject_id]', $subjects, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('entrance-examination[0][subject_id]') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][subject_type_id]', 'Тип предмета') }}
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::select('entrance-examination[0][subject_type_id]', $subjectTypes, null, ['class' => 'form-select']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('entrance-examination[0][subject_type_id]') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][scores]', 'Кол-во баллов') }}
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::text('entrance-examination[0][scores]', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('entrance-examination[0][scores]') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][position]', 'Позиция') }}
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::text('entrance-examination[0][position]', '', ['class' => 'form-control']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
{{ $errors->first('entrance-examination[0][position]') }}
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<div class="col align-items-end">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('btn', 'Действия') }}
|
||||
</div>
|
||||
<button type="button" class="btn btn-success col" name="add" id="add">Добавить</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 mb-3">
|
||||
{{ Form::submit('Изменить Направление', ['class' => 'btn btn-primary']) }}
|
||||
</div>
|
||||
{{ Form::close() }}
|
||||
</div>
|
||||
@include('admin.catalog.direction.script')
|
||||
@endauth
|
||||
@endsection
|
||||
|
||||
|
||||
|
|
|
@ -65,45 +65,23 @@
|
|||
<h2>
|
||||
Количество бюджетных мест
|
||||
</h2>
|
||||
@foreach($budget as $education_form_id => $amount)
|
||||
@php
|
||||
$educationForm = (new EducationForm())->find($education_form_id);
|
||||
@endphp
|
||||
<p>{{ $educationForm->name }} - {{ $amount }}</p>
|
||||
@endforeach
|
||||
|
||||
{{ $direction->budget_places }}
|
||||
<h2>
|
||||
Количество мест по договорам об оказании платных обр. услуг
|
||||
</h2>
|
||||
@foreach($paid as $education_form_id => $amount)
|
||||
@php
|
||||
$educationForm = (new EducationForm())->find($education_form_id);
|
||||
@endphp
|
||||
<p>{{ $educationForm->name }} - {{ $amount }}</p>
|
||||
@endforeach
|
||||
|
||||
{{ $direction->paid_places }}
|
||||
<h2>
|
||||
стоимость обучения
|
||||
</h2>
|
||||
@foreach($costs as $education_form_id => $cost)
|
||||
@php
|
||||
$educationForm = (new EducationForm())->find($education_form_id);
|
||||
@endphp
|
||||
<p>{{ $educationForm->name }} - {{ $cost }}</p>
|
||||
@endforeach
|
||||
{{ $direction->cost_paid_place }}
|
||||
|
||||
<h2>Профили подготовки</h2>
|
||||
@foreach($direction->directionProfiles as $profile)
|
||||
<p>{{ $profile->name }}</p>
|
||||
@endforeach
|
||||
|
||||
<h2>Профили подготовки</h2>
|
||||
@foreach($direction->periods as $period)
|
||||
@php
|
||||
$educationForm = (new EducationForm())->find($period->education_form_id);
|
||||
@endphp
|
||||
<p>{{ $educationForm->name }} - {{ $period->period }}</p>
|
||||
@endforeach
|
||||
<h2>Период Обучения</h2>
|
||||
{{ $direction->period }}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
<ul>
|
||||
<li class="list-group-item"><a href="{{ route('documents.index') }}">Документы</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('admissions.index') }}">Экран Приема</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('directions.index') }}">Направления</a></li>
|
||||
@can('viewAny', Auth::user())
|
||||
<li class="list-group-item"></li>
|
||||
<li class="list-group-item"><a href="{{ route('users.index') }}">Список администраторов</a></li>
|
||||
|
@ -55,17 +56,13 @@
|
|||
заведения</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('faculties.index') }}">Факультеты</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('departments.index') }}">Кафедры</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('directions.index') }}">Направления</a></li>
|
||||
|
||||
<li class="list-group-item"><a href="{{ route('entrance_examinations.index') }}">Вступ. экзамены</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('education_levels.index') }}">Уровни образования</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('education_forms.index') }}">Формы образования</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('examination_types.index') }}">Типы Экзаменов</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('subjects.index') }}">Предметы</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('subject_types.index') }}">Типы Предметов</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('places.index') }}">Кол-во Мест</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('place_types.index') }}">Типы Мест</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('costs.index') }}">Стоимость об.</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('periods.index') }}">Срок. обучения</a></li>
|
||||
<li class="list-group-item"><a href="{{ route('direction_profiles.index') }}">Профили подготовки</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
|
|
|
@ -2,15 +2,11 @@
|
|||
|
||||
use App\Http\Controllers\admin\AdmissionController;
|
||||
use App\Http\Controllers\admin\Catalog\DepartmentController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\CostController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\DirectionProfileController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\EducationFormController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\EducationLevelController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\EntranceExaminationController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\ExaminationTypeController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\PeriodController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\PlaceController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\PlaceTypeController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\SubjectController;
|
||||
use App\Http\Controllers\admin\Catalog\Direction\SubjectTypeController;
|
||||
use App\Http\Controllers\admin\Catalog\DirectionController;
|
||||
|
@ -61,13 +57,6 @@ Route::middleware(['auth', 'verified'])->prefix('admin')->group(function () {
|
|||
|
||||
Route::resource('/entrance_examinations', EntranceExaminationController::class);
|
||||
|
||||
Route::resource('/place_types', PlaceTypeController::class)
|
||||
->scoped(['place_type' => 'slug']);
|
||||
|
||||
Route::resource('/places', PlaceController::class);
|
||||
Route::resource('/costs', CostController::class);
|
||||
Route::resource('/periods', PeriodController::class);
|
||||
|
||||
Route::resource('/direction_profiles', DirectionProfileController::class)
|
||||
->scoped(['direction_profile' => 'slug']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue