/
var
/
www
/
html
/
stengineers
/
Upload FileeE
HOME
<?php header('Access-Control-Allow-Origin: *'); require_once 'admin/dbconnection.php'; error_reporting(0); $url = $_GET['urls']; $categoryurl = $_GET['categoryurl']; $row1 = mysqli_query($con, "select * from category where url='$url'"); $row2 = mysqli_fetch_array($row1); // print_r($row2);exit; $id = $row2['id']; $category_name = $row2['category_name']; $description = $row2['description']; $thumb_img = $row2['thumb_img']; $catgory_type = $row2['category_type']; $parent_categoryid = $row2['parent_categoryid']; $status = $row2['status']; $meta_title = $row2['meta_title']; $metadescription = $row2['meta_description']; $h1_title = $row2['h1_title']; if($meta_title=="") { $pagetitle = "ST Engineers | $category_name"; } else { $pagetitle = $meta_title; } if($h1_title=="") { $h1tag = "$category_name"; } else { $h1tag = $h1_title; } require 'header.php'; ?> <!--Start Page Header--> <section class="product-banner"> <div class="d-flex flex-column align-items-center "> <div class="page-header__inner text-center"> <h1><?php echo "$h1tag" ?></h1> </div> </div> </section> <!--End Page Header--> <!--Product Section Start--> <section class="machines-sec "> <div class="container-fluid"> <div class="row"> <ol class="breadcrumb"> <li><a href="<?php echo $baseUrl; ?>products.php">Products</a></li> <li class="current"><?php echo ucwords($category_name); ?></li> </ol> </div> <div class="row col-xl-8 col-lg-10 mx-auto"> <p><?php echo "$description" ?> </p> </div> <div class="product-tab"> <div class="spacer"></div> <?php $result = $con->query("SELECT * FROM category WHERE Parent_categoryid=$id AND status='active' ORDER BY id ASC"); // Set the default active button ID while ($row = $result->fetch_assoc()) { $categoryId = $row['id']; $category_name = $row['category_name']; $categoryurl = $row['url']; echo "<div id='parent'> <h5>$category_name</h5> <div class='spacer'></div>"; // Nested query to fetch products based on the current category $productQuery = $con->query("SELECT * FROM products WHERE sub_category='$categoryId' and status='active' order by display_order asc limit 4"); while ($productRow = $productQuery->fetch_assoc()) { $productName = $productRow['product_title']; $machineImg = $productRow['preview_image']; $brandproID = $productRow['brandid']; $slug = $productRow['slug']; // Display product information within the existing tab-box structure echo "<div class='tab-box $brandproID'> <a href='" . $baseUrl . "product/$slug'> <img src='" . $imageUrl . "machines/machine-bg.png' class='machine-bg'> <img src='{$machineImg}' class='position-relative img-fluid img-shadow'> <h6>$productName</h6> </a> </div>"; } echo "<div class='line-btn'> <img src='" . $imageUrl . "machines/line.png' class='line-img'><a class='tab-btn1 shadow-pulse' href='" . $baseUrl . "subcategory/{$categoryurl}'>Know More<img src='" . $imageUrl . "home/btn-arrow.png' alt='' class='arrow-img1'></a> </div>"; echo "<div class='spacer'></div> </div>"; } ?> </div> </div> </div> </section> <!--Product Section End--> <?php require 'footer.php';?>