<?php

include('include/main.inc.php');

$actual_links = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";

$ex_cat =explode("/",$actual_links);

$cat_url = $ex_cat[3];



$cat_name = explode(".", $cat_url);

$catName = str_ireplace("-", " ", $cat_name[0]);

$catName = ucwords($catName);

$sel_cat_query = "select displayName,catName,catImage,parentID,catID,keyword1,keyword2,catDesc1,catDesc,pageTitle,pageDescription,pageKeywords from category_tbl where catName ='$catName'";

$res_cat = $dbconn->query($sel_cat_query);

if($res_cat->num_rows > 0){

$cat_details = $res_cat->fetch_assoc();



$web_det_query = "Select * from admin_details where slno = '1'";

$res_web = $dbconn->query($web_det_query);

$web_details = $res_web->fetch_assoc();

$page_metatitle = $cat_details['pageTitle'];
$page_metadesc = $cat_details['pageDescription'];
$page_metakey = $cat_details['pageKeywords'];


$page_metatitle = ($page_metatitle) ? $page_metatitle : $cat_details['keyword1'].' Manufacturers in Delhi, '.$cat_details['keyword2'].' Suppliers in India';

$page_metadesc = ($page_metadesc) ? $page_metadesc : $web_details['companyName'].' leading '.$cat_details['keyword1'].' Manufacturers in '.$web_details['city'].', since 1983. Premium Quality '.$cat_details['keyword2'].' Suppliers in '.$web_details['country'].', Get latest Factory Price for '.$cat_details['keyword1'].'. Call +91-9810369969, ✓Fast Delivery ✓Good Price ✓Premium Quality';



// Variety Metal Corporation leading Stainless Steel Pipes Manufacturers in city, since YYYY. Premium Quality SS Pipe Suppliers in country, Get latest factory price for Stainless Steel Pipes. Call +91-9810369969, ✓Fast Delivery ✓Good Price ✓Premium Quality

$page_metakey = ($page_metakey) ? $page_metakey : $cat_details['keyword1'].' in Delhi, '.$cat_details['keyword2'].' in Delhi, '.$cat_details['keyword1'].' Manufacturers in Delhi, '.$cat_details['keyword2'].' Suppliers in Delhi, '.$cat_details['keyword2'].' Manufacturers in India, '.$cat_details['keyword2'].' Suppliers in India '


?>

<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <title><?= $page_metatitle; ?></title>

    <meta name="description" content="<?= $page_metadesc; ?>">

    <meta name="keywords" content="<?= $page_metakey; ?>">

    <?php include "app_top.php"; ?>

</head>

<body>

    <?php include "app_header.php"; ?>



    <section class="pageBanner" style="background-image:url('<?= site_url; ?>/designer/images/product_bg.jpg')">

        <div class="container">

            <div class="pagebannerWrap">

                <h1 class="pagebanner_heading"><?=$cat_details['catName']; ?></h1>

            </div>

        </div>

    </section>



    <!-- Quote Box -->

    <div class="w-p-s-home-feture">

        <div class="container">

            <div class="row">

                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">

                    <div>

                        <div class="page_breadcrumb">

                            <ul>

                                <li><a href="<?= site_url; ?>" title="Home">Home</a></li>

                                <li>/</li>

                                <?php if($cat_details['parentID'] != 0){

                                $res_pr_cat = $dbconn->query("select displayName,catName from category_tbl where catID = '".$cat_details['parentID']."'");

                                $res_cat_pr = $res_pr_cat->fetch_assoc();

                                $res_pr_href = str_ireplace(" ", "-", $res_cat_pr['catName']);

                            ?>

                                <li><a href="<?= site_url; ?>/<?= strtolower($res_pr_href); ?>.htm"
                                        title="<?= $res_cat_pr['displayName']; ?>"><?= $res_cat_pr['displayName']; ?></a>
                                </li>

                                <li>/</li>

                                <?php } ?>

                                <li><?= $cat_details['catName']; ?></li>

                            </ul>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </div>



    <section class="productSection productSecPage">

        <div class="container">
            <h2 class="cat_sec_title_1 sec_title_1"><?= $cat_details['catName']; ?> in Delhi</h2>
            <div class="row">

                <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-12 col-12">

                    <div class="productWrap">

                        <?php if($cat_details['catImage']) { ?>

                        <a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID"
                            class="main-category-image"
                            title="<?= $cat_details['displayName']; ?> Manufacturers in Delhi">

                            <img class=" main-cat-image"
                                src="<?= site_url.'/uploaded-files/category/images/'.$cat_details['catImage']; ?>"
                                title="<?= $cat_details['displayName']; ?> Manufacturers in Delhi"
                                alt="<?= $cat_details['catName']; ?> Manufacturers in Delhi">

                            <input type="hidden" class="main_heading" value="<?= $cat_details['displayName']; ?>">

                        </a>



                        <a href="javascript:void(0);" class="productenquiry main-category-image" data-bs-toggle="modal"
                            data-bs-target="#productID" title="Enquiry Now"><svg xmlns="http://www.w3.org/2000/svg"
                                width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                <path
                                    d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z">
                                </path>
                            </svg> Enquiry Now</a>

                        <?php } ?>

                    </div>



                </div>

                <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-12 col-12">

                    <div class="poductDetailWrap">

                        <?= $cat_details['catDesc1']; ?>

                    </div>

                </div>

            </div>

        </div>

    </section>



    <div class="productrangeSec">

        <div class="container">
            <?php
$res_products=$dbconn->query("select * from product_tbl where find_in_set('".$cat_details['catID']."',product_cat)");
if($res_products->num_rows > 0){
?>
            <div class="cat_pro_t">Products Related to <?= $cat_details['displayName']; ?></div>
            <?php while($products = $res_products->fetch_assoc()){ ?>
            <div class="newProductList">
                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                        <div class="product_listing">
                            <div class="row">
                                <?php
                                                    $pr_images = explode(",", $products['product_image']);

                                                ?>
                                <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-12">
                                    <div class="product">
                                        <!-- <div id="small<?= $products['product_id']; ?>" class="small">
                                            <?php $prno = 0; foreach($pr_images as $image){ $prno++; ?>
                                            <img class="item product_aimage <?= ($prno == 1) ? 'active': ''; ?>"
                                                src="<?= getImage($image,500,500, $products['product_title'].$prno, "/uploaded-files/product-images/"); ?>"
                                                alt="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $getAdminDetails['targetlocation']; ?>"
                                                title="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $getAdminDetails['targetlocation']; ?>">
                                            <?php } ?>
                                            <input type="hidden" class="pr_sno" value="<?= $sno; ?>">
                                        </div> -->

                                        <div class="single_image product_pop_up">
                                            <a class="largeImage product_pop_up"
                                                id="bigImage<?= $products['product_id']; ?>" href="javascript:void(0);"
                                                data-bs-toggle="modal" data-bs-target="#productID"
                                                title="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $web_details['targetlocation']; ?>">
                                                <img class="activeImage<?= $sno; ?> product_image<?= $products['product_id']; ?>"
                                                    src="<?= getImage($pr_images['0'],500,500, $products['product_title'], "/uploaded-files/product-images/"); ?>"
                                                    alt="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $web_details['targetlocation']; ?>"
                                                    title="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $web_details['targetlocation']; ?>">
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-8 col-12">
                                    <div class="right-content">
                                        <h4><a href="#"
                                                title="<?= $products['product_title']; ?> Manufacturers, Suppliers and Exporters in <?= $web_details['targetlocation']; ?>"><?= $products['product_title']; ?></a>
                                        </h4>
                                        <div class="more_info">
                                            <?= $products['product_specfi']; ?>
                                            <a class="productenquiry product_pop_up"  onclick="$('.catID').val('<?php echo $products['product_id'];?>');
            $('.catName').html('<?php echo $products['product_title'];?>');  $('.catImg').attr('src','<?= getImage($image,500,500, $products['product_title'].$prno, "/uploaded-files/product-images/"); ?>'); $('.catImg').attr('alt','<?=$products['product_title'];?> in <?=$web_details['targetlocation'];?>'); $('.catImg').attr('title','<?=$products['product_title'];?> in <?=$web_details['targetlocation'];?>');" href="javascript:void(0);"
                                                data-bs-toggle="modal"  data-bs-target="#productID" title=""
                                                title="Enquire Now">Enquire Now</a>
                                        </div>
                                        

                                        <div class="clearfix"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <?php }}
    $sub_cat_query = "select displayName,catName,catImage,parentID,catID,catDesc,catDesc1 from category_tbl where parentID = '".$cat_details['catID']."' order by catOrder asc";

    $res_cat = $dbconn->query($sub_cat_query);

    if($res_cat->num_rows > 0){
        ?>
            <h4>You May Also like These</h4>
            <?php
            while($sub_cat_det = $res_cat->fetch_assoc()){

                $sub_cat_href = str_ireplace(" ", "-", $sub_cat_det['catName']);

            ?>

            <div class="productrangeWrap">

                <div class="row">

                    <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12">

                        <div class="productrangeImage">

                            <a href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm"
                                title="<?= $sub_cat_det['displayName']; ?> Manufacturers in Delhi">

                                <?php if($sub_cat_det['catImage']){ ?>

                                <img class="category_image<?= $sub_cat_det['catID']; ?>"
                                    src="<?= getImage($sub_cat_det['catImage'],300,300, $sub_cat_det['catName'], "/uploaded-files/category/images/");?>"
                                    title="<?= $sub_cat_det['displayName']; ?> Manufacturers in Delhi"
                                    alt="<?= $sub_cat_det['displayName']; ?> Manufacturers in Delhi">

                                <?php } ?>

                            </a>

                        </div>

                    </div>

                    <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-12 col-12">

                        <div class="productrangedetail">

                            <h4 class="pro_det_nam"><a class="category_title<?= $sub_cat_det['catID']; ?>"
                                    href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm"
                                    title="<?= $sub_cat_det['displayName']; ?> Manufacturers in Delhi"><?= $sub_cat_det['displayName']; ?></a>
                            </h4>

                            <p><?= $sub_cat_det['catDesc']; ?></p>

                            <a href="javascript:void(0);" class="productenquiry pop_cat_id" data-bs-toggle="modal"
                                data-bs-target="#productID" title="Enquiry Now"><input type="hidden" class="cat_id"
                                    value="<?= $sub_cat_det['catID']; ?>"><svg xmlns="http://www.w3.org/2000/svg"
                                    width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                    <path
                                        d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z">
                                    </path>
                                </svg> Enquiry Now</a>

                            <a href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm" class="read_more1"
                                title="Read More">Read More</a>

                        </div>

                    </div>

                </div>

            </div>

            <?php } ?>



        </div>

    </div>

    <?php }else{

        $sub_cat_query = "select displayName,catName,catImage,parentID,catID,catDesc,catDesc1 from category_tbl where parentID = '".$cat_details['parentID']."' and catID != '".$cat_details['catID']."' order by catOrder asc";

        $res_cat = $dbconn->query($sub_cat_query);

        if($res_cat->num_rows > 0){

    ?>

    <div class="productrangeSec">

        <div class="container">

            <h4>You May Also like These</h4>

            <?php

            while($sub_cat_det = $res_cat->fetch_assoc()){

                $sub_cat_href = str_ireplace(" ", "-", $sub_cat_det['catName']);

            ?>

            <div class="productrangeWrap">

                <div class="row">

                    <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-12 col-12">

                        <div class="productrangeImage">

                            <a href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm"
                                title="<?= $sub_cat_det['displayName']; ?> Manufacturers in Delhi">

                                <?php if($sub_cat_det['catImage']){ ?>

                                <img class="category_image<?= $sub_cat_det['catID']; ?>"
                                    src="<?= getImage($sub_cat_det['catImage'],300,300, $sub_cat_det['catName'], "/uploaded-files/category/images/");?>"
                                    title="<?= $sub_cat_det['catName']; ?> Manufacturers in Delhi"
                                    alt="<?= $sub_cat_det['catName']; ?> Manufacturers in Delhi">

                                <?php } ?>

                            </a>

                        </div>

                    </div>

                    <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-12 col-12">

                        <div class="productrangedetail">

                            <h5><a class="category_title<?= $sub_cat_det['catID']; ?>"
                                    href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm"
                                    title="<?= $sub_cat_det['catName']; ?>"><?= $sub_cat_det['catName']; ?></a></h5>

                            <p><?= $sub_cat_det['catDesc']; ?></p>

                            <a href="javascript:void(0);" class="productenquiry pop_cat_id" data-bs-toggle="modal"
                                data-bs-target="#productID" title="Enquiry Now"><input type="hidden" class="cat_id"
                                    value="<?= $sub_cat_det['catID']; ?>"><svg xmlns="http://www.w3.org/2000/svg"
                                    width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
                                    <path
                                        d="M.05 3.555A2 2 0 0 1 2 2h12a2 2 0 0 1 1.95 1.555L8 8.414.05 3.555ZM0 4.697v7.104l5.803-3.558L0 4.697ZM6.761 8.83l-6.57 4.027A2 2 0 0 0 2 14h12a2 2 0 0 0 1.808-1.144l-6.57-4.027L8 9.586l-1.239-.757Zm3.436-.586L16 11.801V4.697l-5.803 3.546Z">
                                    </path>
                                </svg> Enquiry Now</a>

                            <a href="<?= site_url.'/'.strtolower($sub_cat_href); ?>.htm" class="read_more1"
                                title="Read More">Read More</a>

                        </div>

                    </div>

                </div>

            </div>

            <?php } ?>



        </div>

    </div>

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

    <?//php include "app_testimonials.php"; ?>

    <?//php include "app_faq.php"; ?>

    <?//php include "app_clients.php"; ?>

    <?php include "app_footer.php"; ?>

    <?php include "app_bottom.php"; ?>

    <script>
    $('#small1 .item').click(function() {
        $('#bigImage1 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small1 .item").removeClass("active");
        } else {
            $("#small1 .item").removeClass("active");
            $(this).addClass("active");
        }
    });
    $('#small2 .item').click(function() {
        $('#bigImage2 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small2 .item").removeClass("active");
        } else {
            $("#small2 .item").removeClass("active");
            $(this).addClass("active");
        }
    });

    $('#small3 .item').click(function() {
        $('#bigImage3 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small3 .item").removeClass("active");
        } else {
            $("#small3 .item").removeClass("active");
            $(this).addClass("active");
        }
    });

    $('#small4 .item').click(function() {
        $('#bigImage4 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small4 .item").removeClass("active");
        } else {
            $("#small4 .item").removeClass("active");
            $(this).addClass("active");
        }
    });

    $('#small5 .item').click(function() {
        $('#bigImage5 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small5 .item").removeClass("active");
        } else {
            $("#small5 .item").removeClass("active");
            $(this).addClass("active");
        }
    });

    $('#small6 .item').click(function() {
        $('#bigImage6 img').attr('src', $(this).attr('src').replace('thumb', 'large'));
        if ($(this).hasClass("active")) {
            $("#small1 .item").removeClass("active");
        } else {
            $("#small6 .item").removeClass("active");
            $(this).addClass("active");
        }
    });
    </script>

</body>

</html>

<?php }else{

    header('location:'.site_url);

} ?>