 
<?php
$product_noibats = result_array("select * from #_product where type='san-pham' and hienthi=1 and noibat=1 order by stt asc ");
?>
<div id="product_noibat">
    <div class="container">
        <div class="header-title">
            <h2 class="h2-title"><span>Menu Quán</span></h2>
            <div class="desc"></div>
        </div>
        <div class="product_noibat-content">
            <div class="swiper-container">
                <!-- Additional required wrapper -->
                <div class="swiper-wrapper">
                    <?php foreach($product_noibats as $item){ ?>
                        <div class="swiper-slide">
                            <?php include _template."layout/product_item.php";?>
                        </div>
                    <?php } ?>

                </div>
            </div>

        </div>
    </div>
</div>

<?php
$quangcao =result_array("select ten_vi,photo_vi,link from #_photo where type='quangcao'  and hienthi=1 order by stt,id desc");
$width=1366;
$height = 291;
?>
<div id="quangcao">
         <div class="swiper-container">
            <div class="swiper-wrapper">
             <?php foreach($quangcao as $stt => $item){ ?>
               <div class="swiper-slide">
                 <a href="<?=$item["link"]?>">
                  <img src="thumb/1-<?=$width?>-<?=$height?>/<?=_upload_hinhanh_l.$item["photo_vi"]?>" class="w-100" alt="<?=$item["photo_vi"]?>">
              </a>

          </div>
      <?php } ?>
    </div>
</div>
</div>


<?php
$menunuoc = result_array("select * from #_product where type='menu-nuoc' and hienthi=1 order by stt asc ");
?>
<div id="menunuoc">
    <div class="container">
        <div class="header-title">
            <h2 class="h2-title"><span>Menu Nước</span></h2>
            <div class="desc"></div>
        </div>
        <div class="menunuoc-content">
            <div class="swiper-container">
                <!-- Additional required wrapper -->
                <div class="swiper-wrapper">
                    <?php foreach($menunuoc as $item){ ?>
                        <div class="swiper-slide">
                            <div class="menunuoc_item hover">
                                <div class="image">
                                    <div>
                                    <a href="<?=$item["tenkhongdau"]?>">
                                        <img class="w-100 img-fluid" src="thumb/1-300-300/upload/product/<?=$item["photo"]?>" alt="<?=$item["photo"]?>" onerror="this.src='img/300x300/'">
                                    </a>
                                     <h3><a href="<?=$item["tenkhongdau"]?>"><?=$item["ten_$lang"]?></a></h3>
                                     </div>
                                </div>
                                   
                            </div>
                        </div>
                    <?php } ?>

                </div>
            </div>

        </div>
    </div>
</div>
<div id="visaochon">
    <div class="image ">
        <img src="assets/images/img_visaochon.png" alt="visaochon" class="mx-auto" style="position: absolute;
    left: 0;
    right: 0;
    bottom: 0px;">
    </div>
</div>
<?php
            $album = result_array("select * from #_baiviet where type='album' and hienthi=1 limit 4");
            if(count($album) > 0){ 
?>
<div id="album">
    <div class="container">
          <div class="header-title">
            <h2 class="h2-title"><span>Không gian quán</span></h2>
            <div class="desc">Món tiêu biểu của chúng tôi</div>
        </div>
        <div class="row row-10">
                    <div class="col-8">
                        <div class="row row-10">
                    <?php foreach($album as $stt => $item){
                        if($stt % 5 < 2){
                            $w = 390;
                            $h = 246;
                            $c = 'col-6';
                        }else if($stt % 5 < 3){
                            $w = 630;
                            $h = 320;
                            $c = 'col-12';
                        }else{
                            $w = 348;
                            $h = 586;
                            $c = 'col-12';
                        }
                        ?>
                        <div class="<?=$c?>">
                            <div class="kgq_item hieuung">
                                <div class="image">
                                <a href="<?=$item["link"]?>">
                                    <img src="thumb/1-<?=$w?>-<?=$h?>/upload/baiviet/<?=$item["photo"]?>" alt="<?=$item["photo"]?>" class="img-fluid w-100" onerror='this.src="img/<?=$w?>x<?=$h?>/"'>
                                </a>
                                <h3 class="overlay d-none"><?=$item["ten_$lang"]?></h3>
                                </div>
                            </div>
                        </div>
                        <?php if($stt + 1 == count($album)) { echo('</div></div>');break;} ?>
                        <?php if($stt % 3 == 2) { echo('</div></div><div class="col-4"><div class="row row-10">');} ?>
                    <?php } ?>
                </div>
            </div>
        </div>
        </div>
         <?php } ?>
<?php
$tintucs = result_array("select * from #_baiviet where type='tin-tuc' and hienthi=1 order by stt asc ");
?>
<div id="tintuc">
    <div class="container">
        <div class="header-title">
            <h2 class="h2-title"><span>Tin Tức</span></h2>
            <div class="desc"></div>
        </div>
        <div class="tintuc-content">
            <div class="swiper-container">
                <!-- Additional required wrapper -->
                <div class="swiper-wrapper">
                    <?php foreach($tintucs as $item){ ?>
                        <div class="swiper-slide">
                            <div class="tintuc_item hover">
                                <div class="image">
                                    <a href="<?=$item["tenkhongdau"]?>">
                                        <img class="w-100 img-fluid" src="thumb/1-400-220/upload/baiviet/<?=$item["photo"]?>" alt="<?=$item["photo"]?>" onerror="this.src='img/400x200/'">
                                    </a>
                                </div>
                                <div class="detail">
                                    <div class="ngaytao">
                                        <div class="ngay"><?=date("d",$item['ngaytao'])?></div>
                                        <div>tháng</div>
                                        <div><?=date("m",$item['ngaytao'])?></div>
                                    </div>
                                    <h3><a href="<?=$item["tenkhongdau"]?>"><?=$item["ten_$lang"]?></a></h3>
                                    <div class="mota">
                                        <?=catchuoi($item["mota_$lang"],120)?>
                                    </div>
                                    <div class="xemthem">
                                        <a href="<?=$item["tenkhongdau"]?>">Xem thêm</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    <?php } ?>

                </div>
            </div>

        </div>
    </div>
</div>
<style>
    
</style>