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/classes/pdf/

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/classes/pdf/pdf-helper.php
<?php

namespace MPHB\Addons\Invoice\PDF;

use MPHB\Views\BookingView as BView;
use Dompdf\Dompdf;
use Dompdf\Options;
use MPHB\PostTypes\PaymentCPT\Statuses as PaymentStatuses;
use MPHB\Utils\DateUtils;

class PDFHelper
{

    public $invoice_macros = '%pdf_invoice%';

    public function printPdf($id, $return_attachment = false)
    {
        $variables = $this->getRenderVariables($id);

		/*
		 * To override template in a theme
		 * {theme}\hotel-booking\invoice_template.html
		 */
		$template_file = locate_template( MPHB()->getTemplatePath() . 'invoice_template.html' );
        if ( !$template_file ) {
            $template_file = MPHB_INVOICE_PLUGIN_DIR .'templates/invoice_template.html';
        }
        $rendered_template = $this->renderTemplate($template_file,$variables);
        $filename = 'invoice-'.$id.'-'.date(get_option('date_format')).'-'.date(get_option('time_format')).'.pdf';
        $filename = str_replace(':','-',$filename);
        $filename = preg_replace("/[^a-z0-9\_\-\.]/i", '', $filename);
        $options = new Options();
        $options->set('isRemoteEnabled', true);
        $dompdf = new Dompdf($options);
        $dompdf->loadHtml($rendered_template);
        $dompdf->setPaper('A4', 'portrait');
        $dompdf->render();

        $canvas = $dompdf->getCanvas();
        $footer = $canvas->open_object();
        $page_numeration = sprintf( __( 'Page %s of %s', 'mphb-invoices' ), '{PAGE_NUM}', '{PAGE_COUNT}' );
        $canvas->page_text(35, 810, $page_numeration, 'sans-serif', 7);
        $canvas->close_object();
        $canvas->add_object($footer, 'all');

        if ($return_attachment){
            $dir = mphb_uploads_dir();
            @file_put_contents($dir . $filename, $dompdf->output());
            return $dir . $filename;
        }

        $dompdf->stream($filename, array('Attachment'=>0));
        die();
    }



    public function addInvoicePdfAttachment($attachments, $booking){

        $invoice_attachment = $this->printPdf($booking->getId(), true);
        if ($attachments == null || $attachments == ''){
            $attachments = [];
        }
        $attachments []= $invoice_attachment;
        return $attachments;
    }

    public function getRenderVariables($booking_id){

        $booking = MPHB()->getBookingRepository()->findById( $booking_id );
        $logo_path = '';
        $logo_image_id = get_option('mphb_invoice_company_logo', '');
        if($logo_image_id != ''){
            $logo_image_url = wp_get_attachment_url( $logo_image_id );
            $uploads = wp_upload_dir();
            $logo_path = str_replace( $uploads['baseurl'], $uploads['basedir'], $logo_image_url );
        }
        $date_format = get_option('date_format').' '.get_option('time_format');
        $current_date = mphb_current_time($date_format);
        $render_variables = [
            'OPTIONS_INVOICE_TITLE' => get_option('mphb_invoice_title', ''),
            'OPTIONS_HOTEL_TITLE' => get_option('mphb_invoice_company_name', ''),
            'OPTIONS_LOGO_IMAGE' => $logo_path,
            'OPTIONS_HOTEL_INFORMATION' => str_replace("\r\n", "<br>",get_option('mphb_invoice_company_information', '')),
            'OPTIONS_BOTTOM_INFORMATION' => str_replace("\r\n", "<br>",get_option('mphb_invoice_bottom_information', '')),
            'BOOKING_ID' => $booking->getId(),
            'BOOKING_DATE' => get_the_date( get_option('date_format'), $booking->getId()),
            'BOOKING_CHECK_IN'	 => \MPHB\Utils\DateUtils::formatDateWPFront( $booking->getCheckInDate() ),
            'BOOKING_CHECK_OUT'	 => \MPHB\Utils\DateUtils::formatDateWPFront( $booking->getCheckOutDate() ),
            'BOOKING_CURRENT_DATE' => \MPHB\Utils\DateUtils::formatDateWPFront( new \DateTime('now') ),
            'CUSTOMER_INFORMATION' => $this->renderCustomerInformation($booking),
            'BOOKING_DETAILS' => $this->generatePriceBreakdown($booking),
            'PAYMENT_DETAILS' => $this->generatePaymentTable($booking),
            'CPT_PAYMENT_DETAILS' => __( 'Payment Details', 'mphb-invoices' ),
            'CPT_BOOKING_DETAILS' => __( 'Booking Details', 'mphb-invoices' ),
            'CPT_BOOKING' => __( 'Booking', 'mphb-invoices' ),
            'CPT_DATE' => __( 'Date', 'mphb-invoices' ),
            'CPT_BOOKING_CHECK_IN_DATE' => __( 'Check In', 'mphb-invoices' ),
            'CPT_BOOKING_CHECK_OUT_DATE' => __( 'Check Out', 'mphb-invoices' ),
            'CPT_INVOICE_DATE' => __( 'Invoice Date', 'mphb-invoices' ),
        ];

        return $render_variables;

    }

