plugin_path . 'includes/models/methods-api.php'; $method = new Methods(); include $controller->plugin_path . 'includes/translations/translations.php'; $txt = new Translation; $booking_id = sanitize_text_field($_POST['param1']); $sub_total_room_price = 0; $sub_total_service_price = 0; $grand_total = 0; $vat_percentage = $method->has_get_settings('vat_percentage'); global $wpdb; $booking = $wpdb->prefix . 'hotel_has_booking'; $query_result = $wpdb->get_results("SELECT * FROM `$booking` WHERE `booking_id` = $booking_id ", ARRAY_A); foreach ($query_result as $row): ?>
txt("Payable amount") ?> has_get_booking_allocated_rooms($booking_id); foreach ($booking_rooms as $row2): ?>
txt("Room") ?> txt("Date") ?> txt("Price") ?>
has_get_room_name($row2['room_id']); ?> - has_currency($row2['price']); $sub_total_room_price += $row2['price']; ?>
has_get_booking_attached_services($booking_id); foreach ($booking_services as $row3): ?>
txt("Services") ?> txt("Unit") ?> txt("Price") ?>
has_get_service_name($row3['service_id']); ?> has_currency($row3['price']); } if ($row3['type'] == 3){ echo $row3['night_number'] . ' night x ' . $method->has_currency($row3['price']); } ?> has_currency($service_individual_price); $sub_total_service_price += $service_individual_price; ?>
txt('Room Pricing'); ?> has_currency($sub_total_room_price); ?>
txt('Service Pricing'); ?> has_currency($sub_total_service_price); ?>
Vat (%) has_currency($vat_amount); ?>
txt('Total'); ?> has_currency($grand_total); ?>
txt("Payment history") ?> has_get_booking_payments($booking_id); foreach ($payments as $row2): ?>
txt("Date") ?> txt("Price") ?>
has_currency($row2['amount']); $total_paid_amount += $row2['amount']; ?>
txt("Paid") ?> has_currency($total_paid_amount); ?>
txt("Due") ?> has_currency($grand_total - $total_paid_amount); ?>
txt("Take payment") ?>