<?php
defined('ABSPATH') or die('No script kiddies please!!');
$std_settings = get_option('std_settings');
?>
<div class="wrap std-wrap">
    <div class="std-header std-clearfix">
        <h1 class="std-floatLeft">
            <img src="<?php echo STD_URL . 'images/logo.png' ?>" class="std-plugin-logo" />
            <span class="std-sub-header"><?php esc_html_e('Settings', 'subscribe-to-download'); ?></span>
        </h1>
        <div class="std-add-wrap">
            <a href="javascript:void(0);" class="std-form-save-trigger"><input type="button" class="std-button-white" value="<?php esc_html_e('Save Settings', 'subscribe-to-download'); ?>"></a>
        </div>
    </div>

    <div class="std-form-wrap std-form-add-block std-clearfix">
        <form method="post" action="" class="std-subscription-form" data-form-action="std_settings_save_action">
            <div class="std-form-nav-wrap">
                <ul class="std-form-nav">
                    <?php
                    $active_tab = (isset($_GET['tab'])) ? sanitize_text_field($_GET['tab']) : 'mailchimp';
                    ?>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'mailchimp') ? esc_attr('std-active-nav') : ''; ?>" data-tab="mailchimp"><span class="dashicons dashicons-email"></span><?php esc_html_e('Mailchimp Settings', 'subscribe-to-download'); ?></a></li>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'mailerlite') ? esc_attr('std-active-nav') : ''; ?>" data-tab="mailerlite"><span class="dashicons dashicons-email-alt"></span><?php esc_html_e('Mailerlite Settings', 'subscribe-to-download'); ?></a></li>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'sendinblue') ? esc_attr('std-active-nav') : ''; ?>" data-tab="sendinblue"><span class="dashicons dashicons-email-alt"></span><?php esc_html_e('Sendinblue Settings', 'subscribe-to-download'); ?></a></li>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'convertkit') ? esc_attr('std-active-nav') : ''; ?>" data-tab="convertkit"><span class="dashicons dashicons-email-alt"></span><?php esc_html_e('Convertkit Settings', 'subscribe-to-download'); ?></a></li>
                    <?php
                    if (!empty($std_settings['constant_contact']['enable'])) {
                    ?>
                        <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'constant_contact') ? esc_attr('std-active-nav') : ''; ?>" data-tab="constant_contact"><span class="dashicons dashicons-email-alt"></span><?php esc_html_e('Constant Contact Settings(Deprecated)', 'subscribe-to-download'); ?></a></li>
                    <?php } ?>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'constant_contact_v3') ? esc_attr('std-active-nav') : ''; ?>" data-tab="constant_contact_v3"><span class="dashicons dashicons-email-alt"></span><?php esc_html_e('Constant Contact V3 Settings', 'subscribe-to-download'); ?></a></li>
                    <li><a href="javascript:void(0);" class="std-nav-item <?php echo ($active_tab == 'extra') ? esc_attr('std-active-nav') : ''; ?>" data-tab="extra"><span class="dashicons dashicons-admin-settings"></span><?php esc_html_e('Extra Settings', 'subscribe-to-download'); ?></a></li>
                </ul>
            </div>
            <div class="std-settings-section-wrap">
                <?php
                /**
                 * Mailchimp Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/mailchimp-settings.php');
                ?>
                <?php
                /**
                 * Constant Contact Settings
                 */

                if (!empty($std_settings['constant_contact']['enable'])) {

                    include(STD_PATH . 'inc/views/backend/settings-sections/constant-contact-settings.php');
                }

                ?>
                <?php
                /**
                 * Constant Contact V3 Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/constant-contact-v3-settings.php');
                ?>
                <?php
                /**
                 * Mailerlite Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/mailerlite-settings.php');
                ?>
                <?php
                /**
                 * Convertkit Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/convertkit-settings.php');
                ?>
                <?php
                /**
                 * Sendinblue Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/sendinblue-settings.php');
                ?>
                <?php
                /**
                 * Extra Settings
                 */
                include(STD_PATH . 'inc/views/backend/settings-sections/extra-settings.php');
                ?>

            </div>

        </form>
    </div>
</div>
<div class="std-form-message"></div>