Compare commits

...

22 Commits

Author SHA1 Message Date
ROMANGOLIENKO 5fc547803c 1 2024-03-13 15:04:18 +03:00
aslan ac72d0d562 fix calculator 2024-03-13 14:48:21 +03:00
aslan 1743d10289 fix calculator 2024-03-13 14:44:54 +03:00
aslan 27cbb5d8cf desc sort to direction 2024-03-13 14:29:58 +03:00
aslan 858492cd2e fix cost_paid_place table directions field name 2024-03-13 14:08:40 +03:00
aslan f5638722a6 fix unique table directions field name 2024-03-13 14:06:50 +03:00
aslan 6187bf360e fix cost paid 200 000 2024-03-13 13:57:20 +03:00
aslan 3d71cdde17 any fix 2024-03-13 13:49:37 +03:00
aslan 490f720850 Merge pull request 'adding white logo, fixing' (#27) from RomanGolienko/Roman_applicant-site:new-design into main
Reviewed-on: http://172.17.254.104/aslan/applicant-site/pulls/27
2024-03-13 13:45:54 +03:00
aslan a0ce271215 Merge pull request 'fixing professor' (#26) from RomanGolienko/Roman_applicant-site:new-design into main
Reviewed-on: http://172.17.254.104/aslan/applicant-site/pulls/26
2024-03-13 13:22:43 +03:00
aslan 919bfca236 fix tooltips 2024-03-13 13:10:59 +03:00
aslan 45143e541f add edit direction validation bootstrap 2024-03-13 13:04:36 +03:00
aslan e397d4b46a fix slug deparment 2024-03-13 12:33:48 +03:00
aslan 78c5d7700e fix messages valdation and any fix 2024-03-13 11:57:15 +03:00
aslan 54901c7ed5 add Logging to DirectionController 2024-03-13 11:41:33 +03:00
aslan ec57a7bd02 fix slug store in Educational Institution 2024-03-13 11:28:12 +03:00
aslan f3c98e1548 Merge branch 'main' of gitea.mkgtu.ru:aslan/applicant-site 2024-03-13 11:24:13 +03:00
aslan 7f2f24ca59 add bootstrap validation and Logging for Educational Institution 2024-03-13 11:24:10 +03:00
aslan 4cb1422b09 Merge pull request 'fixing professor' (#25) from RomanGolienko/Roman_applicant-site:new-design into main
Reviewed-on: http://172.17.254.104/aslan/applicant-site/pulls/25
2024-03-13 11:20:27 +03:00
aslan 8a6e1bea3d fix lint and test 2024-03-13 11:04:38 +03:00
aslan ebe604293f Merge branch 'main' of gitea.mkgtu.ru:aslan/applicant-site 2024-03-13 10:56:35 +03:00
aslan 5fa4b20ec7 add bootstrap validation and Logging for Department 2024-03-13 10:56:14 +03:00
23 changed files with 616 additions and 174 deletions

View File

@ -60,4 +60,10 @@ class PositionHelper
$maxPosition = EntranceExamination::max('position'); $maxPosition = EntranceExamination::max('position');
return $maxPosition >= 254 ? 255 : $maxPosition + 1; return $maxPosition >= 254 ? 255 : $maxPosition + 1;
} }
public static function department()
{
$maxPosition = EntranceExamination::max('position');
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
}
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\admin\Catalog; namespace App\Http\Controllers\admin\Catalog;
use App\Helpers\SlugHelper;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\StoreDepartmentRequest; use App\Http\Requests\admin\Catalog\StoreDepartmentRequest;
use App\Http\Requests\admin\Catalog\UpdateDepartmentRequest; use App\Http\Requests\admin\Catalog\UpdateDepartmentRequest;
@ -11,6 +12,8 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class DepartmentController extends Controller class DepartmentController extends Controller
{ {
@ -30,14 +33,22 @@ class DepartmentController extends Controller
{ {
$validated = $request->validated(); $validated = $request->validated();
$slug = SlugHelper::get($validated);
$department = new Department(); $department = new Department();
$department->name = $validated['name']; $department->name = $validated['name'];
$department->description = $validated['description']; $department->description = $validated['description'];
$department->position = $validated['position']; $department->position = $validated['position'];
$department->faculty_id = $validated['faculty_id']; $department->faculty_id = $validated['faculty_id'];
$department->slug = $validated['slug']; $department->slug = $slug;
$department->save(); $department->save();
Log::channel('app')
->info(
'CREATE кафедра {department} - user {user}',
['user' => Auth::user()->name, 'department' => $department->name, 'data' => $validated]
);
return redirect()->route('departments.index'); return redirect()->route('departments.index');
} }
@ -57,12 +68,25 @@ class DepartmentController extends Controller
public function update(UpdateDepartmentRequest $request, Department $department): RedirectResponse public function update(UpdateDepartmentRequest $request, Department $department): RedirectResponse
{ {
$validated = $request->validated(); $validated = $request->validated();
$oldData = $department->toArray();
$department->name = $validated['name']; $department->name = $validated['name'];
$department->description = $validated['description']; $department->description = $validated['description'];
$department->position = $validated['position']; $department->position = $validated['position'];
$department->faculty_id = $validated['faculty_id']; $department->faculty_id = $validated['faculty_id'];
$department->slug = $validated['slug']; $department->slug = $validated['slug'];
Log::channel('app')
->warning(
'UPDATE кафедра {department} - user {user}',
[
'user' => Auth::user()->name,
'department' => $department->name,
'oldData' => $oldData,
'newData' => $validated
]
);
$department->save(); $department->save();
return redirect()->route('departments.index'); return redirect()->route('departments.index');
@ -71,8 +95,26 @@ class DepartmentController extends Controller
public function destroy(Department $department): RedirectResponse public function destroy(Department $department): RedirectResponse
{ {
if ($department->directions()->exists()) { if ($department->directions()->exists()) {
Log::channel('app')
->error(
'NOT DELETE кафедра {department} - user {user}',
[
'user' => Auth::user()->name,
'department' => $department->name,
'data' => $department->toArray(),
]
);
return back(); return back();
} }
Log::channel('app')
->critical(
'DELETE кафедра {department} - user {user}',
[
'user' => Auth::user()->name,
'department' => $department->name,
'data' => $department->toArray(),
]
);
$department->delete(); $department->delete();
return redirect()->route('departments.index'); return redirect()->route('departments.index');
} }

View File

@ -53,10 +53,15 @@ class EntranceExaminationController extends Controller
$entranceExamination->subject_type_id = $validated['subject_type_id']; $entranceExamination->subject_type_id = $validated['subject_type_id'];
$entranceExamination->save(); $entranceExamination->save();
Log::channel('app') Log::channel('app')
->info( ->info(
'CREATE вступ. испытания {entranceExamination} - user {user}', 'CREATE вступ. испытания {entranceExamination} - user {user}',
['user' => Auth::user()->name, 'entranceExamination' => $entranceExamination->name, 'data' => $validated] [
'user' => Auth::user()->name,
'entranceExamination' => $entranceExamination->name,
'data' => $validated
]
); );
return redirect()->route('entrance_examinations.index'); return redirect()->route('entrance_examinations.index');

View File

@ -3,6 +3,7 @@
namespace App\Http\Controllers\admin\Catalog; namespace App\Http\Controllers\admin\Catalog;
use App\Enums\ExaminationTypeEnum; use App\Enums\ExaminationTypeEnum;
use App\Helpers\SlugHelper;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\StoreDirectionRequest; use App\Http\Requests\admin\Catalog\StoreDirectionRequest;
use App\Http\Requests\admin\Catalog\UpdateDirectionRequest; use App\Http\Requests\admin\Catalog\UpdateDirectionRequest;
@ -20,12 +21,14 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Application; use Illuminate\Foundation\Application;
use Illuminate\Http\RedirectResponse; use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class DirectionController extends Controller class DirectionController extends Controller
{ {
public function index(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application public function index(): View|Application|Factory|\Illuminate\Contracts\Foundation\Application
{ {
$directions = Direction::all(); $directions = Direction::all()->sortBy('created_at', SORT_REGULAR, true);
return view('admin.catalog.direction.index', compact('directions')); return view('admin.catalog.direction.index', compact('directions'));
} }
@ -56,12 +59,14 @@ class DirectionController extends Controller
{ {
$validated = $request->validated(); $validated = $request->validated();
$slug = SlugHelper::get($validated);
$direction = new Direction(); $direction = new Direction();
$direction->name = $validated['name']; $direction->name = $validated['name'];
$direction->full_name = "{$validated['code']} {$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 = $slug;
$direction->code = $validated['code']; $direction->code = $validated['code'];
$direction->education_level_id = $validated['education_level_id']; $direction->education_level_id = $validated['education_level_id'];
$direction->education_form_id = $validated['education_form_id']; $direction->education_form_id = $validated['education_form_id'];
@ -92,6 +97,15 @@ class DirectionController extends Controller
$direction->directionProfiles()->attach($validated['direction_profiles']); $direction->directionProfiles()->attach($validated['direction_profiles']);
} }
Log::channel('app')
->info(
'CREATE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'data' => $validated
]
);
return redirect()->route('directions.index'); return redirect()->route('directions.index');
} }
@ -158,7 +172,9 @@ class DirectionController extends Controller
public function update(UpdateDirectionRequest $request, Direction $direction): RedirectResponse public function update(UpdateDirectionRequest $request, Direction $direction): RedirectResponse
{ {
$oldData = $direction->toArray();
$validated = $request->validated(); $validated = $request->validated();
$direction->name = $validated['name']; $direction->name = $validated['name'];
$direction->full_name = "{$validated['code']} {$validated['name']}"; $direction->full_name = "{$validated['code']} {$validated['name']}";
$direction->description = $validated['description']; $direction->description = $validated['description'];
@ -173,6 +189,18 @@ class DirectionController extends Controller
$direction->paid_places = $validated['paid_places']; $direction->paid_places = $validated['paid_places'];
$direction->cost_paid_place = $validated['cost_paid_place']; $direction->cost_paid_place = $validated['cost_paid_place'];
$direction->period = $validated['period']; $direction->period = $validated['period'];
Log::channel('app')
->warning(
'UPDATE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'oldData' => $oldData,
'newData' => $validated
]
);
$direction->save(); $direction->save();
if (array_key_exists('entrance-examination', $validated)) { if (array_key_exists('entrance-examination', $validated)) {
@ -188,7 +216,7 @@ class DirectionController extends Controller
} }
} }
// dd($validated);
if (array_key_exists('delete', $validated)) { if (array_key_exists('delete', $validated)) {
foreach ($validated['delete'] as $id => $value) { foreach ($validated['delete'] as $id => $value) {
$entranceExamination = EntranceExamination::firstOrNew(['id' => $id]); $entranceExamination = EntranceExamination::firstOrNew(['id' => $id]);
@ -207,8 +235,27 @@ class DirectionController extends Controller
public function destroy(Direction $direction): RedirectResponse public function destroy(Direction $direction): RedirectResponse
{ {
if ($direction->entranceExaminations()->exists()) { if ($direction->entranceExaminations()->exists()) {
Log::channel('app')
->error(
'NOT DELETE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'data' => $direction->toArray(),
]
);
return back(); return back();
} }
Log::channel('app')
->critical(
'DELETE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'data' => $direction->toArray(),
]
);
$direction->directionProfiles()->detach(); $direction->directionProfiles()->detach();
$direction->delete(); $direction->delete();
return redirect()->route('directions.index'); return redirect()->route('directions.index');
@ -248,6 +295,16 @@ class DirectionController extends Controller
$newDirection->directionProfiles()->attach($direction->directionProfiles); $newDirection->directionProfiles()->attach($direction->directionProfiles);
Log::channel('app')
->info(
'DUPLICATE напр. подготовки {direction} - user {user}',
[
'user' => Auth::user()->name,
'direction' => $direction->name,
'data' => $direction->toArray(),
]
);
return redirect()->route('directions.index'); return redirect()->route('directions.index');
} }
} }

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\admin\Catalog; namespace App\Http\Controllers\admin\Catalog;
use App\Helpers\SlugHelper;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Http\Requests\admin\Catalog\StoreEducationalInstitutionRequest; use App\Http\Requests\admin\Catalog\StoreEducationalInstitutionRequest;
use App\Http\Requests\admin\Catalog\UpdateEducationalInstitutionRequest; use App\Http\Requests\admin\Catalog\UpdateEducationalInstitutionRequest;
@ -9,6 +10,8 @@ use App\Models\EducationalInstitution;
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;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class EducationalInstitutionController extends Controller class EducationalInstitutionController extends Controller
{ {
@ -27,13 +30,25 @@ class EducationalInstitutionController extends Controller
{ {
$validated = $request->validated(); $validated = $request->validated();
$slug = SlugHelper::get($validated);
$educationalInstitution = new EducationalInstitution(); $educationalInstitution = new EducationalInstitution();
$educationalInstitution->name = $validated['name']; $educationalInstitution->name = $validated['name'];
$educationalInstitution->description = $validated['description']; $educationalInstitution->description = $validated['description'];
$educationalInstitution->slug = $validated['slug']; $educationalInstitution->slug = $slug;
$educationalInstitution->position = $validated['position']; $educationalInstitution->position = $validated['position'];
$educationalInstitution->save(); $educationalInstitution->save();
Log::channel('app')
->info(
'CREATE учеб. заведение {educationalInstitution} - user {user}',
[
'user' => Auth::user()->name,
'educationalInstitution' => $educationalInstitution->name,
'data' => $validated
]
);
return redirect()->route('educational_institutions.index'); return redirect()->route('educational_institutions.index');
} }
@ -50,11 +65,24 @@ class EducationalInstitutionController extends Controller
public function update(UpdateEducationalInstitutionRequest $request, EducationalInstitution $educationalInstitution) public function update(UpdateEducationalInstitutionRequest $request, EducationalInstitution $educationalInstitution)
{ {
$validated = $request->validated(); $validated = $request->validated();
$oldData = $educationalInstitution->toArray();
$educationalInstitution->name = $validated['name']; $educationalInstitution->name = $validated['name'];
$educationalInstitution->description = $validated['description']; $educationalInstitution->description = $validated['description'];
$educationalInstitution->position = $validated['position']; $educationalInstitution->position = $validated['position'];
$educationalInstitution->slug = $validated['slug']; $educationalInstitution->slug = $validated['slug'];
Log::channel('app')
->warning(
'UPDATE учеб. заведение {educationalInstitution} - user {user}',
[
'user' => Auth::user()->name,
'faculty' => $educationalInstitution->name,
'oldData' => $oldData,
'newData' => $validated
]
);
$educationalInstitution->save(); $educationalInstitution->save();
return redirect()->route('educational_institutions.index'); return redirect()->route('educational_institutions.index');
@ -63,8 +91,26 @@ class EducationalInstitutionController extends Controller
public function destroy(EducationalInstitution $educationalInstitution) public function destroy(EducationalInstitution $educationalInstitution)
{ {
if ($educationalInstitution->faculties()->exists()) { if ($educationalInstitution->faculties()->exists()) {
Log::channel('app')
->error(
'NOT DELETE учеб. заведение {educationalInstitution} - user {user}',
[
'user' => Auth::user()->name,
'educationalInstitution' => $educationalInstitution->name,
'data' => $educationalInstitution->toArray(),
]
);
return back(); return back();
} }
Log::channel('app')
->critical(
'DELETE учеб. заведение {educationalInstitution} - user {user}',
[
'user' => Auth::user()->name,
'educationalInstitution' => $educationalInstitution->name,
'data' => $educationalInstitution->toArray(),
]
);
$educationalInstitution->delete(); $educationalInstitution->delete();
return redirect()->route('educational_institutions.index'); return redirect()->route('educational_institutions.index');

View File

@ -2,16 +2,15 @@
namespace App\Http\Controllers\admin; namespace App\Http\Controllers\admin;
use App\Enums\FacultyEnum; use App\Enums\ExaminationTypeEnum;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use App\Models\Admission; use App\Models\Admission;
use App\Models\Direction; use App\Models\EntranceExamination;
use App\Models\Faculty; use App\Models\Faculty;
use App\Models\Subject; use App\Models\Subject;
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;
use Illuminate\Support\Facades\DB;
class PageController extends Controller class PageController extends Controller
{ {
@ -30,7 +29,20 @@ class PageController extends Controller
// ->groupBy('faculties.name') // ->groupBy('faculties.name')
// ->get(); // ->get();
$faculties = Faculty::all(); $faculties = Faculty::all();
$subjects = Subject::pluck('name', 'id'); $subjects = EntranceExamination::all()
->select('subject_id', 'subject_type_id', 'examination_type_id')
->where('examination_type_id', '=', ExaminationTypeEnum::Ege->value)
->groupBy('subject_type_id')->map(function ($examinate) {
return $examinate->reduce(function (?array $carry, $subject) {
$id = $subject['subject_id'];
$value = Subject::find($id)->name;
$carry[$id] = $value;
return $carry;
});
})
->toArray();
// $subjects = EntranceExamination::pluck('name', 'id');
// $infBez = $faculties->find(FacultyEnum::InfBez->value); // $infBez = $faculties->find(FacultyEnum::InfBez->value);
// $query = `select faculties.name, directions.name, directions.id // $query = `select faculties.name, directions.name, directions.id
//FROM faculties //FROM faculties

View File

@ -17,9 +17,30 @@ class StoreDepartmentRequest extends FormRequest
return [ return [
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'name' => 'required|string|max:255|unique:departments,name', 'name' => 'required|string|max:255|unique:departments,name',
'description' => 'string', 'description' => 'nullable|string',
'slug' => 'required|string|max:255|unique:departments,slug', 'slug' => 'nullable|string|max:255|unique:departments,slug',
'faculty_id' => 'required|numeric|int|max:1000', 'faculty_id' => 'required|numeric|int|max:1000',
]; ];
} }
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
'faculty_id.required' => 'Поле учебное заведение обязательно.',
'faculty_id.int' => 'Учебное заведение должно быть целым числом.',
'faculty_id.numeric' => 'Учебное заведение должно быть числом.',
'faculty_id.max' => 'Поле учебное заведение не должен быть больше :max.',
];
}
} }

View File

@ -16,8 +16,8 @@ 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',
'description' => 'string', 'description' => 'nullable|string',
'slug' => 'required|string|max:255|unique:directions,slug', 'slug' => 'nullable|string|max:255|unique:directions,slug',
'code' => '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',
@ -30,9 +30,92 @@ class StoreDirectionRequest extends FormRequest
'budget_places' => 'required|int|numeric|max:255', 'budget_places' => 'required|int|numeric|max:255',
'paid_places' => 'required|int|numeric|max:255', 'paid_places' => 'required|int|numeric|max:255',
'quota' => 'required|int|numeric|max:255', 'quota' => 'required|int|numeric|max:255',
'cost_paid_place' => 'required|int|numeric|max:255', 'cost_paid_place' => 'required|int|numeric|max:200000',
'period' => 'required|numeric|max:255', 'period' => 'required|numeric|max:255',
'direction_profiles' => 'nullable|array' 'direction_profiles' => 'nullable|array'
]; ];
} }
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
'code.required' => 'Поле Код обязательно.',
'code.string' => 'Поле Код должен быть строкой.',
'code.max' => 'Код не должен быть длиннее :max',
'education_level_id.required' => 'Поле "уровень образования" обязательно.',
'education_level_id.int' => 'Поле "уровень образования" должно быть целым числом.',
'education_level_id.numeric' => 'Поле "уровень образования" должно быть числом.',
'education_level_id.max' => 'Поле "уровень образования" не должен быть больше :max',
'education_form_id.required' => 'Поле "форма образования" обязательно.',
'education_form_id.int' => 'Поле "форма образования" должно быть целым числом.',
'education_form_id.numeric' => 'Поле "форма образования" должно быть числом.',
'education_form_id.max' => 'Поле "форма образования" не должен быть больше :max',
'department_id.required' => 'Поле "Кафедра" обязательно.',
'department_id.int' => 'Поле "Кафедра" должно быть целым числом.',
'department_id.numeric' => 'Поле "Кафедра" должно быть числом.',
'department_id.max' => 'Поле "Кафедра" не должен быть больше :max',
'entrance-examination.*.position.required' => 'Поле позиция обязательно.',
'entrance-examination.*.position.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.position.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.position.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.direction_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.direction_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.direction_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.direction_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.examination_type_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.examination_type_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.examination_type_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.examination_type_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.subject_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.subject_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.subject_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.subject_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.subject_type_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.subject_type_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.subject_type_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.subject_type_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.scores.required' => 'Поле позиция обязательно.',
'entrance-examination.*.scores.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.scores.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.scores.max' => 'Позиция не должен быть больше :max',
'budget_places.required' => 'Поле Кол-во бюджетных мест обязательно.',
'budget_places.int' => 'Кол-во бюджетных мест должно быть целым числом.',
'budget_places.numeric' => 'Кол-во бюджетных мест должно быть числом.',
'budget_places.max' => 'Кол-во бюджетных мест не должен быть больше :max',
'paid_places.required' => 'Поле Кол-во мест по договорам обязательно.',
'paid_places.int' => 'Кол-во мест по договорам должно быть целым числом.',
'paid_places.numeric' => 'Кол-во мест по договорам должно быть числом.',
'paid_places.max' => 'Кол-во мест по договорам не должен быть больше :max',
'quota.required' => 'Поле Квота обязательно.',
'quota.int' => 'Квота должно быть целым числом.',
'quota.numeric' => 'Квота должно быть числом.',
'quota.max' => 'Квота не должен быть больше :max',
'cost_paid_place.required' => 'Поле Стоимость обучения обязательно.',
'cost_paid_place.int' => 'Стоимость обучения должно быть целым числом.',
'cost_paid_place.numeric' => 'Стоимость обучения должно быть числом.',
'cost_paid_place.max' => 'Стоимость обучения не должен быть больше :max',
'period.required' => 'Поле Период обучения обязательно.',
'period.int' => 'Период обучения должно быть целым числом.',
'period.numeric' => 'Период обучения должно быть числом.',
'period.max' => 'Период обучения не должен быть больше :max',
'direction_profiles.array' => 'Поле Профиль подготовки должно быть массивом.',
];
}
} }

