<form action="<?php echo admin_url('admin-post.php'); ?>" method="POST">
    <input type="hidden" name="action" value="salva_impostazioni_generali">

    <div class="container-fluid mt-2">
        <h5 class="m-0 mb-1">Settings</h5>
        <div class="row mb-3">
            <div class="col-8">
                <input class="form-control" type="checkbox" name="infinite_scroll_chk" value="1" id="infinite-scroll-chk" <?php echo $infinite_scroll_chk && $infinite_scroll_chk == 1 ? 'checked' : ''; ?>>
                <label class="form-check-label" for="infinite-scroll-chk">
                    Enable Infinite Scroll on single post
                </label>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-8">
                <input class="form-control" type="checkbox" name="infinite_scroll_home_chk" value="1" id="infinite-scroll-home-chk" <?php echo $infinite_scroll_home_chk && $infinite_scroll_home_chk == 1 ? 'checked' : ''; ?>>
                <label class="form-check-label" for="infinite-scroll-home-chk">
                    Enable Infinite Scroll in home page
                </label>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-8">
                <input class="form-control" type="checkbox" name="span_replace_chk" value="1" id="span-replace-chk" <?php echo $span_replace_chk && $span_replace_chk == 1 ? 'checked' : ''; ?>>
                <label class="form-check-label" for="span-replace-chk">
                    Enable Tag Span Replace
                </label>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-8">
                <input class="form-control" type="checkbox" name="p_cleaner_chk" value="1" id="p-cleaner-chk" <?php echo $p_cleaner_chk && $p_cleaner_chk == 1 ? 'checked' : ''; ?>>
                <label class="form-check-label" for="p-cleaner-chk">
                    Enable Tag P Cleaner
                </label>
            </div>
        </div>

        <div class="row mb-3">
            <div class="col-8">
                <input class="form-control" type="checkbox" name="http_cleaner_chk" value="1" id="http-cleaner-chk" <?php echo $http_cleaner_chk && $http_cleaner_chk == 1 ? 'checked' : ''; ?>>
                <label class="form-check-label" for="http-cleaner-chk">
                    Enable Http replace (replace Http with Https) 
                </label>
            </div>
        </div>

    </div>

    <div class="container-fluid mb-3">
        <h5 class="m-0 mb-1">Controlli SEO sulla scrittura</h5>

        <?php foreach($controlli_seo_checkbox as $key => $val) { ?>
            <div class="row mb-3">
                <div class="col-6">
                    <input class="form-control" type="checkbox" name="controlli_seo[]" value="<?php echo $key ?>" id="<?php echo $key.'-chk'; ?>" autocomplete="off" <?php echo $controlli_seo_chk && in_array($key,$controlli_seo_chk) ? 'checked' : ''; ?>>
                    <label class="form-check-label" for="<?php echo $key.'-chk'; ?>">
                        <?php echo $val; ?>
                    </label>
                </div>
            </div>
        <?php } ?>

    </div>

    <div class="container-fluid mb-5">
        <h5 class="m-0 mb-1">AI</h5>

        <div class="row mb-3">
            <div class="col-6">
                <input type="text" class="form-control form-control-sm w-75" name="chatgpt_token" placeholder="ChatGPT(OpenAI) token" autocomplete="off" value="<?php echo $chatgpt_token ?: '' ?>">
            </div>
        </div>

    </div>
    
    <div class="row-mb-3">
        <div class="col-12">
            <button class="btn btn-primary">Salva impostazioni</button>
        </div>
    </div>
</form>