Compare commits

..

6 Commits

13 changed files with 144 additions and 45 deletions

View File

@ -33,7 +33,6 @@ class DirectionProfileController extends Controller
$directionProfile->description = $validated['description'];
$directionProfile->slug = $validated['slug'];
$directionProfile->position = $validated['position'];
$directionProfile->direction_id = $validated['direction_id'];
$directionProfile->save();
return redirect()->route('direction_profiles.index');
@ -61,7 +60,6 @@ class DirectionProfileController extends Controller
$directionProfile->description = $validated['description'];
$directionProfile->slug = $validated['slug'];
$directionProfile->position = $validated['position'];
$directionProfile->direction_id = $validated['direction_id'];
$directionProfile->save();
return redirect()->route('direction_profiles.index');
@ -69,6 +67,9 @@ class DirectionProfileController extends Controller
public function destroy(DirectionProfile $directionProfile): RedirectResponse
{
if ($directionProfile->direction()->exists()) {
return back();
}
$directionProfile->delete();
return redirect()->route('direction_profiles.index');
}

View File

@ -73,18 +73,21 @@ class DirectionController extends Controller
$direction->period = $validated['period'];
$direction->save();
foreach ($validated['entrance-examination'] as $data) {
$entranceExamination = new EntranceExamination();
$entranceExamination->examination_type_id = $data['examination_type_id'];
$entranceExamination->direction_id = $direction->id;
$entranceExamination->subject_id = $data['subject_id'];
$entranceExamination->scores = $data['scores'];
$entranceExamination->position = $data['position'];
$entranceExamination->subject_type_id = $data['subject_type_id'];
$entranceExamination->save();
if (array_key_exists('entrance-examination', $validated)) {
foreach ($validated['entrance-examination'] as $data) {
$entranceExamination = new EntranceExamination();
$entranceExamination->examination_type_id = $data['examination_type_id'];
$entranceExamination->direction_id = $direction->id;
$entranceExamination->subject_id = $data['subject_id'];
$entranceExamination->scores = $data['scores'];
$entranceExamination->position = $data['position'];
$entranceExamination->subject_type_id = $data['subject_type_id'];
$entranceExamination->save();
}
}
if (array_key_exists('direction_profiles', $validated)) {
$direction->directionProfiles()->attach($validated['direction_profiles']);
}

View File

@ -21,14 +21,4 @@ class EducationForm extends Model
{
return $this->hasMany('App\Models\Direction', 'education_form_id');
}
public function places(): HasMany
{
return $this->hasMany('App\Models\Place', 'education_form_id');
}
public function costs(): HasMany
{
return $this->hasMany('App\Models\Cost', 'education_form_id');
}
}

View File

