<div>
    <br>
    <form method="post">
        <input type="submit" id="submit" name="submit" value="Flush Cache" style= "cursor:pointer; background:<?Php echo ITSP_SECONDARY_COLOR;?>">
    </form>
</div>
<?php
if (isset($_POST['submit'])) {
    $option_name = 'get_post_details';
    $post_details = get_option($option_name);
    $cache_clear = array(
        'get_brandkit_data',
        'get_brandkit_name',
        'get_brandkit_customer_details',
        'activities_by_since_events',
        'activities_by_since_events_EVENT',
        'activities_by_since_events_PAGE_NEWSLETTER',
        'activities_by_since_events_Reviews',
        'activities_reviews0',
        'activities_reviews1',
        'activities_reviews2',
        'activities_reviews3',
        'activities_reviews4',
        'activities_reviews5',
        'activities_reviews6',
        'activities_reviews7',
        'activities_reviews0on',
        'activities_reviews1on',
        'activities_reviews2on',
        'activities_reviews3on',
        'activities_reviews4on',
        'activities_reviews5on',
        'activities_reviews6on',
        'activities_reviews7on',
        'activities_reviews0Reviews',
        'activities_reviews1Reviews',
        'activities_reviews2Reviews',
        'activities_reviews3Reviews',
        'activities_reviews4Reviews',
        'activities_reviews5Reviews',
        'activities_by_since_events_COUPON',
		'get_tracking_codes_details'
    );
    if ($post_details) {
        $cache_clear = array_merge($cache_clear, $post_details);
    }
    foreach ($cache_clear as $key => $option_name) {
        $new_value = '';
        if (get_option($option_name) !== false) {
            // The option already exists, so update it.
            update_option($option_name, $new_value);
        } else {
            // The option hasn't been created yet, so add it with $autoload set to 'no'.
            $deprecated = null;
            $autoload = 'no';
            add_option($option_name, $new_value, $deprecated, $autoload);
        }
    }
    
      self::is_clear();
      print('<script>window.location.href="admin.php?page=is-integration"</script>');
      exit;
    
}