View File

@ -16,8 +16,24 @@ class StoreEducationalInstitutionRequest extends FormRequest
return [ return [
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'name' => 'required|string|max:255|unique:educational_institutions,name', 'name' => 'required|string|max:255|unique:educational_institutions,name',
'description' => 'string', 'description' => 'nullable|string',
'slug' => 'required|string|max:255|unique:educational_institutions,slug', 'slug' => 'nullable|string|max:255|unique:educational_institutions,slug',
];
}
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
]; ];
} }
} }

View File

@ -14,7 +14,7 @@ class UpdateDepartmentRequest extends FormRequest
{ {
return [ return [
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'description' => 'string', 'description' => 'nullable|string',
'slug' => [ 'slug' => [
'string', 'string',
'required', 'required',
@ -30,4 +30,25 @@ class UpdateDepartmentRequest extends FormRequest
], ],
]; ];
} }
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
'faculty_id.required' => 'Поле учебное заведение обязательно.',
'faculty_id.int' => 'Учебное заведение должно быть целым числом.',
'faculty_id.numeric' => 'Учебное заведение должно быть числом.',
'faculty_id.max' => 'Поле учебное заведение не должен быть больше :max.',
];
}
} }

View File

@ -16,7 +16,7 @@ class UpdateDirectionRequest 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',
'description' => 'string', 'description' => 'nullable|string',
'slug' => "required|string|max:255|unique:directions,slug,{$this->direction->id}", 'slug' => "required|string|max:255|unique:directions,slug,{$this->direction->id}",
'code' => "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',
@ -30,10 +30,94 @@ class UpdateDirectionRequest extends FormRequest
'budget_places' => 'required|int|numeric|max:255', 'budget_places' => 'required|int|numeric|max:255',
'paid_places' => 'required|int|numeric|max:255', 'paid_places' => 'required|int|numeric|max:255',
'quota' => 'required|int|numeric|max:255', 'quota' => 'required|int|numeric|max:255',
'cost_paid_place' => 'required|int|numeric|max:255', 'cost_paid_place' => 'required|int|numeric|max:200000',
'period' => 'required|numeric|max:255', 'period' => 'required|numeric|max:255',
'direction_profiles' => 'nullable|array', 'direction_profiles' => 'nullable|array',
'delete.*' => 'nullable|array' 'delete.*' => 'nullable|array'
]; ];
} }
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
'code.required' => 'Поле Код обязательно.',
'code.string' => 'Поле Код должен быть строкой.',
'code.max' => 'Код не должен быть длиннее :max',
'education_level_id.required' => 'Поле "уровень образования" обязательно.',
'education_level_id.int' => 'Поле "уровень образования" должно быть целым числом.',
'education_level_id.numeric' => 'Поле "уровень образования" должно быть числом.',
'education_level_id.max' => 'Поле "уровень образования" не должен быть больше :max',
'education_form_id.required' => 'Поле "форма образования" обязательно.',
'education_form_id.int' => 'Поле "форма образования" должно быть целым числом.',
'education_form_id.numeric' => 'Поле "форма образования" должно быть числом.',
'education_form_id.max' => 'Поле "форма образования" не должен быть больше :max',
'department_id.required' => 'Поле "Кафедра" обязательно.',
'department_id.int' => 'Поле "Кафедра" должно быть целым числом.',
'department_id.numeric' => 'Поле "Кафедра" должно быть числом.',
'department_id.max' => 'Поле "Кафедра" не должен быть больше :max',
'entrance-examination.*.position.required' => 'Поле позиция обязательно.',
'entrance-examination.*.position.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.position.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.position.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.direction_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.direction_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.direction_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.direction_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.examination_type_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.examination_type_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.examination_type_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.examination_type_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.subject_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.subject_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.subject_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.subject_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.subject_type_id.required' => 'Поле позиция обязательно.',
'entrance-examination.*.subject_type_id.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.subject_type_id.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.subject_type_id.max' => 'Позиция не должен быть больше :max',
'entrance-examination.*.scores.required' => 'Поле позиция обязательно.',
'entrance-examination.*.scores.int' => 'Позиция должно быть целым числом.',
'entrance-examination.*.scores.numeric' => 'Позиция должно быть числом.',
'entrance-examination.*.scores.max' => 'Позиция не должен быть больше :max',
'budget_places.required' => 'Поле Кол-во бюджетных мест обязательно.',
'budget_places.int' => 'Кол-во бюджетных мест должно быть целым числом.',
'budget_places.numeric' => 'Кол-во бюджетных мест должно быть числом.',
'budget_places.max' => 'Кол-во бюджетных мест не должен быть больше :max',
'paid_places.required' => 'Поле Кол-во мест по договорам обязательно.',
'paid_places.int' => 'Кол-во мест по договорам должно быть целым числом.',
'paid_places.numeric' => 'Кол-во мест по договорам должно быть числом.',
'paid_places.max' => 'Кол-во мест по договорам не должен быть больше :max',
'quota.required' => 'Поле Квота обязательно.',
'quota.int' => 'Квота должно быть целым числом.',
'quota.numeric' => 'Квота должно быть числом.',
'quota.max' => 'Квота не должен быть больше :max',
'cost_paid_place.required' => 'Поле Стоимость обучения обязательно.',
'cost_paid_place.int' => 'Стоимость обучения должно быть целым числом.',
'cost_paid_place.numeric' => 'Стоимость обучения должно быть числом.',
'cost_paid_place.max' => 'Стоимость обучения не должен быть больше :max',
'period.required' => 'Поле Период обучения обязательно.',
'period.int' => 'Период обучения должно быть целым числом.',
'period.numeric' => 'Период обучения должно быть числом.',
'period.max' => 'Период обучения не должен быть больше :max',
'direction_profiles.array' => 'Поле Профиль подготовки должно быть массивом.',
];
}
} }

