<?php

add_action( 'admin_menu', 'real_estate_broker_gettingstarted' );
function real_estate_broker_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'real-estate-broker'), esc_html__('Theme Demo Import', 'real-estate-broker'), 'edit_theme_options', 'real-estate-broker-guide-page', 'real_estate_broker_guide');   
}

function real_estate_broker_admin_theme_style() {
   wp_enqueue_style('real-estate-broker-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('real-estate-broker-tab', esc_url( get_stylesheet_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');
   wp_enqueue_script('real-estate-broker-bundle-banner', get_template_directory_uri() . '/inc/dashboard/js/bundle_banner.js', array(), false, true);
   // Admin notice code START
	wp_register_script('real-estate-broker-notice', esc_url(get_stylesheet_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('real-estate-broker-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'real_estate_broker_admin_theme_style');

// Notice after Theme Activation
add_action('admin_notices', 'real_estate_broker_notice');

function real_estate_broker_notice(){
      // Hide permanently if dismissed
    if ( get_option('real_estate_broker_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'real-estate-broker-guide-page' ) {
        return;
    }  {?>
    <div id="real-estate-broker-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info-row">
			<div class="notice-image">
				<img style="width: 100%;max-width: 320px;line-height: 40px;display: inline-block;vertical-align: top;" src="<?php echo esc_url(get_stylesheet_directory_uri()) .'/screenshot.png'; ?>" />
			</div>
			<div class="notice-content">
				<h2><?php esc_html_e( 'Thanks For Installing Real Estate Broker, You Rock!', 'real-estate-broker' ) ?> </h2>
				<p><?php esc_html_e( 'Take benefit of a variety of features, functionalities, elements, and an exclusive set of customization options to build your own professional charity website. Please Click on the link below to know the theme setup information.', 'real-estate-broker' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=real-estate-broker-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'real-estate-broker' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_BUNDLE ); ?>"><?php esc_html_e('Get Bundle', 'real-estate-broker') ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'real-estate-broker') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'real-estate-broker') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'real-estate-broker') ?></a>
				</div>
			</div>
		</div>
	</div>
	<?php }
}

// Admin notice code START
add_action('wp_ajax_real_estate_broker_dismiss_notice', 'real_estate_broker_dismiss_notice');
function real_estate_broker_dismiss_notice() {
    update_option('real_estate_broker_admin_notice', 1);
    wp_die();
}

//After Switch theme function
add_action('after_switch_theme', 'real_estate_broker_getstart_setup_options');
function real_estate_broker_getstart_setup_options () {
    delete_option('real_estate_broker_admin_notice');
}
// Admin notice code END

/**
 * Theme Info Page
 */
function real_estate_broker_guide() {

	// Theme info
	$real_estate_broker_return = add_query_arg( array()) ;
	$real_estate_broker_theme = wp_get_theme( 'real-estate-broker' ); ?>

	<div class="wrap getting-started">
		<div class="getting-started__header">
		    <div>
                <h2 class="tgmpa-notice-warning"></h2>
            </div>
		</div>
		<div class="tab-sec">
			<div class="bwp-bundle-banner">
				<div class="bwp-bundle-banner__row">
					<div class="bwp-bundle-banner__content">
						<span class="bwp-bundle-banner__badge"><?php esc_html_e( 'Limited Time Deal - 25% Off', 'real-estate-broker' ); ?></span>
						<h2 class="bwp-bundle-banner__title"><?php esc_html_e( '250+ Premium WordPress Themes in One Bundle', 'real-estate-broker' ); ?></h2>
						<p class="bwp-bundle-banner__desc">
							<strong><?php esc_html_e( 'SUMMER SALE!', 'real-estate-broker' ); ?></strong>
							<?php esc_html_e( 'Get 15% off on a Bundle of 250+ Premium WP Themes. Use', 'real-estate-broker' ); ?>
							<span class="bwp-bundle-banner__coupon-inline">&quot;SUMMER15&quot;</span>
							<?php esc_html_e( 'at Checkout.', 'real-estate-broker' ); ?>
						</p>
						<div class="bwp-bundle-banner__actions">
							<a class="bwp-bundle-banner__cta" target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_BUNDLE ); ?>"><?php esc_html_e( 'Get Bundle Just at $99', 'real-estate-broker' ); ?><span class="dashicons dashicons-arrow-right-alt2"></span></a>
							<button type="button" class="bwp-bundle-banner__coupon" id="bwp-copy-coupon" data-coupon="SUMMER15" aria-label="<?php echo esc_attr__( 'Copy coupon code SUMMER15', 'real-estate-broker' ); ?>">
								<span class="bwp-bundle-banner__coupon-label"><?php esc_html_e( 'Coupon Code', 'real-estate-broker' ); ?></span>
								<span class="bwp-bundle-banner__coupon-code">SUMMER15</span>
								<span class="bwp-bundle-banner__coupon-copied" id="bwp-copy-coupon-msg"><?php esc_html_e( 'Copied!', 'real-estate-broker' ); ?></span>
							</button>
						</div>
					</div>
					<div class="bwp-bundle-banner__price">
						<div class="bwp-bundle-banner__price-amount">
							<span class="bwp-bundle-banner__price-old">$9750</span>
							<span class="bwp-bundle-banner__price-new">$99</span>
						</div>
						<span class="bwp-bundle-banner__price-note"><?php esc_html_e( '* Lifetime Updates & All Future Themes Included', 'real-estate-broker' ); ?></span>
					</div>
					<div class="bwp-bundle-banner__visual" aria-hidden="true">
						<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/bwt-bundle.png'); ?>"/>
					</div>
				</div>
			</div>
			<div class="tab">
				<button role="tab" class="tablinks home" onclick="real_estate_broker_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'real-estate-broker' ); ?></button>
				<button role="tab" class="tablinks" onclick="real_estate_broker_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'real-estate-broker' ); ?></button>
				<button role="tab" class="tablinks" onclick="real_estate_broker_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'real-estate-broker' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( REAL_ESTATE_BROKER_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'real-estate-broker' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'real-estate-broker' ); ?>
				</a>
			</div>
			<div  id="bwp_getstart" class="tabcontent">
				<div class="row">
					<div class="col-md-5 intro">
						<div class="pad-box">
							<h2><?php esc_html_e( 'Welcome to Real Estate Broker ', 'real-estate-broker' ); ?>
							<span><?php esc_html_e( 'Version: ', 'real-estate-broker' ); ?><?php echo esc_html($real_estate_broker_theme['Version']);?></span>
							</h2>
							<span class="intro__version"><?php esc_html_e( 'Congratulations! You are about to use the most easy to use and flexible WordPress theme.', 'real-estate-broker' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'real-estate-broker' ); ?></strong></p>
								<p>
									<img class="logo" src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/theme-logo.png'); ?>"/>
								</p>
								<div class="demo-content">
									<?php
										/* Demo Import */
										require get_theme_file_path( '/inc/dashboard/demo-content.php' );
									?>
								</div>

								<div id="demo-import-loader">
									<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/spinner.gif'); ?>" alt="<?php echo esc_attr( 'Loading...', 'real-estate-broker'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'real-estate-broker'); ?>" />
							<div class="install-plugins__actions">
								<a class="install-plugins__btn install-plugins__btn--pro" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_PRO ); ?>" target="_blank"><?php esc_html_e( 'Get Pro at $39', 'real-estate-broker' ); ?></a>
								<a class="install-plugins__btn install-plugins__btn--bundle" href="<?php echo esc_url( REAL_ESTATE_BROKER_BUY_BUNDLE ); ?>" target="_blank"><?php esc_html_e( 'Buy Bundle at $99', 'real-estate-broker' ); ?></a>
							</div>
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','real-estate-broker'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','real-estate-broker'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','real-estate-broker'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','real-estate-broker'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','real-estate-broker'); ?></a> <?php esc_html_e( 'your website.','real-estate-broker'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','real-estate-broker'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','real-estate-broker'); ?></a></li>
							</ol>
						</div>
					</div>
				</div>
			</div>
			<div  id="bwp_setup" class="tabcontent">
				<h2 class="tg-docs-section intruction-title" id="section-4"><?php esc_html_e( '1) Setup Real Estate Broker Theme', 'real-estate-broker' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Real Estate Broker is a fine solution for estate brokers, real estate businesses, realtors, property agents, rental websites, apartment and home booking brokers, hotel and accommodation services, property listing websites, brokerage services, property management, real estate marketing, commercial and residential properties, property sales, investment properties, real estate development, home buyers, luxury real estate, real estate listings, property valuation, real estate platforms, consultancy, SEO, home selling, property advertising, real estate management, property deals, and property promotions across every growing city market while showcasing premium housetop properties. Built on the robust Bootstrap framework and compatible with popular page builder plugins for easy drag-and-drop customization, this flexible and elegant design allows agencies to create professional websites without coding skills, making it ideal for expanding your reach in any competitive city environment. The theme features stunning banner layouts, dedicated sections for team introductions and client testimonials, and Call to Action (CTA) buttons to enhance engagement and conversions. Social media integration enables seamless promotion of listings across platforms like Facebook, Instagram, and Twitter. Optimized for performance with fast load times, mobile responsiveness, and translation readiness, it ensures a smooth experience for users worldwide while highlighting unique housetop designs and modern living spaces. Whether showcasing homes for sale, managing rental properties, or offering real estate services, Real Estate Broker provides all the tools necessary for a powerful online presence, boosting credibility and attracting more clients with an eye-catching, functional, and professional design. ', 'real-estate-broker' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','real-estate-broker'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','real-estate-broker'); ?></a> <?php esc_html_e( 'your website.','real-estate-broker'); ?> </li>
								<li><?php esc_html_e( 'Real Estate Broker','real-estate-broker'); ?> <a target="_blank" href="<?php echo esc_url( REAL_ESTATE_BROKER_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','real-estate-broker'); ?></a> </li>
							</ol>
						</div>
				</div>
				<div class="col-md-5">
					<div class="pad-box">
              			<img class="logo" src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/screenshot.png'); ?>"/>
              	</div> 
              	</div>
            </div>
			</div>
			<div class="col-md-12 text-block tabcontent"  id="bwp_premium_info">
				<h2 class="dashboard-install-title"><?php esc_html_e( '2) Premium Theme Information.','real-estate-broker'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_theme_file_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'real-estate-broker'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','real-estate-broker'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'As a real estate agent, you would want people to know about your profession, and for that, this Real Estate Broker WordPress Theme is a winner. It gives you a more convenient and user-friendly way of creating unique and professional websites that not only shows the properties and real estate businesses but also make it possible to sell them online. Woocommerce integration of this theme gives you this feature. The customization options allow you to carve a masterpiece out of this theme as you can implement any of your ideas and creativity to bring something original and unique.', 'real-estate-broker' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','real-estate-broker'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Theme options using customizer API','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Responsive design','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Site Icon and Logo option','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Header Images option','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Favicon, Logo, title, and tagline customization','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets','real-estate-broker'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Pagination option','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Demo Importer','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Main Slider','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Woocommerce Compatible','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Unlimited Slides','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Section to show categories','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Product Listing based on category','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Top Categories Section','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Best Seller Tab','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Testimonial with custom post type','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Promotional Banners','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Partner listing','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Shortcodes for Testimonials','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Newsletter with the help of contact form 7.','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Responsive layout for all devices','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Typography for the complete website','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Global Color pallete','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Section specific Color pallete','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Fully integrated with Font Awesome Icon','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Instagram Section','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Partner Listing','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Background Image Option','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Custom page templates','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Allow setting site title, tagline, logo','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Contact Page Template','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Blog Full width and right and left sidebar','real-estate-broker'); ?></li>
									<li><?php esc_html_e( 'Recent post widget with images, Related post','real-estate-broker'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>