Derniere version de site au 4/10/2026

This commit is contained in:
Oleg Barykin committed 2026-10-04 14:50:04 +02:00
1 parent 21f34c64c9
commit dbb8e299a0
35 files changed
+8697 -1242

No files matched your search

+111 -87
View File
@@ -1,74 +1,98 @@
<?php
declare(strict_types=1);
require_once __DIR__ . '/../includes/bootstrap_global.php';
declare (strict_types = 1);
require_once __DIR__ . '/../includes/bootstrap_global.php';
// ===== Helpers header (identiques à index.php) =====
function is_client_logged_in(): bool {
$role = $_SESSION['role'] ?? ($_SESSION['user_type'] ?? '');
if (!empty($_SESSION['user_id']) && $role === 'client') return true;
if (!empty($_SESSION['client_id'])) return true;
if (!empty($_SESSION['reference_id']) && $role === 'client') return true;
if (!empty($_SESSION['user_id']) && $role === 'praticien') return true;
if (!empty($_SESSION['praticien_id'])) return true;
if (!empty($_SESSION['reference_id']) && $role === 'praticien') return true;
return false;
}
// ===== Helpers header (identiques à index.php) =====
function is_client_logged_in(): bool
{
$role = $_SESSION['role'] ?? ($_SESSION['user_type'] ?? '');
if (! empty($_SESSION['user_id']) && $role === 'client') {
return true;
}
function include_header_clean(string $absPath): void {
global $translations, $lang;
ob_start();
include $absPath; // /public/includes/header.php
$buf = ob_get_clean() ?: '';
if (! empty($_SESSION['client_id'])) {
return true;
}
// 0) DOCTYPE + <html>…</html>
$buf = preg_replace('~<!doctype\s+html[^>]*>~i', '', $buf);
$buf = preg_replace('~</?html\b[^>]*>~i', '', $buf);
if (! empty($_SESSION['reference_id']) && $role === 'client') {
return true;
}
// 1) retirer <head>…</head> et <body> ouverts/fermés
$buf = preg_replace('~<head\b[^>]*>.*?</head>~is', '', $buf);
$buf = preg_replace('~</?body\b[^>]*>~i', '', $buf);
if (! empty($_SESSION['user_id']) && $role === 'praticien') {
return true;
}
// 2) retirer les <link> CSS “globaux” pour éviter d’écraser la home
$buf = preg_replace('~<link[^>]+href="[^"]*(bootstrap[^"]*\.css|mobil_style\.css|site_style\.css|fonts\.googleapis)[^"]*"[^>]*>~i', '', $buf);
if (! empty($_SESSION['praticien_id'])) {
return true;
}
// 3) retirer le <script> Bootstrap CDN (on le charge déjà en bas de la page)
$buf = preg_replace('~<script[^>]+src="[^"]*bootstrap[^"]*bundle[^"]*\.js[^"]*"[^>]*>\s*</script>~i', '', $buf);
if (! empty($_SESSION['reference_id']) && $role === 'praticien') {
return true;
}
echo $buf; // garde <header> + tes scripts inline utiles
}
return false;
}
function t(array $translations, string $key, string $fallback = ''): string {
$val = $translations[$key] ?? '';
if ($val === '') return $fallback;
return (string)$val;
}
function include_header_clean(string $absPath): void
{
global $translations, $lang;
ob_start();
include $absPath; // /public/includes/header.php
$buf = ob_get_clean() ?: '';
// Lang HTML
$langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (string)$lang : 'ru';
// 0) DOCTYPE + <html>…</html>
$buf = preg_replace('~<!doctype\s+html[^>]*>~i', '', $buf);
$buf = preg_replace('~</?html\b[^>]*>~i', '', $buf);
// 1) retirer <head>…</head> et <body> ouverts/fermés
$buf = preg_replace('~<head\b[^>]*>.*?</head>~is', '', $buf);
$buf = preg_replace('~</?body\b[^>]*>~i', '', $buf);
// 2) retirer les <link> CSS “globaux” pour éviter d’écraser la home
$buf = preg_replace('~<link[^>]+href="[^"]*(bootstrap[^"]*\.css|mobil_style\.css|site_style\.css|fonts\.googleapis)[^"]*"[^>]*>~i', '', $buf);
// 3) retirer le <script> Bootstrap CDN (on le charge déjà en bas de la page)
$buf = preg_replace('~<script[^>]+src="[^"]*bootstrap[^"]*bundle[^"]*\.js[^"]*"[^>]*>\s*</script>~i', '', $buf);
echo $buf; // garde <header> + tes scripts inline utiles
}
function t(array $translations, string $key, string $fallback = ''): string
{
$val = $translations[$key] ?? '';
if ($val === '') {
return $fallback;
}
return (string) $val;
}
// Lang HTML
$langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string) ($lang ?? '')) ? (string) $lang : 'ru';
?>
<!doctype html>
<html lang="<?= htmlspecialchars($langHtml, ENT_QUOTES, 'UTF-8') ?>">
<html lang="<?php echo htmlspecialchars($langHtml, ENT_QUOTES, 'UTF-8') ?>">
<head>
<meta charset="UTF-8">
<title><?= htmlspecialchars($translations['seo_about_title'], ENT_QUOTES, 'UTF-8') ?></title>
<meta name="description" content="<?= htmlspecialchars($translations['seo_about_desc'], ENT_QUOTES, 'UTF-8') ?>">
<meta name="keywords" content="<?= htmlspecialchars($translations['seo_about_keywords'], ENT_QUOTES, 'UTF-8') ?>">
<title><?php echo htmlspecialchars($translations['seo_about_title'], ENT_QUOTES, 'UTF-8') ?></title>
<meta name="description" content="<?php echo htmlspecialchars($translations['seo_about_desc'], ENT_QUOTES, 'UTF-8') ?>">
<meta name="keywords" content="<?php echo htmlspecialchars($translations['seo_about_keywords'], ENT_QUOTES, 'UTF-8') ?>">
<meta name="author" content="Uslugi.fr">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="<?= asset('/includes/site_style.css') ?>">
<link rel="stylesheet" href="<?= asset('/includes/custom_style.css') ?>">
<link rel="stylesheet" href="<?= asset('/includes/mobil_style.css') ?>">
<link rel="stylesheet" href="<?php echo asset('/includes/site_style.css') ?>">
<link rel="stylesheet" href="<?php echo asset('/includes/custom_style.css') ?>">
<link rel="stylesheet" href="<?php echo asset('/includes/mobil_style.css') ?>">
<?php include_once __DIR__ . '/includes/tracking.php'; ?>
</head>
<body>
<?php if (is_client_logged_in()): ?>
<?php
require_once __DIR__ . '/public/includes/init_pr_cl.php';
include_header_clean(__DIR__ . '/public/includes/header.php'); ?>
<?php
require_once __DIR__ . '/public/includes/init_pr_cl.php';
include_header_clean(__DIR__ . '/public/includes/header.php'); ?>
<?php else: ?>
<header class="site-header">
<div class="container">
@@ -88,8 +112,8 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
</div>
<nav class="header-actions">
<a class="btn-login" href="/connexion.php">
<span class="d-sm-none"><?= htmlspecialchars($translations['btn_se_connecter'] ?? 'Connexion', ENT_QUOTES, 'UTF-8') ?></span>
<span class="d-none d-sm-inline"><?= htmlspecialchars($translations['ja_spec'] ?? 'Je suis spécialiste', ENT_QUOTES, 'UTF-8') ?></span>
<span class="d-sm-none"><?php echo htmlspecialchars($translations['btn_se_connecter'] ?? 'Connexion', ENT_QUOTES, 'UTF-8') ?></span>
<span class="d-none d-sm-inline"><?php echo htmlspecialchars($translations['ja_spec'] ?? 'Je suis spécialiste', ENT_QUOTES, 'UTF-8') ?></span>
</a>
<div class="dropdown">
@@ -99,15 +123,15 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
data-bs-toggle="dropdown"
data-bs-auto-close="true"
aria-expanded="false"
aria-label="<?= htmlspecialchars(t($translations, 'about_help_aria', 'Help'), ENT_QUOTES, 'UTF-8') ?>">
aria-label="<?php echo htmlspecialchars(t($translations, 'about_help_aria', 'Help'), ENT_QUOTES, 'UTF-8') ?>">
?
</button>
<ul class="dropdown-menu dropdown-menu-end shadow help-menu menu-panel">
<li><a href="/how-it-work.php"><?= htmlspecialchars($translations['kak_rabotaet'] ?? 'Как это работает', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/about.php"><?= htmlspecialchars($translations['pro_nas'] ?? 'О нас', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/faq.php"><?= htmlspecialchars($translations['faq'] ?? 'FAQ', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/contact.php"><?= htmlspecialchars($translations['nam_pisat'] ?? 'Написать нам', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/how-it-work.php"><?php echo htmlspecialchars($translations['kak_rabotaet'] ?? 'Как это работает', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/about.php"><?php echo htmlspecialchars($translations['pro_nas'] ?? 'О нас', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/faq.php"><?php echo htmlspecialchars($translations['faq'] ?? 'FAQ', ENT_QUOTES, 'UTF-8') ?></a></li>
<li><a href="/contact.php"><?php echo htmlspecialchars($translations['nam_pisat'] ?? 'Написать нам', ENT_QUOTES, 'UTF-8') ?></a></li>
</ul>
</div>
</nav>
@@ -151,67 +175,67 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
<div class="wrap">
<div class="card" style="margin-bottom:18px;">
<h2><?= htmlspecialchars(t($translations, 'about_intro_title', 'About'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?= htmlspecialchars(t($translations, 'about_intro_text', 'uslugi.fr is a platform...'), ENT_QUOTES, 'UTF-8') ?></p>
<h2><?php echo htmlspecialchars(t($translations, 'about_intro_title', 'About'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?php echo htmlspecialchars(t($translations, 'about_intro_text', 'uslugi.fr is a platform...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
<div class="about-grid">
<div class="card">
<h2><?= htmlspecialchars(t($translations, 'about_mission_title', 'Our mission'), ENT_QUOTES, 'UTF-8') ?></h2>
<h2><?php echo htmlspecialchars(t($translations, 'about_mission_title', 'Our mission'), ENT_QUOTES, 'UTF-8') ?></h2>
<ul class="about-list">
<li class="about-item">
<div class="about-ico">🤝</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_mission_item1_title', 'Easy booking'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_mission_item1_text', 'Book in a few clicks...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_mission_item1_title', 'Easy booking'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_mission_item1_text', 'Book in a few clicks...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">🛡️</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_mission_item2_title', 'Security'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_mission_item2_text', 'Data privacy and Jitsi...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_mission_item2_title', 'Security'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_mission_item2_text', 'Data privacy and Jitsi...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">⏱️</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_mission_item3_title', 'Save time'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_mission_item3_text', 'Calendar and online consults...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_mission_item3_title', 'Save time'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_mission_item3_text', 'Calendar and online consults...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
</ul>
</div>
<div class="card">
<h2><?= htmlspecialchars(t($translations, 'about_platform_title', 'How the platform works'), ENT_QUOTES, 'UTF-8') ?></h2>
<h2><?php echo htmlspecialchars(t($translations, 'about_platform_title', 'How the platform works'), ENT_QUOTES, 'UTF-8') ?></h2>
<ul class="about-list">
<li class="about-item">
<div class="about-ico">📚</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_platform_item1_title', 'Specialists catalog'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_platform_item1_text', 'Lawyers, notaries...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_platform_item1_title', 'Specialists catalog'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_platform_item1_text', 'Lawyers, notaries...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">🗓️</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_platform_item2_title', 'Online booking'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_platform_item2_text', 'Choose a time and get email confirmation...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_platform_item2_title', 'Online booking'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_platform_item2_text', 'Choose a time and get email confirmation...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">💬</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_platform_item3_title', 'Chat before the session'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_platform_item3_text', 'Ask details directly...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_platform_item3_title', 'Chat before the session'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_platform_item3_text', 'Ask details directly...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">🎥</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_platform_item4_title', 'Video calls'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_platform_item4_text', 'Meetings via Jitsi...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_platform_item4_title', 'Video calls'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_platform_item4_text', 'Meetings via Jitsi...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
</ul>
@@ -220,30 +244,30 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
<div class="about-grid" style="margin-top:14px;">
<div class="card">
<h2><?= htmlspecialchars(t($translations, 'about_clients_title', 'For clients'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?= htmlspecialchars(t($translations, 'about_clients_text', 'Fast search and booking...'), ENT_QUOTES, 'UTF-8') ?></p>
<h2><?php echo htmlspecialchars(t($translations, 'about_clients_title', 'For clients'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?php echo htmlspecialchars(t($translations, 'about_clients_text', 'Fast search and booking...'), ENT_QUOTES, 'UTF-8') ?></p>
<div class="about-callout">
<strong><?= htmlspecialchars(t($translations, 'about_clients_note_label', 'Important:'), ENT_QUOTES, 'UTF-8') ?></strong>
<?= htmlspecialchars(t($translations, 'about_clients_note_text', 'uslugi.fr helps you find...'), ENT_QUOTES, 'UTF-8') ?>
<strong><?php echo htmlspecialchars(t($translations, 'about_clients_note_label', 'Important:'), ENT_QUOTES, 'UTF-8') ?></strong>
<?php echo htmlspecialchars(t($translations, 'about_clients_note_text', 'uslugi.fr helps you find...'), ENT_QUOTES, 'UTF-8') ?>
</div>
</div>
<div class="card">
<h2><?= htmlspecialchars(t($translations, 'about_specialists_title', 'For specialists'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?= htmlspecialchars(t($translations, 'about_specialists_text', 'Dashboard, calendar...'), ENT_QUOTES, 'UTF-8') ?></p>
<h2><?php echo htmlspecialchars(t($translations, 'about_specialists_title', 'For specialists'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?php echo htmlspecialchars(t($translations, 'about_specialists_text', 'Dashboard, calendar...'), ENT_QUOTES, 'UTF-8') ?></p>
<ul class="about-list">
<li class="about-item">
<div class="about-ico">🔒</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_specialists_item1_title', 'Data is safe'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_specialists_item1_text', 'Basic security practices...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_specialists_item1_title', 'Data is safe'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_specialists_item1_text', 'Basic security practices...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="about-item">
<div class="about-ico">📈</div>
<div>
<h4><?= htmlspecialchars(t($translations, 'about_specialists_item2_title', 'Grow your audience'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?= htmlspecialchars(t($translations, 'about_specialists_item2_text', 'Visibility in the catalog...'), ENT_QUOTES, 'UTF-8') ?></p>
<h4><?php echo htmlspecialchars(t($translations, 'about_specialists_item2_title', 'Grow your audience'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'about_specialists_item2_text', 'Visibility in the catalog...'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
</ul>
@@ -253,11 +277,11 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
<br>
<div class="card">
<h2><?= htmlspecialchars(t($translations, 'about_contact_title', 'Contact us'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?= htmlspecialchars(t($translations, 'about_contact_text', 'Have suggestions or questions? Write to us.'), ENT_QUOTES, 'UTF-8') ?></p>
<h2><?php echo htmlspecialchars(t($translations, 'about_contact_title', 'Contact us'), ENT_QUOTES, 'UTF-8') ?></h2>
<p><?php echo htmlspecialchars(t($translations, 'about_contact_text', 'Have suggestions or questions? Write to us.'), ENT_QUOTES, 'UTF-8') ?></p>
<div class="text-start">
<a class="btn btn-danger" href="/contact.php" style="padding:12px 16px;border-radius:999px;">
<?= htmlspecialchars(t($translations, 'about_contact_btn', 'Write to us'), ENT_QUOTES, 'UTF-8') ?>
<?php echo htmlspecialchars(t($translations, 'about_contact_btn', 'Write to us'), ENT_QUOTES, 'UTF-8') ?>
</a>
</div>
</div>
@@ -270,7 +294,7 @@ $langHtml = preg_match('~^[a-z]{2}(-[A-Z]{2})?$~', (string)($lang ?? '')) ? (str
<footer class="site-footer">
<div class="container">
<p><?= $translations['copyr'] ?></p>
<p><?php echo $translations['copyr'] ?></p>
</div>
</footer>