2026-10-12 13:27:02 +00:00

54 lines
2.2 KiB
PHP
Raw 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
// Результаты (значения метрик только из CF)
if (! defined('ABSPATH')) {
exit;
}
$data = Pksh_Data::instance();
$post_id = get_the_ID();
$lead = (string) carbon_get_post_meta($post_id, 'pksh_results_lead');
$metrics = carbon_get_post_meta($post_id, 'pksh_results_metrics');
$answer = (string) $data->get_geo_answer_results();
$q2 = $data->get_geo_question_2();
if (function_exists('dekart_fill_city')) {
$lead = dekart_fill_city($lead);
$answer = dekart_fill_city($answer);
}
?>
<section class="bento pksh-section" id="results" aria-label="Результаты учеников">
<div class="bento__full bento-card bento-card--highlight-results section-header--centered">
<span class="bento-label bento-label--light">Результаты наших учеников</span>
<h2 class="bento-h2 bento-h2--light">К чему мы приводим детей</h2>
<?php if ('' !== $lead) : ?><p class="bento-p"><?php echo wp_kses_post($lead); ?></p><?php endif; ?>
<?php if (is_array($metrics) && ! empty($metrics)) : ?>
<div class="results-grid">
<?php foreach ($metrics as $m) :
$val = trim((string) ($m['metric_value'] ?? ''));
$lbl = trim((string) ($m['metric_label'] ?? ''));
if ('' === $val && '' === $lbl) {
continue;
}
?>
<div class="result-item">
<?php if ('' !== $val) : ?><span class="result-item__value"><?php echo esc_html($val); ?></span><?php endif; ?>
<?php if ('' !== $lbl) : ?><span class="result-item__desc"><?php echo esc_html($lbl); ?></span><?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<?php if ('' !== $q2) : ?>
<h3 class="bento-h3 geo-answer-heading"><?php echo esc_html($q2); ?></h3>
<?php endif; ?>
<?php if ('' !== $answer) : ?>
<div class="geo-answer-block">
<p class="bento-p geo-answer-text"><?php echo wp_kses_post($answer); ?></p>
</div>
<?php endif; ?>
</div>
</section>