forked from aslan/applicant-site
Compare commits
7 Commits
f68e22fa9f
...
f1cefa1184
Author | SHA1 | Date |
---|---|---|
ROMANGOLIENKO | f1cefa1184 | |
aslan | d0abc35a07 | |
aslan | 5d7863a655 | |
aslan | 730573b1fe | |
aslan | b43e602fab | |
aslan | 19b075c755 | |
aslan | cc89ecabe8 |
|
@ -59,21 +59,21 @@ jobs:
|
|||
- name: Check tests
|
||||
run: make test
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: deploy to test server
|
||||
uses: appleboy/ssh-action@v1.0.3
|
||||
|
||||
with:
|
||||
host: ${{ secrets.HOST }}
|
||||
username: ${{ secrets.USERNAME }}
|
||||
password: ${{ secrets.PASSWORD }}
|
||||
port: ${{ secrets.PORT }}
|
||||
script: |
|
||||
cd /var/www/test-testabit/
|
||||
git stash
|
||||
git pull --rebase
|
||||
git stash clear
|
||||
make setup-test
|
||||
# deploy:
|
||||
# needs: build
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - name: deploy to test server
|
||||
# uses: appleboy/ssh-action@v1.0.3
|
||||
#
|
||||
# with:
|
||||
# host: ${{ secrets.HOST }}
|
||||
# username: ${{ secrets.USERNAME }}
|
||||
# password: ${{ secrets.PASSWORD }}
|
||||
# port: ${{ secrets.PORT }}
|
||||
# script: |
|
||||
# cd /var/www/test-testabit/
|
||||
# git stash
|
||||
# git pull --rebase
|
||||
# git stash clear
|
||||
# make setup-test
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Models\Direction;
|
||||
use App\Models\Faculty;
|
||||
|
||||
class PositionHelper
|
||||
|
@ -11,4 +12,10 @@ class PositionHelper
|
|||
$maxPosition = Faculty::max('position');
|
||||
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
||||
}
|
||||
|
||||
public static function direction()
|
||||
{
|
||||
$maxPosition = Direction::max('position');
|
||||
return $maxPosition >= 254 ? 255 : $maxPosition + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Department;
|
||||
use App\Models\Direction;
|
||||
use App\Models\EntranceExamination;
|
||||
use App\Models\Faculty;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CalculatorController extends Controller
|
||||
{
|
||||
public function findDirectionFromSubjects(Request $request)
|
||||
{
|
||||
$getJSON = $request->input()['predmets'];
|
||||
$getsSubjects = json_decode($getJSON);
|
||||
$countUserSubjects = count($getsSubjects);
|
||||
|
||||
$filteredDirectionIds = EntranceExamination::all()
|
||||
->select("direction_id", "subject_id")
|
||||
->groupBy('direction_id')
|
||||
->map(function ($direction) {
|
||||
return $direction->map(fn($item) => $item['subject_id']);
|
||||
})
|
||||
->filter(fn($direction) => count($direction) <= $countUserSubjects)
|
||||
->keys();
|
||||
|
||||
$directions = Direction::whereIn('id', $filteredDirectionIds)->get();
|
||||
|
||||
|
||||
$generateHtml = function ($acc, $direction) {
|
||||
$department = Department::find($direction->department_id);
|
||||
$faculty = Faculty::find($department->faculty_id);
|
||||
|
||||
return "{$acc} <tr class=\"\">
|
||||
<td id=\"faculty\"> {$faculty->name} </td>
|
||||
<td> {$direction->name} </td>
|
||||
<td class=\"text-end\"> {$direction->period} </td>
|
||||
</tr>";
|
||||
};
|
||||
|
||||
$html = $directions->reduce($generateHtml, '');
|
||||
|
||||
return response()->json(['html' => $html]);
|
||||
}
|
||||
}
|
|
@ -6,6 +6,6 @@ return [
|
|||
'name' => 'Поле "Название" должно быть уникальным для отображения на сайте',
|
||||
'description' => 'Поле "Описание" может быть пустым для отображения на сайте',
|
||||
'educational_institution_id' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению',
|
||||
'URL' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению'
|
||||
'slug' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению'
|
||||
]
|
||||
];
|
||||
|
|
|
@ -3,10 +3,35 @@
|
|||
|
||||
return [
|
||||
'faculty' => [
|
||||
'position' => 'Поле "Позиция" нужно для упарядочивания отображения на сайте',
|
||||
'position' => 'Поле "Позиция" нужно для упорядочивания отображения на сайте',
|
||||
'name' => 'Поле "Название" должно быть уникальным для отображения на сайте',
|
||||
'description' => 'Поле "Описание" может быть пустым для отображения на сайте',
|
||||
'educational_institution_id' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению',
|
||||
'URL' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению'
|
||||
]
|
||||
'slug' => 'Поле "URL" нужно для отображения в браузере'
|
||||
],
|
||||
'direction' => [
|
||||
'position' => 'Поле "Позиция" нужно для упорядочивания отображения на сайте',
|
||||
'name' => 'Поле "Название" должно быть уникальным для отображения на сайте',
|
||||
'description' => 'Поле "Описание" может быть пустым для отображения на сайте',
|
||||
'educational_institution_id' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению',
|
||||
'department_id' => 'Поле "Кафедра" указывает на привязку направления к кафедре',
|
||||
'education_level_id' => 'Поле "Уровень Образования" указывает на привязку направления к уровню образованию',
|
||||
'education_form_id' => 'Поле "Форма образования" указывает на привязку направления к форма образованию',
|
||||
'budget_places' => 'Поле "Бюджетные места" указывает на количество бюджетных мест в направлении',
|
||||
'paid_places' => 'Поле "Платные места" указывает на количество платных мест в направлении',
|
||||
'cost_paid_place' => 'Поле "Стоимость обучения" указывает на стоимость платных мест в направлении',
|
||||
'slug' => 'Поле "Учебное заведение" указывает на привязку к учебному заведению',
|
||||
'code' => 'Поле "URL" нужно для отображения в браузере',
|
||||
'quota' => 'Поле "Квота" указывает на количество мест по квоте',
|
||||
'period' => 'Поле "Период обучения" указывает на период обучения',
|
||||
'direction_profile' => 'Поле "Профиль подготовки" указывает на привязку направления к профилям подготовки',
|
||||
|
||||
],
|
||||
'entrance-examination' => [
|
||||
'examination_type_id' => 'Поле "Тип экзамена" указывает на привязку вступительного испытания к типу экзамена',
|
||||
'subject_id' => 'Поле "Предмет" указывает на привязку вступительного испытания к предмету',
|
||||
'subject_type_id' => 'Поле "Тип Предмета" указывает на привязку вступительного испытания к типу предмету',
|
||||
'scores' => 'Поле "Кол-во баллов" указывает на привязку вступительного испытания к Кол-ву баллов',
|
||||
'position' => 'Поле "Позиция" нужно для упорядочивания отображения на сайте',
|
||||
],
|
||||
];
|
||||
|
|
|
@ -1,15 +1,20 @@
|
|||
@php use App\Helpers\PositionHelper; @endphp
|
||||
@extends('layouts.admin_layout')
|
||||
@section('content')
|
||||
@auth()
|
||||
<h1 class=""> Создать Направление</h1>
|
||||
{{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => '']) }}
|
||||
{{ Form::open(['url' => route('directions.store'), 'method' => 'POST', 'class' => 'needs-validation', 'novalidate']) }}
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::select('department_id', $departments, null, ['class' => 'form-select']) }}
|
||||
{{ Form::select('department_id', $departments, null, ['class' => 'form-select', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.department_id'), 'required']) }}
|
||||
<div class="invalid-feedback">
|
||||
Поле "Кафедра" обязательно!
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -19,10 +24,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::select('education_level_id', $levels, null, ['class' => 'form-select']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -32,10 +38,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::select('education_form_id', $forms, null, ['class' => 'form-select']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -47,10 +54,11 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::number('position', '', ['class' => 'form-control']) }}
|
||||
{{ Form::number('position', PositionHelper::direction(), ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.position'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -60,10 +68,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('code', 'Код') }}
|
||||
{{ Form::label('code', 'Код', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('code', '', ['class' => 'form-control']) }}
|
||||
{{ Form::text('code', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.code'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -73,10 +82,10 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('slug', 'URL') }}
|
||||
{{ Form::label('slug', 'URL', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('slug', '', ['class' => 'form-control']) }}
|
||||
{{ Form::text('slug', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.slug')]) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -86,10 +95,11 @@
|
|||
</div>
|
||||
|
||||
<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 class="mt-1">
|
||||
{{ Form::text('name', '', ['class' => 'form-control']) }}
|
||||
{{ Form::text('name', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -98,10 +108,10 @@
|
|||
</div>
|
||||
|
||||
<div class="mt-3">
|
||||
{{ Form::label('description', 'Описание') }}
|
||||
{{ Form::label('description', 'Описание', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.description')]) }}
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::text('description', '', ['class' => 'form-control']) }}
|
||||
{{ Form::text('description', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.name')]) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -110,14 +120,14 @@
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::number('budget_places', null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('budget_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.budget_places'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -127,10 +137,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::number('quota', null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('quota', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.quota'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -140,10 +151,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::number('paid_places', null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('paid_places', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.paid_places'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -154,10 +166,11 @@
|
|||
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::number('cost_paid_place', null, ['class' => 'form-select']) }}
|
||||
{{ Form::number('cost_paid_place', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.cost_paid_place'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -168,10 +181,11 @@
|
|||
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::text('period', null, ['class' => 'form-select']) }}
|
||||
{{ Form::text('period', null, ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.direction.period'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -184,10 +198,11 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<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 class="mt-1">
|
||||
{{ Form::select('direction_profiles[]', $directionProfiles, null, ['class' => 'form-control rounded border-gray-300 w-1/3 h-32', 'multiple' => 'multiple']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -204,10 +219,11 @@
|
|||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][examination_type_id]', 'Тип экзамена') }}
|
||||
{{ Form::label('entrance-examination[0][examination_type_id]', 'Тип экзамена', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.examination_type_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1">
|
||||
{{ Form::select('entrance-examination[0][examination_type_id]', $examination_types, null, ['class' => 'form-select']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -217,10 +233,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][subject_id]', 'Предмет') }}
|
||||
{{ Form::label('entrance-examination[0][subject_id]', 'Предмет', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::select('entrance-examination[0][subject_id]', $subjects, null, ['class' => 'form-select']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -230,10 +247,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][subject_type_id]', 'Тип предмета') }}
|
||||
{{ Form::label('entrance-examination[0][subject_type_id]', 'Тип предмета', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.subject_type_id')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::select('entrance-examination[0][subject_type_id]', $subjectTypes, null, ['class' => 'form-select']) }}
|
||||
{{ 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>
|
||||
@if ($errors->any())
|
||||
|
@ -243,10 +261,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][scores]', 'Кол-во баллов') }}
|
||||
{{ Form::label('entrance-examination[0][scores]', 'Кол-во баллов', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::text('entrance-examination[0][scores]', '', ['class' => 'form-control']) }}
|
||||
{{ Form::number('entrance-examination[0][scores]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.scores'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -256,10 +275,11 @@
|
|||
</div>
|
||||
<div class="col">
|
||||
<div class="mt-3">
|
||||
{{ Form::label('entrance-examination[0][position]', 'Позиция') }}
|
||||
{{ Form::label('entrance-examination[0][position]', 'Позиция', ['data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position')]) }}
|
||||
<span class="text-danger">*</span>
|
||||
</div>
|
||||
<div class="mt-1 col">
|
||||
{{ Form::text('entrance-examination[0][position]', '', ['class' => 'form-control']) }}
|
||||
{{ Form::number('entrance-examination[0][position]', '', ['class' => 'form-control', 'data-bs-toggle' => "tooltip", 'data-bs-title' => __('tooltips.entrance-examination.position'), 'required']) }}
|
||||
</div>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
|
@ -282,6 +302,7 @@
|
|||
{{ Form::close() }}
|
||||
</div>
|
||||
@include('admin.catalog.direction.script')
|
||||
@include('layouts.bootstrap_validation')
|
||||
@endauth
|
||||
@endsection
|
||||
|
||||
|
|
|
@ -81,22 +81,5 @@
|
|||
</div>
|
||||
</div>
|
||||
@endauth
|
||||
<script>
|
||||
(function () {
|
||||
'use strict'
|
||||
var forms = document.querySelectorAll('.needs-validation')
|
||||
|
||||
Array.prototype.slice.call(forms)
|
||||
.forEach(function (form) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
</script>
|
||||
@include('layouts.bootstrap_validation')
|
||||
@endsection
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<script>
|
||||
(function () {
|
||||
'use strict'
|
||||
var forms = document.querySelectorAll('.needs-validation')
|
||||
|
||||
Array.prototype.slice.call(forms)
|
||||
.forEach(function (form) {
|
||||
form.addEventListener('submit', function (event) {
|
||||
if (!form.checkValidity()) {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
form.classList.add('was-validated')
|
||||
}, false)
|
||||
})
|
||||
})()
|
||||
</script>
|
|
@ -494,17 +494,20 @@
|
|||
</div>
|
||||
<script>window.onload = function() {
|
||||
$(".calcul input").click(function(){
|
||||
var selected = []; let predmets='';
|
||||
$('.text-remove').remove();
|
||||
let selected = []; let predmets='';
|
||||
$('.calcul input:checked').each(function() {
|
||||
selected.push($(this).val());
|
||||
predmets += $(this).val()+',';
|
||||
});
|
||||
console.log(selected);
|
||||
|
||||
$(".calcul_rez").html('<tr><td>обрабатываем</td></tr>');
|
||||
$.ajax({ url: "json.php", dataType: 'json', cache:false,type: "POST",data: 'ajx=get_napr&format=html&predmets='+selected,
|
||||
|
||||
$.ajax({ url: "{{ route('calculator') }}", dataType: 'json', cache:false,type: "POST",data: 'ajx=get_napr&format=html&predmets='+JSON.stringify(selected),
|
||||
success: function(data) {
|
||||
$(".calcul_rez").html(data.html);
|
||||
$(".calcul_rez").html('<tr><th> Факультет </th><th> Направление </th><th align="right"> Период обучения (в годах)</th></tr>');
|
||||
$(".calcul_rez").append(data.html);
|
||||
console.log(data);
|
||||
}});
|
||||
});
|
||||
};
|
||||
|
@ -516,7 +519,7 @@
|
|||
|
||||
<div class="d-md-flex d-none border border-white py-5 justify-content-center" style="border-radius: 50px;">
|
||||
<table class="table1 text-white mx-0 p-2 calcul_rez" style="width: 90%; font-family: Geologica-ExtraLight;">
|
||||
Выберите предметы
|
||||
<span class="text-remove">Выберите предметы</span>
|
||||
|
||||
</table>
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\admin\PageController;
|
||||
use App\Http\Controllers\Api\CalculatorController;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
@ -19,4 +20,4 @@ Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
|
|||
return $request->user();
|
||||
});
|
||||
|
||||
Route::post('/calc', [PageController::class, 'calculator'])->name('calculator');
|
||||
Route::post('/calculator', [CalculatorController::class, 'findDirectionFromSubjects'])->name('calculator');
|
||||
|
|
Loading…
Reference in New Issue