Compare commits

..

No commits in common. "f482d036e1d2fca12cbde6ae40fd0b6bcd2d8b0b" and "4ed8dabb19994f64796d1b8e36545942c25a7ccf" have entirely different histories.

32 changed files with 83 additions and 378 deletions

View File

@ -4,7 +4,9 @@ namespace App\Http\Controllers\admin\Catalog\Direction;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\Direction\StoreCostRequest; use App\Http\Requests\admin\Catalog\Direction\StoreCostRequest;
use App\Http\Requests\admin\Catalog\Direction\StorePlaceRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateCostRequest; use App\Http\Requests\admin\Catalog\Direction\UpdateCostRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdatePlaceRequest;
use App\Models\Cost; use App\Models\Cost;
use App\Models\Direction; use App\Models\Direction;
use App\Models\EducationForm; use App\Models\EducationForm;

View File

@ -23,7 +23,7 @@ class EntranceExaminationController extends Controller
public function create(): View public function create(): View
{ {
$directions = Direction::pluck('full_name', 'id'); $directions = Direction::pluck('name', 'id');
$examination_types = ExaminationType::pluck('name', 'id'); $examination_types = ExaminationType::pluck('name', 'id');
$subjects = Subject::pluck('name', 'id'); $subjects = Subject::pluck('name', 'id');
$subjectTypes = SubjectType::pluck('name', 'id'); $subjectTypes = SubjectType::pluck('name', 'id');
@ -64,7 +64,7 @@ class EntranceExaminationController extends Controller
public function edit(EntranceExamination $entranceExamination): View public function edit(EntranceExamination $entranceExamination): View
{ {
$directions = Direction::pluck('full_name', 'id'); $directions = Direction::pluck('name', 'id');
$examination_types = ExaminationType::pluck('name', 'id'); $examination_types = ExaminationType::pluck('name', 'id');
$subjects = Subject::pluck('name', 'id'); $subjects = Subject::pluck('name', 'id');
$subjectTypes = SubjectType::pluck('name', 'id'); $subjectTypes = SubjectType::pluck('name', 'id');

View File

@ -6,7 +6,9 @@ use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\Direction\StoreExaminationTypeRequest; use App\Http\Requests\admin\Catalog\Direction\StoreExaminationTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateExaminationTypeRequest; use App\Http\Requests\admin\Catalog\Direction\UpdateExaminationTypeRequest;
use App\Models\ExaminationType; use App\Models\ExaminationType;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
class ExaminationTypeController extends Controller class ExaminationTypeController extends Controller

View File

@ -3,7 +3,9 @@
namespace App\Http\Controllers\admin\Catalog\Direction; namespace App\Http\Controllers\admin\Catalog\Direction;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\Direction\StoreCostRequest;
use App\Http\Requests\admin\Catalog\Direction\StorePeriodRequest; use App\Http\Requests\admin\Catalog\Direction\StorePeriodRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateCostRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdatePeriodRequest; use App\Http\Requests\admin\Catalog\Direction\UpdatePeriodRequest;
use App\Models\Direction; use App\Models\Direction;
use App\Models\EducationForm; use App\Models\EducationForm;

View File

@ -43,7 +43,6 @@ class PlaceController extends Controller
$place->position = $validated['position']; $place->position = $validated['position'];
$place->description = $validated['description']; $place->description = $validated['description'];
$place->amount = $validated['amount']; $place->amount = $validated['amount'];
$place->quota = $validated['quota'];
$place->education_form_id = $validated['education_form_id']; $place->education_form_id = $validated['education_form_id'];
$place->place_type_id = $validated['place_type_id']; $place->place_type_id = $validated['place_type_id'];
$place->direction_id = $validated['direction_id']; $place->direction_id = $validated['direction_id'];
@ -80,7 +79,6 @@ class PlaceController extends Controller
$place->position = $validated['position']; $place->position = $validated['position'];
$place->description = $validated['description']; $place->description = $validated['description'];
$place->amount = $validated['amount']; $place->amount = $validated['amount'];
$place->quota = $validated['quota'];
$place->education_form_id = $validated['education_form_id']; $place->education_form_id = $validated['education_form_id'];
$place->place_type_id = $validated['place_type_id']; $place->place_type_id = $validated['place_type_id'];
$place->direction_id = $validated['direction_id']; $place->direction_id = $validated['direction_id'];

View File

@ -3,7 +3,9 @@
namespace App\Http\Controllers\admin\Catalog\Direction; namespace App\Http\Controllers\admin\Catalog\Direction;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\Direction\StoreExaminationTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\StorePlaceTypeRequest; use App\Http\Requests\admin\Catalog\Direction\StorePlaceTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateExaminationTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdatePlaceTypeRequest; use App\Http\Requests\admin\Catalog\Direction\UpdatePlaceTypeRequest;
use App\Models\PlaceType; use App\Models\PlaceType;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;

View File

@ -3,7 +3,9 @@
namespace App\Http\Controllers\admin\Catalog\Direction; namespace App\Http\Controllers\admin\Catalog\Direction;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\Direction\StoreExaminationTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\StoreSubjectRequest; use App\Http\Requests\admin\Catalog\Direction\StoreSubjectRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateExaminationTypeRequest;
use App\Http\Requests\admin\Catalog\Direction\UpdateSubjectRequest; use App\Http\Requests\admin\Catalog\Direction\UpdateSubjectRequest;
use App\Models\Subject; use App\Models\Subject;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;

View File

@ -9,11 +9,7 @@ use App\Models\Department;
use App\Models\Direction; use App\Models\Direction;
use App\Models\EducationForm; use App\Models\EducationForm;
use App\Models\EducationLevel; use App\Models\EducationLevel;
use App\Models\EntranceExamination;
use App\Models\ExaminationType;
use App\Models\Faculty; use App\Models\Faculty;
use App\Models\Subject;
use App\Models\SubjectType;
use Illuminate\Contracts\View\Factory; use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
@ -32,19 +28,15 @@ class DirectionController extends Controller
$levels = EducationLevel::pluck('name', 'id'); $levels = EducationLevel::pluck('name', 'id');
$forms = EducationForm::pluck('name', 'id'); $forms = EducationForm::pluck('name', 'id');
$departments = Department::pluck('name', 'id'); $departments = Department::pluck('name', 'id');
$examination_types = ExaminationType::pluck('name', 'id'); return view('admin.catalog.direction.create', compact('departments', 'levels', 'forms'));
$subjects = Subject::pluck('name', 'id');
$subjectTypes = SubjectType::pluck('name', 'id');
return view('admin.catalog.direction.create',
compact('departments', 'levels', 'forms', 'examination_types', 'subjectTypes', 'subjects'));
} }
public function store(StoreDirectionRequest $request): RedirectResponse public function store(StoreDirectionRequest $request): RedirectResponse
{ {
$validated = $request->validated(); $validated = $request->validated();
$direction = new Direction(); $direction = new Direction();
$direction->name = $validated['name']; $direction->name = $validated['name'];
$direction->full_name = "{$validated['code']} {$validated['name']}";
$direction->description = $validated['description']; $direction->description = $validated['description'];
$direction->position = $validated['position']; $direction->position = $validated['position'];
$direction->slug = $validated['slug']; $direction->slug = $validated['slug'];
@ -54,19 +46,6 @@ class DirectionController extends Controller
$direction->department_id = $validated['department_id']; $direction->department_id = $validated['department_id'];
$direction->save(); $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();
}
}
return redirect()->route('directions.index'); return redirect()->route('directions.index');
} }
@ -76,38 +55,17 @@ class DirectionController extends Controller
$faculty = Faculty::find($department->faculty->id); $faculty = Faculty::find($department->faculty->id);
$educationalInstitution = $faculty->educationalInstitution; $educationalInstitution = $faculty->educationalInstitution;
$ege = $direction $ege = $direction->entranceExaminations->where('examination_type_id', '=', '1')->pluck('scores', 'subject_id');
->entranceExaminations $spo = $direction->entranceExaminations->where('examination_type_id', '=', '2')->pluck('scores', 'subject_id');
->where('examination_type_id', '=', '1')
->sortBy('position')
->pluck('scores', 'subject_id');
$spo = $direction
->entranceExaminations->where('examination_type_id', '=', '2')
->sortBy('position')
->pluck('scores', 'subject_id');
$magistracy = $direction $magistracy = $direction
->entranceExaminations ->entranceExaminations
->where('examination_type_id', '=', '3') ->where('examination_type_id', '=', '3')
->pluck('scores', 'subject_id'); ->pluck('scores', 'subject_id');
$budget = $direction $budget = $direction->places->where('place_type_id', '=', '1')->pluck('amount', 'education_form_id');
->places $paid = $direction->places->where('place_type_id', '=', '2')->pluck('amount', 'education_form_id');
->where('place_type_id', '=', '1')
->sortBy('position')
->pluck('amount', 'education_form_id');
$paid = $direction $costs = $direction->costs->pluck('cost', 'education_form_id');
->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( return view(
'admin.catalog.direction.show', 'admin.catalog.direction.show',
@ -138,8 +96,8 @@ class DirectionController extends Controller
{ {
$validated = $request->validated(); $validated = $request->validated();
$direction = new Direction();
$direction->name = $validated['name']; $direction->name = $validated['name'];
$direction->full_name = "{$validated['code']} {$validated['name']}";
$direction->description = $validated['description']; $direction->description = $validated['description'];
$direction->position = $validated['position']; $direction->position = $validated['position'];
$direction->slug = $validated['slug']; $direction->slug = $validated['slug'];

View File

@ -16,7 +16,6 @@ class StorePlaceRequest extends FormRequest
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'description' => 'string', 'description' => 'string',
'amount' => 'required|int|numeric|max:255', 'amount' => 'required|int|numeric|max:255',
'quota' => 'required|int|numeric|max:255',
'education_form_id' => 'required|int|numeric|max:255', 'education_form_id' => 'required|int|numeric|max:255',
'place_type_id' => 'required|int|numeric|max:255', 'place_type_id' => 'required|int|numeric|max:255',
'direction_id' => 'required|int|numeric|max:255', 'direction_id' => 'required|int|numeric|max:255',

View File

@ -16,7 +16,6 @@ class UpdatePlaceRequest extends FormRequest
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'description' => 'string', 'description' => 'string',
'amount' => 'required|int|numeric|max:255', 'amount' => 'required|int|numeric|max:255',
'quota' => 'required|int|numeric|max:255',
'education_form_id' => 'required|int|numeric|max:255', 'education_form_id' => 'required|int|numeric|max:255',
'place_type_id' => 'required|int|numeric|max:255', 'place_type_id' => 'required|int|numeric|max:255',
'direction_id' => 'required|int|numeric|max:255', 'direction_id' => 'required|int|numeric|max:255',

View File

@ -15,18 +15,13 @@ class StoreDirectionRequest extends FormRequest
{ {
return [ return [
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'name' => 'required|string|max:255', 'name' => 'required|string|max:255|unique:directions,name',
'description' => 'string', 'description' => 'string',
'slug' => 'required|string|max:255|unique:directions,slug', 'slug' => 'required|string|max:255|unique:directions,slug',
'code' => 'required|string|max:255|unique:directions,code', 'code' => 'required|string|max:255',
'education_level_id' => 'required|int|numeric|max:1000', 'education_level_id' => 'required|int|numeric|max:1000',
'education_form_id' => 'required|int|numeric|max:1000', 'education_form_id' => 'required|int|numeric|max:1000',
'department_id' => 'required|numeric|int|max:1000', 'department_id' => 'required|numeric|int|max:1000'
'entrance-examination.*.examination_type_id' => 'required|numeric|int|max:1000',
'entrance-examination.*.subject_id' => 'required|numeric|int|max:1000',
'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',
]; ];
} }
} }

View File

@ -24,14 +24,14 @@ class UpdateDirectionRequest extends FormRequest
'max:255', 'max:255',
"unique:directions,slug,{$this->direction->id}", "unique:directions,slug,{$this->direction->id}",
], ],
'name' => 'required|string|max:255', 'code' => 'required|string|max:255',
'education_level_id' => 'required|int|numeric|max:1000', 'education_level_id' => 'required|int|numeric|max:1000',
'education_form_id' => 'required|int|numeric|max:1000', 'education_form_id' => 'required|int|numeric|max:1000',
'code' => [ 'name' => [
'required', 'required',
'string', 'string',
'max:255', 'max:255',
"unique:directions,code,{$this->direction->id}", "unique:directions,name,{$this->direction->id}",
], ],
]; ];
} }

