<?php

add_action( 'admin_menu', 'coupons_deals_gettingstarted' );
function coupons_deals_gettingstarted() {    	
	add_theme_page( esc_html__('About Theme', 'coupons-deals'), esc_html__('Theme Demo Import', 'coupons-deals'), 'edit_theme_options', 'coupons-deals-guide-page', 'coupons_deals_guide');   
}

function coupons_deals_admin_theme_style() {
   wp_enqueue_style('coupons-deals-custom-admin-style', esc_url(get_template_directory_uri()) . '/inc/dashboard/get_started_info.css');
   wp_enqueue_script('coupons-deals-tab', esc_url( get_template_directory_uri() ) . '/inc/dashboard/js/get_started_tab.js');

   // Admin notice code START
	wp_register_script('coupons-deals-notice', esc_url(get_template_directory_uri()) . '/inc/dashboard/js/notice.js', array('jquery'), time(), true);
	wp_enqueue_script('coupons-deals-notice');
	// Admin notice code END
}
add_action('admin_enqueue_scripts', 'coupons_deals_admin_theme_style');

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

function coupons_deals_notice(){
    // Hide permanently if dismissed
    if ( get_option('coupons_deals_admin_notice') == 1 ) {
        return;
    }
    // Hide ONLY on Get Started page
    if ( isset($_GET['page']) && $_GET['page'] === 'artist-portfolio-guide-page' ) {
        return;
    }  {?>
    <div id="coupons-deals-welcome-notice" class="notice notice-success is-dismissible getting_started activation-notice">
		<div class="notice-info">
			<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 Coupons Deals, You Rock!', 'coupons-deals' ) ?> </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.', 'coupons-deals' ) ?></p>
				<div style="display: grid;">
					<a class="button notice-btn" href="<?php echo esc_url( admin_url( 'themes.php?page=coupons-deals-guide-page' )); ?>"><?php esc_html_e( 'Get Started', 'coupons-deals' ) ?></a>
					<a class="button notice-btn" target="_blank" href="<?php echo esc_url( COUPONS_DEALS_LIVE_DEMO ); ?>"><?php esc_html_e('Pro Demo', 'coupons-deals') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( COUPONS_DEALS_BUY_PRO ); ?>"><?php esc_html_e('Upgrade To Pro', 'coupons-deals') ?></a>
					<a  class="button notice-btn" target="_blank" href="<?php echo esc_url( COUPONS_DEALS_FREE_DOC ); ?>"><?php esc_html_e('Free Doc', 'coupons-deals') ?></a>
				</div>

			</div>
		</div>
	</div>
	<?php }
}
//Hook (VERY IMPORTANT)
add_action('admin_notices', 'coupons_deals_notice');

