<div class="theme-import">
	<?php 
        // Check if the demo import has been completed
        $travel_booking_agency_demo_import_completed = get_option('travel_booking_agency_demo_import_completed', false);

        // If the demo import is completed, display the "View Site" button
        if ($travel_booking_agency_demo_import_completed) {
        echo '<p class="notice-text">' . esc_html__('Your demo import has been completed successfully.', 'travel-booking-agency') . '</p>';
        echo '<span><a href="' . esc_url(home_url()) . '"  class= "run-import view-site" target="_blank">' . esc_html__('VIEW SITE', 'travel-booking-agency') . '</a></span>';
        }

		// POST and update the customizer and other related data
        if (isset($_POST['submit'])) {

            // ------- Create Nav Menu --------
            $travel_booking_agency_menuname = 'Main Menus';
            $travel_booking_agency_bpmenulocation = 'primary';
            $travel_booking_agency_menu_exists = wp_get_nav_menu_object($travel_booking_agency_menuname);

            if (!$travel_booking_agency_menu_exists) {
                $travel_booking_agency_menu_id = wp_create_nav_menu($travel_booking_agency_menuname);

                // Create Home Page
                $travel_booking_agency_home_title = 'Home';
                $travel_booking_agency_home = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_home_title,
                    'post_content' => '',
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'home'
                );
                $travel_booking_agency_home_id = wp_insert_post($travel_booking_agency_home);
                // Assign Home Page Template
                add_post_meta($travel_booking_agency_home_id, '_wp_page_template', 'page-template/custom-frontpage.php');
                // Update options to set Home Page as the front page
                update_option('page_on_front', $travel_booking_agency_home_id);
                update_option('show_on_front', 'page');
                // Add Home Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('Home', 'travel-booking-agency'),
                    'menu-item-classes' => 'home',
                    'menu-item-url' => home_url('/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_home_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create About Us Page with Dummy Content
                $travel_booking_agency_pages_title = 'About Us';
                $travel_booking_agency_pages_content = '
                <p>Explore all the pages we have on our website. Find information about our services, company, and more.</p>

                 Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> 

                  All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.';
                $travel_booking_agency_pages = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_pages_title,
                    'post_content' => $travel_booking_agency_pages_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'pages'
                );
                $travel_booking_agency_pages_id = wp_insert_post($travel_booking_agency_pages);
                // Add About Us Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('About Us', 'travel-booking-agency'),
                    'menu-item-classes' => 'pages',
                    'menu-item-url' => home_url('/pages/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_pages_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Pages Page with Dummy Content
                $travel_booking_agency_about_title = 'Pages';
                $travel_booking_agency_about_content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam...<br>

                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> 

                            There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isnt anything embarrassing hidden in the middle of text.<br> 

                            All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.';
                $travel_booking_agency_about = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_about_title,
                    'post_content' => $travel_booking_agency_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'about-us'
                );
                $travel_booking_agency_about_id = wp_insert_post($travel_booking_agency_about);
                // Add Pages Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('Pages', 'travel-booking-agency'),
                    'menu-item-classes' => 'about-us',
                    'menu-item-url' => home_url('/about-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Tour List Page with Dummy Content
                $travel_booking_agency_about_title = 'Tour List';
                $travel_booking_agency_about_content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam...<br>

                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> 

                            There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isnt anything embarrassing hidden in the middle of text.<br> 

                            All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.';
                $travel_booking_agency_about = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_about_title,
                    'post_content' => $travel_booking_agency_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'about-us'
                );
                $travel_booking_agency_about_id = wp_insert_post($travel_booking_agency_about);
                // Add Tour List Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('Tour List', 'travel-booking-agency'),
                    'menu-item-classes' => 'about-us',
                    'menu-item-url' => home_url('/about-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));


                // Create Destinations Page with Dummy Content
                $travel_booking_agency_about_title = 'Destinations';
                $travel_booking_agency_about_content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam...<br>

                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> 

                            There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isnt anything embarrassing hidden in the middle of text.<br> 

                            All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.';
                $travel_booking_agency_about = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_about_title,
                    'post_content' => $travel_booking_agency_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'about-us'
                );
                $travel_booking_agency_about_id = wp_insert_post($travel_booking_agency_about);
                // Add Destinations Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('Destinations', 'travel-booking-agency'),
                    'menu-item-classes' => 'about-us',
                    'menu-item-url' => home_url('/about-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));
               // ===== CREATE BLOG PAGE =====
                $travel_booking_agency_blog_page = get_page_by_path('blog');
                if (!$travel_booking_agency_blog_page) {
                    $travel_booking_agency_blog_page_id = wp_insert_post(array(
                        'post_type'   => 'page',
                        'post_title'  => 'Blog',
                        'post_status' => 'publish',
                        'post_name'   => 'blog',
                    ));

                } else {
                    $travel_booking_agency_blog_page_id = $travel_booking_agency_blog_page->ID;
                }
                update_option('page_for_posts', $travel_booking_agency_blog_page_id);

                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title'     => __('Blog', 'travel-booking-agency'),
                    'menu-item-object-id' => $travel_booking_agency_blog_page_id,
                    'menu-item-object'    => 'page',
                    'menu-item-type'      => 'post_type',
                    'menu-item-status'    => 'publish',
                ));

                // Create Contact Us Page with Dummy Content
                $travel_booking_agency_about_title = 'Contact Us';
                $travel_booking_agency_about_content = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam...<br>

                         Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry standard dummy text ever since the 1500, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960 with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.<br> 

                            There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which dont look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isnt anything embarrassing hidden in the middle of text.<br> 

                            All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.';
                $travel_booking_agency_about = array(
                    'post_type' => 'page',
                    'post_title' => $travel_booking_agency_about_title,
                    'post_content' => $travel_booking_agency_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'about-us'
                );
                $travel_booking_agency_about_id = wp_insert_post($travel_booking_agency_about);
                // Add Contact Us Page to Menu
                wp_update_nav_menu_item($travel_booking_agency_menu_id, 0, array(
                    'menu-item-title' => __('Contact Us', 'travel-booking-agency'),
                    'menu-item-classes' => 'about-us',
                    'menu-item-url' => home_url('/about-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $travel_booking_agency_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Set the menu location if it's not already set
                if (!has_nav_menu($travel_booking_agency_bpmenulocation)) {
                    $travel_booking_agency_locations = get_theme_mod('nav_menu_locations'); // Use 'nav_menu_locations' to get locations array
                    if (empty($travel_booking_agency_locations)) {
                        $travel_booking_agency_locations = array();
                    }
                    $travel_booking_agency_locations[$travel_booking_agency_bpmenulocation] = $travel_booking_agency_menu_id;
                    set_theme_mod('nav_menu_locations', $travel_booking_agency_locations);
                }
                
        }     

            //Header
            set_theme_mod( 'travel_booking_agency_topbar_hide_show', true );
            set_theme_mod( 'travel_booking_agency_mail', 'Mail' ); 
            set_theme_mod( 'travel_booking_agency_mail1', 'example@gmail.com' ); 
            set_theme_mod( 'travel_booking_agency_location', 'Our Location' ); 
            set_theme_mod( 'travel_booking_agency_location1', '104 Main Collins Street' ); 
            set_theme_mod( 'travel_booking_agency_call', 'Call Us' ); 
            set_theme_mod( 'travel_booking_agency_call1', '123 456 789' ); 

            //Social Icon
            set_theme_mod( 'travel_booking_agency_show_social_icon', true );
            set_theme_mod( 'travel_booking_agency_facebook_url', '#' ); 
            set_theme_mod( 'travel_booking_agency_twitter_url', '#' ); 
            set_theme_mod( 'travel_booking_agency_goggle_url', '#' ); 
            set_theme_mod( 'travel_booking_agency_youtube_url', '#' ); 

            //Slider Section
            set_theme_mod( 'travel_booking_agency_slider_hide_show', true );
            set_theme_mod( 'travel_booking_agency_slider_small_text', 'TOUR & TRAVEL' ); 
            set_theme_mod( 'travel_booking_agency_slider_button_text', 'View Tours' ); 
            set_theme_mod( 'travel_booking_agency_slider_button_link', '#' ); 

            $travel_booking_agency_titles = [
                'Explore Exotic Destinations with Ease',
                'Plan Your Perfect Vacation Today',
                'Discover Hidden Gems Around the World',
                'Unforgettable Journeys Await You'
            ];
            for($travel_booking_agency_i=1;$travel_booking_agency_i<=4;$travel_booking_agency_i++){
                $travel_booking_agency_slider_title = $travel_booking_agency_titles[$travel_booking_agency_i - 1];
                $travel_booking_agency_slider_content = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard';
                // Create post object
                $travel_booking_agency_my_post = array(
                'post_title'    => wp_strip_all_tags( $travel_booking_agency_slider_title ),
                'post_content'  => $travel_booking_agency_slider_content,
                'post_status'   => 'publish',
                'post_type'     => 'page',
                );
 
                // Insert the post into the database
                $travel_booking_agency_post_id = wp_insert_post( $travel_booking_agency_my_post );
 
                if ($travel_booking_agency_post_id) {
                  // Set the theme mod for the slider page
                  set_theme_mod('travel_booking_agency_slider_page' . $travel_booking_agency_i, $travel_booking_agency_post_id);
 
                   $travel_booking_agency_image_url = get_template_directory_uri().'/images/slider'.$travel_booking_agency_i.'.png';
 
                 $travel_booking_agency_image_id = media_sideload_image($travel_booking_agency_image_url, $travel_booking_agency_post_id, null, 'id');
 
                     if (!is_wp_error($travel_booking_agency_image_id)) {
                         // Set the downloaded image as the post's featured image
                         set_post_thumbnail($travel_booking_agency_post_id, $travel_booking_agency_image_id);
                     }
                 }
            } 

            //Popular Tour Section
            set_theme_mod( 'travel_booking_agency_tour_section_hide_show', true );
            set_theme_mod( 'travel_booking_agency_section_title', 'Most Popular Tours' ); 
            set_theme_mod( 'travel_booking_agency_latest_post_button_text', 'View Tours' ); 
            set_theme_mod( 'travel_booking_agency_popular_number', '3' ); 

            // Arrays for the demo content
            $travel_booking_agency_tab_text_array = array("Featured", "Lifestyle", "Adventure");
            $travel_booking_agency_category_names = array("postcategory1", "postcategory2", "postcategory3"); // Updated to 5 categories
            $travel_booking_agency_title_array = array(
                array("Special Package 01", "Special Package 02", "Special Package 03"),
                array("Special Package 01", "Special Package 02", "Special Package 03"),
                array("Special Package 01", "Special Package 02", "Special Package 03"),
            );

            for ($travel_booking_agency_tab_index = 1; $travel_booking_agency_tab_index <= 3; $travel_booking_agency_tab_index++) {

                // Set the tab text for each tab in customizer
                $travel_booking_agency_theme_mod_key = 'travel_booking_agency_popular_text' . $travel_booking_agency_tab_index;
                $travel_booking_agency_theme_mod_value = $travel_booking_agency_tab_text_array[$travel_booking_agency_tab_index - 1];
                set_theme_mod($travel_booking_agency_theme_mod_key, $travel_booking_agency_theme_mod_value);

                // Set the category for this tab
                $travel_booking_agency_current_category = $travel_booking_agency_category_names[$travel_booking_agency_tab_index - 1];
                set_theme_mod('travel_booking_agency_popular_category' . $travel_booking_agency_tab_index, $travel_booking_agency_current_category);

                // Create or retrieve the post category term ID
                $travel_booking_agency_term = term_exists($travel_booking_agency_current_category, 'category');
                if ($travel_booking_agency_term === 0 || $travel_booking_agency_term === null) {
                    // If the term does not exist, create it
                    $travel_booking_agency_term = wp_insert_term($travel_booking_agency_current_category, 'category');
                    if (is_wp_error($travel_booking_agency_term)) {
                        error_log('Error creating category: ' . $travel_booking_agency_term->get_error_message());
                        continue; // Skip to the next iteration if category creation fails
                    }
                }
                $travel_booking_agency_term_id = is_array($travel_booking_agency_term) ? $travel_booking_agency_term['term_id'] : $travel_booking_agency_term;

                // Add featured tag for each tab
                $travel_booking_agency_title_small = 'Starting From $79'; // Example text
                set_theme_mod('travel_booking_agency_title_small' . $travel_booking_agency_tab_index, $travel_booking_agency_title_small);

                // Loop to add 3 posts in this category
                for ($travel_booking_agency_i = 0; $travel_booking_agency_i < 3; $travel_booking_agency_i++) {
                    // Check if the title exists for the current tab and index
                    if (!isset($travel_booking_agency_title_array[$travel_booking_agency_tab_index - 1][$travel_booking_agency_i])) {
                        continue; // Skip if there's no title for this index
                    }

                    // Create post content
                    $travel_booking_agency_title = $travel_booking_agency_title_array[$travel_booking_agency_tab_index - 1][$travel_booking_agency_i];
                    $travel_booking_agency_content = 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard'; // Standard content for all posts
                    $travel_booking_agency_full_content = $travel_booking_agency_content . '<br>' . $travel_booking_agency_title_small;

                    // Create post object
                    $travel_booking_agency_my_post = array(
                        'post_title'    => wp_strip_all_tags($travel_booking_agency_title),
                        'post_content'  => $travel_booking_agency_full_content,
                        'post_status'   => 'publish',
                        'post_type'     => 'post',
                    );

                    // Insert the post into the database
                    $travel_booking_agency_post_id = wp_insert_post($travel_booking_agency_my_post);

                    update_post_meta($travel_booking_agency_post_id, 'spaecial_package_user', "9+");
                    update_post_meta($travel_booking_agency_post_id, 'spaecial_package_location', "Europe");
                    update_post_meta($travel_booking_agency_post_id, 'spaecial_package_days', "7 Days");
                    update_post_meta($travel_booking_agency_post_id, 'spaecial_package_ratings', "9.9 Ratings");

                    if (is_wp_error($travel_booking_agency_post_id)) {
                        error_log('Error creating post: ' . $travel_booking_agency_post_id->get_error_message());
                        continue; // Skip to the next post if creation fails
                    }

                    // Assign the category to the post
                    wp_set_post_categories($travel_booking_agency_post_id, array((int)$travel_booking_agency_term_id));

                    // Handle the featured image using media_sideload_image (adjusted to media_handle_sideload)
                    $travel_booking_agency_image_url = get_template_directory_uri() . '/images/tour' . ($travel_booking_agency_i + 1) . '.png';
                    $travel_booking_agency_image_temp = download_url($travel_booking_agency_image_url);

                    if (is_wp_error($travel_booking_agency_image_temp)) {
                        error_log('Error downloading image: ' . $travel_booking_agency_image_temp->get_error_message());
                        continue; // Skip to the next post if image download fails
                    }

                    // Upload the image and get the attachment ID
                    $travel_booking_agency_image_array = array(
                        'name' => basename($travel_booking_agency_image_url),
                        'tmp_name' => $travel_booking_agency_image_temp
                    );

                    $travel_booking_agency_upload = media_handle_sideload($travel_booking_agency_image_array, $travel_booking_agency_post_id);

                    if (is_wp_error($travel_booking_agency_upload)) {
                        error_log('Error uploading image: ' . $travel_booking_agency_upload->get_error_message());
                        continue; // Skip to the next post if upload fails
                    }

                    // Assign featured image to post
                    set_post_thumbnail($travel_booking_agency_post_id, $travel_booking_agency_upload);
                }
            }

            //Copyright Text
            set_theme_mod( 'travel_booking_agency_footer_copy', 'By ThemesCaliber' ); 

            // Set the demo import completion flag
    		update_option('travel_booking_agency_demo_import_completed', true);
    		// Display success message and "View Site" button
    		echo '<p class="notice-text">' . esc_html__('Your demo import has been completed successfully.', 'travel-booking-agency') . '</p>';
    		echo '<span><a href="' . esc_url(home_url()) . '" class="run-import site-btn" target="_blank">' . esc_html__('VIEW SITE', 'travel-booking-agency') . '</a></span>';

        }
    ?>
  
    <p class="note"><?php esc_html_e( 'Please Note: If your website is live and already contains data, we recommend creating a backup first. Running this importer will replace your current settings with the custom values from the demo.', 'travel-booking-agency' ); ?></p>
        <form action="<?php echo esc_url(home_url()); ?>/wp-admin/themes.php?page=travel_booking_agency_guide" method="POST" onsubmit="return validate(this);">
        <?php if (!get_option('travel_booking_agency_demo_import_completed')) : ?>
            <button type="submit" name="submit" class="run-import">
                    <?php esc_html_e('Run Importer','travel-booking-agency'); ?>
                    <span id="spinner" style="display: none;">
                        <img src="<?php echo esc_url(get_template_directory_uri()); ?>/images/spinner.gif" alt="Loading..." style="width:34px; height:34px; vertical-align: middle;" />
                    </span>
            </button>
        <?php endif; ?>
        </form>
        <script type="text/javascript">
            function validate(valid) {
                if(confirm("Do you really want to import the theme demo content?")){
                    document.getElementById('spinner').style.display = 'inline-block';
                }
                else {
                    return false;
                }
            }
        </script>
    </div>