View File

@ -14,7 +14,6 @@ class Direction extends Model
protected $fillable = [ protected $fillable = [
'id', 'id',
'name', 'name',
'full_name',
'description', 'description',
'position', 'position',
'slug', 'slug',

View File

@ -15,7 +15,6 @@ class Place extends Model
'position', 'position',
'description', 'description',
'amount', 'amount',
'quota',
'education_form_id', 'education_form_id',
'place_type_id', 'place_type_id',
'direction_id', 'direction_id',

View File

@ -8,14 +8,11 @@ class DirectionFactory extends Factory
{ {
public function definition(): array public function definition(): array
{ {
$name = fake()->name();
$code = fake()->text(10);
return [ return [
'name' => $name, 'name' => fake()->name(),
'full_name' => "{$code} {$name}",
'description' => fake()->text(), 'description' => fake()->text(),
'slug' => fake()->slug(), 'slug' => fake()->slug(),
'code' => $code, 'code' => fake()->text(50),
'position' => fake()->randomDigit(), 'position' => fake()->randomDigit(),
'department_id' => 1, 'department_id' => 1,
'education_level_id' => 1, 'education_level_id' => 1,

View File

@ -12,7 +12,6 @@ class PlaceFactory extends Factory
'position' => 1, 'position' => 1,
'description' => fake()->text(), 'description' => fake()->text(),
'amount' => fake()->randomDigit(), 'amount' => fake()->randomDigit(),
'quota' => fake()->randomDigit(),
'education_form_id' => 1, 'education_form_id' => 1,
'place_type_id' => 1, 'place_type_id' => 1,
'direction_id' => 1, 'direction_id' => 1,

View File

@ -11,7 +11,6 @@ return new class extends Migration
Schema::create('directions', function (Blueprint $table) { Schema::create('directions', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name'); $table->string('name');
$table->string('full_name');
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->string('code'); $table->string('code');
$table->integer('position'); $table->integer('position');

View File

@ -15,7 +15,6 @@ return new class extends Migration
$table->id(); $table->id();
$table->integer('position'); $table->integer('position');
$table->integer('amount'); $table->integer('amount');
$table->integer('quota');
$table->foreignId('education_form_id')->constrained('education_forms'); $table->foreignId('education_form_id')->constrained('education_forms');
$table->foreignId('place_type_id')->constrained('place_types'); $table->foreignId('place_type_id')->constrained('place_types');
$table->foreignId('direction_id')->constrained('directions'); $table->foreignId('direction_id')->constrained('directions');

View File

@ -13,7 +13,6 @@ class DirectionSeeder extends Seeder
DB::table('directions')->insert([ DB::table('directions')->insert([
[ [
'name' => 'Юриспруденция', 'name' => 'Юриспруденция',
'full_name' => '40.03.01 Юриспруденция',
'description' => 'Юриспруденция', 'description' => 'Юриспруденция',
'slug' => 'jurisprudence', 'slug' => 'jurisprudence',
'code' => '40.03.01', 'code' => '40.03.01',
@ -24,7 +23,6 @@ class DirectionSeeder extends Seeder
], ],
[ [
'name' => 'фармация', 'name' => 'фармация',
'full_name' => '33.05.01 фармация',
'description' => 'фармация', 'description' => 'фармация',
'slug' => 'pharmacy', 'slug' => 'pharmacy',
'code' => '33.05.01', 'code' => '33.05.01',
@ -35,7 +33,6 @@ class DirectionSeeder extends Seeder
], ],
[ [
'name' => 'строительство', 'name' => 'строительство',
'full_name' => '08.04.01 строительство',
'description' => 'строительство', 'description' => 'строительство',
'slug' => 'construction', 'slug' => 'construction',
'code' => '08.04.01', 'code' => '08.04.01',

View File

@ -14,7 +14,6 @@ class PlaceSeeder extends Seeder
[ [
'position' => 1, 'position' => 1,
'amount' => 25, 'amount' => 25,
'quota' => 4,
'education_form_id' => 1, 'education_form_id' => 1,
'place_type_id' => 1, 'place_type_id' => 1,
'direction_id' => 1, 'direction_id' => 1,
@ -23,7 +22,6 @@ class PlaceSeeder extends Seeder
[ [
'position' => 2, 'position' => 2,
'amount' => 30, 'amount' => 30,
'quota' => 8,
'education_form_id' => 2, 'education_form_id' => 2,
'place_type_id' => 2, 'place_type_id' => 2,
'direction_id' => 1, 'direction_id' => 1,

8
package-lock.json generated
View File

@ -6,8 +6,7 @@
"": { "": {
"dependencies": { "dependencies": {
"@rails/ujs": "^7.1.2", "@rails/ujs": "^7.1.2",
"bootstrap-icons": "^1.11.3", "bootstrap-icons": "^1.11.3"
"jquery": "^3.7.1"
}, },
"devDependencies": { "devDependencies": {
"@popperjs/core": "^2.11.6", "@popperjs/core": "^2.11.6",
@ -1422,11 +1421,6 @@
"jiti": "bin/jiti.js" "jiti": "bin/jiti.js"
} }
}, },
"node_modules/jquery": {
"version": "3.7.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz",
"integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg=="
},
"node_modules/laravel-vite-plugin": { "node_modules/laravel-vite-plugin": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.0.1.tgz", "resolved": "https://registry.npmjs.org/laravel-vite-plugin/-/laravel-vite-plugin-1.0.1.tgz",

View File

@ -21,7 +21,6 @@
}, },
"dependencies": { "dependencies": {
"@rails/ujs": "^7.1.2", "@rails/ujs": "^7.1.2",
"bootstrap-icons": "^1.11.3", "bootstrap-icons": "^1.11.3"
"jquery": "^3.7.1"
} }
} }

View File

@ -2,9 +2,8 @@
import Alpine from 'alpinejs'; import Alpine from 'alpinejs';
import ujs from '@rails/ujs'; import ujs from '@rails/ujs';
import jQuery from 'jquery';
window.Alpine = Alpine; window.Alpine = Alpine;
Alpine.start(); Alpine.start();
ujs.start(); ujs.start();
window.$ = jQuery;

View File

@ -1,25 +1,25 @@
@extends('layouts.admin_layout') @extends('layouts.admin_layout')
@section('content') @section('content')
@auth() @auth()
<div class="row">
<div class="col">
<h1 class=""> Создать Направление</h1> <h1 class=""> Создать Направление</h1>
{{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => '']) }} {{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => '']) }}
<div class="row">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция') }} {{ Form::label('position', 'Позиция') }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('position', '', ['class' => 'form-control']) }} {{ Form::text('position', '', ['class' => 'form-control']) }}
</div> </div>
<div> <div>
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
</div> </div>
</div>
<div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('code', 'Код') }} {{ Form::label('code', 'Название') }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('code', '', ['class' => 'form-control']) }} {{ Form::text('code', '', ['class' => 'form-control']) }}
@ -29,32 +29,6 @@
{{ $errors->first('code') }} {{ $errors->first('code') }}
@endif @endif
</div> </div>
</div>
<div class="col">
<div class="mt-3">
{{ Form::label('slug', 'URL') }}
</div>
<div class="mt-1">
{{ Form::text('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', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('name') }}
@endif
</div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('description', 'Описание') }} {{ Form::label('description', 'Описание') }}
@ -67,8 +41,6 @@
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
</div> </div>
<div class="row">
<div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('department_id', 'Кафедра') }} {{ Form::label('department_id', 'Кафедра') }}
</div> </div>
@ -80,8 +52,7 @@
{{ $errors->first('department_id') }} {{ $errors->first('department_id') }}
@endif @endif
</div> </div>
</div>
<div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('education_level_id', 'Увовень образования') }} {{ Form::label('education_level_id', 'Увовень образования') }}
</div> </div>
@ -93,10 +64,9 @@
{{ $errors->first('education_level_id') }} {{ $errors->first('education_level_id') }}
@endif @endif
</div> </div>
</div>
<div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('education_form_id', 'Форма образования') }} {{ Form::label('education_form_id', 'Увовень образования') }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select']) }} {{ Form::select('education_form_id', $forms, null, ['class' => 'form-select']) }}
@ -106,95 +76,24 @@
{{ $errors->first('education_form_id') }} {{ $errors->first('education_form_id') }}
@endif @endif
</div> </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"> <div class="mt-3">
{{ Form::label('entrance-examination[0][examination_type_id]', 'Тип экзамена') }} {{ Form::label('slug', 'URL') }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select']) }} {{ Form::text('slug', '', ['class' => 'form-control']) }}
</div> </div>
<div> <div>
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][examination_type_id]') }} {{ $errors->first('slug') }}
@endif @endif
</div> </div>
</div>
<div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('entrance-examination[0][subject_id]', 'Предмет') }} {{ Form::submit('Создать', ['class' => 'btn btn-primary']) }}
</div> </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> </div>
{{ Form::close() }} {{ Form::close() }}
</div> </div>
@include('admin.catalog.direction.script') </div>
@endauth @endauth
@endsection @endsection

View File

@ -5,7 +5,7 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1 class="">Изменить направление</h1> <h1 class="">Изменить направление</h1>
{{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => '']) }} {{ Form::open(['url' => route('departments.update', $direction), 'method' => 'PATCH', 'class' => '']) }}
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция') }} {{ Form::label('position', 'Позиция') }}
@ -19,18 +19,6 @@
@endif @endif
</div> </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"> <div class="mt-3">
{{ Form::label('name', 'Название') }} {{ Form::label('name', 'Название') }}
</div> </div>

View File

@ -43,18 +43,6 @@
@endif @endif
</div> </div>
<div class="mt-3">
{{ Form::label('quota', 'Квота') }}
</div>
<div class="mt-1">
{{ Form::text('quota', '', ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('quota') }}
@endif
</div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('direction_id', 'Направление подготовки') }} {{ Form::label('direction_id', 'Направление подготовки') }}
</div> </div>

