<div class="banner">
    <div class="container">
        <div class="row align-items-center justify-content-center">

            <div class="col-lg-12">
                <div id="carouselExampleFade" class="carousel slide carousel-fade" data-bs-ride="carousel">
                    <div class="carousel-inner">
                      <?php $sdot=''; if(isset($slider) && $slider){ foreach($slider as $key => $value){ 
                        $sdot .= '<button type="button" data-bs-target="#carouselExampleFade" data-bs-slide-to="'.$key.'" class="'.(($key==0)?'active':'').'" aria-current="true" aria-label="Slide"></button>';
                      ?>
                        <div class="carousel-item <?php echo($key==0)?'active':''; ?>" data-bs-interval="2000">
                            <div class="row align-items-center">
                                <div class="col-md-5">
                                    <div class="banner-top-des">
                                        <h2><?php echo $value['title']; ?></h2>
                                        <!-- <p> <span class="red"> Free </span> Delivery Above $150 </p> -->
                                        <p> <?php echo $value['subtitle']; ?> </p>
                                        <a href="<?php echo $value['url']; ?>" class="btn btn-secondary"> <span> View All <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span> </a>
                                    </div>
                                </div>
                                <div class="col-md-7">
                                    <img src="<?php echo base_url($value['image']); ?>" class="d-block w-100" alt="slider one">
                                </div>
                            </div>
                        </div>
                      <?php } } ?>
                    </div>
                    <div class="carousel-indicators">
                        <?php echo $sdot; ?>
                    </div>

                    <!-- <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="prev">
                        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                        <span class="visually-hidden">Previous</span>
                    </button>
                    <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleFade" data-bs-slide="next">
                        <span class="carousel-control-next-icon" aria-hidden="true"></span>
                        <span class="visually-hidden">Next</span>
                    </button> -->
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home1">
    <div class="container">
        <div class="row align-items-center  g-3">
            <div class="col-lg-6 col-md-6 col-12">
                <div class="home1-img mb-md-0 ml-minus20">
                    <img src="<?php echo base_url(); ?>assets/user/img/about-us.webp" class="w-100" alt="home1 image">
                </div>
            </div>
            <div class="col-lg-6 col-md-6 col-12">
                <div class="home1-inner pe-md-3">
                    <h6 class="sub-title"> About Us </h6>
                    <h2 class="main-title mb-0">Creating your recipe for success</h2>
                    <p>When it comes to your ultimate baking success, you can count on L’ecole a <a href="https://www.lecolefood.com/" target="_blank" class="text-decoration-underline"> Bakery supply store in Singapore,</a> to whisk right into action, whipping up innovative ideas matched by top-quality, healthy baking ingredients, sourced from trusted products from Taiwan and Asia.
                    </p>
                    <a href="<?php echo base_url(); ?>about-us" class="btn btn-primary"> <span> Read More <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span></a>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home2 services-section">
    <div class="container">
        <div class="row g-3 align-items-center">
            <div class="col-lg-12 col-12">
                <div class="home2-inner mb-3">
                    <h4 class="main-title"> Our Baking Tools </h4>
                </div>
            </div>
            <div class="col-lg-12 col-12 mt-0">
                <div class="owl-carousel owl-theme owl-services arrow-top-right">
                  <?php if(isset($btools) && $btools){ foreach($btools as $key => $value){ ?>
                    <div class="items">
                        <a href="<?php echo $value['link']; ?>" class="services-inner text-center">
                            <div class="services-content">
                              <?php if($value['image']!=''){ ?>
                                <img src="<?php echo base_url($value['image']); ?>" alt="img" class="w-100">
                              <?php }else{ ?>
                                <img src="<?php echo base_url(); ?>assets/user/img/service-one.png" alt="img" class="w-100">
                              <?php } ?>
                              <h2 class="title text-center"><?php echo $value['name']; ?></h2>
                            </div>
                        </a>
                    </div>
                  <?php } } ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home2 categories-section">
    <img src="<?php echo base_url(); ?>assets/user/img/Categories-Wheat.webp" alt="" class="img-1">
    <img src="<?php echo base_url(); ?>assets/user/img/Categories-iconmd.webp" alt="" class="img-2">
    <img src="<?php echo base_url(); ?>assets/user/img/Categories-Whip.webp" alt="" class="img-3">
    <div class="container">
        <div class="row g-3 justify-content-center">
            <div class="col-lg-12 col-12">
                <div class="home2-inner text-center mb-4">
                    <h4 class="main-title text-white"> Our Categories </h4>
                </div>
            </div>
            <div class="col-lg-11 col-12">
                <div class="row g-md-5 g-3 justify-content-center">
                  <?php if(isset($category) && $category){ foreach($category as $key => $value){ ?>
                    <div class="col-lg-3 col-md-3 col-sm-6 col-8">
                        <a href="<?php echo base_url('shop/'.url_title(strtolower($value['category'])).'/pr?catid='.$value['c_id']); ?>">
                          <div class="categories-wrap">
                            <div class="categories-img">
                              <?php if($value['image']!=''){ ?>
                                <img src="<?php echo base_url($value['image']); ?>" alt="img" class="w-100">
                              <?php }else{ ?>
                                <img src="<?php echo base_url(); ?>assets/user/img/home-cat.webp" alt="img" class="w-100">
                              <?php } ?>
                            </div>
                            <div class="categories-content">
                              <h2 class="cat-title mb-0"><?php echo $value['category']; ?></h2>
                            </div>
                          </div>
                        </a>
                    </div>
                  <?php } } ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home2 our-featured-section">
    <div class="container">
        <div class="row g-3 align-items-center">
            <div class="col-lg-12 col-12">
                <div class="home2-inner">
                    <h4 class="main-title"> Our Featured <br>
                        Products </h4>
                </div>
            </div>
            <div class="col-lg-12 col-12">
                <div class="owl-carousel owl-theme owl-featured arrow-top-right">
                  <?php if (isset($products) && !empty($products)){
                    foreach ($products as $key => $value) {
                  ?>
                    <div class="items">
                      <div class="product">
                        <div class="product-wrap">
                            <div class="product-img">
                              <a href="<?php echo base_url('shop-detail/'.strtolower($value['product_slug']).'/'.$value['productid']); ?>">
                                <?php if($value['product_image']!=''){ $pimg = base_url($value['product_image']); ?>
                                    <img src="<?php echo base_url($value['product_image']); ?>" alt="<?php echo substr($value['product_name'],0, 15); ?>" class="img-fluid pro-img">
                                <?php }else{ $pimg = base_url('assets/user/img/product1.webp'); ?>
                                    <img src="<?php echo base_url('assets/user/img/product-item.webp'); ?>" alt="<?php echo substr($value['product_name'],0, 15); ?>" class="img-fluid pro-img">
                                <?php } ?>
                              </a>
                              <div class="product-btn">
                                  <?php if($value['product_sale_price']>0){ $price = $value['product_sale_price']; }else{ $price = $value['product_price']; } ?>
                                  <a href="javascript:void(0);" class="btn-view mb-0 addToCartP" data-pid="<?php echo $value['productid']; ?>" data-pimg="<?php echo $pimg; ?>" data-price="<?php echo $price; ?>" data-pname="<?php echo $value['product_name']; ?>">
                                      <img src="<?php echo base_url(); ?>assets/user/img/addcart.webp" class="img-fluid" alt="product view">
                                  </a>
                              </div>
                            </div>
                            <div class="btn-wrap">
                              <a href="<?php echo base_url('shop-detail/'.strtolower($value['product_slug']).'/'.$value['productid']); ?>">
                                <div class="btn btn-primary-outline mb-0">
                                    <span> View Product
                                        <img src="<?php echo base_url(); ?>assets/user/img/Aerrow-t.webp" class="img ms-2" width="14" alt="right">
                                    </span>
                                </div>
                              </a>
                            </div>
                        </div>
                        <div class="product-inner">
                          <a href="<?php echo base_url('shop-detail/'.strtolower($value['product_slug']).'/'.$value['productid']); ?>">
                            <p class="product-title" style="min-height:40px;"><?php echo substr($value['product_name'], 0,40); ?><?php echo(strlen($value['product_name'])>40)?'...':''; ?></p>
                          </a>
                        </div>
                      </div>
                    </div>
                  <?php } } ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home2 our-recipes-section">
    <div class="container">
        <div class="row g-md-3 g-3">
            <div class="col-lg-6 col-md-6 col-sm-8">
                <div class="home2-inner mb-md-5 mb-3">
                    <h4 class="main-title"> Our Recipes </h4>
                </div>
            </div>
            <div class="col-lg-6 col-md-6 col-sm-4 text-md-end mb-md-0 mb-3">
                <a href="<?php echo base_url('recipes'); ?>" class="btn btn-secondary"> <span> View All <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span> </a>
            </div>
        </div>
        <div class="row g-md-5 g-3 align-items-center">
          <?php if(isset($recipes) && $recipes){ foreach($recipes as $key => $value){ ?>
            <div class="col-lg-6 col-12">
              <div class="our-recipes">
                  <div class="img-wrap">
                    <?php if($value['image']!=''){ ?>
                      <img src="<?php echo base_url($value['image']); ?>" class="img-fluid" alt="recipe image">
                    <?php }else{ ?>
                      <img src="<?php echo base_url(); ?>assets/user/img/recipes-1.webp" class="img-fluid" alt="recipe image">
                    <?php } ?>
                  </div>
                  <div class="content-wrap">
                      <h1 style="min-height:48px;"><?php echo substr($value['title'], 0,40); ?><?php echo(strlen($value['title'])>40)?'...':''; ?></h1>
                      <a href="<?php echo base_url('recipe-detail/'.url_title(strtolower($value['title'])).'/'.$value['id']); ?>" class="btn btn-primary"> <span> Read More <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span></a>
                  </div>
              </div>
            </div>
          <?php } } ?>
        </div>
    </div>