View File

@ -16,7 +16,7 @@ class UpdateEducationalInstitutionRequest extends FormRequest
{ {
return [ return [
'position' => 'required|int|numeric|max:255', 'position' => 'required|int|numeric|max:255',
'description' => 'string', 'description' => 'nullable|string',
'slug' => [ 'slug' => [
'required', 'required',
'string', 'string',
@ -31,4 +31,21 @@ class UpdateEducationalInstitutionRequest extends FormRequest
], ],
]; ];
} }
public function messages(): array
{
return [
'position.required' => 'Поле позиция обязательно.',
'position.int' => 'Позиция должно быть целым числом.',
'position.numeric' => 'Позиция должно быть числом.',
'position.max' => 'Позиция не должен быть больше :max',
'name.required' => 'Поле название обязательно.',
'name.string' => 'Поле название должен быть строкой.',
'name.max' => 'Поле название не должен превышать :max символов.',
'name.unique' => 'Название уже занят.',
'description.string' => 'Поле описание должен быть строкой.',
'slug.string' => 'Поле URL должен быть строкой.',
'slug.max' => 'Поле URL не должен превышать :max символов.',
];
}
} }

View File

@ -10,7 +10,7 @@ return new class extends Migration
{ {
Schema::create('directions', function (Blueprint $table) { Schema::create('directions', function (Blueprint $table) {
$table->id(); $table->id();
$table->string('name', 255)->unique(); $table->string('name', 255);
$table->string('full_name', 255); $table->string('full_name', 255);
$table->text('description')->nullable(); $table->text('description')->nullable();
$table->string('code', 255); $table->string('code', 255);
@ -22,7 +22,7 @@ return new class extends Migration
$table->smallInteger('budget_places'); $table->smallInteger('budget_places');
$table->smallInteger('quota'); $table->smallInteger('quota');
$table->smallInteger('paid_places'); $table->smallInteger('paid_places');
$table->smallInteger('cost_paid_place'); $table->integer('cost_paid_place');
$table->float('period'); $table->float('period');
$table->timestamps(); $table->timestamps();
}); });

View File

@ -21,7 +21,7 @@ return [
'paid_places' => 'Поле "Платные места" указывает на количество платных мест в направлении', 'paid_places' => 'Поле "Платные места" указывает на количество платных мест в направлении',
'cost_paid_place' => 'Поле "Стоимость обучения" указывает на стоимость платных мест в направлении', 'cost_paid_place' => 'Поле "Стоимость обучения" указывает на стоимость платных мест в направлении',
'slug' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению', 'slug' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению',
'code' => 'Поле "URL" нужно для отображения в браузере', 'code' => 'Поле "Код" для идентификации направления',
'quota' => 'Поле "Квота" указывает на количество мест по квоте', 'quota' => 'Поле "Квота" указывает на количество мест по квоте',
'period' => 'Поле "Период обучения" указывает на период обучения', 'period' => 'Поле "Период обучения" указывает на период обучения',
'direction_profile' => 'Поле "Профиль подготовки" указывает на привязку направления к профилям подготовки', 'direction_profile' => 'Поле "Профиль подготовки" указывает на привязку направления к профилям подготовки',
@ -75,4 +75,11 @@ return [
'description' => 'Поле "Описание" может быть пустым для отображения на сайте', 'description' => 'Поле "Описание" может быть пустым для отображения на сайте',
'slug' => 'Поле "URL" нужно для отображения в браузере' 'slug' => 'Поле "URL" нужно для отображения в браузере'
], ],
'departments' => [
'position' => 'Поле "Позиция" нужно для упорядочивания отображения на сайте',
'name' => 'Поле "Название" должно быть уникальным для отображения на сайте',
'description' => 'Поле "Описание" может быть пустым для отображения на сайте',
'faculty_id' => 'Поле "Факультет" указывает на привязку к факультету',
'slug' => 'Поле "URL" нужно для отображения в браузере'
],
]; ];

