<?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 = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
$ee = explode('/', $actual_link);
$loc_url = $ee[3];
$cat_url = $_REQUEST['pid'];
$cats = ucwords(str_replace("-", " ", $_REQUEST['pid']));
$cat_s = "select catName, catID from category_tbl where catName='$cats' or catUrl='$cat_url'";
$cat_q = mysqli_query($GLOBALS['dbconn'], $cat_s);

// if (mysqli_num_rows($cat_q) > 0) {
// } else {
//   header("Location: " . site_url);
//   exit;
// }
$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 catImage, catName, displayName, catDesc, catID, catDesc1, parentID,headingone,catUrl from category_tbl where parentID='$category_id' and status='Y'";
$cat_qry = mysqli_query($GLOBALS['dbconn'], $cat_sql);
$cccnum = mysqli_num_rows($cat_qry);
$cat_sql1 = "select catName, displayName, catID, parentID,catImage,catDesc1,catBanner,keyword1,keyword2,keyword3,catHeading1, catHeading2,alt,pageTitle,pageKeywords,pageDescription,multi_image,catDesc2 from category_tbl where catID='$category_id'";
$cat_qry1 = mysqli_query($GLOBALS['dbconn'], $cat_sql1);
$cat_res = mysqli_fetch_array($cat_qry1);
$pageTitles = $cat_res['catName'];
$disTitles = $cat_res['displayName'];

$parent = $cat_res['parentID'];
$cat_sql2 = "select catName, displayName, catID, parentID from category_tbl where catID='$parent'";
$cat_qry2 = mysqli_query($GLOBALS['dbconn'], $cat_sql2);
$num2 = mysqli_num_rows($cat_qry2);
$cat_res2 = mysqli_fetch_array($cat_qry2);
$mparent = $cat_res2['parentID'];
$cat_sql3 = "select catName, displayName, catID, parentID from category_tbl where catID='$mparent'";
$cat_qry3 = mysqli_query($GLOBALS['dbconn'], $cat_sql3);
$num3 = mysqli_num_rows($cat_qry3);
$cat_res3 = mysqli_fetch_array($cat_qry3);
$mmparent = $cat_res3['parentID'];
$cat_sql4 = "select catName, displayName, catID, parentID from category_tbl where catID='$mmparent'";
$cat_qry4 = mysqli_query($GLOBALS['dbconn'], $cat_sql4);
$num4 = mysqli_num_rows($cat_qry4);
$cat_res4 = mysqli_fetch_array($cat_qry4);
$mobile = $admin_res['mobile'];
$city = $admin_res['city'];
$state = $admin_res['state'];
$country = $admin_res['country'];
$companyName = $admin_res['companyName'];
$address = $admin_res['address'];
$multi_image = explode(',', $cat_res['multi_image']);

if ($cat_res['catImage'] != '') {
  $imglink = getImage($cat_res[catImage], 420, 630, $cat_res[catName], "/uploaded-files/category/images/");
} else {
  $imglink = getImage("noimage.jpg", 420, 630, "noimages", "/uploaded-files/category/images/");
}
$loc_sql = mysqli_query($GLOBALS['dbconn'], "select locationID,locationName,loc_url from location_tbl where loc_url='$loc_url' and status='Y'");
$location = mysqli_fetch_array($loc_sql);
$locationName = $location['locationName'];
$location_id = $location['locationID'];
$category_sub_general = mysqli_query($dbconn, "select location_ids,meta_title,headingone,meta_keyword,meta_description,description,short_description,subheadingtwo,description2 from location_content_tbl where category_id='$category_id' AND location_id='0'");
$content_count = mysqli_num_rows($category_sub_general);
if ($content_count > 0) {
  while ($categorysubdomain = mysqli_fetch_array($category_sub_general)) {
    $locati = explode(",", $categorysubdomain['location_ids']);
    if (in_array($location_id, $locati)) {
      if ($categorysubdomain['meta_title'] != '') {
        $page_metatitle = $categorysubdomain['meta_title'];
      }
      if ($categorysubdomain['meta_keyword'] != '') {
        $page_metakey = $categorysubdomain['meta_keyword'];
      }
      if ($categorysubdomain['meta_description']) {
        $page_metadesc = $categorysubdomain['meta_description'];
      }
      $page_desc = $categorysubdomain['description']; 
     $page_desc2 = $categorysubdomain['description2'];
     $heading11 = $categorysubdomain['headingone'];
    }
  }
  //    specific location content
}