// Admin notice code START
add_action('wp_ajax_coupons_deals_dismiss_notice', 'coupons_deals_dismiss_notice');
function coupons_deals_dismiss_notice() {
    update_option('coupons_deals_admin_notice', 1);
    wp_die();
}

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

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

	// Theme info
	$coupons_deals_return = add_query_arg( array()) ;
	$coupons_deals_theme = wp_get_theme( 'coupons-deals' ); ?>

	<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="tab">
				<button role="tab" class="tablinks home" onclick="coupons_deals_openCity(event, 'bwp_getstart')"><?php esc_html_e( 'Theme Demo Import', 'coupons-deals' ); ?></button>
				<button role="tab" class="tablinks" onclick="coupons_deals_openCity(event, 'bwp_setup')"><?php esc_html_e( 'Free Theme Information', 'coupons-deals' ); ?></button>
				<button role="tab" class="tablinks" onclick="coupons_deals_openCity(event, 'bwp_premium_info')"><?php esc_html_e( 'Premium Theme Information', 'coupons-deals' ); ?></button>
				<a class="tablinks tablinks-demo" role="tab" href="<?php echo esc_url( COUPONS_DEALS_LIVE_DEMO ); ?>" target="_blank">
					<?php esc_html_e( 'Live Demo', 'coupons-deals' ); ?>
				</a>
				<a class="tablinks tablinks-pro" role="tab" href="<?php echo esc_url( COUPONS_DEALS_BUY_PRO ); ?>" target="_blank">
					<?php esc_html_e( 'Buy Pro', 'coupons-deals' ); ?>
				</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 Coupons Deals ', 'coupons-deals' ); ?>
							<span><?php esc_html_e( 'Version: ', 'coupons-deals' ); ?><?php echo esc_html($coupons_deals_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.', 'coupons-deals' ); ?>
							</span>
							<div class="powered-by">
								<p><strong><?php esc_html_e( 'Theme created by Buy WP Templates', 'coupons-deals' ); ?></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_parent_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...', 'coupons-deals'); ?>" />
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-7">
						<div class="install-plugins">
							<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive1.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'coupons-deals'); ?>" />
						</div>
					</div>
				</div>
				<div class="dashboard__blocks">
					<div class="row">
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Get Support','coupons-deals'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( COUPONS_DEALS_FREE_SUPPORT ); ?>"><?php esc_html_e( 'Free Theme Support','coupons-deals'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( COUPONS_DEALS_PRO_SUPPORT ); ?>"><?php esc_html_e( 'Premium Theme Support','coupons-deals'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Getting Started','coupons-deals'); ?></h3>
							<ol>
								<li><?php esc_html_e( 'Start','coupons-deals'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','coupons-deals'); ?></a> <?php esc_html_e( 'your website.','coupons-deals'); ?> </li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Help Docs','coupons-deals'); ?></h3>
							<ol>
								<li><a target="_blank" href="<?php echo esc_url( COUPONS_DEALS_FREE_DOC ); ?>"><?php esc_html_e( 'Free Theme Documentation','coupons-deals'); ?></a></li>
								<li><a target="_blank" href="<?php echo esc_url( COUPONS_DEALS_PRO_DOC ); ?>"><?php esc_html_e( 'Premium Theme Documentation','coupons-deals'); ?></a></li>
							</ol>
						</div>
						<div class="col-md-3">
							<h3><?php esc_html_e( 'Buy Premium','coupons-deals'); ?></h3>
							<ol>
								<a href="<?php echo esc_url( COUPONS_DEALS_BUY_PRO ); ?>" target="_blank"><?php esc_html_e('Buy Pro', 'coupons-deals'); ?></a>
							</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 Coupons Deals Theme', 'coupons-deals' ); ?></h2>
				<div class="row">
					<div class="theme-instruction-block col-md-7">
						<div class="pad-box">
							<p><?php esc_html_e( 'Coupons Deals has been designed and created to showcase amazing deals, discounts, and promo codes online with a clean, responsive, and modern design, making it a powerful tool for digital marketing and promotional campaigns. This theme is ideal for creating coupon websites, deal aggregation platforms, and daily deals portals where users can find discount codes, voucher codes, cashback offers, and limited-time promotions, all optimized for effective affiliate marketing strategies. It supports a variety of niches including travel deals, restaurant discounts, electronics offers, grocery coupons, fashion sales, beauty product discounts, subscription savings, and membership deals. Built with a powerful coupon management plugin that allows easy creation, tracking, and display of discount codes and promotional offers, it helps businesses boost engagement and conversions while strengthening their online marketing presence. The layout is crafted to beautifully highlight active deals and seasonal offers, while its responsive design ensures your website works flawlessly across devices. Optimized for SEO and speed, it delivers faster load times and an excellent user experience. With features like customizable sections, CTA buttons, testimonials, and team showcases, the Coupons Deals theme provides a perfect foundation for affiliate marketers, deal bloggers, and coupon-sharing communities looking to grow their audience and scale their marketing efforts efficiently.', 'coupons-deals' ); ?><p><br>
							<ol>
								<li><?php esc_html_e( 'Start','coupons-deals'); ?> <a target="_blank" href="<?php echo esc_url( admin_url('customize.php') ); ?>"><?php esc_html_e( 'Customizing','coupons-deals'); ?></a> <?php esc_html_e( 'your website.','coupons-deals'); ?> </l>
								<li><?php esc_html_e( 'Coupons Deals','coupons-deals'); ?> <a target="_blank" href="<?php echo esc_url( COUPONS_DEALS_FREE_DOC ); ?>"><?php esc_html_e( 'Documentation','coupons-deals'); ?></a> </li>
							</ol>
						</div>
					</div>
					<div class="col-md-5">
						<div class="pad-box">
								<img class="logo" src="<?php echo esc_url(get_template_directory_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.','coupons-deals'); ?></h2>
				<div class="row">
					<div class="col-md-7">
						<img src="<?php echo esc_url(get_template_directory_uri() . '/inc/dashboard/media/responsive.png'); ?>" alt="<?php echo esc_attr( 'responsive-image', 'coupons-deals'); ?>">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Description','coupons-deals'); ?></h3>
							<p class="pad-box-p"><?php esc_html_e( 'Deals WordPress Theme is an advanced coupon management solution that will enable you in creating a professional discount deals website. Your website may not only help your audience save money, but it can also produce a profit. Deals WordPress theme has several features that can assist your coupon website in becoming a success. This theme includes just about everything you need to get begin promoting discounts and coupons online. It not only has designs that are appropriate for this sort of website, but they also have all of the tools and functionality needed to organize and post coupons and deals.This theme is rich in features that you always wanted to have on your website. Deals WordPress theme has SEO-friendly content that will help you get better rankings on the search engines. It has all the customizable sections and full documentation of the theme so you dont have to worry about the coding. It is built with safe and clean code and includes plugins, shortcodes, and other modification tools to help you to alter your website without writing a single line of code. With CTA(call to action) feature, it will be easier to resolve issues of the customers and with that, you can attract new users. It has a strong e-commerce feature which is great for developing an e-commerce website that also produces and distributes discount coupons.', 'coupons-deals' ); ?><p>
						</div>
					</div>
					<div class="col-md-5 install-plugin-right">
						<div class="pad-box">
							<h3><?php esc_html_e( 'Pro Theme Features','coupons-deals'); ?></h3>
							<div class="dashboard-install-benefit">
								<ul>
									<li><?php esc_html_e( 'Car listing Shortcode with category','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Car listing Shortcode','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Multiple image feature for each property with slider.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Brand Listing Section','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Car Brand(categories) Option','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Car Tags(categories) Option','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Testimonial listing.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Testimonial shortcode.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Social icons widget.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Latest post with the image widget.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Live customize editor for the About US section.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Font Awesome integrated.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Advanced Color options and color pallets.','coupons-deals'); ?></li>
									<li><?php esc_html_e( '100+ Font Family Options.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Enable-Disable options on All sections.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Well sanitized as per WordPress standards.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Allow to set site title, tagline, logo.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Sticky post & Comment threads.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Left and Right Sidebar.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Customizable Home Page.','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Footer Widgets & Editor style','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Gallery & Banner functionality','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Multiple inner page templates','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Full-width Template','coupons-deals'); ?></li>
									<li><?php esc_html_e( 'Custom Menu, Colors Editor','coupons-deals'); ?></li>
								</ul>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

<?php }?>