diff --git a/app/Http/Controllers/admin/Catalog/DirectionController.php b/app/Http/Controllers/admin/Catalog/DirectionController.php index c8c0fd3..969add8 100644 --- a/app/Http/Controllers/admin/Catalog/DirectionController.php +++ b/app/Http/Controllers/admin/Catalog/DirectionController.php @@ -54,6 +54,19 @@ class DirectionController extends Controller $department = $direction->department; $faculty = Faculty::find($department->faculty->id); $educationalInstitution = $faculty->educationalInstitution; + + $ege = $direction->entranceExaminations->where('examination_type_id', '=', '1')->pluck('scores', 'subject_id'); + $spo = $direction->entranceExaminations->where('examination_type_id', '=', '2')->pluck('scores', 'subject_id'); + $magistracy = $direction + ->entranceExaminations + ->where('examination_type_id', '=', '3') + ->pluck('scores', 'subject_id'); + + $budget = $direction->places->where('place_type_id', '=', '1')->pluck('amount', 'education_form_id'); + $paid = $direction->places->where('place_type_id', '=', '2')->pluck('amount', 'education_form_id'); + + $costs = $direction->costs->pluck('cost', 'education_form_id'); + return view( 'admin.catalog.direction.show', compact( @@ -61,6 +74,12 @@ class DirectionController extends Controller 'educationalInstitution', 'faculty', 'department', + 'ege', + 'spo', + 'magistracy', + 'budget', + 'paid', + 'costs', ) ); } diff --git a/app/Models/Direction.php b/app/Models/Direction.php index 6e0abca..082638e 100644 --- a/app/Models/Direction.php +++ b/app/Models/Direction.php @@ -54,4 +54,9 @@ class Direction extends Model { return $this->hasMany('App\Models\DirectionProfile', 'direction_id'); } + + public function periods(): HasMany + { + return $this->hasMany('App\Models\Period', 'direction_id'); + } } diff --git a/resources/views/admin/catalog/direction/show.blade.php b/resources/views/admin/catalog/direction/show.blade.php index cfb1c67..c39ea2b 100644 --- a/resources/views/admin/catalog/direction/show.blade.php +++ b/resources/views/admin/catalog/direction/show.blade.php @@ -1,3 +1,7 @@ +@php + use App\Models\Subject; + use App\Models\EducationForm; +@endphp @extends('layouts.admin_layout') @section('content') @auth() @@ -13,20 +17,96 @@
{{ $direction->name }}
-{{ $direction->description }}
-{{ $direction->position }}
-{{ $direction->slug }}
-{{ $direction->educationLevel->name }}
-{{ $direction->educationForm->name }}
++ {{ $direction->educationLevel->name }} +
+ ++ {{ $direction->educationForm->name }} +
+ @if(count($ege) !== 0) +{{ $subject->name }} - {{ $scores }}
+ @endforeach + @endif + @if(count($spo) !== 0) +{{ $subject->name }} - {{ $scores }}
+ @endforeach + @endif + @if(count($magistracy) !== 0) +{{ $subject->name }} - {{ $scores }}
+ @endforeach + @endif + +{{ $educationForm->name }} - {{ $amount }}
+ @endforeach + +{{ $educationForm->name }} - {{ $amount }}
+ @endforeach + +{{ $educationForm->name }} - {{ $cost }}
+ @endforeach + +{{ $profile->name }}
+ @endforeach + +{{ $educationForm->name }} - {{ $period->period }}
+ @endforeach + + +