<td colspan="2" align="center">
    <h2>{$params_tpl['title']}{$params_tpl['help']}</h2>
    <div style="display: flex; flex-direction: column;">{$tpl_types['dupl_field']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['sort_field']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['sort_dir']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['mark_field']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['main_value']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['dupl_value']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['uniq_value']}</div>
    <div style="display: flex; flex-direction: column;">{$tpl_types['empty_value']}</div>
    <div style="display: flex; flex-direction: column; display: none;">{$tpl_types['status_filter']}</div>
    <div style="display: flex; flex-direction: column;">
        <div class="correlation__row">
            <div class="correlation__key">
                <span>Где искать</span><span class="help_bt" h_id="tpl_status_filter"></span>:
            </div>
            <div style="text-align: left; padding: 3px;">
                <input type="checkbox" id="act_{$tpl_num}_0" onclick="set_status_filter()"> активные<br>
                <input type="checkbox" id="act_{$tpl_num}_1" onclick="set_status_filter()"> архив<br>
                <input type="checkbox" id="act_{$tpl_num}_2" onclick="set_status_filter()"> удаленные
            </div>
        </div>
    </div>
</td>
<script>
function set_status_filter() {
    let status_filter = [];
    if (document.getElementById('act_{$tpl_num}_0').checked) {
        status_filter.push(0);
    }
    if (document.getElementById('act_{$tpl_num}_1').checked) {
        status_filter.push(1);
    }
    if (document.getElementById('act_{$tpl_num}_2').checked) {
        status_filter.push(2);
    }
    if (status_filter.length === 0) {
        document.getElementById('act_{$tpl_num}_0').checked = true;
        status_filter.push(0);
    }
    $('input[name="calc_params[{$tpl_num}][status_filter]"]').val(status_filter.join());
}
if ($('input[name="calc_params[{$tpl_num}][status_filter]"]').val() == '') {
    $('input[name="calc_params[{$tpl_num}][status_filter]"]').val('0');
}
$('input[name="calc_params[{$tpl_num}][status_filter]"]').val().split(',').forEach((status) => {
    document.getElementById('act_{$tpl_num}_' + status).checked = true;
});
</script>