Files

319 lines
14 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?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;
}
function include_header_clean(string $absPath): void
{
global $translations, $lang;
ob_start();
include $absPath; // /public/includes/header.php
$buf = ob_get_clean() ?: '';
// 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="<?php echo htmlspecialchars($langHtml, ENT_QUOTES, 'UTF-8') ?>">
<head>
<meta charset="UTF-8">
<title><?php echo htmlspecialchars($translations['seo_how_it_work_title'], ENT_QUOTES, 'UTF-8') ?></title>
<meta name="description" content="<?php echo htmlspecialchars($translations['seo_how_it_work_desc'], ENT_QUOTES, 'UTF-8') ?>">
<meta name="keywords" content="<?php echo htmlspecialchars($translations['seo_how_it_work_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="<?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') ?>">
<style>
.howitworks { --brand:#38378B; --mint:#06FFA8; --text:#111; --muted:#6b7280; --card:#fff; --border:#e5e7eb; }
.howitworks { font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color:var(--text); }
.howitworks .wrap { max-width: 980px; margin: 0 auto; padding: clamp(16px,4vw,32px); }
.howitworks .card {
background: var(--card); border:1px solid var(--border); border-radius:16px;
box-shadow: 0 8px 24px rgba(0,0,0,.06); padding: clamp(18px,3.6vw,28px);
}
.howitworks h2 { font-size: clamp(24px, 5.2vw, 36px); line-height:1.2; margin: 0 0 16px; }
.howitworks p { font-size: clamp(14px, 2.8vw, 16px); line-height:1.65; color: var(--muted); margin: 0 0 12px; }
.hiw-steps{ display:grid; gap:14px; grid-template-columns: 1fr; }
@media (min-width: 600px){ .hiw-steps{ grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px){ .hiw-steps{ grid-template-columns: 1fr 1fr; } }
.step{
display:flex; gap:12px; align-items:flex-start; background:#fafafa; border:1px solid #f0f1f4;
border-radius:12px; padding:14px;
}
.step-icon{
width:44px; height:44px; flex:0 0 44px; display:grid; place-items:center; font-size:20px; font-weight:700;
background: color-mix(in oklab, var(--brand) 12%, #fff); color: var(--brand); border:2px solid color-mix(in oklab, var(--brand) 25%, #fff);
border-radius:50%;
}
.step h3{ margin:2px 0 4px; font-size: clamp(15px, 2.8vw, 18px); line-height:1.35; color:#1f2937; font-weight:600; }
.step p { margin:0; }
.hiw-intro { margin-bottom: 10px; }
.hiw-list{ list-style:none; padding:0; margin: 8px 0 0; display:grid; gap:10px; }
.hiw-item{
display:flex; gap:12px; align-items:flex-start; border:1px dashed #e6e8ee; border-radius:12px; padding:12px 14px; background:#fff;
}
.dot{
width:22px; height:22px; border-radius:50%; flex:0 0 22px; display:grid; place-items:center;
background: var(--mint); color:#043; font-size:14px; font-weight:800;
}
.hiw-item h4{ margin:2px 0 4px; font-size: clamp(15px, 2.8vw, 18px); line-height:1.35; font-weight:700; color:#111; }
.hiw-item p { margin:0; }
.callout{
margin-top:16px; border-left:6px solid var(--brand);
background: color-mix(in oklab, var(--brand) 8%, #fff);
border-radius:12px; padding:14px 16px;
}
</style>
<?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 else: ?>
<header class="site-header">
<div class="container">
<div class="header-left">
<div class="brand">
<a href="/index.php"><img src="/public/uploads/img/logo_u.png"
alt="uslugi.fr"
class="logo-mobile"></a>
<a href="/index.php"><img src="/public/uploads/img/logo.png"
alt="uslugi.fr"
class="logo-desktop"></a>
</div>
<div class="lang-switch">
<?php require __DIR__ . '/includes/menu_langue.php'; ?>
</div>
</div>
<nav class="header-actions">
<a class="btn-login" href="/connexion.php">
<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">
<button
class="btn btn-logo rounded-circle d-inline-flex align-items-center justify-content-center question-btn"
type="button"
data-bs-toggle="dropdown"
data-bs-auto-close="true"
aria-expanded="false"
aria-label="<?php echo htmlspecialchars(t($translations, 'howitworks_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"><?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>
</div>
</header>
<?php endif; ?>
<div class="main">
<div class="content">
<section class="howitworks">
<div class="wrap">
<div class="card" style="margin-bottom:18px;">
<h2><?php echo htmlspecialchars(t($translations, 'howitworks_short_title', 'How it works'), ENT_QUOTES, 'UTF-8') ?></h2>
<div class="hiw-steps">
<div class="step">
<div class="step-icon">📝</div>
<div>
<h3><?php echo htmlspecialchars(t($translations, 'howitworks_step1_title', 'Registration'), ENT_QUOTES, 'UTF-8') ?></h3>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_step1_text', 'Create your account in minutes.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</div>
<div class="step">
<div class="step-icon">🔎</div>
<div>
<h3><?php echo htmlspecialchars(t($translations, 'howitworks_step2_title', 'Choose a specialist'), ENT_QUOTES, 'UTF-8') ?></h3>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_step2_text', 'Find an expert and pick a time.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</div>
<div class="step">
<div class="step-icon">✉️</div>
<div>
<h3><?php echo htmlspecialchars(t($translations, 'howitworks_step3_title', 'Confirmation'), ENT_QUOTES, 'UTF-8') ?></h3>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_step3_text', 'Receive an email confirmation and pay the specialist directly.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</div>
<div class="step">
<div class="step-icon">🎥</div>
<div>
<h3><?php echo htmlspecialchars(t($translations, 'howitworks_step4_title', 'Online consultation'), ENT_QUOTES, 'UTF-8') ?></h3>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_step4_text', 'Happens on our website via Jitsi.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</div>
</div>
</div>
<div class="card">
<h2><?php echo htmlspecialchars(t($translations, 'howitworks_long_title', 'How uslugi.fr works'), ENT_QUOTES, 'UTF-8') ?></h2>
<p class="hiw-intro">
<?php echo htmlspecialchars(t($translations, 'howitworks_long_intro', 'We built the website to help you find a trusted Russian-speaking specialist in France and get a consultation easily.'), ENT_QUOTES, 'UTF-8') ?>
</p>
<ul class="hiw-list">
<li class="hiw-item">
<div class="dot">1</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item1_title', 'Registration'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item1_text', 'Create your personal account in minutes.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">2</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item2_title', 'Choose a specialist'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item2_text', 'In the catalog: lawyers, notaries, consultants, psychologists and translators. Each specialist has a calendar with available dates and times.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">3</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item3_title', 'Booking'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item3_text', 'Pick a time and receive an email confirmation.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">4</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item4_title', 'Payment'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item4_text', 'Pay the specialist directly — we do not take any commission.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">5</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item5_title', 'Chat'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item5_text', 'Before the consultation, you can уточнить детали in chat with the expert.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">6</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item6_title', 'Online meeting'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item6_text', 'The consultation takes place via Jitsi on our website — just open the link.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
<li class="hiw-item">
<div class="dot">7</div>
<div>
<h4><?php echo htmlspecialchars(t($translations, 'howitworks_item7_title', 'Cancellation'), ENT_QUOTES, 'UTF-8') ?></h4>
<p><?php echo htmlspecialchars(t($translations, 'howitworks_item7_text', 'If plans change, each specialist has their own cancellation policy.'), ENT_QUOTES, 'UTF-8') ?></p>
</div>
</li>
</ul>
<div class="callout">
<strong><?php echo htmlspecialchars(t($translations, 'howitworks_goal_label', 'Our goal:'), ENT_QUOTES, 'UTF-8') ?></strong>
<?php echo htmlspecialchars(t($translations, 'howitworks_goal_text', 'Connect you with the right Russian-speaking specialist in France and make everything simple and convenient.'), ENT_QUOTES, 'UTF-8') ?>
</div>
</div>
</div>
</section>
</div>
</div>
<footer class="site-footer">
<div class="container">
<p><?php echo $translations['copyr'] ?></p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>