    public function renderTemplate($template_file, $variables){
        $template = file_get_contents($template_file);
        foreach ($variables as $key=>$var){
            $template = str_replace( "{%".$key."%}",$var,$template);
        }

        $unsupported = mphb_invoice_unsupported_symbols();

        foreach( $unsupported as $code => $sym ) {
            $pattern = '/<span(.*)class=(.*)mphb-price(.*)' . $sym . '(.*)<\/span>/i';
            $replace = '<span${1}class=${2}mphb-price${3}<span class="mphb-special-symbol">' . $sym . '</span>${4}<\/span>';
            $template = preg_replace( $pattern, $replace, $template );
        }

        return $template;
    }

    public function renderCustomerInformation($booking){

		$customer = $booking->getCustomer();

        $html = ($customer->getName() !== '')?'<strong>'.$customer->getName().'</strong><br/>':'';
		$html .= ($customer->getEmail() !== '')? $customer->getEmail().'<br/>':'';
		$html .= ($customer->getPhone() !== '')? $customer->getPhone().'<br/>':'';

        $html_arr = [
			$customer->getZip(),
			$customer->getCountry(),
			$customer->getState(),
			$customer->getCity(),
			$customer->getAddress1(),
		];

        // compatibility with US adress standarts
        $html_arr = array_reverse($html_arr);

        $html .= implode(', ', array_filter($html_arr) );
        return $html;
    }

    public function generatePaymentTable($booking){

            $payments = MPHB()->getPaymentRepository()->findAll(array('booking_id' => $booking->getId()));

            $totalPaid = 0.0;
            ob_start();
            ?>
            <table class="resultstables" style="width: 100%">
                <thead>
                <tr>
                    <th><?php _e('Payment ID', 'motopress-hotel-booking'); ?></th>
                    <th><?php _e('Date', 'motopress-hotel-booking'); ?></th>
                    <th><?php _e('Payment Method', 'motopress-hotel-booking'); ?></th>
                    <th><?php _e('Status', 'motopress-hotel-booking'); ?></th>
                    <th><?php _e('Amount', 'motopress-hotel-booking'); ?></th>
                </tr>
                </thead>
                <tbody>
                <?php if (empty($payments)) { ?>
                    <tr>
                        <td>&#8212;</td>
                        <td>&#8212;</td>
                        <td>&#8212;</td>
                        <td>&#8212;</td>
                        <td>&#8212;</td>
                    </tr>
                <?php } else { ?>
                    <?php
                    foreach ($payments as $payment) {
                        if ($payment->getStatus() == PaymentStatuses::STATUS_COMPLETED) {
                            $totalPaid += $payment->getAmount();
                        }
                        $gateway = MPHB()->gatewayManager()->getGateway($payment->getGatewayId());
                        $gatewayTitle = !is_null($gateway) ? $gateway->getAdminTitle() : self::NO_VALUE_PLACEHOLDER;


                        printf('<tr class="%s">', esc_attr('mphb-payment mphb-payment-status-' . $payment->getStatus()));
                        echo '<td>',  $payment->getId() , '</td>';
                        echo '<td>', esc_html(DateUtils::formatDateWPFront($payment->getDate())), '</td>';
                        echo '<td>', esc_html($gatewayTitle), '</td>';
                        echo '<td>', mphb_get_status_label($payment->getStatus()), '</td>';
                        echo '<td>', mphb_format_price($payment->getAmount()), '</td>';
                        echo '</tr>';
                    }
                    ?>
                <?php } ?>
                </tbody>
                <tfoot>
                <tr>
                    <th class="mphb-total-label" colspan="4"><?php _e('Total Paid', 'motopress-hotel-booking'); ?></th>
                    <th><?php echo mphb_format_price($totalPaid); ?></th>
                </tr>
                <tr>
                    <th class="mphb-to-pay-label" colspan="4"><?php _e('To Pay', 'motopress-hotel-booking'); ?></th>
                    <th>
                        <?php
                        $needToPay = $booking->getTotalPrice() - $totalPaid;
                        echo mphb_format_price($needToPay);
                        ?>
                    </th>
                </tr>
                </tfoot>
            </table>
        <?php

        return ob_get_clean();
    }



