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

    // If the demo import is completed, display the "View Site" button
    if ($demo_import_completed) {
      echo '<p class="notice-text">' . esc_html__('Your demo import has been completed successfully.', 'islamic-center-mosque') . '</p>';
      echo '<span><a href="' . esc_url(home_url()) . '" class="button button-primary site-btn" target="_blank">' . esc_html__('View Site', 'islamic-center-mosque') . '</a></span>';
    }

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

        // Check if woocommerce is installed and activated
        if (!is_plugin_active('woocommerce/woocommerce.php')) {
          // Install the plugin if it doesn't exist
          $islamic_center_mosque_plugin_slug = 'woocommerce';
          $islamic_center_mosque_plugin_file = 'woocommerce/woocommerce.php';

          // Check if plugin is installed
          $islamic_center_mosque_installed_plugins = get_plugins();
          if (!isset($islamic_center_mosque_installed_plugins[$islamic_center_mosque_plugin_file])) {
              include_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
              include_once(ABSPATH . 'wp-admin/includes/file.php');
              include_once(ABSPATH . 'wp-admin/includes/misc.php');
              include_once(ABSPATH . 'wp-admin/includes/class-wp-upgrader.php');

              // Install the plugin
              $islamic_center_mosque_upgrader = new Plugin_Upgrader();
              $islamic_center_mosque_upgrader->install('https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip');
          }
          // Activate the plugin
          activate_plugin($islamic_center_mosque_plugin_file);
        }

        // ------- Create Nav Menu --------
            $islamic_center_mosque_menuname = 'Main Menus';
            $islamic_center_mosque_bpmenulocation = 'primary';
            $islamic_center_mosque_menu_exists = wp_get_nav_menu_object($islamic_center_mosque_menuname);

            if (!$islamic_center_mosque_menu_exists) {
                $islamic_center_mosque_menu_id = wp_create_nav_menu($islamic_center_mosque_menuname);

                // Create Home Page
                $islamic_center_mosque_home_title = 'Home';
                $islamic_center_mosque_home = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_home_title,
                    'post_content' => '',
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'home'
                );
                $islamic_center_mosque_home_id = wp_insert_post($islamic_center_mosque_home);
                // Assign Home Page Template
                add_post_meta($islamic_center_mosque_home_id, '_wp_page_template', 'page-template/custom-home-page.php');
                // Update options to set Home Page as the front page
                update_option('page_on_front', $islamic_center_mosque_home_id);
                update_option('show_on_front', 'page');
                // Add Home Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Home', 'islamic-center-mosque'),
                    'menu-item-classes' => 'home',
                    'menu-item-url' => home_url('/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_home_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Pages Page with Dummy Content
                $islamic_center_mosque_pages_title = 'Pages';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_pages = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_pages_title,
                    'post_content' => $islamic_center_mosque_pages_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'pages'
                );
                $islamic_center_mosque_pages_id = wp_insert_post($islamic_center_mosque_pages);
                // Add Pages Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Pages', 'islamic-center-mosque'),
                    'menu-item-classes' => 'pages',
                    'menu-item-url' => home_url('/pages/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_pages_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create About Us Page with Dummy Content
                $islamic_center_mosque_about_title = 'About Us';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'about-us'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add About Us Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('About Us', 'islamic-center-mosque'),
                    'menu-item-classes' => 'about-us',
                    'menu-item-url' => home_url('/about-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Store Page with Dummy Content
                $islamic_center_mosque_about_title = 'Store';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'store'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Store Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Store', 'islamic-center-mosque'),
                    'menu-item-classes' => 'store',
                    'menu-item-url' => home_url('/store/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Islamic Sermons Page with Dummy Content
                $islamic_center_mosque_about_title = 'Islamic Sermons';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'Islamic Sermons'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Islamic Sermons Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Islamic Sermons', 'islamic-center-mosque'),
                    'menu-item-classes' => 'islamic-sermons',
                    'menu-item-url' => home_url('/islamic-sermons/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));


                // Create Features Page with Dummy Content
                $islamic_center_mosque_about_title = 'Features';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'features'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Features Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Features', 'islamic-center-mosque'),
                    'menu-item-classes' => 'features',
                    'menu-item-url' => home_url('/features/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Events Page with Dummy Content
                $islamic_center_mosque_about_title = 'Events';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'events'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Events Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Events', 'islamic-center-mosque'),
                    'menu-item-classes' => 'events',
                    'menu-item-url' => home_url('/events/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Causes Page with Dummy Content
                $islamic_center_mosque_about_title = 'Causes';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'causes'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Causes Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Causes', 'islamic-center-mosque'),
                    'menu-item-classes' => 'causes',
                    'menu-item-url' => home_url('/causes/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

                // Create Contact Us Page with Dummy Content
                $islamic_center_mosque_about_title = 'Contact Us';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'contact us'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Contact Us Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Contact Us', 'islamic-center-mosque'),
                    'menu-item-classes' => 'contact-us',
                    'menu-item-url' => home_url('/contact-us/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_about_id,
                    'menu-item-object' => 'page',
                    'menu-item-type' => 'post_type'
                ));

               // Create Donate Page with Dummy Content
                $islamic_center_mosque_about_title = 'Donate';
                $islamic_center_mosque_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.';
                $islamic_center_mosque_about = array(
                    'post_type' => 'page',
                    'post_title' => $islamic_center_mosque_about_title,
                    'post_content' => $islamic_center_mosque_about_content,
                    'post_status' => 'publish',
                    'post_author' => 1,
                    'post_slug' => 'Donate'
                );
                $islamic_center_mosque_about_id = wp_insert_post($islamic_center_mosque_about);
                // Add Donate Page to Menu
                wp_update_nav_menu_item($islamic_center_mosque_menu_id, 0, array(
                    'menu-item-title' => __('Donate', 'islamic-center-mosque'),
                    'menu-item-classes' => 'donate',
                    'menu-item-url' => home_url('/donate/'),
                    'menu-item-status' => 'publish',
                    'menu-item-object-id' => $islamic_center_mosque_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($islamic_center_mosque_bpmenulocation)) {
                    $locations = get_theme_mod('nav_menu_locations'); // Use 'nav_menu_locations' to get locations array
                    if (empty($locations)) {
                        $locations = array();
                    }
                    $locations[$islamic_center_mosque_bpmenulocation] = $islamic_center_mosque_menu_id;
                    set_theme_mod('nav_menu_locations', $locations);
                }  
        }    

        // Set the demo import completion flag
        update_option('islamic_center_mosque_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.', 'islamic-center-mosque') . '</p>';
        echo '<span><a href="' . esc_url(home_url()) . '" class="button button-primary site-btn" target="_blank">' . esc_html__('View Site', 'islamic-center-mosque') . '</a></span>';

        //end      

        // Top Bar start //
          set_theme_mod( 'islamic_center_mosque_phone_number', '+00 123 456 7890' ); 
          set_theme_mod( 'islamic_center_mosque_lite_email', 'support@gmail.com' );      

        // slider section start //  
            set_theme_mod( 'islamic_center_mosque_slider_button_text', 'Read More' );
            set_theme_mod( 'islamic_center_mosque_slider_button_link_text2', '#' );
            set_theme_mod( 'islamic_center_mosque_slider_button_text1', 'Donate Now' );
            set_theme_mod( 'islamic_center_mosque_slider_button_link_text22', '#' );

            for($islamic_center_mosque_i=1;$islamic_center_mosque_i<=3;$islamic_center_mosque_i++){
               $islamic_center_mosque_slider_title = 'IN THE NAME OF ALLAH THE BENEFICENT THE MERCIFUL';
               $islamic_center_mosque_slider_content = 'Lorem ipsum is simply dummy text';
                  // Create post object
               $my_post = array(
               'post_title'    => wp_strip_all_tags( $islamic_center_mosque_slider_title ),
               'post_content'  => $islamic_center_mosque_slider_content,
               'post_status'   => 'publish',
               'post_type'     => 'page',
               );

               // Insert the post into the database
               $islamic_center_mosque_post_id = wp_insert_post( $my_post );

               if ($islamic_center_mosque_post_id) {
                 // Set the theme mod for the slider page
                 set_theme_mod('islamic_center_mosque_slider_page' . $islamic_center_mosque_i, $islamic_center_mosque_post_id);

                  $islamic_center_mosque_image_url = get_template_directory_uri().'/assets/images/slider'.$islamic_center_mosque_i.'.png';

                $islamic_center_mosque_image_id = media_sideload_image($islamic_center_mosque_image_url, $islamic_center_mosque_post_id, null, 'id');

                    if (!is_wp_error($islamic_center_mosque_image_id)) {
                        // Set the downloaded image as the post's featured image
                        set_post_thumbnail($islamic_center_mosque_post_id, $islamic_center_mosque_image_id);
                    }
                }
            }  

        // Events Section start //
        set_theme_mod( 'islamic_center_mosque_events_heading', 'Upcoming Event' ); 
        set_theme_mod( 'islamic_center_mosque_event_button_text1', 'View Details' );
        set_theme_mod( 'islamic_center_mosque_event_button_text2', 'Participate' );
        set_theme_mod( 'islamic_center_mosque_event_button_link_text2', '#' );
        set_theme_mod( 'islamic_center_mosque_product_clock_timer_end', 'November 3 2025 11:00:00' );
          
        // select Post Box
        $islamic_center_mosque_title_array = array("IMPORTANCE OF RAMADAM IN ISLAM", "IMPORTANCE OF RAMADAM IN ISLAM", "IMPORTANCE OF RAMADAM IN ISLAM");
        for ($islamic_center_mosque_i = 1; $islamic_center_mosque_i <= 3; $islamic_center_mosque_i++) {
            // Create post
            
            $islamic_center_mosque_title = $islamic_center_mosque_title_array[$islamic_center_mosque_i - 1];
            $islamic_center_mosque_content = 'Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.';            
            $islamic_center_mosque_my_post = array(
                 'post_title'   => wp_strip_all_tags($islamic_center_mosque_title),
                 'post_content' => $islamic_center_mosque_content,
                 'post_status'  => 'publish',
                 'post_type'    => 'post',
            );
            $islamic_center_mosque_post_id = wp_insert_post($islamic_center_mosque_my_post);

            set_theme_mod('islamic_center_mosque_tab_pages' . $islamic_center_mosque_i, $islamic_center_mosque_post_id);
            
            // Get image URL
            $islamic_center_mosque_image_url = get_template_directory_uri() . '/assets/images/event' . $islamic_center_mosque_i . '.png';
            $islamic_center_mosque_image_data = wp_remote_get($islamic_center_mosque_image_url);
            if (!is_wp_error($islamic_center_mosque_image_data)) {
                 $islamic_center_mosque_image_body = wp_remote_retrieve_body($islamic_center_mosque_image_data);
                 $islamic_center_mosque_upload_dir = wp_upload_dir();
                 $islamic_center_mosque_image_name = 'event' . $islamic_center_mosque_i . '.png';
                 $uploaded_file = wp_upload_bits($islamic_center_mosque_image_name, null, $islamic_center_mosque_image_body);
                 if (!$uploaded_file['error']) {
                     // Set attachment data
                     $attachment = array(
                         'post_mime_type' => $uploaded_file['type'],
                         'post_title'     => sanitize_file_name($islamic_center_mosque_image_name),
                         'post_content'   => '',
                         'post_status'    => 'inherit',
                     );
                     $islamic_center_mosque_attach_id = wp_insert_attachment($attachment, $uploaded_file['file'], $islamic_center_mosque_post_id);
                     require_once(ABSPATH . 'wp-admin/includes/image.php');
                     $islamic_center_mosque_attach_data = wp_generate_attachment_metadata($islamic_center_mosque_attach_id, $uploaded_file['file']);
                     wp_update_attachment_metadata($islamic_center_mosque_attach_id, $islamic_center_mosque_attach_data);
                     set_post_thumbnail($islamic_center_mosque_post_id, $islamic_center_mosque_attach_id);
                 }
            }
          } 
          //Copyright Text
          set_theme_mod( 'islamic_center_mosque_footer_text', 'By VWThemes' );             
    }
  ?>
  
	
    <form action="<?php echo esc_url(home_url()); ?>/wp-admin/themes.php?page=islamic_center_mosque_guide" method="POST" onsubmit="return validate(this);">
        <?php if (!get_option('islamic_center_mosque_demo_import_completed')) : ?>
            <form method="post">
                <p class="run-import-text"><?php esc_html_e('Click On The Below Run Importer Button To Import Demo Content Of Islamic Center Mosque','islamic-center-mosque'); ?></p>
                <p><?php esc_html_e('Please back up your website if it’s already live with data. This importer will overwrite your existing settings with the new customizer values for Islamic Center Mosque','islamic-center-mosque'); ?></p>
                <input class= "run-import" type="submit" name="submit" value="<?php esc_attr_e('Run Importer','islamic-center-mosque'); ?>" class="button button-primary button-large">
            </form>
        <?php endif; ?>
    </form>
	<script type="text/javascript">
		function validate(valid) {
			 if(confirm("Do you really want to import the theme demo content?")){
                // Show loader
                document.getElementById('demo-import-loader').style.display = 'block';
                // Submit form
			    document.forms[0].submit();
			}
		    else {
			    return false;
		    }
		}
	</script>
</div>