View File

@ -1,3 +1,4 @@
@php use App\Helpers\PositionHelper; @endphp
@extends('layouts.admin_layout') @extends('layouts.admin_layout')
@section('content') @section('content')
@auth() @auth()
@ -6,60 +7,71 @@
<h1 class=""> Создать кафедру</h1> <h1 class=""> Создать кафедру</h1>
{{ Form::open(['url' => route('departments.store'), 'method' => 'POST', 'class' => '']) }} {{ Form::open(['url' => route('departments.store'), 'method' => 'POST', 'class' => '']) }}
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция') }} {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.position')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('position', '', ['class' => 'form-control']) }} {{ Form::number('position', PositionHelper::department(), ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.position'), 'required']) }}
<div class="invalid-feedback">
Поле "Позиция" обязательно!
</div> </div>
<div> </div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('name', 'Название') }} {{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.name')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('name', '', ['class' => 'form-control']) }} {{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.name'), 'required']) }}
<div class="invalid-feedback">
Поле "Название" обязательно!
</div> </div>
<div> </div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('name') }} {{ $errors->first('name') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('description', 'Описание') }} {{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.description')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('description', '', ['class' => 'form-control']) }} {{ Form::text('description', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.description')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('faculty_id', 'Факультет') }} {{ Form::label('faculty_id', 'Факультет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.faculty_id')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('faculty_id', $faculties, null, ['class' => 'form-select']) }} {{ Form::select('faculty_id', $faculties, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.faculty_id')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('faculty_id') }} {{ $errors->first('faculty_id') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('slug', 'URL') }} {{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.slug')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('slug', '', ['class' => 'form-control']) }} {{ Form::text('slug', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.slug')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('slug') }} {{ $errors->first('slug') }}
@endif @endif

View File

@ -7,59 +7,68 @@
{{ Form::open(['url' => route('departments.update', $department), 'method' => 'PATCH', 'class' => '']) }} {{ Form::open(['url' => route('departments.update', $department), 'method' => 'PATCH', 'class' => '']) }}
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция') }} {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.position')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('position', $department->position, ['class' => 'form-control']) }} {{ Form::number('position', $department->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.position'), 'required']) }}
<div class="invalid-feedback">
Поле "Позиция" обязательно!
</div> </div>
<div> </div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('name', 'Название') }} {{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.name')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('name', $department->name, ['class' => 'form-control']) }} {{ Form::text('name', $department->name, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.name'), 'required']) }}
<div class="invalid-feedback">
Поле "Название" обязательно!
</div> </div>
<div> </div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('name') }} {{ $errors->first('name') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('description', 'Описание') }} {{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.description')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('description', $department->description, ['class' => 'form-control']) }} {{ Form::text('description', $department->description, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.description')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('educational_institution_id', 'Факультет') }} {{ Form::label('faculty_id', 'Факультет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.faculty_id')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('faculty_id', $faculties, $department->faculty->id, ['class' => 'form-select']) }} {{ Form::select('faculty_id', $faculties, $department->faculty->id, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.faculty_id')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('educational_institution_id') }} {{ $errors->first('faculty_id') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('slug', 'URL') }} {{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.slug')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('slug', $department->slug, ['class' => 'form-control']) }} {{ Form::text('slug', $department->slug, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.departments.slug')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('slug') }} {{ $errors->first('slug') }}
@endif @endif

View File

@ -16,7 +16,7 @@
Поле "Кафедра" обязательно! Поле "Кафедра" обязательно!
</div> </div>
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('department_id') }} {{ $errors->first('department_id') }}
@endif @endif
@ -30,7 +30,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::select('education_level_id', $levels, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id'), 'required']) }} {{ Form::select('education_level_id', $levels, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('education_level_id') }} {{ $errors->first('education_level_id') }}
@endif @endif
@ -44,7 +44,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id'), 'required']) }} {{ Form::select('education_form_id', $forms, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('education_form_id') }} {{ $errors->first('education_form_id') }}
@endif @endif
@ -60,7 +60,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::number('position', PositionHelper::direction(), ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }} {{ Form::number('position', PositionHelper::direction(), ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
@ -74,7 +74,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::text('code', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }} {{ Form::text('code', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('code') }} {{ $errors->first('code') }}
@endif @endif
@ -87,7 +87,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::text('slug', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }} {{ Form::text('slug', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('slug') }} {{ $errors->first('slug') }}
@endif @endif
@ -101,7 +101,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }} {{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('name') }} {{ $errors->first('name') }}
@endif @endif
@ -113,7 +113,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::text('description', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }} {{ Form::text('description', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
@ -129,7 +129,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::number('budget_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }} {{ Form::number('budget_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('budget_places') }} {{ $errors->first('budget_places') }}
@endif @endif
@ -143,7 +143,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::number('quota', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }} {{ Form::number('quota', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('quota') }} {{ $errors->first('quota') }}
@endif @endif
@ -157,7 +157,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::number('paid_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }} {{ Form::number('paid_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('paid_places') }} {{ $errors->first('paid_places') }}
@endif @endif
@ -172,7 +172,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::number('cost_paid_place', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }} {{ Form::number('cost_paid_place', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('cost_paid_place') }} {{ $errors->first('cost_paid_place') }}
@endif @endif
@ -187,7 +187,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::text('period', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }} {{ Form::text('period', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('period') }} {{ $errors->first('period') }}
@endif @endif
@ -204,7 +204,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::select('direction_profiles[]', $directionProfiles, null, ['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']) }} {{ Form::select('direction_profiles[]', $directionProfiles, null, ['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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('direction_profile') }} {{ $errors->first('direction_profile') }}
@endif @endif
@ -225,7 +225,7 @@
<div class="mt-1"> <div class="mt-1">
{{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id'), 'required']) }} {{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][examination_type_id]') }} {{ $errors->first('entrance-examination[0][examination_type_id]') }}
@endif @endif
@ -239,7 +239,7 @@
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::select('entrance-examination[0][subject_id]', $subjects, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id'), 'required']) }} {{ Form::select('entrance-examination[0][subject_id]', $subjects, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][subject_id]') }} {{ $errors->first('entrance-examination[0][subject_id]') }}
@endif @endif
@ -253,7 +253,7 @@
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::select('entrance-examination[0][subject_type_id]', $subjectTypes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id'), 'required']) }} {{ Form::select('entrance-examination[0][subject_type_id]', $subjectTypes, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][subject_type_id]') }} {{ $errors->first('entrance-examination[0][subject_type_id]') }}
@endif @endif
@ -267,7 +267,7 @@
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::number('entrance-examination[0][scores]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }} {{ Form::number('entrance-examination[0][scores]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][scores]') }} {{ $errors->first('entrance-examination[0][scores]') }}
@endif @endif
@ -281,7 +281,7 @@
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::number('entrance-examination[0][position]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }} {{ Form::number('entrance-examination[0][position]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('entrance-examination[0][position]') }} {{ $errors->first('entrance-examination[0][position]') }}
@endif @endif

