Roman_applicant-site/app/Services/DirectonHtmlBuilder.php

95 lines
6.7 KiB
PHP
Raw Normal View History

2024-03-12 12:47:12 +03:00
<?php
namespace App\Services;
use App\Models\Direction;
2024-03-14 13:11:18 +03:00
use Illuminate\Support\Facades\URL;
2024-03-15 10:38:26 +03:00
use PhpParser\Node\Expr\Array_;
2024-03-12 12:47:12 +03:00
class DirectonHtmlBuilder
{
2024-03-15 10:38:26 +03:00
private array $direction;
2024-03-12 12:47:12 +03:00
public function __construct($direction)
{
$this->direction = $direction;
}
public function getHTML()
{
2024-03-15 10:38:26 +03:00
2024-03-12 12:47:12 +03:00
$direction = $this->direction;
2024-03-14 13:11:18 +03:00
$fon_3 = URL::to('img/front-page/bakalavr-special/fon3_blok.png');
2024-03-15 10:38:26 +03:00
$educationForm = implode(", ", $direction['educationForm']);
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
<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-md-6 col-12 d-block'>
<div class=\"\">
2024-03-15 10:38:26 +03:00
<div class=\"display-6 \" style=\"font-family: Geologica-Light\"> {$direction['code']} </div>
<div class=\"display-5 \" > {$direction['name']}</div>
2024-03-12 12:47:12 +03:00
</div>
2024-03-14 13:11:18 +03:00
<div class=\"mt-4\">
2024-03-15 10:38:26 +03:00
<p style=\"text-align: justify;\">{$direction['description']}</p>
2024-03-14 13:11:18 +03:00
</div>
2024-03-12 12:47:12 +03:00
</div>
2024-03-14 13:11:18 +03:00
<div class='col-md-6 col-12 d-flex justify-content-center align-items-center'>
<div class=\"p-3 px-5 border-success fs-4\" style='border-radius: 50px; border: 2px solid;'>
<div > Уровень образования:
2024-03-15 10:38:26 +03:00
<strong>{$direction['educationLevel']} </strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Форма обучения:
2024-03-15 10:38:26 +03:00
<strong> {$educationForm}
</strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Бюджетные места:
2024-03-15 10:38:26 +03:00
<strong >{$direction['budget_places']} </strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Квота:
2024-03-15 10:38:26 +03:00
<strong >{$direction['quota']} </strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Места на контракт:
2024-03-15 10:38:26 +03:00
<strong >{$direction['paid_places']} </strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Стоимость платного обучения:
2024-03-15 10:38:26 +03:00
<strong >{$direction['cost_paid_place']} </strong>
2024-03-14 13:11:18 +03:00
</div>
<hr class='d-block d-md-none'><br>
<div > Период обучения (в годах):
2024-03-15 10:38:26 +03:00
<strong>{$direction['period']} </span>
2024-03-14 13:11:18 +03:00
</div>
2024-03-12 12:47:12 +03:00
</div>
</div>
2024-03-14 13:11:18 +03:00
</div>
2024-03-12 12:47:12 +03:00
<div class=\"offcanvas-body mt-2\" style=\"font-family: Geologica-ExtraLight\">
2024-03-14 13:11:18 +03:00
2024-03-12 12:47:12 +03:00
</div>
</div>
2024-03-14 13:11:18 +03:00
</div>
2024-03-12 12:47:12 +03:00
2024-03-14 13:11:18 +03:00
</div>
2024-03-12 12:47:12 +03:00
</div> ";
}
// phpcs:enable
2024-03-12 12:47:12 +03:00
}