54 lines
2.0 KiB
PHP
54 lines
2.0 KiB
PHP
<?php
|
||
|
||
// Сравнение форматов обучения (школа / семейный класс / онлайн)
|
||
|
||
if (! defined('ABSPATH')) {
|
||
exit;
|
||
}
|
||
|
||
$title = dekart_family_get('family_compare_title');
|
||
$text = dekart_family_get('family_compare_text');
|
||
$rows = function_exists('dekart_cf_theme_complex')
|
||
? dekart_cf_theme_complex('family_compare_rows')
|
||
: (array) dekart_family_get('family_compare_rows');
|
||
|
||
// Только строки с заполненным параметром
|
||
$rows = array_values(array_filter((array) $rows, function ($r) {
|
||
return is_array($r) && trim((string) ($r['param'] ?? '')) !== '';
|
||
}));
|
||
|
||
if (! $rows) {
|
||
return;
|
||
}
|
||
?>
|
||
<section class="section-bg reveal family-block family-compare" data-bg="family-compare">
|
||
<div class="container">
|
||
<div class="section-header--left">
|
||
<?php if ($title) : ?><h2 class="bento-h2"><?php echo esc_html($title); ?></h2><?php endif; ?>
|
||
<?php if ($text) : ?><p class="bento-p"><?php echo esc_html($text); ?></p><?php endif; ?>
|
||
</div>
|
||
<div class="family-compare__wrap">
|
||
<table class="family-compare__table">
|
||
<thead>
|
||
<tr>
|
||
<th scope="col">Параметр</th>
|
||
<th scope="col">Школа</th>
|
||
<th scope="col" class="is-hl">Семейный класс</th>
|
||
<th scope="col">Онлайн</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<?php foreach ($rows as $r) : ?>
|
||
<tr>
|
||
<th scope="row"><?php echo esc_html($r['param'] ?? ''); ?></th>
|
||
<td><?php echo esc_html($r['school'] ?? ''); ?></td>
|
||
<td class="is-hl"><?php echo esc_html($r['family'] ?? ''); ?></td>
|
||
<td><?php echo esc_html($r['online'] ?? ''); ?></td>
|
||
</tr>
|
||
<?php endforeach; ?>
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</section>
|