Compare commits

..

No commits in common. "21224d43cc752ff8cc42dd78c95128b79139dd1e" and "604d5a902cae39a2381f9f52ff931c450a4a0408" have entirely different histories.

9 changed files with 131 additions and 114 deletions

View File

@ -1,36 +0,0 @@
<?php
namespace App\Services;
class PageScrapper
{
private string $url;
private string $contentMarker;
public function __construct($url, $contentMarker = '<div class=["\']content_info["\']>')
{
$this->url = $url;
$this->contentMarker = $contentMarker;
}
public function getHTML()
{
$page = file_get_contents($this->url);
$strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/isU";
$arr = [];
$rez = preg_match_all($strForPregMatch, $page, $arr);
return $content = $arr[1][0].'</div>';
}
public function normalizeURLFile($content)
{
$rez = preg_match_all('/href="(.*)"/isU',$content,$arr);
foreach ($arr[1] as $el) {
if (strpos($el, 'http') !== 0) {
$content = str_replace($el,'https://mkgtu.ru'.$el,$content);
}
}
return $content;
}
}

View File

@ -44,6 +44,11 @@
</x-primary-button>
</div>
{{--<div class="flex items-center justify-center mt-4">
@if (Route::has('register'))
<a> Нет аккаунта? </a>
<a href="{{ route('register') }}">Зарегистрируйтесь</a>
@endif
</div> --}}
</form>
</x-guest-layout>

View File

@ -26,7 +26,7 @@
</a>
</div>
<div class="col-lg-3 col-md-4">
<a href="{{ route('applicant') }}">
<a href="#">
<div class="tp-feature__item before-color-2 mb-40">
<div class="tp-feature__icon">
<img style="max-width: 26%;" src="{{ URL::to('img/courses/abit.png') }}" alt="">

View File

@ -135,7 +135,23 @@
<a href="contact.html">Контакты</a>
</li>
{{-- Добавляет на хедер страницы кнопку "вход", имя которой меняется, если вы уже авторизованы
<li>
@if (Route::has('login'))
@auth
<a href="{{ url('/dashboard') }}" > {{ Auth::user()->name }} </a>
@else
<a href="{{ route('login') }}" >Вход</a>
@endauth
@endif
</li>
--}}
</ul>
</nav>
</div>

View File

@ -1,18 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5"> Веб-консультации для абитуриентов и их родителей </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://www.mkgtu.ru/postuplenie/web-consultations/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -1,49 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<style>
.accordionHover {
transition: .3s all;
}
.accordionHover:hover {
background-color: #006147;
transform: scale(1.03);
color: #fff;
}
.accordion-button:not(.collapsed) {
color: #006147;
background-color: #fff;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125);
}
.accordion-button:focus {
z-index: 3;
border-color: #479f76;
outline: 0;
box-shadow: 0 0 0 0.25rem rgba(0, 131, 16, .69);
}
.accordion-button:not(.collapsed)::after {
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg' fill='%230c63e4'%3e%3cg%3e%3ctitle%3eLayer 1%3c/title%3e%3cpath fill='%23396849' fill-rule='evenodd' d='m1.646,4.646a0.5,0.5 0 0 1 0.708,0l5.646,5.647l5.646,-5.647a0.5,0.5 0 0 1 0.708,0.708l-6,6a0.5,0.5 0 0 1 -0.708,0l-6,-6a0.5,0.5 0 0 1 0,-0.708z' id='svg_1'/%3e%3c/g%3e%3c/svg%3e");
}
</style>
<div class=" fw-bolder fs-1 text-center py-5"> Подача документов онлайн </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://www.mkgtu.ru/postuplenie/web-consultations/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -16,7 +16,7 @@
<div class="container mt-4">
<div class="row d-flex justify-content-center align-items-center">
<div class="col-8">
<a href="{{ route('web-consultations') }}">
<a href="web-consultations.php">
<h4>
<div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -127,5 +127,4 @@
</div>
</div>
@endsection

View File

