direction = $direction; } public function getHTML() { $direction = $this->direction; $fon_3 = URL::to('img/front-page/bakalavr-special/fon2_blok.png'); $green_circle = URL::to('img/front-page/green-circle.png'); $education_form = ''; foreach ($direction['education_form'] as $el) { $education_form .= $el . ', '; } $education_form = substr($education_form, 0, -2); $period = '
'; foreach ($direction['period'] as $key => $el) { $period .= '' . $key . ' - ' . '' . $el . '
' ; } //dd($direction); $paid_cost = '
Стоимость обучения
'; foreach ($direction['cost_paid_place'] as $key => $el) { $paid_cost .= '' . $key . ' - ' . '' . $el . '
' ; } $paid_cost .= '
'; $EGE = '
ЕГЭ
'; foreach ($direction['entrance_examinations']['ЕГЭ']['Обязательные'] as $key => $el) { $EGE .= '' . $key . ' - ' . '' . $el . '
' ; } $EGE .= '
'; $po_viboru = '
Предметы по выбору
'; if (array_key_exists('Предметы по выбору', $direction['entrance_examinations']['ЕГЭ'])) { foreach ($direction['entrance_examinations']['ЕГЭ']['Предметы по выбору'] as $key => $el) { $po_viboru .= '' . $key . ' - ' . '' . $el . '
' ; } $po_viboru .= '
'; } else { $po_viboru = ''; } $SPO = '
СПО
'; if (array_key_exists('СПО', $direction['entrance_examinations'])) { foreach ($direction['entrance_examinations']['СПО']['Обязательные'] as $key => $el) { $SPO .= '' . $key . ' - ' . '' . $el . '
' ; } $SPO .= '
'; } else { $SPO = ''; } $mgtu = ''; if (array_key_exists('МГТУ', $direction['budget_places'])) { foreach ($direction['budget_places']['МГТУ'] as $profile_name => $profile) { $profile_content = ''; foreach ($profile as $forms => $budget_places) { $profile_content .= " {$forms} - " . " {$budget_places}
"; } $tmp = str_replace(' ', '', $profile_name); $tmp = str_replace(',', '', $tmp); $mgtu .= "

$profile_content
" ; } } // if($direction['name'] == 'Нефтегазовое дело') { // dd($direction); // }; // dd($direction); $filial = ''; if (array_key_exists('Филиал МГТУ (пос. Яблоновский)', $direction['budget_places'])) { foreach ($direction['budget_places']['Филиал МГТУ (пос. Яблоновский)'] as $profile_name => $profile) { $profile_content = ''; foreach ($profile as $forms => $budget_places) { $profile_content .= " {$forms} - " . " {$budget_places}
"; } $tmp = str_replace(' ', '', $profile_name); $tmp = str_replace(',', '', $tmp); $filial .= "

$profile_content
" ; } } else { $filial = '
Этой специальности нет в филиалле
'; } $paid_places_content = ''; foreach ($direction['paid_places'] as $institution) { foreach ($institution as $profile_name => $profile) { $profile_content = ''; foreach ($profile as $forms => $paid_places) { $profile_content .= " {$forms} - " . " {$paid_places}
"; } $tmp = str_replace(' ', '', $profile_name); $tmp = str_replace(',', '', $tmp); $paid_places_content .= "

$profile_content
" ; } } return "
{$direction['code']}
{$direction['name']}

{$direction['description']}

Уровень образования: {$direction['education_level']}
Форма обучения: {$education_form}
Период обучения (в годах): $period
Места для обучения:

Бюджет

{$mgtu}

Коммерция

$paid_places_content
Проходные баллы:
$EGE $po_viboru $SPO
$paid_cost
"; } // phpcs:enable }