View File

@ -43,18 +43,6 @@
@endif @endif
</div> </div>
<div class="mt-3">
{{ Form::label('quota', 'Квота') }}
</div>
<div class="mt-1">
{{ Form::text('quota', $place->amount, ['class' => 'form-control']) }}
</div>
<div>
@if ($errors->any())
{{ $errors->first('quota') }}
@endif
</div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('direction_id', 'Направление подготовки') }} {{ Form::label('direction_id', 'Направление подготовки') }}
</div> </div>

View File

@ -15,7 +15,6 @@
<th scope="col">Тип места</th> <th scope="col">Тип места</th>
<th scope="col">направление</th> <th scope="col">направление</th>
<th scope="col">Кол-во</th> <th scope="col">Кол-во</th>
<th scope="col">Квота</th>
<th scope="col">действия</th> <th scope="col">действия</th>
<th scope="col"></th> <th scope="col"></th>
</tr> </tr>
@ -29,7 +28,6 @@
<td><a href="{{ route('place_types.show', $place->placeType) }}">{{ $place->placeType->name }}</a></td> <td><a href="{{ route('place_types.show', $place->placeType) }}">{{ $place->placeType->name }}</a></td>
<td><a href="{{ route('directions.show', $place->direction) }}">{{ $place->direction->name }}</a></td> <td><a href="{{ route('directions.show', $place->direction) }}">{{ $place->direction->name }}</a></td>
<td>{{ $place->amount }}</td> <td>{{ $place->amount }}</td>
<td>{{ $place->quota }}</td>
<td> <td>
<a href="{{ route("places.show", $place) }}" <a href="{{ route("places.show", $place) }}"
class="btn btn-info">посмотреть</a> class="btn btn-info">посмотреть</a>