@ -0,0 +1,104 @@
@extends('layouts.applicant-layout')
@section('content')
<style>
.accordionHover {
transition: .3s all;
}
.accordionHover:hover {
background-color: #006147;
transform: scale(1.03);
color: #fff;
}
.accordion-button:not(.collapsed) {
color: #006147;
background-color: #fff;
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .125);
}
.accordion-button:focus {
z-index: 3;
border-color: #479f76;
outline: 0;
box-shadow: 0 0 0 0.25rem rgba(0, 131, 16, .69);
}
.accordion-button:not(.collapsed)::after {
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='16' height='16' xmlns='http://www.w3.org/2000/svg' fill='%230c63e4'%3e%3cg%3e%3ctitle%3eLayer 1%3c/title%3e%3cpath fill='%23396849' fill-rule='evenodd' d='m1.646,4.646a0.5,0.5 0 0 1 0.708,0l5.646,5.647l5.646,-5.647a0.5,0.5 0 0 1 0.708,0.708l-6,6a0.5,0.5 0 0 1 -0.708,0l-6,-6a0.5,0.5 0 0 1 0,-0.708z' id='svg_1'/%3e%3c/g%3e%3c/svg%3e");
}
</style>
<!-- transform: scale(1.2); -->
<!--<div class="container py-5" id="featured-3">
<br><br><br><br><br>
<h1 class="text-dark col-12 d-flex justify-content-center">Подача документов онлайн с помощью информационных систем МГТУ: <br><br></h1>
<div class="d-flex justify-content-center">
<div class="col-4 px-2 m-3 element-1 " >
<a href="https://portal.mkgtu.ru/" target="_blank">
<span style="color: #005951;">
<h3 class="m-2 fs-2 text-body-emphasis"> По образовательным программам высшего образования </h3>
</span>
</a>
</div>
<div class="col-4 px-2 m-3 element-1">
<a href="https://mkgtu.ru/auth/" target="_blank">
<span style="color: #005951;">
<h3 class="m-2 fs-2 text-body-emphasis">По образовательным программам среднего профессионального образования (колледж)</h3>
</span>
</a>
</div>
</div>
</div>
-->
<div class="pt-4 container justify-content-md-center col-6 accordion accordion-flush" id="accordionFlushExample">
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingOne">
<button class="accordion-button collapsed accordionHover" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-collapseOne" aria-expanded="false" aria-controls="flush-collapseOne">
По образовательным программам высшего образования
</button>
</h2>
<div id="flush-collapseOne" class="accordion-collapse collapse" aria-labelledby="flush-headingOne"
data-bs-parent="#accordionFlushExample">
<div class="accordion-body tp-feature__title">
<br>
<h2><a href="https://portal.mkgtu.ru/" target="_blank">По образовательным программам высшего
образования</a></h2>
<br>
<h3>
<a href="https://mkgtu.ru/abitur/%D0%98%D0%BD%D1%81%D1%82%D1%80%D1%83%D0%BA%D1%86%D0%B8%D1%8F%20%D0%BF%D0%BE%20%D1%80%D0%B0%D0%B1%D0%BE%D1%82%D0%B5%20%D1%81%20%D0%BB%D0%B8%D1%87%D0%BD%D1%8B%D0%BC%20%D0%BA%D0%B0%D0%B1%D0%B8%D0%BD%D0%B5%D1%82%D0%BE%D0%BC%20%D0%B0%D0%B1%D0%B8%D1%82%D1%83%D1%80%D0%B8%D0%B5%D0%BD%D1%82%D0%B0%202023.pdf"
target="_blank">Инструкция по работе с личным кабинетом абитуриента</a></h3><br>
</div>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header" id="flush-headingTwo">
<button class="accordion-button collapsed accordionHover" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-collapseTwo" aria-expanded="false" aria-controls="flush-collapseTwo">
По образовательным программам среднего профессионального образования (колледж)
</button>
</h2>
<div id="flush-collapseTwo" class="accordion-collapse collapse" aria-labelledby="flush-headingTwo"
data-bs-parent="#accordionFlushExample">
<div class="accordion-body tp-feature__title">
<br>
<h2><a href="https://mkgtu.ru/auth/" target="_blank">По&nbsp;образовательным программам среднего
профессионального образования (колледж)</a></h2><br>
<br>
<h3><a href="https://mkgtu.ru/abitur/1.pdf" target="_blank">Инструкция по работе с личным кабинетом
абитуриента</a></h3><br>
</div>
</div>
</div>
</div>
@endsection

View File

@ -27,17 +27,13 @@ Route::resources([
]);
Route::get('/course', function () {
return view('menu.course');
return view('pages.course');
})->name('course');
Route::get('/abitur', function () {
return view('menu.abitur');
return view('pages.abitur');
})->name('applicant');
Route::get('/web-consultations', function () {
return view('menu.abitur.web-consultations');
})->name('web-consultations');
Route::post('/uploadfile', [UploadFileController::class, 'showUploadFile'])->name('uploadfile');
Route::get('/dashboard', function () {