<?php
include_once("include/main.inc.php");
@extract($_REQUEST);
if (preg_match('webpulse\.co$/', $_SERVER['HTTP_HOST'], $match)) {
  $match1 = $match[1];
  $vanity_url = 'http://' . $_SERVER['HTTP_HOST'];
}

$actual_link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$ee = explode('/', $actual_link);
$mm = $ee[3];
$ss = explode('.', $mm);
$cc = $ss[0];
$cat = str_replace("-", " ", $cc);
$cats = ucfirst($cat);
$cat_s = "select * from category_tbl where catName='$cats'";
$cat_q = mysqli_query($dbcon, $cat_s);
$num = mysqli_num_rows($cat_q);
$cat_r = mysqli_fetch_array($cat_q);
$category_id = $cat_r['catID'];
$hover = $category_id;
$catn = $cat_r['catName'];

$cat_sql = "select * from category_tbl where parentID='$category_id' and status='Y'";


$cat_qry = mysqli_query($dbcon, $cat_sql);

$cccnum = mysqli_num_rows($cat_qry);

$cat_sql1 = "select * from category_tbl where catID='$category_id'";

$cat_qry1 = mysqli_query($dbcon, $cat_sql1);

$cat_res = mysqli_fetch_array($cat_qry1);


$page_metatitle = $cat_res['pageTitle'];
$keyword = $cat_res['pageKeywords'];

$desc = $cat_res['pageDescription'];

$pageTitles = $cat_res['catName'];

$disTitles = $cat_res['displayName'];
$pdes = $cat_res['catDesc'];

$pdes1 = $cat_res['catDesc1'];

$parent = $cat_res['parentID'];

$cat_sql2 = "select * from category_tbl where catID='$parent'";

$cat_qry2 = mysqli_query($dbcon, $cat_sql2);

$num2 = mysqli_num_rows($cat_qry2);

$cat_res2 = mysqli_fetch_array($cat_qry2);

$mparent = $cat_res2['parentID'];

$cat_sql3 = "select * from category_tbl where catID='$mparent'";

$cat_qry3 = mysqli_query($dbcon, $cat_sql3);

$num3 = mysqli_num_rows($cat_qry3);

$cat_res3 = mysqli_fetch_array($cat_qry3);

$mmparent = $cat_res3['parentID'];

$cat_sql4 = "select * from category_tbl where catID='$mmparent'";

$cat_qry4 = mysqli_query($dbcon, $cat_sql4);

$num4 = mysqli_num_rows($cat_qry4);

$cat_res4 = mysqli_fetch_array($cat_qry4);


$admin_sql = mysqli_query($dbcon, "select * from admin_details");
$admin_res = mysqli_fetch_array($admin_sql);
$mobile = $admin_res['mobile'];
$city = $admin_res['city'];
$state = $admin_res['state'];
$country = $admin_res['country'];
$companyName = $admin_res['companyName'];
$address = $admin_res['address'];
$targetlocation = $admin_res['targetlocation'];