if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '' && $cat_res['keyword3'] != '') {
  $m_title = "hotkeyword1 in location, hotkeyword2 in location";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('location', $locationName, $m_title)));
  $m_keyword = "hotkeyword1 in location, hotkeyword2 in location, hotkeyword3 in location, hotkeyword1, hotkeyword2, hotkeyword3";
  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('location', $locationName, $m_keyword))));
  $meta_des = "companyName leading hotkeyword1 in location, Since 2023. Premium Quality hotkeyword2 in location, Get latest factory price for hotkeyword3. ✓Fast Delivery ✓Good Price ✓Premium Quality";
  $page_metadesc = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('hotkeyword3', $cat_res[keyword3], str_replace('companyName', $admin_res['companyName'], str_replace('phone', $admin_res['mobile_meta'], str_replace('location', $locationName, $meta_des))))));
} else if ($cat_res['keyword1'] != '' && $cat_res['keyword2'] != '') {
  $m_title = "hotkeyword1 in location, hotkeyword2 in location";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('location', $locationName, $m_title)));
  $m_keyword = "hotkeyword1 in location, hotkeyword2 in location, , hotkeyword1, hotkeyword2";
  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('hotkeyword2', $cat_res[keyword2], str_replace('location', $locationName, $m_keyword)));
  $meta_des = "companyName leading hotkeyword1 in location, since 2023. Premium Quality hotkeyword2 in location, Get latest factory price for hotkeyword1. ✓Fast Delivery ✓Good Price";
  $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_meta'], str_replace('location', $locationName, $meta_des)))));
} else if ($cat_res['keyword1'] != '') {
  $m_title = "hotkeyword1 in location, hotkeyword1 in location";
  $page_metatitle = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('location', $locationName, $m_title));
  $m_keyword = "hotkeyword1 in location, hotkeyword1";
  $page_metakey = str_replace('hotkeyword1', $cat_res[keyword1], str_replace('location', $locationName, $m_keyword));
  $meta_des = "companyName leading hotkeyword1 in location, Since 2023. Premium Quality hotkeyword1 in locationh, Get latest factory price for hotkeyword1. ✓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_meta'], str_replace('location', $locationName, $meta_des))));
} else {
  $page_metatitle = $page_metatitle;
  $page_metakey = $page_metakey;
  $page_metadesc = $page_metadesc;
}
$page_desc = str_replace('countryname', $locationName, $page_desc);
$page_desc = str_replace('catname', $pid, $page_desc);
$page_desc = str_replace('{location}', $locationName, $page_desc);
$page_desc = str_ireplace('{companyName}', $admin_res['companyName'], $page_desc);
// for second description 
$page_desc2 = str_replace('countryname', $locationName, $page_desc2);
$page_desc2 = str_replace('catname', $pid, $page_desc2);
$page_desc2 = str_replace('{location}', $locationName, $page_desc2);
$page_desc2 = str_ireplace('{companyName}', $admin_res['companyName'], $page_desc2);
// meta keywords 
$page_metatitle = str_replace('countryname', $locationName, $page_metatitle);
$page_metatitle = str_replace('catname', $pid, $page_metatitle);
$page_metatitle = str_replace('{location}', $locationName, $page_metatitle);
$page_metakey = str_replace('countryname', $locationName, $page_metakey);
$page_metakey = str_replace('catname', $pid, $page_metakey);
$page_metakey = str_replace('{location}', $locationName, $page_metakey);
$page_metadesc = str_replace('countryname', $locationName, $page_metadesc);
$page_metadesc = str_replace('catname', $pid, $page_metadesc);
$page_metadesc = str_replace('{location}', $locationName, $page_metadesc);
// if location not checked in admin 
$category_sub_uncheck_loc = mysqli_query($GLOBALS['dbconn'], "select description,subheadingtwo,short_description,description2 from location_content_tbl where category_id='$category_id' AND location_id='0'");
$category_sub_uncheck_res = mysqli_fetch_array($category_sub_uncheck_loc);
// For description 1 (uncheck location)
$page_descUncheck = $category_sub_uncheck_res['description'];
$page_descUncheck = str_replace('{location}', $locationName,  $page_descUncheck);
$page_descUncheck = str_ireplace('{companyName}', $admin_res['companyName'], $page_descUncheck);
// For description 2 (uncheck location)
$page_desc2Uncheck = $category_sub_uncheck_res['description'];
$page_desc2Uncheck = str_replace('{location}', $locationName,  $page_desc2Uncheck);
$page_desc2Uncheck = str_ireplace('{companyName}', $admin_res['companyName'], $page_desc2Uncheck);
$page_desc = $page_desc != '' ? $page_desc : $page_descUncheck;
$page_desc2 = $page_desc2 != '' ? $page_desc2 : $page_desc2Uncheck;


