<?php
global $complete;  
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg");
$ImageUrl[] = esc_url(get_template_directory_uri() ."/images/slides/slider1.jpg"); 

for($i=1; $i<=10; $i++){
	if(!empty($complete['slide_image'.$i])){
		$imgArr[] = $i;
	}
}
require get_template_directory() . '/frontpage/slider.php';
?>

<section id="home_slider">
  <div class="slider-main">
    <?php if(!empty($imgArr)){ ?>
    <div class="slider-wrapper theme-default">
      <div id="slider" class="nivoSlider">
        <?php
			   foreach($imgArr as $val){
				?>
        <img src="<?php echo $complete['slide_image'.$val]; ?>" data-thumb="<?php echo $complete['slide_image'.$val]; ?>" alt="<?php echo strip_tags($complete['slide_title'.$val]); ?>" title="<?php echo esc_attr('#htmlcaption'.$val) ; ?>" />
        <?php } ?>
      </div>
      <?php foreach($imgArr as $val)	{ ?>
      <div id="htmlcaption<?php echo esc_attr($val); ?>" class="nivo-html-caption">
      	<div class="nivo-caption-content">
			<?php if(!empty($complete['slide_title'.$val])){ ?>
            <div class="title"><?php echo $complete['slide_title'.$val]; ?></div>
            <?php } ?>
            <?php if(!empty($complete['slide_desc'.$val])){ ?>
            <div class="slidedesc"><?php echo $complete['slide_desc'.$val]; ?></div>
            <?php } ?>
            <?php if(!empty($complete['slide_btn'.$val])){ ?>
            <div class="slidebtn"><a class="slidelink" href="<?php echo $complete['slide_link'.$val]; ?>"><?php echo $complete['slide_btn'.$val]; ?></a></div>
            <?php } ?>
            <?php if(!empty($complete['slide_btn'.$val.'_2'])){ ?>
            <div class="slidebtn slidebtn2"><a class="slidelink slidelink2" href="<?php echo $complete['slide_link'.$val.'_2']; ?>"><?php echo $complete['slide_btn'.$val.'_2']; ?></a></div>
            <?php } ?>
      	</div>
      </div>
      <?php } ?>
    </div>
    <?php }
	else { ?>
    <div class="slider-wrapper slide-temp theme-default">
      <div id="slider" class="nivoSlider">
        <?php foreach($ImageUrl as $val) { ?>
        <img src="<?php echo $val; ?>" data-thumb="<?php echo $val; ?>" alt="" title="#htmlcaption" />
        <?php } ?>
      </div>
      <?php for($i=1; $i<=3; $i++)	{ ?>
      <div id="htmlcaption" class="nivo-html-caption">
        <div class="title"><?php echo 'SKT Ele Restaurant Lite<small>Portfolio</small>Theme'; ?></div>
        <div class="slidedesc">&nbsp;</div>
        <div class="slidebtn">&nbsp;</div>
      </div>
      <?php } ?>
    </div>
    <?php } ?>
    
    <div class="skt-slider-wave">
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
 width="1406.000000pt" height="108.000000pt" viewBox="0 0 1406.000000 108.000000"
 preserveAspectRatio="xMidYMid meet">
<g transform="translate(0.000000,108.000000) scale(0.100000,-0.100000)"
fill="#ffffff" stroke="none">
<path class="skt-builder-wave-color" d="M1600 544 c-872 -293 -1589 -535 -1595 -538 -6 -2 3156 -4 7025 -4
3869 0 7028 2 7020 4 -31 8 -10787 1074 -10825 1073 -24 0 -660 -209 -1625
-535z"/>
</g>
</svg>
    </div>
    
  </div>
</section>