if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '' && $cat_res['keyword3'] != '') {
  // echo "3";
  // exit;
  $m_title = "hotkeyword1 Manufacturers in targetlocation,hotkeyword2 Suppliers and Exporters in country";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_title)))));

  $m_keyword = "hotkeyword1 Manufacturers,hotkeyword2 Suppliers, hotkeyword1 Manufacturers in targetlocation,hotkeyword2 Suppliers in country, hotkeyword2 Exporters in country,hotkeyword1 in targetlocation, hotkeyword2 in state";

  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('state', Haryana, str_replace('targetlocation', $admin_res[targetlocation], str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_keyword)))))));

  $m_desc = "companyName is leading hotkeyword1 Manufacturers in targetlocation. Premium Quality hotkeyword2 Suppliers, Exporters in country.Get the best quality product at factory price. Call +91-9354441044, ✓Fast Delivery ✓Good Price ✓Premium Quality";


  $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('state', Haryana, str_replace('targetlocation', $admin_res[targetlocation], str_replace('country', $admin_res[country], $m_desc))))))));
} else if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '') {
  // echo "2";
  // exit;
  $m_title = "hotkeyword1 Manufacturers in targetlocation,hotkeyword2 Suppliers and Exporters in country";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_title)))));

  $m_keyword = "hotkeyword1 Manufacturers,hotkeyword2 Suppliers, hotkeyword1 Manufacturers in targetlocation,hotkeyword2 Suppliers in country, hotkeyword2 Exporters in country,hotkeyword1 in targetlocation, hotkeyword2 in targetlocation";
  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2],  str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_keyword)))));

  $m_desc = "companyName is leading hotkeyword1 Manufacturers in targetlocation. Premium Quality hotkeyword2 Suppliers, Exporters in country.Get the best quality product at factory price. Call +91-9354441044, ✓Fast Delivery ✓Good Price ✓Premium Quality";
  $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile], str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_desc)))))));
} else if ($cat_res['keyword1'] != '') {
  // echo "1";
  // exit;
  $m_title = "hotkeyword1 Manufacturers in targetlocation,hotkeyword1 Suppliers and Exporters in country";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_title))));

  $m_keyword = "hotkeyword1 Manufacturers,hotkeyword2 Suppliers, hotkeyword1 Manufacturers in state,hotkeyword2 Suppliers in country, hotkeyword2 Exporters in country,hotkeyword1 in state, hotkeyword2 in state";
  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1],  str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_keyword))));

  $m_desc = "companyName is leading hotkeyword1 Manufacturers in state. Premium Quality hotkeyword2 Suppliers, Exporters in country.Get the best quality product at factory price. Call +91-9354441044, ✓Fast Delivery ✓Good Price ✓Premium Quality";
  $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('companyName', $admin_res[companyName], str_replace('phone', $admin_res[mobile], str_replace('state', Haryana, str_replace('country', $admin_res[country], str_replace('targetlocation', $admin_res[targetlocation], $m_desc))))));
} else {
  // echo "0";
  // exit;
  $page_metatitle = $cat_res['pageTitle'];
  $page_metakey = $cat_res['pageKeywords'];
  $page_metadesc = $cat_res['pageDescription'];
}

$tt = explode(',', $page_metatitle);
$t1 = $tt[0];
$t2 = $tt[1];