View File

@ -14,8 +14,6 @@
<p>{{ $place->direction->name }}</p> <p>{{ $place->direction->name }}</p>
<h2>Кол-во</h2> <h2>Кол-во</h2>
<p>{{ $place->amount }}</p> <p>{{ $place->amount }}</p>
<h2>Квота</h2>
<p>{{ $place->quota }}</p>
</div> </div>
@endauth @endauth
@endsection @endsection

View File

@ -1,86 +0,0 @@
<script type="module">
let i = 0;
$('#add').click(function () {
++i;
$('#entrance-examination').append(
`<div class="row field">
<div class="col">
<div class="mt-3">
<label for="entrance-examination[${i}][examination_type_id]">Тип экзамена</label>
</div>
<div class="mt-1">
<select class="form-select" id="entrance-examination[${i}][examination_type_id]"
name="entrance-examination[${i}][examination_type_id]">
@foreach($examination_types as $value => $type)
<option value="{{ $value }}">{{ $type }}</option>
@endforeach
</select>
</div>
<div>
</div>
</div>
<div class="col">
<div class="mt-3">
<label for="entrance-examination[${i}][subject_id]">Предмет</label>
</div>
<div class="mt-1 col">
<select class="form-select" id="entrance-examination[${i}][subject_id]"
name="entrance-examination[${i}][subject_id]">
@foreach($subjects as $value => $subject)
<option value="{{ $value }}">{{ $subject }}</option>
@endforeach
</select>
</div>
<div>
</div>
</div>
<div class="col">
<div class="mt-3">
<label for="entrance-examination[${i}][subject_type_id]">Тип предмета</label>
</div>
<div class="mt-1 col">
<select class="form-select" id="entrance-examination[${i}][subject_type_id]"
name="entrance-examination[${i}][subject_type_id]">
@foreach($subjectTypes as $value => $subjectType)
<option value="{{ $value }}">{{ $subjectType }}</option>
@endforeach
</select>
</div>
<div>
</div>
</div>
<div class="col">
<div class="mt-3">
<label for="entrance-examination[${i}][scores]">Кол-во баллов</label>
</div>
<div class="mt-1 col">
<input class="form-control" name="entrance-examination[${i}][scores]" type="text" value=""
id="entrance-examination[${i}][scores]">
</div>
<div>
</div>
</div>
<div class="col">
<div class="mt-3">
<label for="entrance-examination[${i}][position]">Позиция</label>
</div>
<div class="mt-1 col">
<input class="form-control" name="entrance-examination[${i}][position]" type="text" value=""
id="entrance-examination[${i}][position]">
</div>
<div>
</div>
</div>
<div class="col align-items-end">
<div class="mt-3">
<label for="btn">Действия</label>
</div>
<button type="button" class="btn btn-danger col remove-examination-row">Удалить</button>
</div>
</div>`
);
});
$(document).on('click', '.remove-examination-row', function () {
$(this).parents('.field').remove();
});
</script>

View File

@ -36,7 +36,6 @@ class PlaceTest extends TestCase
'position', 'position',
'description', 'description',
'amount', 'amount',
'quota',
'education_form_id', 'education_form_id',
'place_type_id', 'place_type_id',
'direction_id', 'direction_id',

View File

@ -12,9 +12,4 @@ export default defineConfig({
refresh: true, refresh: true,
}), }),
], ],
resolve: {
alias: {
'$': 'jQuery'
},
},
}); });