2026-07-28 20:46:15 +00:00

74 lines
5.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
/**
* Секция сравнения: частная школа Декарт vs государственная школа
*
* Данные из Carbon Fields (Главная → Сравнение).
*
* @package Dekart
* @since 1.0.0
*/
if (! defined('ABSPATH')) {
exit;
}
$post_id = get_the_ID();
$compare_rows = carbon_get_post_meta($post_id, 'compare_rows');
$has_rows = ! empty($compare_rows) && is_array($compare_rows);
$compare_header_param = carbon_get_post_meta($post_id, 'compare_header_param') ?: 'Параметр';
$compare_header_dekart = carbon_get_post_meta($post_id, 'compare_header_dekart') ?: '🎓 «Декарт»';
$compare_header_state = carbon_get_post_meta($post_id, 'compare_header_state') ?: '📚 Государственная';
$check_svg = '<svg class="comparison__icon comparison__icon--check" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/></svg>';
$cross_svg = '<svg class="comparison__icon comparison__icon--cross" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="10"/><path d="M15 9l-6 6M9 9l6 6"/></svg>';
$default_rows = array(
array( 'param' => 'Число учеников в классе', 'dekart' => 'До 10 человек — малые классы', 'state' => '3035 человек' ),
array( 'param' => 'Английский язык', 'dekart' => 'Углублённый с 1 класса', 'state' => 'Базовый со 2 класса' ),
array( 'param' => 'Режим работы', 'dekart' => 'Уроки до 13:00, продлёнка до 19:00', 'state' => 'Уроки до 13:0014:00, продлёнка платно' ),
array( 'param' => 'Продлёнка', 'dekart' => 'Включена: обед, полдник, помощь с ДЗ, кружки, прогулки до 19:00', 'state' => 'Группа до 16:00 / платно' ),
array( 'param' => 'Питание', 'dekart' => 'Обед и полдник входят в продлёнку', 'state' => 'Одноразовое / за доплату' ),
array( 'param' => 'Индивидуальный подход', 'dekart' => 'Персональный план для каждого', 'state' => 'Общая программа на всех' ),
array( 'param' => 'Безопасность', 'dekart' => 'Охрана, видеонаблюдение, закрытая территория', 'state' => 'Пропускной режим, перемены без контроля' ),
array( 'param' => 'Аттестат', 'dekart' => 'Государственного образца, лицензия МО', 'state' => 'Стандартная аккредитация' ),
);
?>
<section class="comparison section-bg reveal" data-bg="comparison">
<div class="container">
<div class="section-header--centered">
<span class="bento-label">Сравнение</span>
<h2 class="bento-h2">Почему выбирают частную школу</h2>
<p class="bento-p">Честное сравнение: чем «Декарт» отличается от государственной школы</p>
</div>
<div class="comparison__scroll-hint" aria-hidden="true"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m15 18 6-6-6-6"/></svg> Листайте</div>
<div class="comparison__table-wrap">
<div class="comparison__table">
<div class="comparison__row comparison__row--head">
<div class="comparison__cell comparison__cell--param"><?php echo esc_html($compare_header_param); ?></div>
<div class="comparison__cell comparison__cell--dekart"><?php echo esc_html($compare_header_dekart); ?></div>
<div class="comparison__cell comparison__cell--state"><?php echo esc_html($compare_header_state); ?></div>
</div>
<?php $rows = $has_rows ? $compare_rows : $default_rows; ?>
<?php foreach ($rows as $row) :
$param = $row['param'] ?? '';
$dekart_text = $row['dekart'] ?? '';
$state_text = $row['state'] ?? '';
if (empty($param)) {
continue;
}
?>
<div class="comparison__row">
<div class="comparison__cell comparison__cell--param"><?php echo esc_html($param); ?></div>
<div class="comparison__cell comparison__cell--dekart"><?php echo $check_svg . ' ' . esc_html($dekart_text); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="comparison__cell comparison__cell--state"><?php echo $cross_svg . ' ' . esc_html($state_text); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
</div>
<?php endforeach; ?>
</div>
</div>
</div>
</section>