$alt = explode(',', $page_metatitle);
$alt2 = $alt[0];
if (mysqli_num_rows($cat_q) > 0) {
?>
<!DOCTYPE html>
<html lang="en" itemscope>

<head itemscope itemtype="http://www.mangla-plastic.webpulse.site/">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- <title><?php echo $page_metatitle; ?></title>
    <meta name=description content="<?php echo $page_metadesc; ?>">
    <meta name=keywords content="<?php echo  $page_metakey; ?>"> -->
    <?php include "top.php"; ?>
    <style>
    .slides {
        width: 50px;
        border: 1px solid #ccc;
        cursor: pointer;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: #fff !important;

    }

    .slides.active {
        border: 1px solid #ed3237;
    }
    </style>
</head>

<body>
    <div class="webpulse-main-wrapper wrapper-wide">
        <!-- <a id="web-pulse-scroll-up" title="Go to Top"><i class="fa fa-angle-up"></i></a> -->
        <?php include "header.php"; ?>
        <div class="clearfix"></div>
        <!-- Heading Banner -->
        <?php
      if ($cat_res['catBanner'] != '') { ?>
        <div class="heading_banner "
            style="background-image:url(<?= SITE_URL_PATH; ?>/uploaded-files/category/banners/<?php echo $cat_res['catBanner']; ?>)">
            <?php } else { ?>
            <div class="heading_banner" style="background-image: url(<?= SITE_URL_PATH; ?>/images/about.jpg)">
                <?php } ?>
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12 text-center">
                            <!-- <h1 class="cat_title"><?php echo $t1; ?></h1> -->
                            <div class="clearfix"></div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- Breadcrumb -->
            <div class="inner_breadcrumb hidden-xs">
                <div class="container">
                    <div class="row">
                        <div class="col-lg-12">
                            <ul class="breadcrumb">
                                <li><a href="<?= SITE_URL_PATH; ?>" title="Home">Home</a></li>
                                <?php if ($num4 > 0) { ?>
                                <li><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($cat_res4['catName']); ?>.htm"
                                        title="<?php echo $cat_res4['catName']; ?> "><?php echo $cat_res4['catName']; ?></a>
                                </li>
                                <?php } ?>
                                <?php if ($num3 > 0) { ?>
                                <li><a href="javascript:void(0)"
                                        title="<?php echo $cat_res3['catName']; ?>"><?php echo $cat_res3['catName']; ?></a>
                                </li>
                                <?php } ?>
                                <?php if ($num2 > 0) { ?>
                                <?php if ($cat_res2['parentID'] == '0') { ?>
                                <li><a href="javascript:void(0)"
                                        title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                                </li>
                                <?php } else { ?>
                                <li><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($cat_res2['catName']); ?>.htm"
                                        title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                                </li>

                                <?php }
                    } ?>
                                <li class="active"><?php echo $cat_res['displayName']; ?></li>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <?php
          if ($cat_res['parentID'] == '0') { ?>
            <section class="about_page webpulse_tm_universal_title_holder">
                <div class="container">
                    <div class="row">
                        <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 col-12">
                            <div class="right_side">
                                <div class="title_holder_inner">
                                    <h1><?php echo $t1; ?></h1>
                                </div>
                                <div class="wps_right">
                                    <div class="product_right_image">
                                        <a href="javascript:void(0);" class="popupEnqBtn" data-bs-toggle="modal"
                                            data-bs-target="#productID"
                                            onclick="$('#catID').val('<?php echo $cat_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $cat_res['catName']; ?>');
                                 $('.catName').html('<?php echo $cat_res['catName']; ?>');  $('.catImg').attr('src',$('.mycatimg_<?php echo $cat_res['catImage']; ?> ').attr('src'));">
                                            <div class="product_dimage">
                                                <div class="detail_image">
                                                    <img class="img-responsive mycatimg_<?php echo $cat_res['catID']; ?>"
                                                        src="<?= getImage($cat_res['catImage'], 400, 400, $cat_res['catName'], "/uploaded-files/category/images/"); ?>"
                                                        alt="<?php echo $alt2; ?>" title="<?php echo $alt2; ?>">
                                                </div>
                                            </div>
                                        </a>
                                        <a class="detail_enq_btn" title="Send Enquiry" data-bs-toggle="modal"
                                            data-bs-target="#productID"
                                            onclick="$('#catID').val('<?php echo $cat_res['catID']; ?>');$('#catName').val('<?php echo $cat_res['catName']; ?>');$('.catName').html('<?php echo $cat_res['catName']; ?>');  $('.catImg').attr('src',$('.mycatimg_<?php echo $cat_res['catImage']; ?> ').attr('src'));$('.catImg').attr('alt','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');">
                                            Get A Quote</a>
                                    </div>
                                    <?php echo html_entity_decode($cat_res['catDesc1']); ?>
                                    <div class="clearfix"></div>
                                    <div class="you_may">You may also like:</div>
                                    <?php

                        while ($sub_res = mysqli_fetch_array($cat_qry)) {
                          if ($sub_res['catImage'] != '') {
                            $img_link = getImage($sub_res[catImage], 366, 214, $sub_res[catName], "/uploaded-files/category/images/");
                            $img_link1 = getImage($sub_res[catImage], 500, 500, $sub_res[catName], "/uploaded-files/category/images/");
                          } else {
                            $img_link = NO_IMG_URL;
                            $img_link1 = NO_IMG_URL;
                          }
                        ?>
                                    <div class="product_listing">
                                        <div class="row">
                                            <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-5 col-12">
                                                <div class="product">
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        title="<?php echo $sub_res['displayName']; ?>">
                                                        <div class="image1">
                                                            <img src="<?= $img_link; ?>"
                                                                alt="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                title="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                class="img-responsive mycatimg_<?php echo $sub_res['catID']; ?>">
                                                        </div>
                                                    </a>
                                                    <p>Interested in this product?</p>
                                                    <a class="read_more_product popupEnqBtn" href="javascript:void(0);"
                                                        data-bs-toggle="modal" data-bs-target="#productID"
                                                        onclick="$('#catID').val('<?php echo $sub_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $sub_res['catName']; ?>');
                                 $('.catName').html('<?php echo $sub_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');"><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" />
                                                        </svg> Get Best Quote</a>
                                                </div>
                                            </div>

                                            <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-7 col-12">
                                                <div class="right-content">
                                                    <h4><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                            title="<?php echo $sub_res['displayName']; ?>"><?php echo $sub_res['displayName']; ?></a>
                                                    </h4>
                                                    <div class="blue-line1"></div>
                                                    <p><?php echo html_entity_decode($sub_res['catDesc']); ?> </p>
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        class="read_more_product" title="">Read More <i
                                                            class="fa-solid fa-arrow-right"></i></a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                        <!-- <?php include 'about-left.php'; ?> -->
                    </div>
                </div>
            </section>
            <!-- Home About -->

            <?php } else {
            if ($cat_res['catImage'] != '') {
              $img_link = getImage($cat_res[catImage], 400, 400, $cat_res[catName], "/uploaded-files/category/images/");
              $img_link1 = getImage($cat_res[catImage], 500, 500, $cat_res[catName], "/uploaded-files/category/images/");
            } else {
              $img_link = NO_IMG_URL;
              $img_link1 = NO_IMG_URL;
            }
          ?>
            <section class="about_page webpulse_tm_universal_title_holder">
                <div class="container">
                    <div class="row">
                        <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12 col-12">
                            <div class="right_side">
                                <div class="title_holder_inner">
                                    <h1><?php echo $t1; ?></h1>
                                </div>
                                <div class="wps_right">
                                    <div class="product_right_image">
                                        <a href="javascript:void(0);" class="popupEnqBtn" data-bs-toggle="modal"
                                            data-bs-target="#productID"
                                            onclick="$('#catID').val('<?php echo $cat_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $cat_res['catName']; ?>');
                                 $('.catName').html('<?php echo $cat_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');">
                                            <div class="product_dimage">
                                                <div class="detail_image">
                                                    <img class="img-responsive mycatimg_<?php echo $cat_res['catID']; ?>"
                                                        src="<?= $img_link; ?>" alt="<?php echo $alt2; ?>"
                                                        title="<?php echo $alt2; ?>">
                                                </div>
                                            </div>
                                        </a>

                                        <a class="detail_enq_btn" title="Send Enquiry" data-bs-toggle="modal"
                                            data-bs-target="#productID"
                                            onclick="$('#catID').val('<?php echo $cat_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $cat_res['catName']; ?>');
                                 $('.catName').html('<?php echo $cat_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');">
                                            Get A Quote</a>
                                    </div>
                                    <?php echo html_entity_decode($cat_res['catDesc1']); ?>

                                    <a class="interestedbtn detail_enq_btn text-center" title="Send Enquiry"
                                        data-bs-toggle="modal" data-bs-target="#productID"
                                        onclick="$('#catID').val('<?php echo $cat_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $cat_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $cat_res['catName']; ?>');
                                 $('.catName').html('<?php echo $cat_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');">
                                        Yes, I am Interested</a>
                                    <div class="clearfix"></div>
                                    <div class="row">
                                        <?php
$sql_pros = mysqli_query($dbcon, "SELECT * FROM product_tbl WHERE prodcut_subcat='$category_id' OR product_subsubcat='$category_id'");
while ($res_pros = mysqli_fetch_array($sql_pros)) {
    // Split all product images (comma separated)
    $all_images = array_filter(array_map('trim', explode(',', $res_pros['product_image'])));
    $main_image = $all_images[0] ?? ''; // Default to first image
?>
                                        <div class="col-lg-12 col-md-12 col-sm-12 col-12">
                                            <div class="product-specification-listing">
                                                <div class="row">
                                                    <!-- Product Image Column -->
                                                    <div class="col-lg-5 col-sm-12">
                                                        <div class="w-100">
                                                            <a href="javascript:void(0);" data-bs-toggle="modal"
                                                                data-bs-target="#productID"
                                                                onclick="$('.catID').val('<?php echo $res_pros['product_id']; ?>');
                                                                        $('.catName').html('<?php echo addslashes($res_pros['product_title']); ?>');
                                                                        $('.catImg').attr('src', $('#myImage<?php echo $res_pros['product_id']; ?>').attr('src'));">

                                                                <div class="spec_thumb">
                                                                    <img id="myImage<?php echo $res_pros['product_id']; ?>"
                                                                        src="<?= getImage($main_image, 400, 234, $res_pros['product_title'], "/uploaded-files/product/images/"); ?>"
                                                                        alt="<?= $res_pros['product_title']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                        class="img-responsive mycatimg_<?php echo $res_pros['product_id']; ?>"
                                                                        title="<?= $res_pros['product_title']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>">
                                                                </div>
                                                            </a>
                                                        </div>

                                                        <!-- Dynamic Thumbnail Slider -->
                                                        <?php if (count($all_images) > 1) { ?>
                                                        <div
                                                            class="slider w-100 d-flex justify-content-center flex-wrap mt-2">
                                                            <?php
                                                                $thumbCount = 1;
                                                                foreach ($all_images as $imgPath) {
                                                                    $thumb_img = getImage($imgPath, 120, 120, $res_pros['product_title'] . $thumbCount, "/uploaded-files/product/images/");
                                                                    $large_img = getImage($imgPath, 400, 234, $res_pros['product_title'] . $thumbCount, "/uploaded-files/product/images/");
                                                                ?>
                                                            <div class="slides p-0 h-auto d-block m-1 bg-dark <?= ($thumbCount == 1 ? 'active' : ''); ?>"
                                                                onclick="imgMulti(<?= $res_pros['product_id']; ?>, '<?= $large_img; ?>', this)">
                                                                <img src="<?= $thumb_img; ?>" class="w-100"
                                                                    alt="<?= $res_pros['product_title']; ?> image <?= $thumbCount; ?>"
                                                                    title="<?= $res_pros['product_title']; ?> image <?= $thumbCount; ?>">
                                                            </div>
                                                            <?php
                                                                $thumbCount++;
                                                            }
                                                            ?>
                                                        </div>
                                                        <?php } ?>
                                                    </div>


                                                   
                                                <div class="col-lg-7 col-sm-12">
                                                    <div class="spec_content">
                                                        <span
                                                            class="title_smalll"><?php echo $res_pros['product_title']; ?></span>
                                                        <div class="content-spec-details">
                                                            <?php echo html_entity_decode($res_pros['product_desc']); ?>



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

                                                        <a class="read_more_product popupEnqBtn" data-bs-toggle="modal"
                                                            data-bs-target="#productID"
                                                            onclick="$('.catID').val('<?php echo $res_pros['product_id']; ?>');$('.catImg').attr('alt','<?php echo $res_pros['product_title']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $res_pros['product_title']; ?> in <?= $admin_res['targetlocation']; ?>');
            $('.catName').html('<?php echo $res_pros['product_title']; ?>'); $('.catImg').attr('src',$('.mycatimg_<?php echo $res_pros['product_id']; ?> ').attr('src'));"
                                                            title="Send Enquiry">Send Enquiry<i
                                                                class="fa fa-envelope"></i></a>



                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <?php } ?>
                                </div>
                                <div class="clearfix"></div>
                                <div class="you_may">You may also like:</div>
                                <div id="prodListingContainer">

                                    <?php
                          if (mysqli_num_rows($cat_qry) > 0) {
                            while ($sub_res = mysqli_fetch_array($cat_qry)) {
                              if ($sub_res['catImage'] != '') {
                                $img_link = getImage($sub_res[catImage], 366, 214, $sub_res[catName], "/uploaded-files/category/images/");
                                $img_link1 = getImage($sub_res[catImage], 500, 500, $sub_res[catName], "/uploaded-files/category/images/");
                              } else {
                                $img_link = NO_IMG_URL;
                                $img_link1 = NO_IMG_URL;
                              }
                          ?>
                                    <div class="product_listing">
                                        <div class="row">
                                            <div class="col-xxl-5 col-xl-5 col-lg-5 col-md-5 col-sm-5 col-12">
                                                <div class="product">
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        title="<?php echo $sub_res['displayName']; ?>">
                                                        <div class="image1">
                                                            <img src="<?= $img_link; ?>"
                                                                alt="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                title="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                class="img-responsive mycatimg_<?php echo $sub_res['catID']; ?>">
                                                        </div>
                                                    </a>
                                                    <p>Interested in this product?</p>
                                                    <a class="read_more_product popupEnqBtn" href="javascript:void(0);"
                                                        data-bs-toggle="modal" data-bs-target="#productID"
                                                        onclick="$('#catID').val('<?php echo $sub_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $sub_res['catName']; ?>');
                                 $('.catName').html('<?php echo $sub_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');"><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" />
                                                        </svg> Get Best Quote</a>
                                                </div>
                                            </div>

                                            <div class="col-xxl-7 col-xl-7 col-lg-7 col-md-7 col-sm-7 col-12">
                                                <div class="right-content">
                                                    <h4><a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                            title="<?php echo $sub_res['displayName']; ?> in <?= $admin_res['targetlocation']; ?>"><?php echo $sub_res['displayName']; ?></a>
                                                    </h4>
                                                    <div class="blue-line1"></div>
                                                    <p> <?php echo html_entity_decode($sub_res['catDesc']); ?> </p>
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        class="read_more_product" title="">Read More <i
                                                            class="fa-solid fa-arrow-right"></i></a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <?php } ?>
                                    <?php  } else {
                            $category_id = $cat_res['catID'];
                            $cat_final = mysqli_query($dbcon, "select * from category_tbl where parentID='$parent' and status='Y' and catID!='$category_id' order by catOrder Asc");

                            while ($sub_res = mysqli_fetch_array($cat_final)) {
                              if ($sub_res['catImage'] != '') {
                                $img_link = getImage($sub_res[catImage], 324, 324, $sub_res[catName], "/uploaded-files/category/images/");
                                $img_link1 = getImage($sub_res[catImage], 500, 500, $sub_res[catName], "/uploaded-files/category/images/");
                              } else {
                                $img_link = NO_IMG_URL;
                                $img_link1 = NO_IMG_URL;
                              }
                            ?>

                                    <div class="product_listing listpager" style="opacity: 1;">
                                        <div class="row">
                                            <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-4 col-sm-4 col-xs-12 col-12">
                                                <div class="product">
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        title="<?php echo $sub_res['displayName']; ?>">
                                                        <div class="image1">
                                                            <img src="<?= $img_link; ?>"
                                                                alt="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                title="<?php echo $sub_res['displayName']; ?> Manufacturers in <?= $admin_res['targetlocation']; ?>"
                                                                class="img-responsive mycatimg_<?php echo $sub_res['catID']; ?>">
                                                        </div>
                                                    </a>
                                                </div>
                                            </div>
                                            <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-8 col-sm-8 col-xs-12 col-12">
                                                <div class="right-content">
                                                    <h4 class="title_h3">
                                                        <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                            title="<?php echo $sub_res['displayName']; ?>"><?php echo $sub_res['displayName']; ?></a>
                                                    </h4>
                                                    <div class="blue-line1"></div>
                                                    <?php echo html_entity_decode($sub_res['catDesc']); ?>
                                                    <a href="<?= SITE_URL_PATH; ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                        class="read_more_product" title="Read More">Read More <i
                                                            class="fa-solid fa-arrow-right"></i></a>
                                                    <a class="read_more_product popupEnqBtn" data-bs-toggle="modal"
                                                        data-bs-target="#productID"
                                                        onclick="$('#catID').val('<?php echo $sub_res['catID']; ?>');$('.catImg').attr('alt','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');$('.catImg').attr('title','<?php echo $sub_res['catName']; ?> in <?= $admin_res['targetlocation']; ?>');
                                 $('#catName').val('<?php echo $sub_res['catName']; ?>');
                                 $('.catName').html('<?php echo $sub_res['catName']; ?>');  $('.catImg').attr('src','<?= $img_link1; ?>');"
                                                        title="Get A Quote">Get A Quote</a>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <?php }
                          } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!-- <?php include 'about-left.php'; ?> -->
                </div>
        </div>

        </section>

        <?php } ?>
        <?php include "award_video.php"; ?>
        <!-- Footer -->
        <?php include "footer.php"; ?>
    </div>
    <?php include "bottom.php"; ?>
    <script>
    function imgMulti(id, url, elm) {
        document.getElementById(`myImage${id}`).src = url;
        $(elm).addClass('active').siblings().removeClass('active');
    }
    </script>
</body>

</html>
<?php
} else {
  echo "<script>window.location='https://www.manglaplastic.com'</script>";
  exit;
}
?>