Compare commits

..

No commits in common. "50be5bfd70450863226244c46ffa98c06db1eabe" and "33b803472dfe5a845ca71b8275d4cabef74f1887" have entirely different histories.

13 changed files with 45 additions and 144 deletions

View File

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

View File

@ -73,7 +73,6 @@ class DirectionController extends Controller
$direction->period = $validated['period']; $direction->period = $validated['period'];
$direction->save(); $direction->save();
if (array_key_exists('entrance-examination', $validated)) {
foreach ($validated['entrance-examination'] as $data) { foreach ($validated['entrance-examination'] as $data) {
$entranceExamination = new EntranceExamination(); $entranceExamination = new EntranceExamination();
$entranceExamination->examination_type_id = $data['examination_type_id']; $entranceExamination->examination_type_id = $data['examination_type_id'];
@ -84,8 +83,6 @@ class DirectionController extends Controller
$entranceExamination->subject_type_id = $data['subject_type_id']; $entranceExamination->subject_type_id = $data['subject_type_id'];
$entranceExamination->save(); $entranceExamination->save();
} }
}
if (array_key_exists('direction_profiles', $validated)) { if (array_key_exists('direction_profiles', $validated)) {

View File

@ -21,4 +21,14 @@ class EducationForm extends Model
{ {
return $this->hasMany('App\Models\Direction', 'education_form_id'); 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", "fakerphp/faker": "^1.23.1",
"guzzlehttp/guzzle": "^7.8.1", "guzzlehttp/guzzle": "^7.8.1",
"imangazaliev/didom": "^2.0.1", "imangazaliev/didom": "^2.0.1",
"laravel/framework": "^10.46.0", "laravel/framework": "^10.44.0",
"laravel/sanctum": "^3.3.3", "laravel/sanctum": "^3.3.3",
"laravel/tinker": "^2.9.0", "laravel/tinker": "^2.9.0",
"laravel/ui": "^4.4.0", "laravel/ui": "^4.4.0",
@ -21,16 +21,16 @@
"twbs/bootstrap": "5.2.3" "twbs/bootstrap": "5.2.3"
}, },
"require-dev": { "require-dev": {
"laravel/breeze": "^1.29.0", "laravel/breeze": "^1.28.2",
"laravel/pint": "^1.14.0", "laravel/pint": "^1.13.11",
"laravel/sail": "^1.28.1", "laravel/sail": "^1.27.4",
"mockery/mockery": "^1.6.7", "mockery/mockery": "^1.6.7",
"nunomaduro/collision": "^7.10.0", "nunomaduro/collision": "^7.10.0",
"phpunit/phpunit": "^10.5.11", "phpunit/phpunit": "^10.5.10",
"spatie/laravel-ignition": "^2.4.2", "spatie/laravel-ignition": "^2.4.2",
"barryvdh/laravel-ide-helper": "^2.15.1", "barryvdh/laravel-ide-helper": "^2.15.1",
"squizlabs/php_codesniffer": "^3.9.0", "squizlabs/php_codesniffer": "^3.8.1",
"phpstan/phpstan": "^1.10.59" "phpstan/phpstan": "^1.10.57"
}, },
"autoload": { "autoload": {
"psr-4": { "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "d33acbf60a62d946e0b4a7923aab2689", "content-hash": "508caf2079a4111080260230b4ab3370",
"packages": [ "packages": [
{ {
"name": "brick/math", "name": "brick/math",

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

@ -318,8 +318,8 @@
</div> </div>
<div class="row d-flex justify-content-md-start justify-content-center"> <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 "> <div class="mt-xl-5 col-xxl-4 col-md-6 col-10 ">
<!-- Button trigger modal --> <!-- Button trigger modal -->
@ -331,7 +331,7 @@
<!-- Modal --> <!-- Modal -->
<div class="modal fade" id="exampleModal-{{ $faculty->id }}" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true"> <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-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"> <div class="modal-header d-flex justify-content-center">
<img class="" style="width: 108px; height: auto " src="{{ URL::to('img/faculties/5.png') }}" alt=""> <img class="" style="width: 108px; height: auto " src="{{ URL::to('img/faculties/5.png') }}" alt="">
@ -352,65 +352,11 @@
<th> Уровень образования </th> <th> Уровень образования </th>
<th> Форма обучения </th> <th> Форма обучения </th>
</tr> </tr>
@foreach($faculty->departments as $department) @foreach($faculty->departments as $department)
@foreach($department->directions as $direction) @foreach($department->directions as $direction)
<tr> <tr>
<td> <td> {{ $direction->name }} </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->code }} </td>
<td> {{ $direction->educationLevel->name }} </td> <td> {{ $direction->educationLevel->name }} </td>
<td> {{ $direction->educationForm->name }} </td> <td> {{ $direction->educationForm->name }} </td>
@ -571,14 +517,14 @@
<div class="row"> <div class="row">
<div class="text-white display-6" > Выберите предметы ЕГЭ</div> <div class="text-white display-6" > Выберите предметы ЕГЭ</div>
<form class="text-white mt-4 fs-4 calcul" style=" font-family: Geologica-ExtraLight"> <form class="text-white mt-4 fs-4" style=" font-family: Geologica-ExtraLight">
<label class="checkbox1"> Русский язык <label class="checkbox1"> Русский язык
<input type="checkbox" checked="checked" value="5"> <input type="checkbox" checked="checked">
<span class="checkmark"></span> <span class="checkmark"></span>
</label> </label>
<label class="checkbox1">Математика <label class="checkbox1">Математика
<input type="checkbox" name="subject[]" value="10"> <input type="checkbox">
<span class="checkmark"></span> <span class="checkmark"></span>
</label> </label>
@ -620,30 +566,13 @@
<div class="row d-md-block d-flex ms-md-3 justify-content-center"> <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 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> </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> </div>
<div class="col-md-6 mt-md-0 mt-5 col-12"> <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;"> <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;"> <table class="table1 text-white mx-0 p-2 " style="width: 90%; font-family: Geologica-ExtraLight;">
<tr class="border-bottom border-white"> <tr class="border-bottom border-white">
<td> Технологический факультет </td> <td> Технологический факультет </td>
<td> Строительство </td> <td> Строительство </td>

View File

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

View File

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

View File

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