Hotel Raxa - Advanced Booking System Implementation
🏨 Hotel Booking Enhancements: - Implemented Eagle Booking Advanced Pricing add-on - Added Booking.com-style rate management system - Created professional calendar interface for pricing - Integrated deals and discounts functionality 💰 Advanced Pricing Features: - Dynamic pricing models (per room, per person, per adult) - Base rates, adult rates, and child rates management - Length of stay discounts and early bird deals - Mobile rates and secret deals implementation - Seasonal promotions and flash sales 📅 Availability Management: - Real-time availability tracking - Stop sell and restriction controls - Closed to arrival/departure functionality - Minimum/maximum stay requirements - Automatic sold-out management 💳 Payment Integration: - Maintained Redsys payment gateway integration - Seamless integration with existing Eagle Booking - No modifications to core Eagle Booking plugin 🛠️ Technical Implementation: - Custom database tables for advanced pricing - WordPress hooks and filters integration - AJAX-powered admin interface - Data migration from existing Eagle Booking - Professional calendar view for revenue management 📊 Admin Interface: - Booking.com-style management dashboard - Visual rate and availability calendar - Bulk operations for date ranges - Statistics and analytics dashboard - Modal dialogs for quick editing 🔧 Code Quality: - WordPress coding standards compliance - Secure database operations with prepared statements - Proper input validation and sanitization - Error handling and logging - Responsive admin interface 🤖 Generated with Claude Code (https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET["account_details"])) :
|
||||
|
||||
?>
|
||||
|
||||
<!-- User Menu -->
|
||||
<nav class="eb-account-menu">
|
||||
<ul class="short">
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>" aria-current="page"><?php echo __('Dashboard', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>?bookings"><?php echo __('Bookings', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item active"><a href="<?php echo esc_url( eb_account_page() ) ?>?account_details"><?php echo __('Account Details', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo wp_logout_url( eb_account_page().'?sign_in' ) ?>"><?php echo __('Log Out', 'eagle-booking') ?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<?php
|
||||
|
||||
// DB QUERY
|
||||
global $wpdb;
|
||||
|
||||
$eb_booking_id = get_the_ID();
|
||||
$eb_current_user_id = get_current_user_id();
|
||||
$eb_current_user = wp_get_current_user();
|
||||
|
||||
// Get New User Meta
|
||||
if(isset($_POST['form_submit'])) {
|
||||
|
||||
$eb_user_firstname = $_POST['first_name'];
|
||||
$eb_user_lastname = $_POST['last_name'];
|
||||
$eb_user_phone = $_POST['user_phone'];
|
||||
$eb_user_address = $_POST['user_address'];
|
||||
$eb_user_city = $_POST['user_city'];
|
||||
$eb_user_country = $_POST['user_country'];
|
||||
$eb_user_zip = $_POST['user_zip'];
|
||||
$eb_user_email = $_POST['user_email'];
|
||||
|
||||
// Create User Meta
|
||||
update_user_meta( $eb_current_user_id, 'first_name', $eb_user_firstname);
|
||||
update_user_meta( $eb_current_user_id, 'last_name', $eb_user_lastname);
|
||||
update_user_meta( $eb_current_user_id, 'user_phone', $eb_user_phone);
|
||||
update_user_meta( $eb_current_user_id, 'user_address', $eb_user_address);
|
||||
update_user_meta( $eb_current_user_id, 'user_city', $eb_user_city);
|
||||
update_user_meta( $eb_current_user_id, 'user_country', $eb_user_country);
|
||||
update_user_meta( $eb_current_user_id, 'user_zip', $eb_user_zip);
|
||||
|
||||
if (!email_exists( $eb_user_email )){
|
||||
|
||||
$args = array(
|
||||
'ID' => $eb_current_user_id,
|
||||
'user_email' => esc_attr( $eb_user_email )
|
||||
);
|
||||
|
||||
wp_update_user( $args );
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-alert eb-alert-success eb-alert-icon mb50" role="alert">
|
||||
<?php echo __('Your account has been updated successfully', 'eagle-booking') ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
} else {
|
||||
|
||||
if ( isset($_GET['form_fill_required']) ) { ?>
|
||||
|
||||
<div class="eb-alert eb-alert-info eb-alert-icon mb50" role="alert">
|
||||
<?php echo __('Please fill out all the required fields before starting a new reservation.', 'eagle-booking') ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
// Get User Meta
|
||||
$eb_user_firstname = get_user_meta( $eb_current_user_id, 'first_name', true);
|
||||
$eb_user_lastname = get_user_meta( $eb_current_user_id, 'last_name', true);
|
||||
$eb_user_phone = get_user_meta( $eb_current_user_id, 'user_phone', true);
|
||||
$eb_user_address = get_user_meta( $eb_current_user_id, 'user_address', true);
|
||||
$eb_user_city = get_user_meta( $eb_current_user_id, 'user_city', true);
|
||||
$eb_user_country = get_user_meta( $eb_current_user_id, 'user_country', true);
|
||||
$eb_user_zip = get_user_meta( $eb_current_user_id, 'user_zip', true);
|
||||
$eb_user_email = $eb_current_user->user_email;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<h4 class="mb40"><?php echo __('Account Details', 'eagle-booking') ?></h4>
|
||||
|
||||
<form method="POST">
|
||||
<div class="eb-g-lg-2 eb-g-md-1 eb-account-details-form">
|
||||
<div>
|
||||
<label for="first_name"><?php echo __('First Name', 'eagle-booking') ?> <span class="required">*</span></label>
|
||||
<input type="text" class="eb-field" name="first_name" id="first_name" value="<?php echo $eb_user_firstname ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="last_name"><?php echo __('Last Name', 'eagle-booking') ?> <span class="required">*</span></label>
|
||||
<input type="text" class="eb-field" name="last_name" id="last_name" value="<?php echo $eb_user_lastname ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_email"><?php echo __('Email', 'eagle-booking') ?> <span class="required">*</span></label>
|
||||
<input type="email" class="eb-field" name="user_email" id="user_email" value="<?php echo $eb_user_email ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_phone"><?php echo __('Phone', 'eagle-booking') ?> <span class="required">*</span></label>
|
||||
<input type="tel" class="eb_user_phone_field eb-field" value="<?php echo $eb_user_phone ?>">
|
||||
<!-- Hidden input will be shown here -->
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_address"><?php echo __('Address', 'eagle-booking') ?></label>
|
||||
<input type="text" class="eb-field" name="user_address" id="user_address" value="<?php echo $eb_user_address ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_city"><?php echo __('City', 'eagle-booking') ?></label>
|
||||
<input type="text" class="eb-field" name="user_city" id="user_city" value="<?php echo $eb_user_city ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_country"><?php echo __('Country', 'eagle-booking') ?></label>
|
||||
<input type="text" class="eb-field" name="user_country" id="user_country" value="<?php echo $eb_user_country ?>">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="user_zip"><?php echo __('ZIP', 'eagle-booking') ?></label>
|
||||
<input type="text" class="eb-field" name="user_zip" id="user_zip" value="<?php echo $eb_user_zip ?>">
|
||||
</div>
|
||||
<div>
|
||||
<button type="submit" name="form_submit" class="btn eb-btn"><?php echo __('Update Account Details', 'eagle-booking')?></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Include phone field translation
|
||||
*/
|
||||
include eb_load_template('elements/phone-field.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php endif ?>
|
||||
83
wp-content/plugins/eagle-booking/core/account/account.php
Normal file
83
wp-content/plugins/eagle-booking/core/account/account.php
Normal file
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Account Page Shortcode
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Core
|
||||
* Since: 1.0.0
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
function eb_account_shortcode() {
|
||||
|
||||
ob_start();
|
||||
|
||||
echo '<div class="eb-user-dashboard">';
|
||||
|
||||
if ( is_user_logged_in() ) {
|
||||
|
||||
if (isset($_GET["view_booking"])) {
|
||||
|
||||
// View Booking Details
|
||||
require_once EB_PATH . '/core/account/view.php';
|
||||
|
||||
} elseif (isset($_GET["bookings"])) {
|
||||
|
||||
// Bookings
|
||||
require_once EB_PATH . '/core/account/bookings.php';
|
||||
|
||||
} elseif (isset($_GET["account_details"])) {
|
||||
|
||||
// Bookings
|
||||
require_once EB_PATH . '/core/account/account-details.php';
|
||||
|
||||
} else {
|
||||
|
||||
// Dashboard
|
||||
require_once EB_PATH . '/core/account/dashboard.php';
|
||||
|
||||
}
|
||||
|
||||
} elseif ( isset( $_GET['sign_up'] ) ) {
|
||||
|
||||
// Signup
|
||||
require_once EB_PATH . '/core/account/signup.php';
|
||||
|
||||
|
||||
// Redirect to login Page
|
||||
} else {
|
||||
|
||||
// Login
|
||||
require_once EB_PATH . '/core/account/signin.php';
|
||||
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
/**
|
||||
* Enqueue Booking Page JS & AJAX (to be remove and create a account.js file to use only the user js)
|
||||
*/
|
||||
wp_enqueue_script( 'eb-checkout', EB_URL .'assets/js/checkout.js', array( 'jquery' ), EB_VERSION, true );
|
||||
wp_localize_script(
|
||||
|
||||
'eb-checkout', 'eb_checkout',
|
||||
|
||||
array(
|
||||
'eb_user_sign_in_ajax' => admin_url( 'admin-ajax.php' ),
|
||||
'eb_user_sign_up_ajax' => admin_url( 'admin-ajax.php' ),
|
||||
'eb_user_sign_out_ajax' => admin_url( 'admin-ajax.php' ),
|
||||
'eb_coupon_code_ajax' => admin_url( 'admin-ajax.php' ),
|
||||
|
||||
// Used for static Ajax requests
|
||||
'eb_ajax_nonce' => wp_create_nonce( 'eb_nonce' ),
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
return ob_get_clean();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Account Page Shortcode
|
||||
add_shortcode('eb_account', 'eb_account_shortcode');
|
||||
167
wp-content/plugins/eagle-booking/core/account/bookings.php
Normal file
167
wp-content/plugins/eagle-booking/core/account/bookings.php
Normal file
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
if (isset($_GET["bookings"])) {
|
||||
|
||||
// DB QUERY
|
||||
global $wpdb;
|
||||
|
||||
$eb_booking_id = get_the_ID();
|
||||
$eb_current_user_id = get_current_user_id();
|
||||
$eb_current_user = wp_get_current_user();
|
||||
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE id_user = '$eb_current_user_id' ORDER BY id DESC LIMIT 30");
|
||||
$eb_bookings_all = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE id_user = '$eb_current_user_id'");
|
||||
$eb_bookings_pending = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE paypal_payment_status = 'Pending' AND id_user = '$eb_current_user_id'");
|
||||
$eb_bookings_pending_payment = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE paypal_payment_status = 'Pending Payment' AND id_user = '$eb_current_user_id'");
|
||||
$eb_bookings_canceled = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE paypal_payment_status = 'Canceled' AND id_user = '$eb_current_user_id'");
|
||||
$eb_bookings_completed = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE paypal_payment_status = 'Completed' AND id_user = '$eb_current_user_id'");
|
||||
|
||||
?>
|
||||
|
||||
<!-- User Menu -->
|
||||
<nav class="eb-account-menu">
|
||||
<ul class="short">
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>" aria-current="page"><?php echo __('Dashboard', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item active"><a href="<?php echo esc_url( eb_account_page() ) ?>?bookings"><?php echo __('Bookings', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>?account_details"><?php echo __('Account Details', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo wp_logout_url( eb_account_page().'?sign_in' ) ?>"><?php echo __('Log Out', 'eagle-booking') ?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<h5 class="mt50"><?php echo __('My Bookings', 'eagle-booking') ?></h5>
|
||||
|
||||
<!-- Bookings -->
|
||||
<table class="eb-user-bookings-table mt30">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="5%"><?php echo __('ID', 'eagle-booking') ?></th>
|
||||
<th width="25%"><?php echo __('Room Title', 'eagle-booking') ?></th>
|
||||
<th width="25%"><?php echo __('Dates', 'eagle-booking') ?></th>
|
||||
<th width="7%"><?php echo __('Price', 'eagle-booking') ?></th>
|
||||
<th width="6%"><?php echo __('Guests', 'eagle-booking') ?></th>
|
||||
<th width="14%"><?php echo __('Payment Method', 'eagle-booking') ?></th>
|
||||
<th width="13%"><?php echo __('Status', 'eagle-booking') ?></th>
|
||||
<th width="5%"><?php echo __('Action', 'eagle-booking') ?></th>
|
||||
</tr>
|
||||
|
||||
<?php if( $eb_bookings ) : ?>
|
||||
|
||||
<?php foreach ( $eb_bookings as $eb_booking ) :
|
||||
|
||||
// Booking Status & Class
|
||||
if ( $eb_booking->paypal_payment_status == 'Pending Payment' ) {
|
||||
$eb_booking_status_text = __('Pending Payment', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending-payment';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Pending' ){
|
||||
$eb_booking_status_text = __('Pending', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Canceled' ){
|
||||
$eb_booking_status_text = __('Canceled', 'eagle-booking');
|
||||
$eb_booking_status_class = 'canceled';
|
||||
|
||||
} else {
|
||||
$eb_booking_status_text = __('Completed', 'eagle-booking');
|
||||
$eb_booking_status_class = 'completed';
|
||||
}
|
||||
|
||||
|
||||
// Get the payment method text
|
||||
if( $eb_booking->action_type === 'payment_on_arrive' ) {
|
||||
|
||||
$eb_booking_payment_method_text = __('Payment on Arrival', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === '2checkout') {
|
||||
|
||||
$eb_booking_payment_method_text = __('2Checkout', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'bank_transfer') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Bank Transfer', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'PayU') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayU', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paystack') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Paystack', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'flutterwave') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Flutterwave', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'vivawallet') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Viva Wallet', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'razorpay') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Razorpay', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'booking_request') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Booking Request', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'stripe') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Stripe', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paypal') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayPal', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Room URL
|
||||
$eb_booking_room_id = $eb_booking->id_post;
|
||||
$eb_booking_room_url = get_the_permalink($eb_booking_room_id)
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo esc_html( $eb_booking->id ) ?></td>
|
||||
<td>
|
||||
<div style="display:flex; align-items: center;">
|
||||
<a href="<?php echo esc_url($eb_booking_room_url) ?>" target="_blank">
|
||||
<?php echo esc_html( $eb_booking->title_post ) ?>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_from) ?> </span> →
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_to) ?> </span>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( eb_currency_position() == 'before' ) : ?>
|
||||
<?php echo eb_currency() ?><?php eb_formatted_price($eb_booking->final_trip_price) ?>
|
||||
<?php else : ?>
|
||||
<?php eb_formatted_price($eb_booking->final_trip_price) ?><?php echo eb_currency() ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td> <?php echo $eb_booking->guests ?></td>
|
||||
<td><span><?php echo $eb_booking_payment_method_text ?></span></td>
|
||||
<td><span class="eb-booking-status eb-<?php echo esc_attr($eb_booking_status_class) ?>"><?php echo $eb_booking_status_text ?></span></td>
|
||||
<td><a href="?view_booking=<?php echo $eb_booking->id ?>" class="view-booking-link"><?php echo __('View', 'eagle-booking')?></a></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<div class="no-bookings">
|
||||
<i class="far fa-frown"></i>
|
||||
<?php echo __('You do not have any booking yet.', 'eagle-booking') ?> <a href="<?php echo eb_search_page() ?>"><?php echo __('Add New Booking', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php } ?>
|
||||
155
wp-content/plugins/eagle-booking/core/account/dashboard.php
Normal file
155
wp-content/plugins/eagle-booking/core/account/dashboard.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?php
|
||||
|
||||
// DB QUERY
|
||||
global $wpdb;
|
||||
|
||||
$eb_booking_id = get_the_ID();
|
||||
$eb_current_user_id = get_current_user_id();
|
||||
$eb_current_user = wp_get_current_user();
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE id_user = '$eb_current_user_id' ORDER BY id DESC LIMIT 5");
|
||||
|
||||
?>
|
||||
|
||||
<!-- User Menu -->
|
||||
<nav class="eb-account-menu">
|
||||
<ul class="short">
|
||||
<li class="menu-item active"><a href="<?php echo esc_url( eb_account_page() ) ?>" aria-current="page"><?php echo __('Dashboard', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>?bookings"><?php echo __('Bookings', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>?account_details"><?php echo __('Account Details', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo wp_logout_url( eb_account_page().'?sign_in' ) ?>"><?php echo __('Log Οut', 'eagle-booking') ?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<h3><?php echo __('Hello', 'eagle-booking') ?>, <?php echo $eb_current_user->user_login ?>!</h3>
|
||||
|
||||
<h5 class="mt50"><?php echo __('My Recent Bookings', 'eagle-booking') ?></h5>
|
||||
|
||||
<!-- Bookings -->
|
||||
<table class="eb-user-bookings-table mt30">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th width="5%"><?php echo __('ID', 'eagle-booking') ?></th>
|
||||
<th width="25%"><?php echo __('Room Title', 'eagle-booking') ?></th>
|
||||
<th width="25%"><?php echo __('Dates', 'eagle-booking') ?></th>
|
||||
<th width="7%"><?php echo __('Price', 'eagle-booking') ?></th>
|
||||
<th width="6%"><?php echo __('Guests', 'eagle-booking') ?></th>
|
||||
<th width="14%"><?php echo __('Payment Method', 'eagle-booking') ?></th>
|
||||
<th width="13%"><?php echo __('Status', 'eagle-booking') ?></th>
|
||||
<th width="5%"><?php echo __('Action', 'eagle-booking') ?></th>
|
||||
</tr>
|
||||
|
||||
<?php if( $eb_bookings ) : ?>
|
||||
|
||||
<?php foreach ( $eb_bookings as $eb_booking ) :
|
||||
|
||||
// Booking Status & Class
|
||||
if ( $eb_booking->paypal_payment_status == 'Pending Payment' ) {
|
||||
$eb_booking_status_text = __('Pending Payment', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending-payment';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Pending' ){
|
||||
$eb_booking_status_text = __('Pending', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Canceled' ){
|
||||
$eb_booking_status_text = __('Canceled', 'eagle-booking');
|
||||
$eb_booking_status_class = 'canceled';
|
||||
|
||||
} else {
|
||||
$eb_booking_status_text = __('Completed', 'eagle-booking');
|
||||
$eb_booking_status_class = 'completed';
|
||||
}
|
||||
|
||||
|
||||
// Get the payment method text
|
||||
if( $eb_booking->action_type === 'payment_on_arrive' ) {
|
||||
|
||||
$eb_booking_payment_method_text = __('Payment on Arrival', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === '2checkout') {
|
||||
|
||||
$eb_booking_payment_method_text = __('2Checkout', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'bank_transfer') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Bank Transfer', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'PayU') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayU', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paystack') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Paystack', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'flutterwave') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Flutterwave', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'vivawallet') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Viva Wallet', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'booking_request') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Booking Request', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'stripe') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Stripe', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paypal') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayPal', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Room Image & URL
|
||||
$eb_booking_room_id = $eb_booking->id_post;
|
||||
$eb_booking_room_url = get_the_permalink($eb_booking_room_id)
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo esc_html( $eb_booking->id ) ?></td>
|
||||
<td>
|
||||
<div style="display:flex; align-items: center;">
|
||||
<a href="<?php echo esc_url($eb_booking_room_url) ?>" target="_blank">
|
||||
<?php echo esc_html( $eb_booking->title_post ) ?>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_from) ?> </span> →
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_to) ?> </span>
|
||||
</td>
|
||||
<td>
|
||||
<?php if ( eb_currency_position() == 'before' ) : ?>
|
||||
<?php echo eb_currency() ?><?php eb_formatted_price($eb_booking->final_trip_price) ?>
|
||||
<?php else : ?>
|
||||
<?php eb_formatted_price($eb_booking->final_trip_price) ?><?php echo eb_currency() ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<td> <?php echo $eb_booking->guests ?></td>
|
||||
<td><span><?php echo $eb_booking_payment_method_text ?></span></td>
|
||||
<td><span class="eb-booking-status eb-<?php echo esc_attr($eb_booking_status_class) ?>"><?php echo $eb_booking_status_text ?></span></td>
|
||||
<td><a href="?view_booking=<?php echo $eb_booking->id ?>" class="view-booking-link"><?php echo __('View', 'eagle-booking')?></a></td>
|
||||
</tr>
|
||||
|
||||
<?php endforeach ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<tr>
|
||||
<td colspan="8">
|
||||
<div class="no-bookings">
|
||||
<i class="far fa-frown"></i>
|
||||
<?php echo __('You do not have any booking yet.', 'eagle-booking') ?> <a href="<?php echo eb_search_page() ?>"><?php echo __('Add New Booking', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
31
wp-content/plugins/eagle-booking/core/account/signin.php
Normal file
31
wp-content/plugins/eagle-booking/core/account/signin.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* The Template for the account sign in form
|
||||
*
|
||||
*
|
||||
* Author: Eagle Themes
|
||||
* Package: Eagle-Booking/Templates
|
||||
* Version: 1.1.6
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
|
||||
<div class="login-page">
|
||||
<h3 class="title mb50"><?php echo __('Sign In', 'eagle-booking') ?></h3>
|
||||
<form id="eb_user_dashboard_signin_form" class="login-form" method="post">
|
||||
<div id="eb_user_sign_in_response" class="eb-alert eb-alert-small mb20" style="display: none">
|
||||
<span id="eb_user_sign_in_response_text"></span>
|
||||
</div>
|
||||
<input type="hidden" id="eb_security" value="<?php echo wp_create_nonce('eb_nonce', 'security'); ?>">
|
||||
<input id="eb_user_sign_in_username" type="text" class="eb-field" name="username" placeholder="<?php echo __('Username or Email', 'eagle-booking') ?>">
|
||||
<input id="eb_user_sign_in_password" type="password" class="eb-field" name="password" autocomplete="on" placeholder="<?php echo __('Password', 'eagle-booking') ?>">
|
||||
<button id="eb_user_sign_in" class="btn eb-btn btn-full" type="submit">
|
||||
<span class="eb-btn-text"><?php echo __('Sign In','eagle-booking') ?></span>
|
||||
</button>
|
||||
<div class="login-form-footer">
|
||||
<a href="?sign_up"><?php echo __("Don't have an account?", 'eagle-booking') ?></a>
|
||||
<a href="<?php echo wp_lostpassword_url(); ?>"><?php echo __('Forgot Password?', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
28
wp-content/plugins/eagle-booking/core/account/signup.php
Normal file
28
wp-content/plugins/eagle-booking/core/account/signup.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="login-page">
|
||||
|
||||
<h3 class="title mb50"><?php echo __('Sign Up', 'eagle-booking') ?></h3>
|
||||
|
||||
<form id="eb_user_dashboard_signup_form" class="login-form method="post">
|
||||
|
||||
<div id="eb_user_sign_up_response" class="eb-alert eb-alert-small mb20" role="alert" style="display:none">
|
||||
<span id="eb_user_sign_up_response_text"></span>
|
||||
</div>
|
||||
|
||||
<input id="eb_user_sign_up_username" type="text" class="eb-field" name="username" placeholder="<?php echo __('Username', 'eagle-booking') ?>">
|
||||
<input id="eb_user_sign_up_email" type="email" class="eb-field" name="email" placeholder="<?php echo __('Email', 'eagle-booking') ?> ">
|
||||
<input id="eb_user_sign_up_password" type="password" name="password" class="eb-field" placeholder="<?php echo __('Password', 'eagle-booking') ?> ">
|
||||
<div class="gdpr mb20">
|
||||
<input type="checkbox" id="eb_user_sign_up_terms">
|
||||
<label for="eb_user_sign_up_terms"><?php echo __('I agree to the', 'eagle-booking') ?> <a class="terms-conditions" target="_blank" href="<?php echo eagle_booking_terms_page() ?>"><?php echo __('Terms and Conditions','eagle-booking') ?></a></label>
|
||||
</div>
|
||||
<button id="eb_user_sign_up" class="btn eb-btn btn-full" type="submit">
|
||||
<span class="eb-btn-text"><?php echo __('Sign Up','eagle-booking') ?></span>
|
||||
</button>
|
||||
<div class="login-form-footer">
|
||||
<a href="<?php echo eb_account_page() ?>?sign_in"><?php echo __('Already Registered?', 'eagle-booking') ?></a>
|
||||
<a href="<?php echo wp_lostpassword_url(); ?>"><?php echo __('Forgot Password?', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
383
wp-content/plugins/eagle-booking/core/account/view.php
Normal file
383
wp-content/plugins/eagle-booking/core/account/view.php
Normal file
@@ -0,0 +1,383 @@
|
||||
<?php
|
||||
|
||||
// DB QUERY
|
||||
global $wpdb;
|
||||
|
||||
$eb_booking_id = $_GET["view_booking"];
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM ".EAGLE_BOOKING_TABLE." WHERE id = $eb_booking_id");
|
||||
|
||||
|
||||
$eagle_booking_table_name = $wpdb->prefix . 'eagle_booking';
|
||||
$eb_table_meta_name = $wpdb->prefix . 'eagle_booking_meta';
|
||||
|
||||
|
||||
// Update Booking
|
||||
if ( isset($_POST['eb_update_booking_status']) ) {
|
||||
|
||||
|
||||
// First check if the booking [room] is cancellable
|
||||
// If yes create a entry on the Eagle Booking Meta Table 'is_cancellable' and set it to true
|
||||
// After the response of the admin to the cancellation request create a new entry called 'cancelled' booleand
|
||||
|
||||
$eb_update_booking_status = $_POST['eb_update_booking_status'];
|
||||
$wpdb->update(EAGLE_BOOKING_TABLE, array("paypal_payment_status" => $eb_update_booking_status), array("id" => $eb_booking_id));
|
||||
|
||||
?>
|
||||
|
||||
<!-- <div class="eb-alert success mb50" role="alert">
|
||||
<i class="fa fa-check" aria-hidden="true"></i>Cancellation Requst submitted ducessfully. We will get back to you as soon as possible.
|
||||
</div> -->
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
foreach ( $eb_bookings as $eb_booking ) {
|
||||
|
||||
// Booking Status & Class
|
||||
if ( $eb_booking->paypal_payment_status == 'Pending Payment' ) {
|
||||
$eb_booking_status_text = __('Pending Payment', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending-payment';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Pending' ){
|
||||
$eb_booking_status_text = __('Pending', 'eagle-booking');
|
||||
$eb_booking_status_class = 'pending';
|
||||
|
||||
} elseif ( $eb_booking->paypal_payment_status == 'Canceled' ){
|
||||
$eb_booking_status_text = __('Canceled', 'eagle-booking');
|
||||
$eb_booking_status_class = 'canceled';
|
||||
|
||||
} else {
|
||||
$eb_booking_status_text = __('Completed', 'eagle-booking');
|
||||
$eb_booking_status_class = 'completed';
|
||||
}
|
||||
|
||||
|
||||
// Get the payment method text
|
||||
if( $eb_booking->action_type === 'payment_on_arrive' ) {
|
||||
|
||||
$eb_booking_payment_method_text = __('Payment on Arrival', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === '2checkout') {
|
||||
|
||||
$eb_booking_payment_method_text = __('2Checkout', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'bank_transfer') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Bank Transfer', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'PayU') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayU', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paystack') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Paystack', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'flutterwave') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Flutterwave', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'vivawallet') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Viva Wallet', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'razorpay') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Razorpay', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'booking_request') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Booking Request', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'stripe') {
|
||||
|
||||
$eb_booking_payment_method_text = __('Stripe', 'eagle-booking');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'paypal') {
|
||||
|
||||
$eb_booking_payment_method_text = __('PayPal', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Services Total Prices
|
||||
$eb_booking_services_price = 0;
|
||||
$eb_booking_services_array = explode(',', $eb_booking->extra_services );
|
||||
for ($eb_booking_services_array_i = 0; $eb_booking_services_array_i < count($eb_booking_services_array)-1; $eb_booking_services_array_i++) {
|
||||
$eb_booking_services = explode('[', $eb_booking_services_array[$eb_booking_services_array_i] );
|
||||
$eb_booking_service_id = $eb_booking_services[0];
|
||||
$eb_booking_service_price = str_replace(']','',$eb_booking_services[1]);
|
||||
$eb_booking_services_price = $eb_booking_services_price + $eb_booking_service_price;
|
||||
}
|
||||
|
||||
// Total Price - Services Price
|
||||
$eb_booking_room_price = $eb_booking->final_trip_price - $eb_booking_services_price;
|
||||
|
||||
// Room Image & URL
|
||||
$eb_booking_room_id = $eb_booking->id_post;
|
||||
$eb_booking_image_id = get_post_thumbnail_id($eb_booking_room_id);
|
||||
$eb_booking_image_attributes = wp_get_attachment_image_src( $eb_booking_image_id, 'thumbnail' );
|
||||
$eb_booking_room_img_src = $eb_booking_image_attributes[0];
|
||||
$eb_booking_room_url = get_the_permalink($eb_booking_room_id)
|
||||
|
||||
?>
|
||||
|
||||
<!-- User Menu -->
|
||||
<nav class="eb-account-menu">
|
||||
<ul class="short">
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>" aria-current="page"><?php echo __('Dashboard', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item active"><a href="<?php echo esc_url( eb_account_page() ) ?>?bookings"><?php echo __('Bookings', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo esc_url( eb_account_page() ) ?>?account_details"><?php echo __('Account Details', 'eagle-booking') ?></a></li>
|
||||
<li class="menu-item"><a href="<?php echo wp_logout_url( eb_account_page().'?sign_in' ) ?>"><?php echo __('Log Out', 'eagle-booking') ?></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="eb-account-booking-header">
|
||||
|
||||
<div>
|
||||
<strong><?php echo __('Booking ID', 'eagle-booking'). ': ' .$eb_booking_id; ?></strong><br>
|
||||
<span><small><?php echo $eb_booking->date ?></small></span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<form method="POST">
|
||||
<input type="hidden" name="eb_update_booking_status" value="cancellation_requested">
|
||||
<!-- <button class="btn eb-btn btn-border btn-small pull-right" type="submit"><?php echo __('Request Cancellation', 'eagle-booking')?></button> -->
|
||||
</form>
|
||||
<button class="btn eb-btn btn-small" onClick="window.print()"><?php echo __('Print Booking Details', 'eagle-booking') ?></button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="eb-printable">
|
||||
|
||||
<div class="eb-main-booking-details mt50">
|
||||
|
||||
<div class="eb-hotel-logo eb-only-printable">
|
||||
<?php
|
||||
if (!empty( eb_get_option('hotel_logo') )) {
|
||||
echo "<img src=".eb_get_option('hotel_logo')." height='25px'>";
|
||||
} else {
|
||||
echo get_bloginfo( 'name' );
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="eb-main-booking-details-head">
|
||||
<div>
|
||||
<span><?php echo __('Arrival Date', 'eagle-booking') ?></span>
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_from) ?> </span>
|
||||
</div>
|
||||
<div>
|
||||
<span><?php echo __('Departure Date', 'eagle-booking') ?></span>
|
||||
<span> <?php echo eagle_booking_displayd_date_format($eb_booking->date_to) ?> </span>
|
||||
</div>
|
||||
<div>
|
||||
<span><?php echo __('Guests', 'eagle-booking') ?></span>
|
||||
<span> <?php echo $eb_booking->guests ?> </span>
|
||||
</div>
|
||||
<div>
|
||||
<span><?php echo __('Payment Method', 'eagle-booking') ?></span>
|
||||
<span><?php echo $eb_booking_payment_method_text ?> </span>
|
||||
</div>
|
||||
<div>
|
||||
<span><?php echo __('Status', 'eagle-booking') ?></span>
|
||||
<span class="eb-booking-status eb-<?php echo esc_attr($eb_booking_status_class) ?>"> <?php echo $eb_booking_status_text ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="eb-booking-details-footer">
|
||||
|
||||
<div class="left-details">
|
||||
<p>
|
||||
<span><?php echo __('Transaction ID', 'eagle-booking') ?></span>
|
||||
<span><?php echo $eb_booking->paypal_tx ?></span>
|
||||
</p>
|
||||
<p>
|
||||
<span><?php echo __('Phone', 'eagle-booking') ?></span>
|
||||
<span><?php echo $eb_booking->user_phone ?></span>
|
||||
</p>
|
||||
<p>
|
||||
<span><?php echo __('Email', 'eagle-booking') ?></span>
|
||||
<span><?php echo $eb_booking->paypal_email ?></span>
|
||||
</p>
|
||||
<p>
|
||||
<span><?php echo __('Adress', 'eagle-booking') ?></span>
|
||||
<span><?php echo $eb_booking->user_address. ' ' .$eb_booking->user_city . ', ' .$eb_booking->user_country ?></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="eb-booking-synopsis">
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Additional Service
|
||||
*/
|
||||
$eagle_booking_services_array = explode(',', $eb_booking->extra_services);
|
||||
|
||||
$eagle_booking_tot_services = 0;
|
||||
$eb_services_total_price = 0;
|
||||
|
||||
for ($eagle_booking_services_array_i = 0; $eagle_booking_services_array_i < count($eagle_booking_services_array)-1; $eagle_booking_services_array_i++) :
|
||||
|
||||
$eagle_booking_service_array = explode('[', $eagle_booking_services_array[$eagle_booking_services_array_i]);
|
||||
$eagle_booking_service_id = $eagle_booking_service_array[0];
|
||||
$eagle_booking_service_name = get_the_title($eagle_booking_service_id);
|
||||
$eagle_booking_mtb_service_price_type_1 = get_post_meta($eagle_booking_service_id, 'eagle_booking_mtb_service_price_type_1', true);
|
||||
$eagle_booking_mtb_service_price_type_2 = get_post_meta($eagle_booking_service_id, 'eagle_booking_mtb_service_price_type_2', true);
|
||||
|
||||
$eb_service_price = get_post_meta($eagle_booking_service_id, 'eagle_booking_mtb_service_price', true);
|
||||
|
||||
$eagle_booking_service_price = str_replace(']', '', $eagle_booking_service_array[1]);
|
||||
|
||||
if (empty($eagle_booking_service_price)) {
|
||||
$eagle_booking_service_price = 10;
|
||||
}
|
||||
|
||||
if ($eagle_booking_mtb_service_price_type_1 == 'guest') {
|
||||
$eagle_booking_price_type_1 = $eb_booking->guests;
|
||||
} else {
|
||||
$eagle_booking_price_type_1 = 1;
|
||||
}
|
||||
if ($eagle_booking_mtb_service_price_type_2 == 'night') {
|
||||
$eagle_booking_price_type_2 = eb_total_booking_nights($eb_booking->date_from, $eb_booking->date_to);
|
||||
} else {
|
||||
$eagle_booking_price_type_2 = 1;
|
||||
}
|
||||
|
||||
$eb_service_price = $eagle_booking_service_price / $eagle_booking_price_type_1 / $eagle_booking_price_type_2;
|
||||
|
||||
if (empty($eagle_booking_service_price_initial)) {
|
||||
$eagle_booking_service_price_initial = 0;
|
||||
}
|
||||
|
||||
?>
|
||||
<div class="eb-booking-synopsis-tem">
|
||||
<span><?php echo $eagle_booking_service_name ?></span>
|
||||
<span><?php echo eb_price( $eagle_booking_service_price ) ?></span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$eb_services_total_price = $eagle_booking_tot_services + $eagle_booking_service_price;
|
||||
|
||||
endfor;
|
||||
|
||||
/**
|
||||
* Fees & Taxes
|
||||
*/
|
||||
$fees = get_option('eb_fees');
|
||||
$taxes = get_option('eb_taxes');
|
||||
$booking_taxes = $wpdb->get_results("SELECT * FROM $eb_table_meta_name WHERE booking_id = $eb_booking_id AND meta_key = 'tax' ");
|
||||
$booking_fees = $wpdb->get_results("SELECT * FROM $eb_table_meta_name WHERE booking_id = $eb_booking_id AND meta_key = 'fee' ");
|
||||
$room_price = $wpdb->get_row( "SELECT * FROM $eb_table_meta_name WHERE booking_id = $eb_booking_id AND meta_key = 'room_price' " );
|
||||
|
||||
$room_price = $room_price->meta_value;
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-booking-synopsis-item">
|
||||
<span><?php echo $eb_booking->title_post ?></span>
|
||||
<span><?php echo eb_price( $room_price ); ?></span>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
// Fees
|
||||
if ( $booking_fees ) {
|
||||
|
||||
$html = '<div class="eb-booking-synopsis-item">';
|
||||
|
||||
foreach( $booking_fees as $key => $booking_fee ) {
|
||||
|
||||
foreach ( $fees as $key => $item ) {
|
||||
|
||||
if ( $booking_fee->meta_value == $item['id'] ) {
|
||||
|
||||
$type = !empty( $item["type"] ) ? $item["type"] : '';
|
||||
|
||||
$amount = $item['amount'];
|
||||
|
||||
// Calculate the fee total
|
||||
if ( $type === 'per_booking' ) {
|
||||
|
||||
$fee_amount = $amount;
|
||||
|
||||
} elseif ( $type === 'per_booking_nights' ) {
|
||||
|
||||
$fee_amount = $amount * eb_total_booking_nights($eb_booking->date_from, $eb_booking->date_to);
|
||||
|
||||
} elseif ( $type === 'per_booking_nights_guests' ) {
|
||||
|
||||
$fee_amount = $amount * $eagle_booking_guests * eb_total_booking_nights($eb_booking->date_from, $eb_booking->date_to);
|
||||
|
||||
} else {
|
||||
|
||||
$fee_amount = $amount * $eagle_booking_guests;
|
||||
|
||||
}
|
||||
|
||||
$html .= '<span>'.$item['title'].'</span>';
|
||||
$html .= '<span>'.eb_price( $fee_amount ).'</span>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$html .= "</div>";
|
||||
|
||||
}
|
||||
|
||||
echo $html;
|
||||
|
||||
}
|
||||
|
||||
// Taxes
|
||||
if ( $booking_taxes ) {
|
||||
|
||||
foreach( $booking_taxes as $key => $booking_tax ) {
|
||||
|
||||
foreach ( $taxes as $key => $tax ) {
|
||||
|
||||
if ( $booking_tax->meta_value == $tax['id'] ) {
|
||||
|
||||
$tax_amount = $tax['amount'] * $room_price / 100;
|
||||
|
||||
$html = '<div class="eb-booking-synopsis-item">';
|
||||
$html .= '<span>'.$tax['title'].'</span>';
|
||||
$html .= '<span>'.eb_price( round( $tax_amount ) ).'</span>';
|
||||
$html .= "</div>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo $html;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-booking-synopsis-item total">
|
||||
<span><?php echo __('Total Price', 'eagle-booking') ?></span>
|
||||
<span><?php echo eb_price($eb_booking->final_trip_price) ?></span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user