diff --git a/app/Services/DirectonHtmlBuilder.php b/app/Services/DirectonHtmlBuilder.php index 86fd004..89b34f4 100644 --- a/app/Services/DirectonHtmlBuilder.php +++ b/app/Services/DirectonHtmlBuilder.php @@ -4,21 +4,23 @@ namespace App\Services; use App\Models\Direction; use Illuminate\Support\Facades\URL; +use PhpParser\Node\Expr\Array_; class DirectonHtmlBuilder { - private Direction $direction; + private array $direction; public function __construct($direction) { $this->direction = $direction; } public function getHTML() { - // phpcs:disable + $direction = $this->direction; $fon_3 = URL::to('img/front-page/bakalavr-special/fon3_blok.png'); - return "
id }\" aria-labelledby=\"offcanvasScrollingLabel-{$direction->id}\" style=\"height: 100%; font-family: Geologica-Medium; overflow-y: auto ; background-image: url({$fon_3}); color: #004329\"> + $educationForm = implode(", ", $direction['educationForm']); + return "
@@ -32,11 +34,11 @@ class DirectonHtmlBuilder
-
{$direction->code}
-
{$direction->name}
+
{$direction['code']}
+
{$direction['name']}
-

{$direction->description}

+

{$direction['description']}

@@ -46,31 +48,32 @@ class DirectonHtmlBuilder
Уровень образования: - {$direction->educationLevel->name} + {$direction['educationLevel']}


Форма обучения: - {$direction->educationForm->name} + {$educationForm} +


Бюджетные места: - {$direction->budget_places} + {$direction['budget_places']}


Квота: - {$direction->quota} + {$direction['quota']}


Места на контракт: - {$direction->paid_places} + {$direction['paid_places']}


Стоимость платного обучения: - {$direction->cost_paid_place} + {$direction['cost_paid_place']}


Период обучения (в годах): - {$direction->period} + {$direction['period']}
diff --git a/resources/views/new-design/bakalavr-special.blade.php b/resources/views/new-design/bakalavr-special.blade.php index ba98290..8f936b0 100644 --- a/resources/views/new-design/bakalavr-special.blade.php +++ b/resources/views/new-design/bakalavr-special.blade.php @@ -359,20 +359,40 @@ @foreach($faculty->departments as $department) - @foreach($department->directions as $direction) + @php + $napr = array(); + foreach ($department->directions as $direction){ + $napr[$direction->name]['educationForm'][$direction->name . ' ' . $direction->id] = $direction->educationForm->name; + $napr[$direction->name]['id'] = $direction->id; + $napr[$direction->name]['code'] = $direction->code; + $napr[$direction->name]['educationLevel'] = $direction->educationLevel->name; + $napr[$direction->name]['name'] = $direction->name; + $napr[$direction->name]['budget_places'] = $direction->budget_places; + $napr[$direction->name]['quota'] = $direction->quota; + $napr[$direction->name]['paid_places'] = $direction->paid_places; + $napr[$direction->name]['cost_paid_place'] = $direction->cost_paid_place; + $napr[$direction->name]['period'] = $direction->period; + $napr[$direction->name]['description'] = $direction->description; + + } + + + @endphp + + @foreach($napr as $el) - {{ $direction->name }} + {{ $el['name'] }} @php - $DirectonHtmlBuilder = new DirectonHtmlBuilder($direction); + $DirectonHtmlBuilder = new DirectonHtmlBuilder($el); echo $DirectonHtmlBuilder->getHTML(); @endphp - {{ $direction->code }} - {{ $direction->educationLevel->name }} - {{ $direction->educationForm->name }} + {{ $el['code'] }} + {{ $el['educationLevel'] }} + '; } ?> @endforeach @endforeach