<?php 
if(!defined('IN_DEMOSOSO')) {
    exit('this is wrong page,please back to homepage');
}

$arr = dm_dirarr(dirname(__FILE__));

 $jtpath = $arr['path'];
 $jtroot = $arr['root'];

?> 
<link rel="stylesheet" href="<?php echo $jtpath?>slider_01/swiper.min.css">
<link rel="stylesheet" href="<?php echo $jtpath?>slider_01/slider01.css">
<script src="<?php echo $jtpath?>slider_01/swiper.min.js"></script>

   <!--Main Slider Start-->
        <section class="main-slider slider01">
            <div class="swiper-container thm-swiper__slider" data-swiper-options='{"slidesPerView": 1, "loop": true,
    "effect": "fade",
    "pagination": {
        "el": "#main-slider-pagination",
        "type": "bullets",
        "clickable": true
      },
    "navigation": {
        "nextEl": ".banner-slider-button-next",
        "prevEl": ".banner-slider-button-prev",
        "clickable": true
    },
    "autoplay": {
        "delay": 5000
    }}'>

                <div class="swiper-wrapper">
                  <?php
    foreach($result['data'] as $k=>$v){
         // pre($v);
      $title = $v['title'];  
      $img  =   get_img($v['kv']);   
      $desp  =   $v['desp'];
      $despjj  =   $v['despjj'];
      
      $dhlinkurl =  $dhlinktitle= '';
      foreach ($v['arrcan'] as   $key=>$value) { 
       $bsccc = $key;
       $$bsccc=$value;
     }

     //$linkurlarr =  get_nodelinkurl($dhlinkurl);
   
        //pre($v);
    ?>
                    <div class="swiper-slide">
                        <div class="image-layer"
                            style="background-image: url(<?php echo $img?>);"></div>
                       
                            <div class="swiper-slide-inner">
                                
                                         <div class="text">
                                            <?php echo $desp?>
                                        </div>
                                        <?php 
                                            if($dhlinkurl<>''){
                                                echo '<a href="'.$dhlinkurl.'" class="thm-btn">'.$dhlinktitle.'</a>';
                                            }
                                        ?> 
                        </div>
                    </div>
                  
                   <?php 
               }
               ?>
                </div>

                <div class="swiper-pagination" id="main-slider-pagination"></div>
                <div class="banner-slider-nav">
                   <div class="banner-slider-button-prev"><i class="fa fa-arrow-right" aria-hidden="true"></i></div>
                    <div class="banner-slider-button-next"><i class="fa fa-arrow-right" aria-hidden="true"></i></div>
                </div>
            </div>
        </section>
        <script type="text/javascript">
              const swiperElm = document.querySelectorAll(".thm-swiper__slider");

            swiperElm.forEach(function (swiperelm) {
              const swiperOptions = JSON.parse(swiperelm.dataset.swiperOptions);
              let thmSwiperSlider = new Swiper(swiperelm, swiperOptions);
            });

        </script>




