new-calculator #43
|
@ -4,14 +4,11 @@ namespace App\Http\Controllers\Api;
|
||||||
|
|
||||||
use App\Enums\ExaminationTypeEnum;
|
use App\Enums\ExaminationTypeEnum;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Models\Department;
|
|
||||||
use App\Models\Direction;
|
use App\Models\Direction;
|
||||||
use App\Models\EntranceExamination;
|
use App\Models\EntranceExamination;
|
||||||
use App\Models\Faculty;
|
|
||||||
use App\Models\Subject;
|
|
||||||
use App\Services\DirectonHtmlBuilder;
|
use App\Services\DirectonHtmlBuilder;
|
||||||
|
use App\Services\DirectonHtmlBuilderForCalculator;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\URL;
|
|
||||||
|
|
||||||
class CalculatorController extends Controller
|
class CalculatorController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -61,9 +58,19 @@ class CalculatorController extends Controller
|
||||||
$dataToGenerateHTML = $this->getDirectionsToModals($directionIds);
|
$dataToGenerateHTML = $this->getDirectionsToModals($directionIds);
|
||||||
// dd($dataToGenerateHTML);
|
// dd($dataToGenerateHTML);
|
||||||
$generateHtml = function ($acc, $direction) {
|
$generateHtml = function ($acc, $direction) {
|
||||||
$builder = new DirectonHtmlBuilder($direction);
|
$builder = new DirectonHtmlBuilderForCalculator($direction);
|
||||||
$offCanvasModal = $builder->getHTML();
|
$offCanvasModal = $builder->getHTML();
|
||||||
return "{$acc} $offCanvasModal";
|
// dd($offCanvasModal);
|
||||||
|
return "{$acc} <tr class=\"border-bottom border-white my-3\">
|
||||||
|
|
||||||
|
<td class='w-25 '>
|
||||||
|
<a class=\"hover2 \" type=\"button\" data-bs-toggle=\"offcanvas\" data-bs-target=\"#calc-{$direction['id']}\" aria-controls=\"offcanvasScrolling\" role=\"button\">{$direction['name']}</a>
|
||||||
|
{$offCanvasModal}
|
||||||
|
</td>
|
||||||
|
<td class=\"text-end\"> 123</td>
|
||||||
|
<td class=\"text-end\"> 456 </td>
|
||||||
|
|
||||||
|
</tr>";
|
||||||
};
|
};
|
||||||
$html = collect($dataToGenerateHTML)->reduce($generateHtml, '');
|
$html = collect($dataToGenerateHTML)->reduce($generateHtml, '');
|
||||||
|
|
||||||
|
@ -75,13 +82,13 @@ class CalculatorController extends Controller
|
||||||
//phpcs:disable
|
//phpcs:disable
|
||||||
$directionsGroups = Direction::with(['department'])
|
$directionsGroups = Direction::with(['department'])
|
||||||
->leftJoin('direction_direction_profile', 'directions.id', '=', 'direction_direction_profile.direction_id')
|
->leftJoin('direction_direction_profile', 'directions.id', '=', 'direction_direction_profile.direction_id')
|
||||||
->leftJoin('direction_profiles','direction_direction_profile.direction_profile_id','=','direction_profiles.id')
|
->leftJoin('direction_profiles', 'direction_direction_profile.direction_profile_id', '=', 'direction_profiles.id')
|
||||||
->leftJoin('departments', 'directions.department_id', '=', 'departments.id')
|
->leftJoin('departments', 'directions.department_id', '=', 'departments.id')
|
||||||
->leftJoin('faculties', 'departments.faculty_id', '=', 'faculties.id')
|
->leftJoin('faculties', 'departments.faculty_id', '=', 'faculties.id')
|
||||||
->leftJoin('education_levels', 'directions.education_level_id', '=', 'education_levels.id')
|
->leftJoin('education_levels', 'directions.education_level_id', '=', 'education_levels.id')
|
||||||
->leftJoin('education_forms', 'directions.education_form_id', '=', 'education_forms.id')
|
->leftJoin('education_forms', 'directions.education_form_id', '=', 'education_forms.id')
|
||||||
->leftJoin('entrance_examinations', 'entrance_examinations.direction_id', '=', 'directions.id')
|
->leftJoin('entrance_examinations', 'entrance_examinations.direction_id', '=', 'directions.id')
|
||||||
->leftJoin('educational_institutions','faculties.educational_institution_id','=','educational_institutions.id')
|
->leftJoin('educational_institutions', 'faculties.educational_institution_id', '=', 'educational_institutions.id')
|
||||||
->leftJoin('examination_types', 'entrance_examinations.examination_type_id', '=', 'examination_types.id')
|
->leftJoin('examination_types', 'entrance_examinations.examination_type_id', '=', 'examination_types.id')
|
||||||
->leftJoin('subject_types', 'entrance_examinations.subject_type_id', '=', 'subject_types.id')
|
->leftJoin('subject_types', 'entrance_examinations.subject_type_id', '=', 'subject_types.id')
|
||||||
->leftJoin('subjects', 'entrance_examinations.subject_id', '=', 'subjects.id')
|
->leftJoin('subjects', 'entrance_examinations.subject_id', '=', 'subjects.id')
|
||||||
|
|
|
@ -179,7 +179,7 @@ class DirectonHtmlBuilderForCalculator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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\">
|
return "<div class=\"offcanvas offcanvas-bottom\" data-bs-scroll=\"true\" data-bs-backdrop=\"false\" tabindex=\"-1\" id=\"calc-{$direction['id'] }\" aria-labelledby=\"Labelcalc-{$direction['id']}\" style=\"height: 100%; font-family: Geologica-Medium; overflow-y: auto ; background-image: url({$fon_3}); color: #004329\">
|
||||||
|
|
||||||
|
|
||||||
<div class=\"mx-5 pb-5\">
|
<div class=\"mx-5 pb-5\">
|
||||||
|
|
Loading…
Reference in New Issue