Compare commits

..

No commits in common. "49cf4f619a22049c9a11c4c29acf365d199b7539" and "c1505ec84ce8700636d327d8fa88c066cd6132df" have entirely different histories.

12 changed files with 19 additions and 186 deletions

View File

@ -15,42 +15,21 @@ class PageScrapper
public function getHTML() public function getHTML()
{ {
$page = file_get_contents($this->url); $page = file_get_contents($this->url);
$strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/is"; $strForPregMatch = "/" . "{$this->contentMarker}" . "(.*)<\/div>/isU";
$arr = []; $arr = [];
$rez = preg_match_all($strForPregMatch, $page, $arr); $rez = preg_match_all($strForPregMatch, $page, $arr);
return $content = $arr[1][0] . '</div>';
return $content = $arr[1][0];
} }
public function normalizeURLFile($content) public function normalizeURLFile($content)
{ {
$rez = preg_match_all('/href="(.*)"/isU', $content, $arr);
$rez = preg_match_all('/<a href="(.*)">/isU',$content,$arr);
$arr[1] = array_unique($arr[1]);
foreach ($arr[1] as $el) { foreach ($arr[1] as $el) {
if (!str_starts_with($el, 'https')){ if (strpos($el, 'http') !== 0) {
$content = str_replace($el,'https://mkgtu.ru' . $el,$content); $content = str_replace($el, 'https://mkgtu.ru' . $el, $content);
} }
} }
return $content; return $content;
}
public function cutHTML($content,$strForScissors)
{
$arr = [];
$rez = preg_match_all($strForScissors, $content, $arr);
$content = str_replace($arr[1],'',$content);
return $content;
} }
} }

View File

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

View File

@ -38,7 +38,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('spetsialitet-magistratura') }}"> <a href="postup.php">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -49,7 +49,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('kolledzh') }}"> <a href="postup-col.php">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -60,7 +60,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('platnye-obrazovatelnye-uslugi') }}"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -71,7 +71,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('ordinatura') }}"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -82,7 +82,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('aspirantura') }}"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -93,7 +93,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="https://mkgtu.ru/upload/postuplenie_docs/abiturientu/voprosi.pdf" target="_blank"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -104,7 +104,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="{{ route('videomaterialy-dlya-postupayushchikh') }}"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">
@ -115,7 +115,7 @@
</div> </div>
<div class="col-8"> <div class="col-8">
<a href="#"> <a href="ui-4.html#">
<h4> <h4>
<div <div
class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2"> class="d-flex justify-content-start align-items-center w-100 h-100 border border-secondary m-1 p-4 buttonHover rounded-2">

View File

@ -1,19 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Для поступающих на обучение по программам аспирантуры </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/aspirantura/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -1,19 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Для поступающих на обучение по программам среднего профессионального образования </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/kolledzh/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -1,19 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Для поступающих на обучение по программам ординатуры </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/ordinatura/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -1,19 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Для поступающих на обучение по договорам об оказании платных образовательных услуг </div>
<div class="container fs-4 pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/platnye-obrazovatelnye-uslugi/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content;
@endphp
</div>
</div>
@endsection

View File

@ -1,19 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Для поступающих на программы бакалавриата, магистратуры </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/spetsialitet-magistratura-2022/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content ;
@endphp
</div>
</div>
@endsection

View File

@ -1,25 +0,0 @@
@extends('layouts.applicant-layout')
@section('content')
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Видеоматериалы для поступающих </div>
<div class="container pt-4 d-flex justify-content-center">
<div class="col-10 text-center pb-4 ">
@php
use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/priemnaya-kampaniya/videomaterialy-dlya-postupayushchikh/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
$content = str_replace(
'<img width="614" alt="Обложка Госуслуги_page-0001.jpg" src="/upload/medialibrary/c76/c761087fd6938bd8eb8708e9e036679e.jpg" height="346" title="Обложка Госуслуги_page-0001.jpg">',
'<img width="614" alt="Обложка Госуслуги_page-0001.jpg" src="https://mkgtu.ru/upload/medialibrary/c76/c761087fd6938bd8eb8708e9e036679e.jpg" height="346" title="Обложка Госуслуги_page-0001.jpg" class="border border-3 rounded-3 border-secondary">',
$content);
echo $content;
@endphp
</div>
</div>
@endsection

View File

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

View File

@ -30,16 +30,15 @@
} }
</style> </style>
<div class=" fw-bolder fs-1 text-center py-5 lh-lg"> Подача документов онлайн </div> <div class=" fw-bolder fs-1 text-center py-5"> Подача документов онлайн </div>
<div class="container pt-4 d-flex justify-content-center"> <div class="container pt-4 d-flex justify-content-center">
<div class="col-10"> <div class="col-10">
@php @php
use App\Services\PageScrapper; use App\Services\PageScrapper;
$pageScrapper = new PageScrapper("https://mkgtu.ru/postuplenie/podat-dokumenty-onlayn/", '<div class=["\']content_info["\']>'); $pageScrapper = new PageScrapper("https://www.mkgtu.ru/postuplenie/web-consultations/", '<div class=["\']content_info["\']>');
$row = $pageScrapper->getHTML(); $row = $pageScrapper->getHTML();
$content = $pageScrapper->normalizeURLFile($row); $content = $pageScrapper->normalizeURLFile($row);
$content = $pageScrapper->cutHTML($content,'/<footer(.*)<\/footer>/isU');
echo $content; echo $content;
@endphp @endphp

View File

@ -30,38 +30,14 @@ Route::get('/course', function () {
return view('menu.course'); return view('menu.course');
})->name('course'); })->name('course');
Route::get('/applicant', function () { Route::get('/abitur', function () {
return view('menu.abitur'); return view('menu.abitur');
})->name('abitur'); })->name('applicant');
Route::get('/web-consultations', function () { Route::get('/web-consultations', function () {
return view('menu.abitur.web-consultations'); return view('menu.abitur.web-consultations');
})->name('web-consultations'); })->name('web-consultations');
Route::get('/specialty-magistracy', function () {
return view('menu.abitur.spetsialitet-magistratura');
})->name('spetsialitet-magistratura');
Route::get('/college', function () {
return view('menu.abitur.kolledzh');
})->name('kolledzh');
Route::get('/paid-educational-services', function () {
return view('menu.abitur.platnye-obrazovatelnye-uslugi');
})->name('platnye-obrazovatelnye-uslugi');
Route::get('/residency', function () {
return view('menu.abitur.ordinatura');
})->name('ordinatura');
Route::get('/traineeship', function () {
return view('menu.abitur.aspirantura');
})->name('aspirantura');
Route::get('/video-materials-for-applicants', function () {
return view('menu.abitur.videomaterialy-dlya-postupayushchikh');
})->name('videomaterialy-dlya-postupayushchikh');
Route::post('/uploadfile', [UploadFileController::class, 'showUploadFile'])->name('uploadfile'); Route::post('/uploadfile', [UploadFileController::class, 'showUploadFile'])->name('uploadfile');
Route::get('/dashboard', function () { Route::get('/dashboard', function () {