View File

@ -1,17 +1,21 @@
@extends('layouts.admin_layout') @extends('layouts.admin_layout')
@section('content') @section('content')
@auth() @auth()
<h1 class=""> Создать Направление</h1> <h1 class=""> Изменить Направление</h1>
{{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => 'ffff']) }} {{ Form::open(['url' => route('directions.update', $direction), 'method' => 'PATCH', 'class' => 'ffff needs-validation', 'novalidate']) }}
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('department_id', 'Кафедра') }} {{ Form::label('department_id', 'Кафедра', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('department_id', $departments, $direction->department->id, ['class' => 'form-select']) }} {{ 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> </div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('department_id') }} {{ $errors->first('department_id') }}
@endif @endif
@ -19,12 +23,13 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('education_level_id', 'Увовень образования') }} {{ Form::label('education_level_id', 'Увовень образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_level_id')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('education_level_id', $levels, $direction->educationLevel->id, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('education_level_id') }} {{ $errors->first('education_level_id') }}
@endif @endif
@ -32,12 +37,13 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('education_form_id', 'Форма образования') }} {{ Form::label('education_form_id', 'Форма образования', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.education_form_id')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select('education_form_id', $forms, $direction->educationForm->id, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('education_form_id') }} {{ $errors->first('education_form_id') }}
@endif @endif
@ -47,12 +53,13 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция') }} {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('position', $direction->position, ['class' => 'form-control']) }} {{ Form::number('position', $direction->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
@ -60,12 +67,12 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('code', 'Код') }} {{ Form::label('code', 'Код', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('code', $direction->code, ['class' => 'form-control']) }} {{ Form::text('code', $direction->code, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('code') }} {{ $errors->first('code') }}
@endif @endif
@ -73,12 +80,12 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('slug', 'URL') }} {{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('slug', $direction->slug, ['class' => 'form-control']) }} {{ Form::text('slug', $direction->slug, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('slug') }} {{ $errors->first('slug') }}
@endif @endif
@ -86,24 +93,25 @@
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('name', 'Название') }} {{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('name', $direction->name, ['class' => 'form-control']) }} {{ Form::text('name', $direction->name, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('name') }} {{ $errors->first('name') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-3">
{{ Form::label('description', 'Описание') }} {{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.description')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('description', $direction->description, ['class' => 'form-control']) }} {{ Form::text('description', $direction->description, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
@ -113,12 +121,13 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('budget_places', 'Кол-во бюджетных мест') }} {{ Form::label('budget_places', 'Кол-во бюджетных мест', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select']) }} {{ Form::number('budget_places', $direction->budget_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('budget_places') }} {{ $errors->first('budget_places') }}
@endif @endif
@ -126,12 +135,13 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('quota', 'Квота') }} {{ Form::label('quota', 'Квота', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('quota', $direction->quota, ['class' => 'form-select']) }} {{ Form::number('quota', $direction->quota, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('quota') }} {{ $errors->first('quota') }}
@endif @endif
@ -139,12 +149,13 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('paid_places', 'Кол-во мест по договорам') }} {{ Form::label('paid_places', 'Кол-во мест по договорам', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select']) }} {{ Form::number('paid_places', $direction->paid_places, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('paid_places') }} {{ $errors->first('paid_places') }}
@endif @endif
@ -153,12 +164,13 @@
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('cost_paid_place', 'Стоимость обучения') }} {{ Form::label('cost_paid_place', 'Стоимость обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::number('cost_paid_place', $direction->cost_paid_place, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('cost_paid_place') }} {{ $errors->first('cost_paid_place') }}
@endif @endif
@ -167,12 +179,13 @@
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('period', 'Период обучения') }} {{ Form::label('period', 'Период обучения', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('period', $direction->period, ['class' => 'form-select']) }} {{ Form::text('period', $direction->period, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('period') }} {{ $errors->first('period') }}
@endif @endif
@ -183,12 +196,13 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('direction_profile', 'Профиль подготовки') }} {{ Form::label('direction_profile', 'Профиль подготовки', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.direction_profile')]) }}
<span class="text-danger">*</span>
</div> </div>
<div class="mt-1"> <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']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('direction_profile') }} {{ $errors->first('direction_profile') }}
@endif @endif
@ -209,12 +223,12 @@
<div class="row field"> <div class="row field">
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][examination_type_id]", 'Тип экзамена') }} {{ Form::label("entrance-examination[{$entranceExamination->id}][examination_type_id]", 'Тип экзамена', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::select("entrance-examination[{$entranceExamination->id}][examination_type_id]", $examination_types, $entranceExamination->examinationType->id, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][examination_type_id]") }} {{ $errors->first("entrance-examination[{$entranceExamination->id}][examination_type_id]") }}
@endif @endif
@ -222,12 +236,12 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][subject_id]", 'Предмет') }} {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_id]", 'Предмет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id')]) }}
</div> </div>
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::select("entrance-examination[{$entranceExamination->id}][subject_id]", $subjects, $entranceExamination->subject->id, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_id]") }} {{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_id]") }}
@endif @endif
@ -235,12 +249,12 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][subject_type_id]", 'Тип предмета') }} {{ Form::label("entrance-examination[{$entranceExamination->id}][subject_type_id]", 'Тип предмета', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id')]) }}
</div> </div>
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::select("entrance-examination[{$entranceExamination->id}][subject_type_id]", $subjectTypes, $entranceExamination->subjectType->id, ['class' => 'form-select']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_type_id]") }} {{ $errors->first("entrance-examination[{$entranceExamination->id}][subject_type_id]") }}
@endif @endif
@ -248,10 +262,10 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][scores]", 'Кол-во баллов') }} {{ Form::label("entrance-examination[{$entranceExamination->id}][scores]", 'Кол-во баллов', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores')]) }}
</div> </div>
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::text("entrance-examination[{$entranceExamination->id}][scores]", $entranceExamination->scores, ['class' => 'form-control']) }} {{ 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>
<div> <div>
@if ($errors->any()) @if ($errors->any())
@ -261,12 +275,12 @@
</div> </div>
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label("entrance-examination[{$entranceExamination->id}][position]", 'Позиция') }} {{ Form::label("entrance-examination[{$entranceExamination->id}][position]", 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position')]) }}
</div> </div>
<div class="mt-1 col"> <div class="mt-1 col">
{{ Form::text("entrance-examination[{$entranceExamination->id}][position]", $entranceExamination->position, ['class' => 'form-control']) }} {{ 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>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first("entrance-examination[{$entranceExamination->id}][position]") }} {{ $errors->first("entrance-examination[{$entranceExamination->id}][position]") }}
@endif @endif

View File

@ -28,7 +28,7 @@
<span class="text-danger">*</span> <span class="text-danger">*</span>
</div> </div>
<div class="mt-2"> <div class="mt-2">
{{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.name'), 'required']) }} {{ Form::number('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.name'), 'required']) }}
<div class="invalid-feedback"> <div class="invalid-feedback">
Поле "Название" обязательно! Поле "Название" обязательно!
</div> </div>

View File

@ -4,50 +4,58 @@
<div class="row"> <div class="row">
<div class="col"> <div class="col">
<h1 class="">Изменить учебное заведение</h1> <h1 class="">Изменить учебное заведение</h1>
{{ Form::model($educationalInstitution, ['route' => ['educational_institutions.update', $educationalInstitution], 'method' => 'PATCH', 'class' => '']) }} {{ Form::model($educationalInstitution, ['route' => ['educational_institutions.update', $educationalInstitution], 'method' => 'PATCH', 'class' => 'needs-validation', 'novalidate']) }}
<div class="col"> <div class="col">
<div>
{{ Form::label('position', 'Позиция') }}
</div>
<div class="mt-2"> <div class="mt-2">
{{ Form::text('position', $educationalInstitution->position, ['class' => 'form-control']) }} {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.position')]) }}
<span class="text-danger">*</span>
</div> </div>
<div> <div class="mt-1">
{{ Form::number('position', $educationalInstitution->position, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.position'), 'required']) }}
<div class="invalid-feedback">
Поле "Позиция" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('position') }} {{ $errors->first('position') }}
@endif @endif
</div> </div>
<div>
{{ Form::label('name', 'Название') }}
</div>
<div class="mt-2"> <div class="mt-2">
{{ Form::text('name', $educationalInstitution->name, ['class' => 'form-control']) }} {{ Form::label('name', 'Название', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.name')]) }}
<span class="text-danger">*</span>
</div> </div>
<div> <div class="mt-1">
{{ Form::text('name', $educationalInstitution->name, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.name'), 'required']) }}
<div class="invalid-feedback">
Поле "Название" обязательно!
</div>
</div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('name') }} {{ $errors->first('name') }}
@endif @endif
</div> </div>
<div>
{{ Form::label('description', 'Описание') }}
</div>
<div class="mt-2"> <div class="mt-2">
{{ Form::text('description', $educationalInstitution->description, ['class' => 'form-control']) }} {{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.description')]) }}
</div> </div>
<div> <div class="mt-1">
{{ Form::text('description', $educationalInstitution->description, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.description')]) }}
</div>
<div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('description') }} {{ $errors->first('description') }}
@endif @endif
</div> </div>
<div class="mt-3"> <div class="mt-2">
{{ Form::label('slug', 'URL') }} {{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.slug')]) }}
</div> </div>
<div class="mt-1"> <div class="mt-1">
{{ Form::text('slug', $educationalInstitution->slug, ['class' => 'form-control']) }} {{ Form::text('slug', $educationalInstitution->slug, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.educational_institutions.slug')]) }}
</div> </div>
<div> <div class="text-danger">
@if ($errors->any()) @if ($errors->any())
{{ $errors->first('slug') }} {{ $errors->first('slug') }}
@endif @endif

View File

@ -7,6 +7,7 @@
<h1 class=""> Создать факультет</h1> <h1 class=""> Создать факультет</h1>
{{ Form::open(['url' => route('faculties.store'), 'method' => 'POST', 'class' => 'needs-validation', 'novalidate']) }} {{ Form::open(['url' => route('faculties.store'), 'method' => 'POST', 'class' => 'needs-validation', 'novalidate']) }}
<div class="col"> <div class="col">
<div class="mt-3"> <div class="mt-3">
{{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.faculty.position')]) }} {{ Form::label('position', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.faculty.position')]) }}
<span class="text-danger">*</span> <span class="text-danger">*</span>

View File

@ -424,10 +424,10 @@
<span class="checkmark"></span> <span class="checkmark"></span>
</label> </label>
@endif @endif
@endforeach @endforeac1
<hr class="col-5"> <hr class="col-5">
@foreach($subjects as $id => $name) @foreach($subjects as $id => $name)
@if($name !== "Русский язык" && $name !== "математика" ) @if($name !== "Русский язык" && $name !== "Математика" )
<label class="checkbox1"> {{$name }} <label class="checkbox1"> {{$name }}
<input class="checkbox_input_clear" type="checkbox" value="{{ $id }}"> <input class="checkbox_input_clear" type="checkbox" value="{{ $id }}">
<span class="checkmark"></span> <span class="checkmark"></span>

View File

@ -1,19 +0,0 @@
<?php
namespace Tests\Feature;
// use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*/
public function testTheApplicationReturnsASuccessfulResponse(): void
{
$response = $this->get('/');
$response->assertStatus(200);
}
}