if ($cat_res['catHeading1'] != '') {
  $heading1 = $cat_res['catHeading1'] . ' in ' . $locationName;
} else {
  $heading1 = $disTitles . ' in ' . $locationName;
}

if($heading11!=''){
  $h11=$heading11.' in '.$locationName;;
}else{
$h11= $disTitles.' in '.$locationName;
}



if ($cat_res['catHeading2'] != '') {
  $heading2 = $cat_res['catHeading2'] . ' in ' . $locationName;
} else {
  $heading2 = $disTitles . ' in ' . $locationName;
}

if ($cat_res['alt'] != '') {
  $alttag = $cat_res['alt'] . ' in ' . $locationName;
} else {
  $alttag = $heading11 . ' in ' . $locationName;
}
if (mysqli_num_rows($loc_sql) > 0) {
} else {
  header("Location: " . site_url);
  exit;
}
$video_sql = mysqli_query($dbconn, "select * from video_tbl  limit 0,2");
?>


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

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

<body>

    <div class="header2">
        <?php include "app_header_sub.php"; ?>
    </div>

    <section class="heading_banner" style="background-image: url(<?= site_url; ?>/designer/images/aboutsbanner.jpg)">
        <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 text-center">
                    <h1 class="cat_title"><?= $h11; ?></h1>
                    <div class="clearfix"></div>
                    <!-- <div class="cat_title2">We Are Available For You</div> -->
                </div>
            </div>
        </div>
    </section>

    <div class="inner_breadcrumb hidden_xs">
        <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">
                    <ul class="breadcrumb">
                        <li><a href="<?= site_url; ?>" title="Home">Home</a></li>
                        <?php if ($num4 > 0) { ?>
                        <li>
                            <a href="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= 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="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= getValidFileName($cat_res3['catName']); ?>.htm"
                                title="<?php echo $cat_res3['catName']; ?>"><?php echo $cat_res3['catName']; ?></a>
                        </li>
                        <?php } ?>

                        <?php if ($num2 > 0) { ?>
                        <?php if ($cat_res2['catID'] == '0') { ?>
                        <li>
                            <a href="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= getValidFileName($cat_res2['catName']); ?>.htm"
                                title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                        </li>
                        <?php } else {  ?>

                        <li>
                            <a href="javascript:void(0);"
                                title="<?php echo $cat_res2['catName']; ?>"><?php echo $cat_res2['catName']; ?></a>
                        </li>
                        <?php  }
        } ?>
                        <li class="active"><?php echo $cat_res['catName']; ?> </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <section class="category_page">
        <div class="container">
            <!-- <h2 class="title_21 h2_title  aboutTitle"><?= $heading2; ?></h2> -->

            <!-- <h2 class="title_1">Category Details</h2> -->
            <div class="clearfix"></div>
            <div class="row">
                <div class="col-xxl-12 col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                    <div class="wps_right">
                        <div class="product_right_image">
                            <div class="more_images">
                                <div class="single_image">
                                    <a href="javascript:void(0);" data-bs-toggle="modal" data-bs-target="#productID"
                                        onclick="$('.catID').val('<?php echo $cat_res['catID']; ?>');  
                                                $('.catName').html('<?php echo $cat_res['catName']; ?>'); 
                                                $('.catImg').attr('src','<?= $imglink; ?>');  
                                                $('.catImg').attr('alt','<?= $alttag; ?>'); 
                                                $('.catImg').attr('title','<?= $alttag; ?>');">
                                        <img id="largeImage" src="<?= $imglink; ?>" alt="<?= $alttag; ?>"
                                            title="<?= $alttag; ?>">
                                    </a>
                                </div>

                            </div>
                            <a class="read_more" href="javascript:void(0);" data-bs-toggle="modal"
                                data-bs-target="#productID" onclick="$('.catID').val('<?php echo $cat_res['catID']; ?>');  
                                            $('.catName').html('<?php echo $cat_res['catName']; ?>'); 
                                            $('.catImg').attr('src','<?= $imglink; ?>');  
                                            $('.catImg').attr('alt','<?= $alttag; ?>'); 
                                            $('.catImg').attr('title','<?= $alttag; ?>');" title="Get Best Quote">
                                <span>
                                    <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> Get Best Quote</span></a>
                        </div>
                        <?php echo html_entity_decode($page_desc); ?>


                    </div>

                </div>

            </div>


            <div class="row g-4">
                <?php $gallery_122 = mysqli_query($GLOBALS['dbconn'], "select * from gallery_tbl where FIND_IN_SET('" . $cat_res['catID'] . "',	gallery_cat) order by id ASC ");
    
                  while ($gallery_res1 = mysqli_fetch_assoc($gallery_122)) {
                      $galImg = getImage($gallery_res1[gallery_image], 500, 500, $gallery_res1[gallery_title] . $gallery_res1[id], "/uploaded-files/catgallery/");
                      $galImg1 = getImage($gallery_res1[gallery_image], 500, 500, $gallery_res1[galery_title] . $gallery_res1[id], "/uploaded-files/catgallery/");
                  ?>
                <div class="col-lg-4 col-6">
                    <div class="gallery_item">
                        <a class="hover_effect h_yellow" data-fancybox="photo-gallery" href="<?=$galImg1;?>"
                            title="<?=$gallery_res1['gallery_title'];?>">
                            <img src="<?=$galImg;?>" alt="<?=$gallery_res1['gallery_title'];?> in <?=$locationName;?>"
                                title="<?=$gallery_res1['gallery_title'];?> in <?=$locationName;?>">
                        </a>
                        <!-- <div class="gallery_item_info d-none">
                            <span>Photo Title Here</span>
                        </div> -->
                    </div>
                </div>
                <?php } ?>


            </div>
            <div class="clientSection  py-4 pb-3">
                <div class="container1">
                    <div class="title_21 h2_title text-start  aboutTitle">Our <span>Latest Videos</span></div>
                    <p class="text-start mb-4">Explore our latest videos for an inside look at our cutting-edge work.
                        From intricate metal fabrication to stunning event setups and mechanical installations, these
                        videos
                        highlight the precision, creativity, and dedication we bring to every project. See firsthand how
                        our team
                        transforms ideas into tangible results, delivering top-tier solutions with expertise and
                        innovation.</p>

                    <div class="row g-4">

                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/nE2GiDdpl5Q" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay1.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">Event Fabrication</div>
                            </a>
                        </div>
                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/0Wv93pjct8I" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay2.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">Event Fabrication</div>
                            </a>
                        </div>
                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/4bClCGxbo0s" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay3.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">Event Fabrication</div>
                            </a>
                        </div>
                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/5TC8SupVvwo" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay4.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">CNC Machine</div>
                            </a>
                        </div>
                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/y24wLMPZQTk" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay5.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">CNC Work</div>
                            </a>
                        </div>
                        <div class="col-lg-2 col-md-3 col-6">
                            <a href="https://www.youtube.com/embed/E7LMJAGjAZM" target="_blank" title="Youtube"
                                data-fancybox="" class="vid-bx">
                                <video autoplay="" muted="" loop="">
                                    <source src="<?=site_url;?>/designer/images/videoplay6.mp4" type="video/mp4">
                                </video>
                                <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
                                    class="bi bi-play-fill" viewBox="0 0 16 16">
                                    <path
                                        d="m11.596 8.697-6.363 3.692c-.54.313-1.233-.066-1.233-.697V4.308c0-.63.692-1.01 1.233-.696l6.363 3.692a.802.802 0 0 1 0 1.393">
                                    </path>
                                </svg>
                                <div class="tt">Event Fabrication</div>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
            <div class="you_may">Explore Our Services</div>
            <div class="allListing w-100 float-start">
                <div class="row">
                    <?php
                    if (mysqli_num_rows($cat_qry) > 1) {
                      $subcat_sql = $cat_qry;
                    } else {

                      $subcat_sql = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, parentID from category_tbl where parentID ='$parent' and status='Y' and catID!='$category_id' order by catOrder Asc");
                    }
                    if (mysqli_num_rows($subcat_sql) < 2) {
                      $subcat_sql = mysqli_query($GLOBALS['dbconn'], "select catImage, catName, displayName, catDesc, catID, catDesc1, parentID from category_tbl where parentID ='0' and status='Y' and catID!='$category_id' order by catOrder Asc");
                    }
                    while ($sub_res = mysqli_fetch_array($subcat_sql)) {

                      if ($sub_res['catImage'] != '') {
                        $img_link = getImage($sub_res[catImage], 500, 500, $sub_res[catName], "/uploaded-files/category/images/");
                        $img_link1 = getImage($sub_res[catImage], 437, 437, $sub_res[catName], "/uploaded-files/category/images/");
                      } else {
                        $img_link = getImage("noimage.jpg",  500, 500, "noimages", "/uploaded-files/category/images/");
                        $img_link1 = getImage("noimage.jpg", 437, 437, "noimages", "/uploaded-files/category/images/");
                      }
                      // echo $sub_res['catDesc'];
                      $sub_desc = $sub_res['catDesc'];
                      $sub_desc = str_ireplace('{companyName}', $admin_res['companyName'], $sub_desc);
                    ?>
                    <div class="col-lg-12 col-md-12">
                        <div class="product_listing">
                            <div class="row">
                                <div class="col-xxl-4 col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12">
                                    <div class="product">
                                        <a href="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                            onclick="$('.catID').val('<?php echo $sub_res['catID']; ?>');
                                                 $('.catName').html('<?php echo $sub_res['catName']; ?>');
                                                 $('.catImg').attr('src','<?= $img_link1; ?>'); 
                                                 $('.catImg').attr('alt','<?= $sub_res['displayName']; ?> in <?=$locationName;?>'); 
                                                 $('.catImg').attr('title','<?= $sub_res['displayName']; ?> in <?=$locationName;?>');"
                                            title="<?= $sub_res['displayName']; ?> in <?=$locationName;?>">
                                            <div class="image<?php echo $sub_res['catID']; ?>">
                                                <img src="<?= $img_link; ?>"
                                                    alt="<?= $sub_res['displayName']; ?> in <?=$locationName;?>"
                                                    title="<?= $sub_res['displayName']; ?> in <?=$locationName;?>">
                                            </div>
                                        </a>
                                    </div>
                                </div>
                                <div class="col-xxl-8 col-xl-8 col-lg-8 col-md-12 col-sm-12 col-12">
                                    <div class="right-content">
                                        <h4 class="title4"><a
                                                href="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                title="<?= $sub_res['displayName']; ?> in <?=$locationName;?>"><?= $sub_res['displayName']; ?> in <?=$locationName;?></a>
                    </h4>
                                        <div class="blue-line1"></div>
                                        <div class="more_info h-auto mb-0">
                                            <p><?= substr($sub_desc, 0, 3000); ?></p>
                                        </div>
                                        <div class="clearfix"></div>
                                        <div class="d-flex">
                                            <a class="read_more mx-1" href="javascript:void(0);" data-bs-toggle="modal"
                                                data-bs-target="#productID"
                                                onclick="$('.catID').val('<?php echo $sub_res['catID']; ?>');
                                                         $('.catName').html('<?php echo $sub_res['catName']; ?>');
                                                         $('.catImg').attr('src','<?= $img_link1; ?>'); 
                                                         $('.catImg').attr('alt','<?= $sub_res['displayName']; ?> in <?=$locationName;?>'); 
                                                         $('.catImg').attr('title','<?= $sub_res['displayName']; ?> in <?=$locationName;?>');"
                                                title="Enquiry Now">
                                                <span> Enquiry Now</span></a>
                                            <a href="<?= site_url; ?>/<?= getValidFileName($loc_url); ?>/<?= getValidFileName($sub_res['catName']); ?>.htm"
                                                title="Read More" class="read_more callback mx-1">
                                                <span> Read More</span></a>

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


                </div>




            </div>

        </div>
    </section>
    <!-- <div class="video-section">
        <?//php include "app_video.php"; ?>
    </div> -->
    <?//php include "app_faq.php"; ?>
    <?php include "app_footer_sub.php"; ?>
    <?php include "app_bottom.php"; ?>
    <script>
    function imgMulti(id, url, elm) {
        document.getElementById(`mainImage${id}`).src = url;
        $(elm).addClass('active').siblings().removeClass('active');
    }
    </script>
</body>

</html>