<?php
/**
 *
 * @package Slider Premium
 */
?>

<?php $showContent = get_theme_mod('premium_slider_show_content', 'on'); ?>
<div id="ht-home-slider-section">
	<div class="container">
	<!-- <div class="slider-shape"></div>  -->
	<div class="extraimg">
		
		<div class="cirimg">
			<?php 
				$ciriimg_image = get_theme_mod('ciriimg_image');
				if(!empty($ciriimg_image)){
					echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($ciriimg_image).'" class="img-responsive" />';
				}else{
					echo '<img alt="ciriimg" src="'.get_template_directory_uri().'/images/Ellipse3.png" class="img-responsive" />';
				}
			?>
		</div>
		<div class="trangleimg ">
			<?php 
				$trangleimg_image = get_theme_mod('trangleimg_image');
				if(!empty($trangleimg_image)){
					echo '<img alt="'. esc_html(get_the_title()) .'" src="'.esc_url($trangleimg_image).'" class="img-responsive" />';
				}else{
					echo '<img alt="trangleimg" src="'.get_template_directory_uri().'/images/trangle.png" class="img-responsive" />';
				}
			?>
		</div>
	</div>
	<div id="ht-bx-slider">
		
		<?php
		$args = array( 'post_type' => 'slider', 'orderby'   => 'id', 'order' => 'DESC',);
		if(!empty($pageId)){
			$args['page_id'] = absint($pageId);

		}
		$text = '';
		$query = new WP_Query($args);
		if($query->have_posts()){
			while($query->have_posts()) : $query->the_post(); 
			
			$slider1btntext = get_post_meta($post->ID, 'slider1btntext', false);
			$test_slider1btntext = !empty($slider1btntext[0]) ? $slider1btntext[0] : '';

			$slider2btntext = get_post_meta($post->ID, 'slider2btntext', false);
			$test_slider2btntext = !empty($slider2btntext[0]) ? $slider2btntext[0] : '';

	?>
				<div class="ht-slide">		
					<div class="slideimgbx">
						<div class="sliderimg animated zoomIn">
							<?php 
							if(has_post_thumbnail()){
								$total_slider_image = wp_get_attachment_image_src(get_post_thumbnail_id(),'full');	
								echo '<img class="slide-mainimg" alt="'. esc_html(get_the_title()) .'" src="'.esc_url($total_slider_image[0]).'">';
							}?>
						</div>
					</div>		
					<?php
					if($showContent == 'on'){
					?>										
					<div class="ht-slide-caption">	
						<div class="ht-slide-cap-title animated fadeInRight">
							<?php echo (get_the_title()); ?>
						</div>
						<div class="ht-slide-cap-desc animated fadeInLeft">
							<?php echo (get_the_content()); ?>
						</div>	
						<div class="slider-btn animated fadeInRight">
							<ul>
							 <?php
                            $sliderbtn1url = get_post_meta($post->ID, 'sliderbtn1url', false);
                            $slider1_btn_url = !empty($sliderbtn1url[0]) ? $sliderbtn1url[0] : '';

                            ?>

							<?php if ($slider1_btn_url) { ?>		
							<li>
								<div class="sliderbtn">	
									<div class="ht-slide-cap-descmore">	
										<a class="secondry-bg" href="<?php echo $slider1_btn_url; ?>"><?php echo ($test_slider1btntext); ?></a>
									</div>
								</div>
							</li>
							<?php } ?>
							<?php
                            $designation = get_post_meta($post->ID, 'designation', false);
                            $slider2_btn_url = !empty($designation[0]) ? $designation[0] : '';

                            ?>
							<?php if ($slider2_btn_url) { ?>		
							<li>
								<div class="sliderbtn2">	
									<div class="ht-slide-cap-descmore2">	
										<a class="secondry-bg" href="<?php echo $slider2_btn_url; ?>"><?php echo ($test_slider2btntext); ?></a>
									</div>
								</div>
							</li>
							<?php } ?>
							</ul>
						</div>
					</div>
				<?php }?>
				</div>
			<?php
				endwhile;
			}else{ 
				for($i=0;$i<2;$i++){?>
				<div class="ht-slide">			
					<div class="slideimgbx">
						<div class="sliderimg animated zoomIn">
							<?php echo '<img class="slide-mainimg" alt="Slider" src="'. esc_html(get_template_directory_uri()) .'/images/slider-banner.jpg">';?>
						</div>
					</div>
				<?php if($showContent == 'on'){?>
					
					<div class="ht-slide-caption">
						<div class="ht-slide-cap-title animated fadeInLeft ">KEEP HEALTHY , RIDE EVERY DAY </div>
						<div class="ht-slide-cap-desc animated fadeInRight">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Quis ipsum suspendisse ultrices gravida. Risus commodo viverra maecenas accumsan lacus vel facilisis.</div>
						<div class="slider-btn animated fadeInLeft">	
						<ul>
							<li>
								<div class="sliderbtn">	
									<div class="ht-slide-cap-descmore">	
										<a class="secondry-bg" href="#"><?php _e( 'CONTACT US', 'luzuk-premium' ); ?></a>
									</div>
								</div>
							</li>	
							<li>
								<div class="sliderbtn2">	
									<div class="ht-slide-cap-descmore2">	
										<a class="secondry-bg" href="#"><?php _e( 'READ MORE', 'luzuk-premium' ); ?></a>
									</div>
								</div>
							</li>	
						</ul>
						</div>
					</div>
					<?php }?>
				</div>
				<?php }
			}?>
		</div>
		</div>
	</div>
