<!DOCTYPE html>
<html lang="en">
<head>
    <?php include_once("assets/include/head.php")?>
</head>
<body>
    <?php include_once("assets/include/header.php")?>
    
    
    
    <?php 
             $slug=$_GET['slug'];
             
            $qry=mysqli_query($con,"SELECT * from category where slug='$slug'");
            // echo "SELECT * from category where slug='$slug'";
            $rn=mysqli_fetch_array($qry);
            $cid=$rn['id'];
            $qry1=mysqli_query($con,"SELECT * from cat_content where cat_id='$cid'");
            $row=mysqli_fetch_array($qry1);
            
    ?>
    
    <!-- sub banner started... -->
    <section class="sub-banner">
        <picture>
           <?php
$im=mysqli_query($con,"select * from top_cat_banner where cat_id='$cid' AND mobile='0'");
$mim=mysqli_query($con,"select * from top_cat_banner where cat_id='$cid' AND mobile='1'");
$si=mysqli_fetch_array($im);
$msi=mysqli_fetch_array($mim);
?>
            <source media="(max-width:767px)" srcset="<?php path();?>/assets/images/service-banner/<?php echo $msi['image']; ?>">
            <source media="(min-width:768px)" srcset="<?php path();?>/assets/images/service-banner/<?php echo $si['image']; ?>">
            <img src="#" alt="sub banner-img">
        </picture>
        <nav aria-label="breadcrumb">
            <div class="container">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="<?php path();?>">Home</a></li>
                    <li class="breadcrumb-item"><a href="<?php path();?>">Services</a></li>
                    <li class="breadcrumb-item active" aria-current="page"><?php echo $rn['cat_name']; ?></li>
                </ol>
            </div>
        </nav>
    </section>
    <!-- sub banner ended... -->
    <?php if(mysqli_num_rows($qry1)!=0){ ?>
    <!-- service content started... -->
    <section class="service py-80">
        <div class="container">
            <div class="row">
                <div class="col-md-12">
                    <?php echo  $row['description']; ?>
                </div>
            </div>
        </div>
    </section>
    <?php echo  $row['edesc']; ?>
    <!-- service content ended... -->
    <!-- slider section started... -->
    <section class="slider py-80">
        <div class="container">
            <div class="row">
                <div class="col-md-12"></div>
            </div>
            <div class="service-slider swiper" style="--swiper-navigation-color: #000; --swiper-pagination-color: #eed181">
                <div class="swiper-wrapper">
                    <?php 
                        $im=mysqli_query($con,"SELECT * FROM service_imgs where cat_id='$cid'");
                        while($ims=mysqli_fetch_array($im)){
                        ?>
                    <div class="swiper-slide">
                        
                        <img src="<?php path();?>/assets/images/service_img/<?php echo $ims['image']; ?>" alt="">
                        
                    </div>
                    <?php } ?>
                </div>
                <div class="swiper-pagination"></div>
                <div class="swiper-navigation">
                    <div class="swiper-button-next"></div>
                    <div class="swiper-button-prev"></div>
                </div>
            </div>
        </div>
    </section>
    <!-- slider section ended... -->
    <!-- section project started... -->
    <?php 
    $p=mysqli_query($con,"select * from project where cat_id='$cid'");
    ?>
    <?php if(mysqli_num_rows($p)!=0){ ?>
    <section class="project py-80 back_fade">
        <div class="container">
            <div class="row">
                <div class="col-md-12 text-center">
                    <div class="sub-title">Projects</div>
                    <h4 class="title">Interior Design</h4>
                </div>
            </div>
            <div class="row">
                <?php while($ps=mysqli_fetch_array($p)){ ?>
                <div class="col-md-6">
                    <a href="<?php path();?>/project-files/<?php echo $ps['additional']; ?>" class="project-box" target="_blank">
                        <div class="project-img">
                            <img src="<?php path();?>/assets/images/project-min.webp" alt="Project Image">
                        </div>
                        <div class="project-cotnent">
                            <?php echo $ps['description']; ?>
                        </div>
                    </a>
                </div>
                <?php }  ?>
                
            </div>
        </div>
    </section>
    <?php } ?>
    <!-- section project ended... -->
    
    <?php } ?>
    <?php include_once("assets/include/footer.php")?>
</body>
</html>