    public function generatePriceBreakdown( $booking){

        MPHB()->reservationRequest()->setupParameter( 'pricing_strategy', 'default' );
        $priceBreakdown =  $booking->getPriceBreakdown();
        MPHB()->reservationRequest()->resetDefaults( array( 'pricing_strategy' ) );

        ob_start();

        if ( !empty( $priceBreakdown ) ) :

            $useThreeColumns = true;
            $unfoldByDefault = true;
            $foldedClass = $unfoldByDefault ? '' : 'mphb-hide';
            $unfoldedClass = $unfoldByDefault ? 'mphb-hide' : '';
            ?>
            <table class="resultstables" cellspacing="0" style="width: 100%;">
                <tbody>
                <?php foreach ( $priceBreakdown['rooms'] as $key => $roomBreakdown ) : ?>
                    <?php if ( isset( $roomBreakdown['room'] ) ) : ?>
                        <tr class="mphb-price-breakdown-booking mphb-price-breakdown-group">
                            <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>">
                                <?php
                                $title = sprintf( _x( '#%d %s', 'Accommodation type in price breakdown table. Example: #1 Double Room', 'motopress-hotel-booking' ), $key + 1, $roomBreakdown['room']['type'] );
                                echo $title;
                                ?>
                                <div class="mphb-price-breakdown-rate <?php echo esc_attr($foldedClass); ?>"><?php printf( __( 'Rate: %s', 'motopress-hotel-booking' ), $roomBreakdown['room']['rate'] ); ?></div>
                            </td>
                            <td class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['total'] ); ?></td>
                        </tr>
                        <?php if ( MPHB()->settings()->main()->isAdultsAllowed() ) { ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-" . (MPHB()->settings()->main()->isChildrenAllowed() ? 'adults' : 'guests')); ?>">
                                <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php
                                    if ( MPHB()->settings()->main()->isChildrenAllowed() ) {
                                        _e( 'Adults', 'motopress-hotel-booking' );
                                    } else {
                                        _e( 'Guests', 'motopress-hotel-booking' );
                                    }
                                    ?></td>
                                <td><?php echo $roomBreakdown['room']['adults']; ?></td>
                            </tr>
                        <?php } ?>
                        <?php if ( $roomBreakdown['room']['children_capacity'] > 0 && MPHB()->settings()->main()->isChildrenAllowed() ) { ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-children"); ?>">
                                <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Children', 'motopress-hotel-booking' ); ?></td>
                                <td><?php echo $roomBreakdown['room']['children']; ?></td>
                            </tr>
                        <?php } ?>
                        <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-nights"); ?>">
                            <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Nights', 'motopress-hotel-booking' ); ?></td>
                            <td><?php echo count( $roomBreakdown['room']['list'] ); ?></td>
                        </tr>
                        <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-dates"); ?>">
                            <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Dates', 'motopress-hotel-booking' ); ?></th>
                            <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                        </tr>
                        <?php foreach ( $roomBreakdown['room']['list'] as $date => $datePrice ) : ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-date"); ?>">
                                <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo \MPHB\Utils\DateUtils::formatDateWPFront( \DateTime::createFromFormat( 'Y-m-d', $date ) ); ?></td>
                                <td class="mphb-table-price-column"><?php echo mphb_format_price( $datePrice ); ?></td>
                            </tr>
                        <?php endforeach; ?>
                        <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-dates-subtotal"); ?>">
                            <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Dates Subtotal', 'motopress-hotel-booking' ); ?></th>
                            <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['room']['total'] ); ?></th>
                        </tr>
                        <?php if ( $roomBreakdown['room']['discount'] > 0 ) { ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-accommodation-discount"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Discount', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php echo mphb_format_price( -$roomBreakdown['room']['discount'] ); ?></th>
                            </tr>
                        <?php } ?>
                        <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-accommodation-subtotal"); ?>">
                            <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Accommodation Subtotal', 'motopress-hotel-booking' ); ?></th>
                            <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['room']['discount_total'] ); ?></th>
                        </tr>

                        <?php if ( isset( $roomBreakdown['taxes']['room'] ) && !empty( $roomBreakdown['taxes']['room']['list'] ) ) { ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-accommodation-taxes"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Accommodation Taxes', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                            </tr>
                            <?php foreach ( $roomBreakdown['taxes']['room']['list'] as $roomTax ) { ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-accommodation-tax"); ?>">
                                    <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo $roomTax['label']; ?></td>
                                    <td class="mphb-table-price-column"><?php echo mphb_format_price( $roomTax['price'] ); ?></td>
                                </tr>
                            <?php } ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-accommodation-taxes-subtotal"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Accommodation Taxes Subtotal', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['taxes']['room']['total'] ); ?></th>
                            </tr>
                        <?php } ?>

                        <?php if ( isset( $roomBreakdown['services'] ) && !empty( $roomBreakdown['services']['list'] ) ) : ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-services"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 3 : 2 ); ?>">
                                    <?php _e( 'Services', 'motopress-hotel-booking' ); ?>
                                </th>
                            </tr>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-services-headers"); ?>">
                                <th class="mphb-price-breakdown-service-name"><?php _e( 'Service', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-price-breakdown-service-details"><?php _e( 'Details', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                            </tr>
                            <?php foreach ( $roomBreakdown['services']['list'] as $serviceDetails ) : ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-service"); ?>">
                                    <td class="mphb-price-breakdown-service-name"><?php echo $serviceDetails['title']; ?></td>
                                    <td class="mphb-price-breakdown-service-details"><?php echo $serviceDetails['details']; ?></td>
                                    <td class="mphb-table-price-column"><?php echo mphb_format_price( $serviceDetails['total'] ); ?></td>
                                </tr>
                            <?php endforeach; ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-services-subtotal"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>">
                                    <?php _e( 'Services Subtotal', 'motopress-hotel-booking' ); ?>
                                </th>
                                <th class="mphb-table-price-column">
                                    <?php echo mphb_format_price( $roomBreakdown['services']['total'] ); ?>
                                </th>
                            </tr>

                            <?php if ( isset( $roomBreakdown['taxes']['services'] ) && !empty( $roomBreakdown['taxes']['services']['list'] ) ) { ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-service-taxes"); ?>">
                                    <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Service Taxes', 'motopress-hotel-booking' ); ?></th>
                                    <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                                </tr>
                                <?php foreach ( $roomBreakdown['taxes']['services']['list'] as $serviceTax ) { ?>
                                    <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-service-tax"); ?>">
                                        <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo $serviceTax['label']; ?></td>
                                        <td class="mphb-table-price-column"><?php echo mphb_format_price( $serviceTax['price'] ); ?></td>
                                    </tr>
                                <?php } ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-service-taxes-subtotal"); ?>">
                                    <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Service Taxes Subtotal', 'motopress-hotel-booking' ); ?></th>
                                    <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['taxes']['services']['total'] ); ?></th>
                                </tr>
                            <?php } ?>
                        <?php endif; ?>

                        <?php if ( isset( $roomBreakdown['fees'] ) && !empty( $roomBreakdown['fees']['list'] ) ) { ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fees"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Fees', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                            </tr>
                            <?php foreach ( $roomBreakdown['fees']['list'] as $fee ) { ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fee"); ?>">
                                    <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo $fee['label']; ?></td>
                                    <td class="mphb-table-price-column"><?php echo mphb_format_price( $fee['price'] ); ?></td>
                                </tr>
                            <?php } ?>
                            <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fees-subtotal"); ?>">
                                <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Fees Subtotal', 'motopress-hotel-booking' ); ?></th>
                                <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['fees']['total'] ); ?></th>
                            </tr>

                            <?php if ( isset( $roomBreakdown['taxes']['fees'] ) && !empty( $roomBreakdown['taxes']['fees']['list'] ) ) { ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fee-taxes"); ?>">
                                    <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Fee Taxes', 'motopress-hotel-booking' ); ?></th>
                                    <th class="mphb-table-price-column"><?php _e( 'Amount', 'motopress-hotel-booking' ); ?></th>
                                </tr>
                                <?php foreach ( $roomBreakdown['taxes']['fees']['list'] as $feeTax ) { ?>
                                    <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fee-tax"); ?>">
                                        <td colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php echo $feeTax['label']; ?></td>
                                        <td class="mphb-table-price-column"><?php echo mphb_format_price( $feeTax['price'] ); ?></td>
                                    </tr>
                                <?php } ?>
                                <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-fee-taxes-subtotal"); ?>">
                                    <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Fee Taxes Subtotal', 'motopress-hotel-booking' ); ?></th>
                                    <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['taxes']['fees']['total'] ); ?></th>
                                </tr>
                            <?php } ?>
                        <?php } ?>

                    <?php endif; ?>
                    <tr class="<?php echo esc_attr("{$foldedClass} mphb-price-breakdown-subtotal"); ?>">
                        <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php _e( 'Subtotal', 'motopress-hotel-booking' ); ?></th>
                        <th class="mphb-table-price-column"><?php echo mphb_format_price( $roomBreakdown['discount_total'] ); ?></th>
                    </tr>
                <?php endforeach; ?>
                </tbody>
                <tfoot>
                <?php if ( !empty( $priceBreakdown['coupon'] ) ) : ?>
                    <tr class="mphb-price-breakdown-coupon">
                        <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>"><?php printf( __( 'Coupon: %s', 'motopress-hotel-booking' ), $priceBreakdown['coupon']['code'] ); ?></th>
                        <td class="mphb-table-price-column">
                            <?php echo mphb_format_price( -1 * $priceBreakdown['coupon']['discount'] ); ?>
                        </td>
                    </tr>
                <?php endif; ?>
                <tr class="mphb-price-breakdown-total">
                    <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>">
                        <?php _e( 'Total', 'motopress-hotel-booking' ); ?>
                    </th>
                    <th class="mphb-table-price-column">
                        <?php
                        echo mphb_format_price( $priceBreakdown['total'] );
                        ?>
                    </th>
                </tr>
                <?php if ( !empty( $priceBreakdown['deposit'] ) ) : ?>
                    <tr class="mphb-price-breakdown-deposit">
                        <th colspan="<?php echo ( $useThreeColumns ? 2 : 1 ); ?>">
                            <?php _e( 'Deposit', 'motopress-hotel-booking' ); ?>
                        </th>
                        <th class="mphb-table-price-column">
                            <?php
                            echo mphb_format_price( $priceBreakdown['deposit'] );
                            ?>
                        </th>
                    </tr>
                <?php endif; ?>
                </tfoot>
            </table>
        <?php
        endif;
        return ob_get_clean();
    }


}

Youez - 2016 - github.com/yon3zu
LinuXploit