ID invalide.";exit;} $currentLang = $lang ?? 'ru'; if (! in_array($currentLang, ['ru', 'fr', 'en'], true)) { $currentLang = 'ru'; } function h($s) {return htmlspecialchars((string) $s, ENT_QUOTES, 'UTF-8');} function percent_from_5($note) {$n = max(0, min(5, (float) $note));return (int) round($n / 5 * 100);} function pseudo_from($prenom, $nom) { $p = trim((string) $prenom); $n = trim((string) $nom); $p = $p !== '' ? mb_convert_case($p, MB_CASE_TITLE, 'UTF-8') : 'Client'; $i = $n !== '' ? mb_strtoupper(mb_substr($nom, 0, 1, 'UTF-8'), 'UTF-8') : ''; return $i ? ($p . '.' . $i) : $p; } function video_thumb_info(?string $url): ?array { if (! $url || ! trim($url)) { return null; } $u = trim($url); if (preg_match('~(?:youtube\.com/(?:watch\?v=|embed/|shorts/)|youtu\.be/)([A-Za-z0-9_-]{6,})~i', $u, $m)) { $id = $m[1];return ['provider' => 'youtube', 'id' => $id, 'thumb' => "https://i.ytimg.com/vi/$id/hqdefault.jpg"]; } if (preg_match('~dailymotion\.com/video/([A-Za-z0-9]+)|dai\.ly/([A-Za-z0-9]+)~i', $u, $m)) { $id = $m[1] ?: $m[2];return ['provider' => 'dailymotion', 'id' => $id, 'thumb' => "https://www.dailymotion.com/thumbnail/video/$id"]; } $path = parse_url($u, PHP_URL_PATH) ?? '';if (preg_match('~\.(mp4|webm|ogg)$~i', $path)) {return ['provider' => 'file', 'id' => null, 'thumb' => null];} if (stripos($u, 'vimeo.com') !== false) {return ['provider' => 'vimeo', 'id' => null, 'thumb' => null];} return ['provider' => 'other', 'id' => null, 'thumb' => null]; } // 1) Praticien $st = $pdo->prepare(" SELECT p.id, p.titre, p.nom, p.prenom, p.telephone, p.adresse, p.ville, p.code_postal, p.specialite, p.presentation, p.photo, p.video, p.disponibilite, COALESCE(pt.nom_affiche, p.nom) AS nom_affiche, COALESCE(pt.prenom_affiche, p.prenom) AS prenom_affiche, COALESCE(pt.ville_affichee, p.ville) AS ville_affichee, COALESCE(pt.titre, p.titre) AS titre_affiche, COALESCE(pt.specialite, p.specialite) AS specialite_affichee, COALESCE(pt.presentation, p.presentation) AS presentation_affichee, COALESCE(pt.disponibilite, p.disponibilite) AS disponibilite_affichee FROM praticien p LEFT JOIN praticien_traduction pt ON pt.praticien_id = p.id AND pt.langue = :lang WHERE p.id = :id LIMIT 1 "); $st->execute([ ':lang' => $currentLang, ':id' => $praticien_id, ]); $p = $st->fetch(PDO::FETCH_ASSOC); if (! $p) {echo "