📁 File Manager
Editing:
/home/wedigitalindia/public_html/jaybalajiassociates.com/product-detail.php
<?php ob_start(); include_once('include/header.php'); $segments = explode('/', trim(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH), '/')); $productSlug = $segments[count($segments) - 1] ?? null; $product = null; $category = null; if ($productSlug) { // Fetch product + category $stmt = $con->prepare(" SELECT p.*, c.name AS category_name, c.slug AS category_slug FROM products p INNER JOIN top_categories c ON c.id = p.top_category_id WHERE p.slug = ? LIMIT 1 "); $stmt->bind_param("s", $productSlug); $stmt->execute(); $product = $stmt->get_result()->fetch_assoc(); } // 404 if product not found if (!$product) { ob_clean(); include '404.php'; exit; } // Decode gallery images $galleryImages = []; if (!empty($product['product_images'])) { $galleryImages = json_decode($product['product_images'], true) ?? []; } ob_end_flush(); ?> <style> .product-main-img { width: 100%; height: 420px; object-fit: cover; border-radius: 12px; } .product-gallery { display: flex; gap: 10px; flex-wrap: wrap; } .gallery-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 1px solid #ddd; } </style> <div class="page-header parallaxie"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="page-header-box"> <h1 class="text-anime"> <?php echo htmlspecialchars($product['product_name']); ?> </h1> <nav class="wow fadeInUp" data-wow-delay="0.25s"> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="<?php path() ?>">Home ></a></li> <li class="breadcrumb-item"> <a href="<?php echo htmlspecialchars($product['category_slug']); ?>"> <?php echo htmlspecialchars($product['product_name']); ?> </a> </li> </ol> </nav> </div> </div> </div> </div> </div> <div class="container py-5"> <div class="row"> <!-- Images --> <div class="col-lg-5 mb-4"> <img src="<?php path(); ?>admin/assets/images/products/<?php echo $product['product_main_image']; ?>" class="img-fluid product-main-img mb-3" alt="<?php echo htmlspecialchars($product['product_name']); ?>"> <?php if (!empty($galleryImages)): ?> <div class="product-gallery"> <?php foreach ($galleryImages as $img): ?> <img src="<?php path(); ?>admin/assets/images/products/<?php echo htmlspecialchars($img); ?>" class="gallery-thumb" alt="<?php echo htmlspecialchars($product['product_name']); ?>"> <?php endforeach; ?> </div> <?php endif; ?> </div> <!-- Product Info --> <div class="col-lg-7"> <h2><?php echo htmlspecialchars($product['product_name']); ?></h2> <?php if (!empty($product['product_short_desc'])): ?> <?php echo html_entity_decode($product['product_short_desc']); ?> <?php endif; ?> </div> </div> </div> <div class="container pb-5"> <?php if (!empty($product['description'])): ?> <div class="tab-pane fade show active" id="desc"> <?php echo html_entity_decode($product['description']); ?> </div> <?php endif; ?> </div> </div> <!-- Single Service Page Start --> <div class="container"> <div class="row"> <div class="col-md-12 mb-4"> <!-- Service Benifits Start --> <div class="service-benefits"> <div class="row"> <div class="col-md-12"> <div class="service-benefits-title"> <h2 class="text-anime">Benefits of Solar Energy</h2> </div> </div> </div> <div class="row"> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-1.svg" alt="Renewable Solar Energy"> </div> <h3>Renewable Energy</h3> <p>Solar energy is a clean and renewable power source that reduces carbon emissions and supports a sustainable environment.</p> </div> </div> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-2.svg" alt="Solar Energy Saving"> </div> <h3>Energy Saving</h3> <p>Generate free electricity from sunlight and reduce your power bills by up to 70–90% over time.</p> </div> </div> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-3.svg" alt="Easy Solar Installation"> </div> <h3>Easy Installation</h3> <p>Modern solar systems are easy to install with minimal disruption and quick setup by experts.</p> </div> </div> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-4.svg" alt="Smart Solar Solution"> </div> <h3>Smart Energy Solution</h3> <p>Solar provides a long-term energy solution for homes, businesses, and industries with reliable output.</p> </div> </div> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-5.svg" alt="Solar Technical Support"> </div> <h3>Technical Support</h3> <p>Get complete support including system monitoring, troubleshooting, and performance optimization.</p> </div> </div> <div class="col-lg-4 col-md-6"> <div class="benefits-item"> <div class="icon-box"> <img src="<?php path() ?>images/icon-benefits-6.svg" alt="Solar Maintenance Service"> </div> <h3>Solar Maintenance</h3> <p>Regular cleaning and inspection ensure maximum efficiency and long life of your solar system.</p> </div> </div> </div> </div> <!-- Service Benifits End --> </div> </div> </div> <!-- Single Service Page End --> <div class="container"> <div class="row py-5"> <div class="col-md-6 faq-box"> <h2 class="text-anime">Frequently Asked Questions</h2> <div class="faq-accordion"> <div class="accordion" id="faq_accordion"> <div class="accordion-item"> <h2 class="accordion-header" id="heading1"> <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse1" aria-expanded="true" aria-controls="collapse1"> What is Renewable Energy and How Does Solar Work? </button> </h2> <div id="collapse1" class="accordion-collapse collapse show" aria-labelledby="heading1" data-bs-parent="#faq_accordion"> <div class="accordion-body"> <p>Renewable energy comes from natural sources like sunlight. Solar panels convert sunlight into electricity, reducing dependency on fossil fuels.</p> </div> </div> </div> <div class="accordion-item"> <h2 class="accordion-header" id="heading2"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse2" aria-expanded="false" aria-controls="collapse2"> Is Solar Energy Suitable for Homes and Businesses? </button> </h2> <div id="collapse2" class="accordion-collapse collapse" aria-labelledby="heading2" data-bs-parent="#faq_accordion"> <div class="accordion-body"> <p>Yes, solar energy is ideal for homes, shops, offices, factories, hospitals, and institutions.</p> </div> </div> </div> <div class="accordion-item"> <h2 class="accordion-header" id="heading3"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse3" aria-expanded="false" aria-controls="collapse3"> How Long Does a Solar Power System Last? </button> </h2> <div id="collapse3" class="accordion-collapse collapse" aria-labelledby="heading3" data-bs-parent="#faq_accordion"> <div class="accordion-body"> <p>Solar panels typically last 20–25 years with minimal maintenance and consistent performance.</p> </div> </div> </div> <div class="accordion-item"> <h2 class="accordion-header" id="heading4"> <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapse4" aria-expanded="false" aria-controls="collapse4"> Does a Solar System Require Regular Maintenance? </button> </h2> <div id="collapse4" class="accordion-collapse collapse" aria-labelledby="heading4" data-bs-parent="#faq_accordion"> <div class="accordion-body"> <p>Solar systems need very little maintenance, mainly panel cleaning and periodic system checks.</p> </div> </div> </div> </div> </div> </div> <div class="col-md-6 mx-auto mb-4"> <h2 class="text-anime">Book a FREE Solar Consultation</h2> <div class="service-sidebar"> <div class="card consult-card p-4"> <form id="contactForm" action="#" method="POST" data-toggle="validator"> <div class="row"> <!-- Name --> <div class="form-group col-md-6 mb-4"> <input type="text" name="name" class="form-control" id="name" placeholder="Full Name" onkeydown="return nameKeyValidation(event)" onpaste="return false" required> <div class="help-block with-errors"></div> </div> <!-- Email --> <div class="form-group col-md-6 mb-4"> <input type="email" name="email" class="form-control" id="email" placeholder="Email Address" required> <div class="help-block with-errors"></div> </div> <!-- Phone --> <div class="form-group col-md-6 mb-4"> <input type="text" name="phone" id="phone" class="form-control" placeholder="Mobile Number" maxlength="10" onkeypress="return /[0-9]/.test(event.key)" required> <div class="help-block with-errors"></div> </div> <!-- Service / Product Selection --> <div class="form-group col-md-6 mb-4"> <select name="service_interest" class="form-control" id="service_interest" required> <option value="" disabled selected>Select Service / Product</option> <optgroup label="Solar Solutions"> <option value="On Grid Solar">On-Grid Solar System</option> <option value="Off Grid Solar">Off-Grid Solar System</option> <option value="Industrial Solar">Industrial Solar</option> </optgroup> <optgroup label="Products"> <option value="Solar Water Heater">Solar Water Heater / Geyser</option> <option value="Solar Water Pump">Solar Water Pump</option> <option value="Solar Street Light">Solar Street Light</option> </optgroup> <optgroup label="Services"> <option value="Installation & Commissioning">Installation & Commissioning</option> <option value="AMC">AMC (Annual Maintenance Contract)</option> <option value="Repair & Maintenance">Repair & Maintenance</option> <option value="Subsidy Help">Subsidy Documentation Help</option> </optgroup> </select> <div class="help-block with-errors"></div> </div> <!-- Message --> <div class="form-group col-md-12 mb-4"> <textarea name="msg" class="form-control" id="msg" rows="4" placeholder="Site details, load requirement, location, or any specific question"></textarea> <div class="help-block with-errors"></div> </div> <!-- Submit --> <div class="col-md-12 text-center"> <button type="submit" class="btn-default">Get Free Consultation</button> <div id="msgSubmit" class="h3 text-left hidden"></div> </div> </div> </form> </div> </div> </div> </div> </div> <!-- Footer Ticker End --> <?php include_once('include/footer.php') ?>
Save
Cancel