</div>

<div class="home2 news-section">
    <div class="container">
        <div class="row g-md-3 g-3">
            <div class="col-lg-12 col-md-12 col-sm-12">
                <div class="home2-inner">
                    <h4 class="main-title"> News </h4>
                </div>
            </div>

            <div class="col-lg-12 col-md-12 col-sm-12 col-12 mt-0">
                <div class="owl-carousel owl-theme owl-news arrow-top-right">
                  <?php if(isset($news) && $news){ foreach($news as $key => $value){ ?>
                    <div class="items">
                        <div class="our-news">
                            <div class="img-wrap">
                              <?php if($value['image']!=''){ ?>
                                <img src="<?php echo base_url($value['image']); ?>" class="img-fluid" alt="recipe image">
                              <?php }else{ ?>
                                <img src="<?php echo base_url(); ?>assets/user/img/news.webp" class="img-fluid" alt="recipe image">
                              <?php } ?>
                            </div>
                            <div class="content-wrap">
                                <p class="date"><?php echo date('d M Y',strtotime($value['publish_date'])); ?></p>
                                <h1 style="min-height:48px;"><?php echo substr($value['post_title'], 0,40); ?><?php echo(strlen($value['post_title'])>40)?'...':''; ?></h1>
                                <a href="<?php echo base_url('article-detail/'.url_title(strtolower($value['post_title'])).'/'.$value['id']); ?>" class="btn btn-primary"> <span> Read More <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span></a>
                            </div>
                        </div>
                    </div>
                  <?php } } ?>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="home2 news-section pt-0">
    <div class="container">
        <div class="row g-md-3 g-3">
            <div class="col-lg-12 col-md-12 col-sm-12">
                <div class="home2-inner">
                    <h4 class="main-title"> Events </h4>
                </div>
            </div>

            <div class="col-lg-12 col-md-12 col-sm-12 col-12 mt-0">
                <div class="owl-carousel owl-theme owl-news arrow-top-right">
                  <?php if(isset($event) && $event){ foreach($event as $key => $value){ ?>
                    <div class="items">
                        <div class="our-news">
                            <div class="img-wrap">
                                <?php if($value['image']!=''){ ?>
                                  <img src="<?php echo base_url($value['image']); ?>" class="img-fluid" alt="recipe image">
                                <?php }else{ ?>
                                  <img src="<?php echo base_url(); ?>assets/user/img/event.webp" class="img-fluid" alt="recipe image">
                                <?php } ?>
                            </div>
                            <div class="content-wrap">
                                <p class="date"><?php echo date('d M Y',strtotime($value['publish_date'])); ?></p>
                                <h1 style="min-height:48px;"><?php echo substr($value['post_title'], 0,40); ?><?php echo(strlen($value['post_title'])>40)?'...':''; ?></h1>
                                <a href="<?php echo base_url('event-detail/'.url_title(strtolower($value['post_title'])).'/'.$value['id']); ?>" class="btn btn-primary"> <span> Read More <div><img src="<?php echo base_url(); ?>assets/user/img/btn-right.png" class="img" alt="right"> </div> </span></a>
                            </div>
                        </div>
                    </div>
                  <?php } } ?>
                </div>
            </div>
        </div>
    </div>
</div>

<?php $this->load->view('contact-section'); ?>