2024-03-12 12:47:12 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
2024-03-14 13:11:18 +03:00
|
|
|
use Illuminate\Support\Facades\URL;
|
2024-03-12 12:47:12 +03:00
|
|
|
|
|
|
|
class DirectonHtmlBuilder
|
|
|
|
{
|
2024-03-15 10:38:26 +03:00
|
|
|
private array $direction;
|
2024-03-15 16:09:19 +03:00
|
|
|
|
|
|
|
|
2024-03-12 12:47:12 +03:00
|
|
|
public function __construct($direction)
|
|
|
|
{
|
|
|
|
$this->direction = $direction;
|
|
|
|
}
|
2024-03-21 14:48:08 +03:00
|
|
|
|
2024-03-12 12:47:12 +03:00
|
|
|
public function getHTML()
|
|
|
|
{
|
2024-03-15 10:38:26 +03:00
|
|
|
|
2024-03-12 13:09:48 +03:00
|
|
|
|
2024-03-12 12:47:12 +03:00
|
|
|
$direction = $this->direction;
|
2024-03-15 16:09:19 +03:00
|
|
|
|
|
|
|
|
2024-03-14 13:11:18 +03:00
|
|
|
$fon_3 = URL::to('img/front-page/bakalavr-special/fon3_blok.png');
|
2024-03-15 16:09:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
$educationForms = '';
|
|
|
|
foreach ($direction['educationForms'] as $key => $educationForm) {
|
|
|
|
$educationForms .= $key . ', ';
|
|
|
|
}
|
|
|
|
$educationForms = substr($educationForms, 0, -2);
|
|
|
|
|
|
|
|
|
2024-03-15 16:15:42 +03:00
|
|
|
// phpcs:disable
|
2024-03-15 16:09:19 +03:00
|
|
|
|
|
|
|
$budget_places_array = array();
|
2024-03-15 16:15:42 +03:00
|
|
|
foreach ($direction['educationForms'] as $key => $educationForm) {
|
2024-03-15 16:09:19 +03:00
|
|
|
$budget_places_array[$key] = $educationForm['budget_places'];
|
|
|
|
}
|
|
|
|
$budget_places = '<br>';
|
2024-03-15 16:15:42 +03:00
|
|
|
foreach ($budget_places_array as $key => $item) {
|
2024-03-15 16:09:19 +03:00
|
|
|
$budget_places .= "<span style='font-family: Geologica-ExtraLight'>$key</span> - <strong> $item </strong><br>";
|
|
|
|
}
|
|
|
|
|
|
|
|
$period_array = array();
|
|
|
|
foreach ($direction['educationForms'] as $key => $period) {
|
|
|
|
$period_array[$key] = $period['period'];
|
|
|
|
}
|
|
|
|
$period = '<br>';
|
|
|
|
foreach ($period_array as $key => $item) {
|
|
|
|
$period .= "<span style='font-family: Geologica-ExtraLight'>$key</span> - <strong> $item </strong><br>";
|
|
|
|
}
|
|
|
|
$profiles = '';
|
|
|
|
//if (array_key_exists('educationalInstitution',$direction)) echo '+++++'; else echo '----';
|
|
|
|
//exit();
|
2024-03-20 16:44:31 +03:00
|
|
|
// if (array_key_exists('educationalInstitution', $direction)) {
|
|
|
|
// foreach ($direction['educationalInstitution'] as $educationalInstitution_name => $educationalInstitution) {
|
|
|
|
//
|
|
|
|
// $profiles .= "<p> {$educationalInstitution_name}</p>";
|
|
|
|
// foreach ($educationalInstitution as $profile_name => $profile) {
|
|
|
|
// $profile_out = '<br>';
|
|
|
|
// foreach ($profile as $key => $value) {
|
|
|
|
// $profile_out .= "<span style='font-family: Geologica-ExtraLight'>{$key}</span> - <strong> {$value['budget_places']} </strong><br>";
|
|
|
|
// }
|
|
|
|
// $tmp = str_replace(' ', '', $profile_name);
|
|
|
|
// $tmp = str_replace(',', '', $tmp);
|
|
|
|
//// $print_r = '<pre>' . print_r($direction,1) . '<pre>';
|
|
|
|
// $profiles .= "
|
|
|
|
// <div class=\"accordion \" id=\"accordionPanelsStayOpenExample\">
|
|
|
|
// <div class=\"accordion-item\">
|
|
|
|
// <h2 class=\"accordion-header\">
|
|
|
|
// <button class=\"accordion-button\" type=\"button\" data-bs-toggle=\"collapse\" data-bs-target=\"#panelsStayOpen-{$tmp}\" aria-expanded=\"true\" aria-controls=\"panelsStayOpen-{$tmp}\">
|
|
|
|
// {$profile_name}
|
|
|
|
// </button>
|
|
|
|
// </h2>
|
|
|
|
// <div id=\"panelsStayOpen-{$tmp}\" class=\"accordion-collapse collapse show\">
|
|
|
|
// <div class=\"accordion-body\">
|
|
|
|
// $profile_out
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// </div>
|
|
|
|
// ";
|
|
|
|
// }
|
|
|
|
// };
|
|
|
|
// }
|
2024-03-15 16:09:19 +03:00
|
|
|
|
2024-03-15 10:38:26 +03:00
|
|
|
return "<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 ; background-image: url({$fon_3}); color: #004329\">
|
2024-03-14 13:11:18 +03:00
|
|
|
|
|
|
|
|
2024-03-21 14:48:08 +03:00
|
|
|
<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-11 d-block'>
|
|
|
|
<div class='col'>
|
|
|
|
<div class=\"display-6 \" style=\"font-family: Geologica-Light\"> {$direction['code']} </div>
|
|
|
|
<div class=\"display-6 \" > {$direction['name']}</div>
|
|
|
|
</div>
|
|
|
|
<div class='col d-flex justify-content-end'>
|
|
|
|
<div class=\"fs-5 \" style=\"font-family: Geologica-Light\">
|
|
|
|
<a href='#' role='button'> МГТУ </a> |
|
|
|
|
<a href='#' role='button' > Филиал МГТУ (пос. Яблоновский)</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr class='col-11 '>
|
|
|
|
<div class=\"mt-4\">
|
|
|
|
<p style=\"text-align: justify;\">{$direction['description']}</p>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
<div class='row'>
|
|
|
|
<div class='col-11 d-flex justify-content-end'> <a href='#' role='button'> Бюджет </a> | <a href='#' role='button' > Коммерция</a> </div>
|
|
|
|
<div class=' col-4 '>
|
|
|
|
<div class=\"p-3 px-5 border-success fs-5\" style='border-radius: 20px; border: 2px solid;'>
|
|
|
|
<div > Уровень образования:
|
|
|
|
<strong>{$direction['educationLevel']} </strong>
|
|
|
|
</div>
|
|
|
|
<div > Форма обучения:
|
|
|
|
<strong> $educationForms</strong>
|
|
|
|
</div>
|
|
|
|
<div > Период обучения (в годах):
|
|
|
|
{$period}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class=' col-7 '>
|
|
|
|
<div class=\"p-3 px-5 border-success fs-5 h-100\" style='border-radius: 20px; border: 2px solid;'>
|
|
|
|
Места для обучения:
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class='row mt-3'>
|
|
|
|
<div class=' col-9 '>
|
|
|
|
<div class=\"p-3 px-5 border-success fs-5 h-100\" style='border-radius: 20px; border: 2px solid;'>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class=' col-2 '>
|
|
|
|
<div class=\"p-3 px-5 border-success fs-5 h-100\" style='border-radius: 20px; border: 2px solid;'>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>";
|
2024-03-12 12:47:12 +03:00
|
|
|
}
|
2024-03-12 13:09:48 +03:00
|
|
|
// phpcs:enable
|
2024-03-12 12:47:12 +03:00
|
|
|
}
|