<?php
/**
 * Template Name: Home - Dinero
 */

get_header(); ?>

<main id="skip-content" role="main">

	<?php do_action( 'dinero_above_slider' ); ?>
	<?php
		$dinero_slider_effect = get_theme_mod('dinero_slider_effect', '') 
	?>
	<section id="slider <?php echo ($dinero_slider_effect) ?>">
		<div class="<?php if(get_theme_mod('dinero_slider_section_width','Full Width') == 'Box Width'){ ?>container <?php }?>">
	        <?php if (get_theme_mod('dinero_slider_section_option', 'Luzuk Slider') == 'Other Plugin Slider') { ?>
	            <?php if (get_theme_mod('dinero_slider_shortcode') != '') {?>
	            	<?php echo do_shortcode(get_theme_mod('dinero_slider_shortcode')); ?>
	            <?php } else {?>
	            	<p class="install-plugin"><?php echo esc_html('Kindly add Other Plugin Shortcode Here.') ?></p>
	            <?php }?>
	        <?php } else { ?>
	        	<?php require_once ABSPATH.'wp-admin/includes/plugin.php';
				if (function_exists('is_plugin_active') && is_plugin_active('luzuk-slider/luzuk-slider.php')) { 
				   	echo do_shortcode('[luzuk_slider]'); ?>
	            <?php } else {?>
	            	<p class="install-plugin"><?php echo esc_html('Kindly Install & Activate the Luzuk Slider Plugin.') ?></p>
	            <?php }?>
	        <?php }?>
	    </div>
    </section>

	<?php do_action('dinero_below_slider'); ?>

	<?php if( get_theme_mod('dinero_service_enable',false) == true){ ?>
		<section id="service-section">
			<div class="service-bg"></div>
			<div class="<?php if(get_theme_mod('dinero_service_section_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_service_section_width','Box Width') == 'Full Width'){ ?> container-fluid <?php }?>">
				<div class="service-head text-md-left text-center">
					<?php if(get_theme_mod('dinero_service_section_small_title')) {?>
						<p class="small-title"><?php echo esc_html(get_theme_mod('dinero_service_section_small_title')); ?></p>
					<?php }?>
					<?php if(get_theme_mod('dinero_service_section_title')) {?>
						<h3><?php echo esc_html(get_theme_mod('dinero_service_section_title')); ?></h3>
					<?php }?>
				</div>
	            <div class="row">
	            	<?php if(get_theme_mod('dinero_service_type', 'With Posts') == 'With Posts' ){ ?>
                        <?php
                        $dinero_service_number = get_theme_mod('dinero_service_number', 6);

                        for ( $count = 1; $count <= $dinero_service_number; $count++ ) {
                        	if (get_theme_mod('dinero_service_post' . $count)) {
	                            $dinero_postData = get_theme_mod('dinero_service_post');
	                            $args = array( 'name' => get_theme_mod('dinero_service_post' . $count));
	                            $query = new WP_Query( $args );
	                            if ( $query->have_posts() ) :
	                                while( $query->have_posts() ) : $query->the_post(); ?>
	                                	<div class="<?php if(get_theme_mod('dinero_service_section_columns','3') == '2'){ ?>col-lg-6 <?php } elseif(get_theme_mod('dinero_service_section_columns','3') == '3'){ ?> col-lg-4 <?php } elseif(get_theme_mod('dinero_service_section_columns','3') == '4'){ ?> col-lg-3 <?php }?> col-md-6">
		                                    <div class="service-box wow <?php echo esc_attr(get_theme_mod('dinero_service_onload_effects','zoomInUp')); ?><?php if(!has_post_thumbnail()){ ?> mt-5 <?php }?>" data-wow-duration="1s">
				          						<div class="service-image">
		                                            <?php if(has_post_thumbnail()){
		                                                the_post_thumbnail(); 
		                                            } ?>
		                                        </div>
				          						<div class="service-icon">
				      								<i class="<?php echo esc_attr(get_theme_mod('dinero_service_icon' . $count, 'far fa-chart-bar')); ?>"></i>
				      							</div>
						      					<div class="service-content">
								            		<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
								            		<p><?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt,20 ) ); ?></p>
								            		<?php if( get_theme_mod('dinero_service_button_enable',true) == true){ ?>
								            			<a href="<?php the_permalink(); ?>" class="read-btn"><?php echo esc_html(get_theme_mod('dinero_service_button_text',__('READ MORE', 'dinero'))); ?><i class="fas fa-angle-double-right"></i></a>
								            		<?php }?>
								            	</div>
					          				</div>
					          			</div>
	                                <?php endwhile; 
	                                wp_reset_postdata();?>
	                            <?php else : ?>
	                              <div class="no-postfound"></div>
	                            <?php
	                            endif;
                        	}
                        } ?>  
                    <?php }elseif (get_theme_mod('dinero_service_type', 'With Posts') == 'With Pages' ) {?>
                        <?php $service_post = array();
                        $services = get_theme_mod('dinero_service_number',6);
                        for ( $count = 1; $count <= $services; $count++ ) {
                            $mod =  intval( get_theme_mod( 'dinero_service_page' . $count ) );
                            if ( 'page-none-selected' != $mod ) {
                              $service_post[] = $mod;
                            }
                        }
                        if( !empty($service_post) ) :
                            $args = array(
                                'post_type' =>  'page',
                                'post__in' => $service_post,
                                'orderby' => 'post__in'
                            );
                        $query = new WP_Query( $args );
                        if ( $query->have_posts() ) :
                            $i = 1;
                            $page_query = new WP_Query( $args);?>
                            <?php while( $page_query->have_posts() ) : $page_query->the_post(); ?> 
                            	<div class="<?php if(get_theme_mod('dinero_service_section_columns','3') == '2'){ ?>col-lg-6 <?php } elseif(get_theme_mod('dinero_service_section_columns','3') == '3'){ ?> col-lg-4 <?php } elseif(get_theme_mod('dinero_service_section_columns','3') == '4'){ ?> col-lg-3 <?php }?> col-md-6"> 
	                                <div class="service-box wow <?php echo esc_attr(get_theme_mod('dinero_service_onload_effects','zoomInUp')); ?> <?php if(!has_post_thumbnail()){ ?> mt-5 <?php }?>" data-wow-duration="1s">
		          						<div class="service-image">
	                                        <?php if(has_post_thumbnail()){
	                                            the_post_thumbnail(); 
	                                        } ?>
	                                    </div>
		          						<div class="service-icon">
		      								<i class="<?php echo esc_attr(get_theme_mod('dinero_service_icon' . $i, 'far fa-chart-bar')); ?>"></i>
		      							</div>
				      					<div class="service-content">
						            		<h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
						            		<p><?php $dinero_excerpt = get_the_excerpt(); echo esc_html( dinero_string_limit_words( $dinero_excerpt,20 ) ); ?></p>
						            		<?php if( get_theme_mod('dinero_service_button_enable',true) == true){ ?>
						            			<a href="<?php the_permalink(); ?>" class="read-btn">
						            				<?php echo esc_html(get_theme_mod('dinero_service_button_text',__('READ MORE', 'dinero'))); ?><i class="fas fa-angle-double-right"></i></a>
						            		<?php }?>
						            	</div>
			          				</div>
			          			</div>
                            <?php $i++; endwhile; 
                            wp_reset_postdata();?>
                        <?php else : ?>
                            <div class="no-postfound"></div>
                        <?php endif;
                        endif;?>
                    <?php }?>
	      		</div>
			</div>
		</section>
	<?php }?>

	<?php do_action('dinero_below_service_section'); ?>

	<?php if (get_theme_mod('dinero_about_enable', false) == true) { ?>
		<section id="about-section" class="<?php if(get_theme_mod('dinero_about_section_width','Full Width') == 'Box Width'){ ?>container <?php }?> wow <?php echo esc_attr(get_theme_mod('dinero_about_onload_effects','fadeInUp')); ?>" data-wow-duration="2s">
			<div class="about-bg"></div>
			<div class="container">
				<div class="row">
					<div class="col-lg-6 col-md-6 align-self-center text-center">
						<?php if (get_theme_mod('dinero_about_image') != '') {?>
							<div class="about-image text-center">
								<img src="<?php echo esc_attr(get_theme_mod('dinero_about_image')); ?>" alt="<?php echo esc_attr('About Image', 'dinero'); ?>">
							</div>
						<?php }?>
					</div>
					<div class="col-lg-6 col-md-6">
						<div class="about-content">
							<?php if (get_theme_mod('dinero_about_section_title1') != '') {?>
								<p class="small-title"><?php echo esc_html(get_theme_mod('dinero_about_section_title1')); ?></p>
							<?php }?>
							<?php if (get_theme_mod('dinero_about_section_title2') != '') {?>
								<h3><?php echo esc_html(get_theme_mod('dinero_about_section_title2')); ?></h3>
							<?php }?>
							<?php if (get_theme_mod('dinero_about_section_text') != '') {?>
								<p><?php echo esc_html(get_theme_mod('dinero_about_section_text')); ?></p>
							<?php }?>
							<ul class="about-lists">
								<?php $dinero_about_noof_list = get_theme_mod('dinero_about_noof_list',4);
								for ($i=1; $i <= $dinero_about_noof_list; $i++) { 
									if (get_theme_mod('dinero_about_list'.$i)) {?>
										<li><?php echo esc_html(get_theme_mod('dinero_about_list'.$i)); ?></li>
									<?php }?>
								<?php }?>
							</ul>
							<?php if (get_theme_mod('dinero_about_section_button_url') != '') {?>
								<a href="<?php echo esc_url(get_theme_mod('dinero_about_section_button_url')); ?>" class="about-btn"><?php echo esc_html(get_theme_mod('dinero_about_section_button_text')); ?></a>
							<?php }?>
						</div>
					</div>
				</div>
			</div>
		</section>
	<?php }?>

	<?php do_action('dinero_below_about_section'); ?>

	<section id="teams-section">
		<div class="teams-bg"></div>
		<div class="<?php if(get_theme_mod('dinero_teams_section_width','Box Width') == 'Box Width'){ ?>container <?php } elseif(get_theme_mod('dinero_teams_section_width','Box Width') == 'Full Width') {?> container-fluid <?php }?>">
			<div class="teams-head text-md-left text-center">
				<?php if(get_theme_mod('dinero_teams_section_small_title')) {?>
					<p class="small-title"><?php echo esc_html(get_theme_mod('dinero_teams_section_small_title')); ?></p>
				<?php }?>
				<?php if(get_theme_mod('dinero_teams_section_title')) {?>
					<h3><?php echo esc_html(get_theme_mod('dinero_teams_section_title')); ?></h3>
				<?php }?>
			</div>
			<?php if (get_theme_mod('dinero_teams_section_option', 'Luzuk Teams Plugin') == 'Other Shortcode') { ?>
				<?php if (get_theme_mod('dinero_teams_shortcode') != '') {?>
	            	<?php echo do_shortcode(get_theme_mod('dinero_teams_shortcode')); ?>
	            <?php } else {?>
	            	<p class="install-plugin"><?php echo esc_html('Kindly add Other Plugin Shortcode Here.') ?></p>
	            <?php }?>
	        <?php } else { ?>
	            <?php require_once ABSPATH.'wp-admin/includes/plugin.php';
				if (function_exists('is_plugin_active') && is_plugin_active('luzuk-team/luzuk-team.php')) { 
				   	echo do_shortcode('[luzukteam_innerpage]'); ?>
	            <?php } else {?>
	            	<p class="install-plugin"><?php echo esc_html('Kindly Install & Activate the Luzuk Team Plugin.') ?></p>
	            <?php }?>
	        <?php }?>
	    </div>
    </section>

    <?php do_action('dinero_below_team_section'); ?>

	<div class="container">
	  	<?php while ( have_posts() ) : the_post(); ?>
	  		<div class="lz-content">
	        	<?php the_content(); ?>
	        </div>
	    <?php endwhile; // end of the loop. ?>
	</div>
</main>

<?php get_footer(); ?>