@ -12,7 +12,7 @@
"fakerphp/faker": "^1.23.1",
"guzzlehttp/guzzle": "^7.8.1",
"imangazaliev/didom": "^2.0.1",
"laravel/framework": "^10.44.0",
"laravel/framework": "^10.46.0",
"laravel/sanctum": "^3.3.3",
"laravel/tinker": "^2.9.0",
"laravel/ui": "^4.4.0",
@ -21,16 +21,16 @@
"twbs/bootstrap": "5.2.3"
},
"require-dev": {
"laravel/breeze": "^1.28.2",
"laravel/pint": "^1.13.11",
"laravel/sail": "^1.27.4",
"laravel/breeze": "^1.29.0",
"laravel/pint": "^1.14.0",
"laravel/sail": "^1.28.1",
"mockery/mockery": "^1.6.7",
"nunomaduro/collision": "^7.10.0",
"phpunit/phpunit": "^10.5.10",
"phpunit/phpunit": "^10.5.11",
"spatie/laravel-ignition": "^2.4.2",
"barryvdh/laravel-ide-helper": "^2.15.1",
"squizlabs/php_codesniffer": "^3.8.1",
"phpstan/phpstan": "^1.10.57"
"squizlabs/php_codesniffer": "^3.9.0",
"phpstan/phpstan": "^1.10.59"
},
"autoload": {
"psr-4": {

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "508caf2079a4111080260230b4ab3370",
"content-hash": "d33acbf60a62d946e0b4a7923aab2689",
"packages": [
{
"name": "brick/math",

View File

@ -8,9 +8,6 @@ use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
User::factory()->create([

2
public/js/jquery-3.7.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

28
public/json.php Normal file
View File

@ -0,0 +1,28 @@
<?php
header('Content-Type: application/json; charset=utf-8');
if(isset($_POST['ajx'])) {
if($_POST['ajx']=='get_fak_info') {
}
if($_POST['ajx']=='get_napr') {
if(isset($_POST['format'])&&$_POST['format']=='html'){
$out['html'] = '
<tr class="border-bottom border-white">
<td> Технологический факультет 1</td>
<td> Строительство </td>
<td class="text-end"> 4 года</td>
</tr>
<tr class="border-bottom border-white">
<td> Технологический факультет 2</td>
<td> Строительство </td>
<td class="text-end"> 4 года</td>
</tr>
';
}
;
}
echo json_encode($out);
}
//echo '<table><tr><td>1</td><td>2</td></tr></table>';

View File

@ -15,6 +15,7 @@
<link rel="stylesheet" type="text/css" href="{{ asset('css/bootstrap.css') }}">
<link rel="stylesheet" type="js" href="{{ asset('js/bootstrap-bundle.js') }}">
<script src="{{ asset('js/jquery-3.7.1.min.js') }}"></script>

View File

@ -34,7 +34,7 @@
}
body {
{{--background-image: url({{ URL::to('img/front-page/fon1_blok.png') }});--}}
overflow-x: hidden;
overflow-x: hidden;
background-repeat: no-repeat;
width: 100%;
height: 100%;
@ -318,8 +318,8 @@ overflow-x: hidden;
</div>
<div class="row d-flex justify-content-md-start justify-content-center">
@foreach($faculties as $faculty)
@foreach($faculties as $faculty)
<div class="mt-xl-5 col-xxl-4 col-md-6 col-10 ">
<!-- Button trigger modal -->
@ -331,7 +331,7 @@ overflow-x: hidden;
<!-- Modal -->
<div class="modal fade" id="exampleModal-{{ $faculty->id }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl" >
<div class="modal-content" style="border-radius: 30px;">
<div class="modal-content" > <!--style="border-radius: 30px;"-->
<div class="modal-header d-flex justify-content-center">
<img class="" style="width: 108px; height: auto " src="{{ URL::to('img/faculties/5.png') }}" alt="">
@ -352,11 +352,65 @@ overflow-x: hidden;
<th> Уровень образования </th>
<th> Форма обучения </th>
</tr>
@foreach($faculty->departments as $department)
@foreach($department->directions as $direction)
<tr>
<td> {{ $direction->name }} </td>
<td>
<a class="" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasScrolling-{{ $direction->id }}" aria-controls="offcanvasScrolling" role="button">{{ $direction->name }}</a>
<div class="offcanvas offcanvas-bottom" data-bs-scroll="true" data-bs-backdrop="false" tabindex="-1" id="offcanvasScrolling-{{ $direction->id }}" aria-labelledby="offcanvasScrollingLabel-{{ $direction->id }}" style="height: 100%; font-family: Geologica-Medium;overflow-y: auto ;">
<div class="mx-5">
<div class="col-12 d-flex justify-content-end mt-4">
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="row">
<div class="col-xl-3 col-12">
<div class="display-5 " style="font-family: Geologica-Light">{{ $direction->code }} </div>
<div class="display-5 " > {{ $direction->name }}</div>
</div>
</div>
<div class="row">
<div class="col-xl-3 col-12">
<br>
<br>
<div class=" "> Уровень образования: <span style="font-family: Geologica-Light">{{ $direction->educationLevel->name }} </span> </div>
<div class=" "> Форма обучения: <span style="font-family: Geologica-Light">{{ $direction->educationForm->name }} </span></div>
</div>
<div class="col-xl-3 col-12">
<br>
<br>
<div class=" "> Бюджетные места: <span style="font-family: Geologica-Light">{{ $direction->budget_places }} </span> </div>
<div class=" "> Квота: <span style="font-family: Geologica-Light">{{ $direction->quota }} </span></div>
</div>
<div class="col-xl-3 col-12">
<br>
<br>
<div class=" "> Места на контракт: <span style="font-family: Geologica-Light">{{ $direction->paid_places }} </span> </div>
<div class=" "> Стоимость платного обучения: <span style="font-family: Geologica-Light">{{ $direction->cost_paid_place }} </span></div>
</div>
<div class="col-xl-3 col-12">
<br>
<br>
<div class=" "> Период обучения (в годах): <span style="font-family: Geologica-Light">{{ $direction->period }} </span> </div>
</div>
</div>
{{-- <p class="display-5 " style="font-family: Geologica-Light">{{ $direction->code }} </p>--}}
{{-- <p class="display-5 " > {{ $direction->name }}</p>--}}
<div class="offcanvas-body mt-2" style="font-family: Geologica-ExtraLight">
<p style="text-align: justify;">{{ $direction->description }}</p>
<p style="text-align: justify;">{{ $direction->description }}</p>
</div>
</div>
</div>
</td>
<td> {{ $direction->code }} </td>
<td> {{ $direction->educationLevel->name }} </td>
<td> {{ $direction->educationForm->name }} </td>
@ -517,14 +571,14 @@ overflow-x: hidden;
<div class="row">
<div class="text-white display-6" > Выберите предметы ЕГЭ</div>
<form class="text-white mt-4 fs-4" style=" font-family: Geologica-ExtraLight">
<form class="text-white mt-4 fs-4 calcul" style=" font-family: Geologica-ExtraLight">
<label class="checkbox1"> Русский язык
<input type="checkbox" checked="checked">
<input type="checkbox" checked="checked" value="5">
<span class="checkmark"></span>
</label>
<label class="checkbox1">Математика
<input type="checkbox">
<input type="checkbox" name="subject[]" value="10">
<span class="checkmark"></span>
</label>
@ -566,13 +620,30 @@ overflow-x: hidden;
<div class="row d-md-block d-flex ms-md-3 justify-content-center">
<div style="border-radius: 11px; font-family: Geologica-ExtraLight" class="mt-4 col-5 text-white p-2 border border-white d-inline-flex justify-content-center shadow"> Сбросить фильтр </div>
</div>
<script>window.onload = function() {
$(".calcul input").click(function(){
var 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='+predmets,
success: function(data) {
$(".calcul_rez").html(data.html);
}});
});
};
</script>
</div>
</div>
<div class="col-md-6 mt-md-0 mt-5 col-12">
<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 " style="width: 90%; font-family: Geologica-ExtraLight;">
<table class="table1 text-white mx-0 p-2 calcul_rez" style="width: 90%; font-family: Geologica-ExtraLight;">
<tr class="border-bottom border-white">
<td> Технологический факультет </td>
<td> Строительство </td>

View File

@ -1,6 +1,7 @@
<?php
use App\Http\Controllers\admin\PageController;
use App\Models\Faculty;
use Illuminate\Support\Facades\Route;
Route::get('/inostran', function () {
@ -11,11 +12,12 @@ Route::get('/magistr', function () {
return view('new-design.magistr');
})->name('magistr');
Route::get('/', [PageController::class, 'directions'])->name('/bakalavr-special');
Route::get('/home', [PageController::class, 'directions'])->name('home');
//Route::get('/', function () {
// return view('new-design.bakalavr-special');
//})->name('bakalavr-special');
Route::get('/', function () {
$faculties = Faculty::all();
return view('new-design.bakalavr-special', compact('faculties'));
})->name('bakalavr-special');
Route::get('/course', function () {
return view('menu.course');

View File

@ -47,6 +47,11 @@ class DirectionTest extends TestCase
'education_level_id',
'education_form_id',
'department_id',
'budget_places',
'quota',
'paid_places',
'cost_paid_place',
'period'
]);
$this->user = User::factory()->create([

View File

@ -36,7 +36,6 @@ class DirectionProfileTest extends TestCase
'position',
'description',
'slug',
'direction_id',
]);
$this->user = User::factory()->create([