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:
298
wp-content/plugins/eagle-booking/core/admin/bookings/booking.php
Normal file
298
wp-content/plugins/eagle-booking/core/admin/bookings/booking.php
Normal file
@@ -0,0 +1,298 @@
|
||||
<?php
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Eagle Booking Manage Booking [Admin]
|
||||
* @since 1.2.8
|
||||
* @author Jomin Muskaj
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
class EB_ADMIN_BOOKING {
|
||||
|
||||
public function __construct() {
|
||||
|
||||
// Add Javascript and CSS back-end
|
||||
add_action('admin_enqueue_scripts', array($this,'enqueue'));
|
||||
|
||||
// Add ajax function that will receive the call back for logged in users
|
||||
add_action( 'wp_ajax_admin_availability', array( $this, 'availability') );
|
||||
add_action( 'wp_ajax_admin_create', array( $this, 'create') );
|
||||
add_action( 'wp_ajax_admin_delete', array( $this, 'delete') );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue the required scripts
|
||||
*/
|
||||
public function enqueue() {
|
||||
|
||||
// EnqueUE JS
|
||||
wp_enqueue_script( 'eb-admin-booking', EB_URL .'assets/js/admin/bookings.js', array( 'jquery' ), EB_VERSION, true );
|
||||
|
||||
// Enqueue AJAX
|
||||
wp_localize_script( 'eb-admin-booking', 'booking_variables', array(
|
||||
'ajaxurl' => admin_url('admin-ajax.php'),
|
||||
'nonce' => wp_create_nonce('nonce')
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
// Check Availability
|
||||
function availability() {
|
||||
|
||||
// Check if Ajax response and get Ajax variables
|
||||
if (! empty($_POST['room_id'])) {
|
||||
|
||||
$nonce = sanitize_text_field( $_POST['nonce'] );
|
||||
$room_id = sanitize_text_field( $_POST['room_id'] );
|
||||
$checkin = sanitize_text_field( $_POST['checkin'] );
|
||||
$checkout = sanitize_text_field( $_POST['checkout'] );
|
||||
$room_title = get_the_title($room_id);
|
||||
|
||||
// Format dates for the system
|
||||
$checkin = eagle_booking_system_date_format($checkin);
|
||||
$checkout = eagle_booking_system_date_format($checkout);
|
||||
|
||||
// Check nonce
|
||||
if ( !wp_verify_nonce($nonce, 'nonce') ) {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('Invalid Nonce', 'eagle-booking');
|
||||
|
||||
// // If everything is ok then proceed to the creation
|
||||
} else {
|
||||
|
||||
// Let letch check the availability
|
||||
if ( eagle_booking_is_qnt_available( eb_room_availability( $room_id, $checkin, $checkout), $checkin, $checkout, $room_id ) == 1 ) {
|
||||
|
||||
$return_data['status'] = 'available';
|
||||
$return_data['heading'] = __('Room is Available', 'eagle-booking');
|
||||
$return_data['text'] = sprintf( __('The room %1$s is available on the requested dates. Do you want to submit the booking?', 'eagle-booking'), $room_title);
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'notavailable';
|
||||
$return_data['heading'] = __('Room is not Available', 'eagle-booking');
|
||||
$return_data['text'] = sprintf( __('The room %1$s is not available on the requested dates.', 'eagle-booking'), $room_title);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('No ID', 'eagle-booking');
|
||||
}
|
||||
|
||||
// Return all data to json
|
||||
wp_send_json( $return_data );
|
||||
wp_die();
|
||||
|
||||
}
|
||||
|
||||
// Create Booking
|
||||
function create() {
|
||||
|
||||
// Check if Ajax response and get Ajax variables
|
||||
if (! empty($_POST['room_id'])) {
|
||||
|
||||
$nonce = sanitize_text_field( $_POST['nonce'] );
|
||||
$room_id = sanitize_text_field( $_POST['room_id'] );
|
||||
$checkin = sanitize_text_field( $_POST['checkin'] );
|
||||
$checkout = sanitize_text_field( $_POST['checkout'] );
|
||||
$price = sanitize_text_field( $_POST['price'] );
|
||||
$deposit = sanitize_text_field( $_POST['deposit'] );
|
||||
$firstname = sanitize_text_field( $_POST['firstname'] );
|
||||
$lastname = sanitize_text_field( $_POST['lastname'] );
|
||||
$email = sanitize_text_field( $_POST['email'] );
|
||||
$phone = sanitize_text_field( $_POST['phone'] );
|
||||
$address = sanitize_text_field( $_POST['address'] );
|
||||
$city = sanitize_text_field( $_POST['city'] );
|
||||
$country = sanitize_text_field( $_POST['country'] );
|
||||
$zip = sanitize_text_field( $_POST['zip'] );
|
||||
$arrival = sanitize_text_field( $_POST['arrival'] );
|
||||
$services = sanitize_text_field( $_POST['services'] );
|
||||
$requests = sanitize_text_field( $_POST['requests'] );
|
||||
$status = sanitize_text_field( $_POST['status'] );
|
||||
$payment = sanitize_text_field( $_POST['payment'] );
|
||||
$source = 'admin';
|
||||
|
||||
|
||||
$room_title = get_the_title($room_id);
|
||||
$booking_date = date('H:m:s F j Y');
|
||||
$transaction_id = rand(100000000,999999999);
|
||||
$user_id = 0;
|
||||
$user_ip = 0;
|
||||
$coupon = '';
|
||||
$currency = '$';
|
||||
|
||||
// Set deposit to 0 if is not set
|
||||
if( $deposit == '' ) $deposit = 0;
|
||||
|
||||
// Check guests type
|
||||
if( eb_get_option('eb_adults_children') == true ) {
|
||||
|
||||
$adults = sanitize_text_field( $_POST['adults'] );
|
||||
$children = sanitize_text_field( $_POST['children'] );
|
||||
$guests = $adults + $children;
|
||||
|
||||
} else {
|
||||
|
||||
$adults = '';
|
||||
$children = '';
|
||||
$guests = sanitize_text_field( $_POST['guests'] );
|
||||
|
||||
}
|
||||
|
||||
// Format dates for the system
|
||||
$checkin = eagle_booking_system_date_format( $checkin );
|
||||
$checkout = eagle_booking_system_date_format( $checkout );
|
||||
|
||||
// Check nonce
|
||||
if ( !wp_verify_nonce($nonce, 'nonce') ) {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('Invalid Nonce', 'eagle-booking');
|
||||
|
||||
// // If everything is ok then proceed to the creation
|
||||
} else {
|
||||
|
||||
// Let letch check the availability
|
||||
if ( eagle_booking_is_qnt_available( eb_room_availability( $room_id, $checkin, $checkout), $checkin, $checkout, $room_id ) == 1 ) {
|
||||
|
||||
// Enter the reservation into the db
|
||||
$insert_booking = eb_insert_booking_into_db(
|
||||
$room_id,
|
||||
$room_title,
|
||||
$booking_date,
|
||||
$checkin,
|
||||
$checkout,
|
||||
$guests,
|
||||
$adults,
|
||||
$children,
|
||||
$price,
|
||||
$price,
|
||||
$deposit,
|
||||
$services,
|
||||
$user_id,
|
||||
$firstname,
|
||||
$lastname,
|
||||
$email,
|
||||
$user_ip,
|
||||
$phone,
|
||||
$address.' '.$zip,
|
||||
$city,
|
||||
$country,
|
||||
$requests,
|
||||
$arrival,
|
||||
$coupon,
|
||||
$status,
|
||||
$currency,
|
||||
$transaction_id,
|
||||
$payment,
|
||||
$source
|
||||
);
|
||||
|
||||
// Get the last ID
|
||||
global $eb_booking_id;
|
||||
|
||||
// if success redirect to edit booking page
|
||||
if ( $insert_booking == true ) {
|
||||
|
||||
$return_data['status'] = 'success';
|
||||
$return_data['mssg'] = 'Booking Created Successfully';
|
||||
$return_data['redirect_url'] = 'admin.php?page=eb_edit_booking&id='.$eb_booking_id;
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['mssg'] = 'Something went wrong';
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'success';
|
||||
$return_data['class'] = 'eb-not-available';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('No ID', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Return all data to json
|
||||
wp_send_json( $return_data );
|
||||
|
||||
// wp_die();
|
||||
|
||||
}
|
||||
|
||||
// Delete Booking
|
||||
function delete() {
|
||||
|
||||
// Check if Ajax response and get Ajax variables
|
||||
if (! empty($_POST['booking_id'])) {
|
||||
|
||||
$booking_id = sanitize_text_field( $_POST['booking_id'] ) ;
|
||||
$nonce = sanitize_text_field( $_POST['nonce'] );
|
||||
|
||||
// Check nonce
|
||||
if ( !wp_verify_nonce($nonce, 'nonce') ) {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('Invalid Nonce', 'eagle-booking');
|
||||
|
||||
// // If everything is ok let's proceed to the deletion
|
||||
} else {
|
||||
|
||||
global $wpdb;
|
||||
|
||||
// Delete Booking
|
||||
$delete_qry = $wpdb->delete( EAGLE_BOOKING_TABLE, array( 'ID' => $booking_id ) );
|
||||
|
||||
// Delete Booking Meta
|
||||
$delete_data_qry = $wpdb->delete( EAGLE_BOOKING_TABLE_META, array( 'booking_id' => $booking_id ) );
|
||||
|
||||
if ( $delete_qry == true ) {
|
||||
|
||||
$return_data['status'] = 'success';
|
||||
$return_data['mssg'] = __('Booking Deleted Successfully', 'eagle-booking');
|
||||
$return_data['redirect_url'] = 'admin.php?page=eb_bookings';
|
||||
|
||||
|
||||
flush_rewrite_rules(true);
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'success';
|
||||
$return_data['mssg'] = __('Oops Something Went Wrong', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$return_data['status'] = 'failed';
|
||||
$return_data['mssg'] = __('No ID', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Return all data to json
|
||||
wp_send_json($return_data);
|
||||
wp_die();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$bookings = new EB_ADMIN_BOOKING();
|
||||
@@ -0,0 +1,17 @@
|
||||
<div class="eb-admin-header">
|
||||
|
||||
<div class="eb-admin-brand">
|
||||
<a href="https://eagle-booking.com/?utm_source=eb_header_logo" target="_blank" class="eb-admin-logo">
|
||||
<img src="<?php echo EB_URL ?>assets/images/admin/logo_light.svg" alt="Eagle Booking">
|
||||
</a>
|
||||
<div class="eb-admin-slogan">
|
||||
<span><?php echo "Eagle Booking" ?></sapn>
|
||||
<span><?php echo "Hotel Booking Plugin"?></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="eb-admin-help">
|
||||
<a href="http://docs.eagle-booking.com/?utm_source=eb_header_docs" target="_blank"><i class="far fa-life-ring"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php if (eb_get_option('eb_admin_booking_stats') == true ) : ?>
|
||||
|
||||
<div class="eagle-booking-stats">
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-revenue">
|
||||
<div class="stat-icon">
|
||||
<i class="fas fa-money-bill-wave"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Total Revenue", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php if ( eb_currency_position() == 'before' ) : ?>
|
||||
<?php echo eb_currency() .eagle_booking_total_earnings()?>
|
||||
<?php else : ?>
|
||||
<?php echo eagle_booking_total_earnings() .eb_currency() ?>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-total">
|
||||
<div class="stat-icon">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Total Bookings", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php echo count($eb_bookings_num_status) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-completed">
|
||||
<div class="stat-icon">
|
||||
<i class="far fa-calendar-check"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Completed Bookings", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php echo count($eb_bookings_num_status_completed) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-pending-payment">
|
||||
<div class="stat-icon">
|
||||
<i class="far fa-calendar"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Pending Payment Bookings", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php echo count($eb_bookings_num_status_pending_payment) ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-pending">
|
||||
<div class="stat-icon">
|
||||
<i class="far fa-calendar-minus"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Pending Bookings", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php echo count($eb_bookings_num_status_pending) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- item -->
|
||||
<div class="stat-item stat-canceled">
|
||||
<div class="stat-icon">
|
||||
<i class="far fa-calendar-times"></i>
|
||||
</div>
|
||||
<div class="stat-title">
|
||||
<?php echo esc_html__("Canceled Bookings", 'eagle-booking') ?>
|
||||
</div>
|
||||
<div class="stat-value">
|
||||
<?php echo count($eb_bookings_num_status_canceled) ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif ?>
|
||||
@@ -0,0 +1,491 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Bookings Pges
|
||||
* Author: Eagle Themes
|
||||
* @since 1.0.0
|
||||
* @modified 1.3.3
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
$eb_bookings_per_page = eb_get_option('eb_bookings_per_page');
|
||||
|
||||
if ( $eb_bookings_per_page == '' ) $eb_bookings_per_page = 20;
|
||||
|
||||
if ( isset($_GET["page_no"]) ) {
|
||||
|
||||
$eb_page_no = $_GET["page_no"];
|
||||
|
||||
} else {
|
||||
|
||||
$eb_page_no = 1;
|
||||
|
||||
}
|
||||
|
||||
$eb_bookings_start = $eb_bookings_per_page * ( (float)$eb_page_no - 1 );
|
||||
|
||||
// Sorting Filter
|
||||
if ( isset( $_GET['sortby'] ) ) {
|
||||
|
||||
$eb_sort_by = $_GET['sortby'];
|
||||
|
||||
} else {
|
||||
|
||||
$eb_sort_by = 'id';
|
||||
|
||||
}
|
||||
|
||||
// Status Filter
|
||||
if (isset($_GET["status"])) {
|
||||
$eb_booking_status = $_GET["status"];
|
||||
} else {
|
||||
$eb_booking_status = '';
|
||||
}
|
||||
|
||||
// Branch Filter
|
||||
if ( isset( $_GET['branch_id'] ) ) {
|
||||
|
||||
$eb_selected_branch_id = $_GET['branch_id'];
|
||||
|
||||
} else {
|
||||
|
||||
$eb_selected_branch_id = '';
|
||||
|
||||
}
|
||||
|
||||
// DB QUERY
|
||||
global $wpdb;
|
||||
|
||||
$eagle_booking_booking_id = get_the_ID();
|
||||
$eagle_booking_table_name = $wpdb->prefix . 'eagle_booking';
|
||||
$eb_table_meta_name = $wpdb->prefix . 'eagle_booking_meta';
|
||||
|
||||
// Bookings
|
||||
if ( empty($eb_booking_status) ) {
|
||||
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name ORDER BY $eb_sort_by DESC LIMIT $eb_bookings_start, $eb_bookings_per_page");
|
||||
|
||||
} else {
|
||||
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = '$eb_booking_status' ORDER BY $eb_sort_by DESC LIMIT $eb_bookings_start, $eb_bookings_per_page");
|
||||
|
||||
}
|
||||
|
||||
// Search Query
|
||||
if (isset($_GET["search"])) {
|
||||
$eb_search = $_GET["search"];
|
||||
$eb_bookings = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = '$eb_booking_status' AND user_first_name LIKE '%$eb_search%' OR user_last_name LIKE '%$eb_search%' OR title_post LIKE '%$eb_search%' OR id LIKE '%$eb_search%' OR paypal_tx LIKE '%$eb_search%' ORDER BY $eb_sort_by");
|
||||
|
||||
}
|
||||
|
||||
$eb_bookings_num_status = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name");
|
||||
$eb_bookings_num_status_pending = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = 'Pending'");
|
||||
$eb_bookings_num_status_pending_payment = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = 'Pending Payment'");
|
||||
$eb_bookings_num_status_canceled = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = 'Canceled'");
|
||||
$eb_bookings_num_status_completed = $wpdb->get_results( "SELECT * FROM $eagle_booking_table_name WHERE paypal_payment_status = 'Completed'");
|
||||
|
||||
?>
|
||||
<div class="eb-admin eb-wrapper">
|
||||
|
||||
<?php include EB_PATH.''."core/admin/bookings/elements/admin-header.php"; ?>
|
||||
|
||||
<div class="eb-admin-title">
|
||||
|
||||
<div>
|
||||
<h1 class="wp-heading-inline"><?php echo __('Bookings','eagle-booking') ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="eb-admin-new-booking">
|
||||
<a href="<?php echo admin_url( 'admin.php?page=eb_new_booking') ?>" class="eb-new-booking-btn"><?php echo __('Add New Booking','eagle-booking') ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
if ($eb_bookings) {
|
||||
|
||||
/**
|
||||
* Include Stats
|
||||
*
|
||||
* @since 1.2.9.6
|
||||
*/
|
||||
|
||||
include_once EB_PATH . 'core/admin/bookings/include/bookings-stats.php';
|
||||
|
||||
?>
|
||||
|
||||
<div class="booking-search">
|
||||
|
||||
<label><?php echo __('Sort by','eagle-booking') ?></label>
|
||||
<select class="eb_bookings_filter" style="margin-right: 20px">
|
||||
<option <?php if ($eb_sort_by == '' || $eb_sort_by == 'id') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&sortby=id&<?php echo $eb_booking_status ?>&branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('ID','eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_sort_by == 'date_from') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&sortby=date_from&<?php echo $eb_booking_status ?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __ ('Check In', 'eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_sort_by == 'date_to') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&sortby=date_to&<?php echo $eb_booking_status ?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __ ('Check Out', 'eagle-booking') ?>
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<label><?php echo __('Status','eagle-booking') ?></label>
|
||||
<select class="eb_bookings_filter" style="margin-right: 20px">
|
||||
<option <?php if ($eb_booking_status == '') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&status&sortby=<?php echo $eb_sort_by?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('All','eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_booking_status == 'Pending') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&status=Pending&sortby=<?php echo $eb_sort_by?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('Pending','eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_booking_status == 'Pending Payment') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&status=Pending Payment&sortby=<?php echo $eb_sort_by?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('Pending Payment','eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_booking_status == 'Completed') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&status=Completed&sortby=<?php echo $eb_sort_by?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('Completed','eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($eb_booking_status == 'Canceled') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&status=Canceled&sortby=<?php echo $eb_sort_by?> &branch_id=<?php echo $eb_selected_branch_id ?>">
|
||||
<?php echo __('Canceled','eagle-booking') ?>
|
||||
</option>
|
||||
</select>
|
||||
|
||||
<label><?php echo __('Branch','eagle-booking') ?></label>
|
||||
<select class="eb_bookings_filter">
|
||||
|
||||
<option <?php if ($eb_booking_status == '') { echo 'selected="slected"'; } ?> value="admin.php?page=eb_bookings&branch_id=&sortby=<?php echo $eb_sort_by?>&status=<?php echo $eb_booking_status ?>">
|
||||
<?php echo __('All','eagle-booking') ?>
|
||||
</option>
|
||||
|
||||
<?php
|
||||
|
||||
$args = array(
|
||||
'taxonomy' => 'eagle_branch',
|
||||
'hide_empty' => false,
|
||||
);
|
||||
|
||||
$branch_query = new WP_Term_Query($args);
|
||||
|
||||
if ( !empty( $branch_query->terms ) ) {
|
||||
|
||||
foreach ( $branch_query->terms as $eb_branch ) {
|
||||
|
||||
$eb_branch_id = $eb_branch->term_id;
|
||||
$eb_branch_name = get_term_field( 'name', $eb_branch );
|
||||
|
||||
echo '<option value="admin.php?page=eb_bookings&branch_id='.$eb_branch_id.'&sortby='.$eb_sort_by.'&status='.$eb_booking_status.'" '.($eb_selected_branch_id == $eb_branch_id ? "selected='selected'" : "" ).' >'.$eb_branch_name.'</option>';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</select>
|
||||
|
||||
<div class="bookings-search" name="eb-bookings-search">
|
||||
<form method="GET">
|
||||
<input type="hidden" name="page" value="eb_bookings">
|
||||
<input type="hidden" name="status" value="<?php echo $eb_booking_status ?>">
|
||||
<input type="hidden" name="sortby" value="<?php echo $eb_sort_by ?>">
|
||||
<input type="text" name="search" class="search-box" placeholder="<?php echo esc_html__('Search Bookings by ID, Name, Surname or Transaction ID', 'eagle-booking') ?>">
|
||||
<button class="button search-button"><?php echo esc_html__('Search', 'eagle-booking') ?></button>
|
||||
<form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="bookings-table">
|
||||
<tbody>
|
||||
<tr class="thead">
|
||||
<td width="3%"><?php echo __('ID','eagle-booking') ?></td>
|
||||
<td width="20%"><?php echo __('Room','eagle-booking') ?></td>
|
||||
<!--
|
||||
<?php if ( !empty( $branch_query->terms ) ) : ?>
|
||||
<td width="7%"><?php echo __('Branch','eagle-booking') ?></td>
|
||||
<?php endif ?> -->
|
||||
|
||||
<td width="10%"><?php echo __('Booking Dates','eagle-booking') ?></td>
|
||||
<td width="10%"><?php echo __('Total Price','eagle-booking') ?></td>
|
||||
<td width="12%"><?php echo __('Full Name','eagle-booking') ?></td>
|
||||
<td width="5%"><?php echo __('Guests','eagle-booking') ?></td>
|
||||
<td width="10%"><?php echo __('Payment Method','eagle-booking') ?></td>
|
||||
<td class="booking-status-col" width="10%"><?php echo __('Status','eagle-booking') ?></td>
|
||||
<td width="10%"><?php echo __('Source','eagle-booking') ?></td>
|
||||
<td width="10%"><?php echo __('Action','eagle-booking') ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
foreach ( $eb_bookings as $eb_booking ) {
|
||||
|
||||
$branches = get_the_terms( $eb_booking->id_post, 'eagle_branch' );
|
||||
|
||||
if ( $branches ) {
|
||||
|
||||
foreach ( $branches as $branch ) {
|
||||
|
||||
$eb_room_branch_id = $branch->term_id;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
$eb_room_branch_id = '';
|
||||
|
||||
}
|
||||
|
||||
if ( ( $eb_selected_branch_id == '' ) || ( $eb_selected_branch_id == $eb_room_branch_id ) ) {
|
||||
|
||||
|
||||
// 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');
|
||||
|
||||
} elseif ($eb_booking->action_type === 'external') {
|
||||
|
||||
$eb_booking_payment_method_text = __('External Payment ', 'eagle-booking');
|
||||
|
||||
}
|
||||
|
||||
// Room Image
|
||||
$eb_booking_id = $eb_booking->id;
|
||||
$eb_room_id = $eb_booking->id_post;
|
||||
$eagle_booking_image_id = get_post_thumbnail_id($eb_room_id);
|
||||
$eagle_booking_image_attributes = wp_get_attachment_image_src( $eagle_booking_image_id, 'thumbnail' );
|
||||
$eagle_booking_room_img_src = $eagle_booking_image_attributes[0];
|
||||
$eagle_booking_booking_id = $eb_booking->id_user;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<tr class="eb-booking-line" data-booking-id="<?php echo $eb_booking_id ?>">
|
||||
<td>
|
||||
<?php echo $eb_booking_id ?>
|
||||
</td>
|
||||
<td>
|
||||
<div style="display:flex;">
|
||||
<div style="width:80px; vertical-align:middle;">
|
||||
<a href="<?php echo get_edit_post_link( $eb_booking->id_post ) ?>" target="_blank">
|
||||
<img width="50" src="<?php echo $eagle_booking_room_img_src ?>" style="border-radius: 2px; display: block">
|
||||
</a>
|
||||
</div>
|
||||
<div class="room-details">
|
||||
<h2 class="room-title">
|
||||
<a href="<?php echo get_edit_post_link( $eb_booking->id_post ) ?>" target="_blank"><?php echo $eb_booking->title_post ?></a>
|
||||
</h2>
|
||||
|
||||
|
||||
<?php if ( !empty( $branch_query->terms ) ) : ?>
|
||||
<div class="room-branch"><?php echo eb_room_branch($eb_booking->id_post) ?></div>
|
||||
<?php endif ?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
<?php if ( !empty( $branch_query->terms ) ) : ?>
|
||||
<td><?php echo eb_room_branch($eb_booking->id_post) ?></td>
|
||||
<?php endif ?> -->
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
<div>
|
||||
<span><?php echo $eb_booking->user_first_name.' '.$eb_booking->user_last_name ?></span>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $eb_booking->guests ?>
|
||||
</td>
|
||||
<td><span><?php echo $eb_booking_payment_method_text ?></span></td>
|
||||
<td class="booking-status-col"><span class="booking-status status-<?php echo esc_attr($eb_booking_status_class) ?>"><?php echo $eb_booking_status_text ?></span></td>
|
||||
<td><?php echo eb_booking_source( $eb_booking_id, true ) ?></td>
|
||||
<td>
|
||||
<div class="eb-action-buttons">
|
||||
|
||||
|
||||
<?php if ( eb_booking_source($eb_booking_id) === 'direct' || eb_booking_source($eb_booking_id) === 'admin' || eb_booking_source($eb_booking_id) === '' ) : ?>
|
||||
|
||||
<a href="admin.php?page=eb_edit_booking&id=<?php echo $eb_booking_id ?>" class="eb-edit-action"><i class="far fa-edit"></i></a>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
<span data-eb-tooltip="<?php echo __('External Bookings can NOT be edited!', 'eagle-booking') ?>" class="eb-edit-action"><i class="far fa-edit"></i></span>
|
||||
|
||||
<?php endif ?>
|
||||
|
||||
<span class="eb-delete-action eb-delete-booking" data-booking-id="<?php echo $eb_booking_id ?>" ><i class="far fa-trash-alt"></i></span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
|
||||
// Get total pages based on status filter
|
||||
|
||||
if ( $eb_booking_status == 'Pending' ) {
|
||||
|
||||
$eb_total_pages_num = ceil( count( $eb_bookings_num_status_pending ) / $eb_bookings_per_page ) ;
|
||||
|
||||
} elseif ( $eb_booking_status == 'Pending Payment' ) {
|
||||
|
||||
$eb_total_pages_num = ceil( count( $eb_bookings_num_status_pending_payment ) / $eb_bookings_per_page ) ;
|
||||
|
||||
} elseif ( $eb_booking_status == 'Completed' ) {
|
||||
|
||||
$eb_total_pages_num = ceil( count( $eb_bookings_num_status_completed ) / $eb_bookings_per_page ) ;
|
||||
|
||||
} else {
|
||||
|
||||
$eb_total_pages_num = ceil( count( $eb_bookings_num_status ) / $eb_bookings_per_page ) ;
|
||||
|
||||
}
|
||||
|
||||
$current_page = (float)$eb_page_no;
|
||||
|
||||
|
||||
// Calculate pages to output.
|
||||
$end_size = 2;
|
||||
$mid_size = 2;
|
||||
$start_pages = range( 1, $end_size );
|
||||
$end_pages = range( $eb_total_pages_num - $end_size + 1, $eb_total_pages_num );
|
||||
$mid_pages = range( $current_page - $mid_size, $current_page + $mid_size );
|
||||
$pages = array_intersect( range( 1, $eb_total_pages_num ), array_merge( $start_pages, $end_pages, $mid_pages ) );
|
||||
$prev_page = 0;
|
||||
|
||||
?>
|
||||
<nav class="eb-pagination">
|
||||
<ul>
|
||||
<?php if ( $current_page && $current_page > 1 ) : ?>
|
||||
<li><a href="?page=eb_bookings&page_no=<?php echo $current_page - 1 ?><?php echo '&status='.$eb_booking_status.'&branch_id='.$eb_selected_branch_id.'&sortby='.$eb_sort_by ?>" data-page="<?php echo esc_attr( $current_page - 1 ); ?>">←</a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
foreach ( $pages as $page ) {
|
||||
if ( $prev_page != $page - 1 ) {
|
||||
echo '<li><span>...</span></li>';
|
||||
}
|
||||
if ( $current_page == $page ) {
|
||||
echo '<li class="current"><a data-page="' . esc_attr( $page ) . '">' . esc_html( $page ) . '</a></li>';
|
||||
} else {
|
||||
echo '<li><a href="?page=eb_bookings&page_no='. $page .'&status='.$eb_booking_status.'&branch_id='.$eb_selected_branch_id.'&sortby='.$eb_sort_by.'" data-page="' . esc_attr( $page ) . '">' . esc_html( $page ) . '</a></li>';
|
||||
}
|
||||
$prev_page = $page;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php if ( $current_page && $current_page < $eb_total_pages_num ) : ?>
|
||||
<li><a href="?page=eb_bookings&page_no=<?php echo $current_page + 1 ?><?php echo '&status='.$eb_booking_status.'&branch_id='.$eb_selected_branch_id.'&sortby='.$eb_sort_by ?>" data-page="<?php echo esc_attr( $current_page + 1 ); ?>">→</a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<div class="eb-popup">
|
||||
<div class="eb-popup-inner">
|
||||
<span class="eb-close-popup"><i class="fas fa-times"></i></span>
|
||||
<div class="eb-popup-icon failed">
|
||||
<i class="far fa-trash-alt"></i>
|
||||
</div>
|
||||
<h3 class="title"><?php echo __('Delete Booking', 'eagle-booking') ?> #<span id="eb_booking_id_text"></span></h3>
|
||||
<p><?php echo __('This action cannot be undone. Are you sure you want to delete this booking?', 'eagle-booking') ?></p>
|
||||
<button class="btn btn-delete" id="eb_delete_booking_confirmation" data-booking-id="">
|
||||
<span class="eb-btn-text"><?php echo __('Yes, delete this booking', 'eagle-booking') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- No Results -->
|
||||
<?php } else { ?>
|
||||
|
||||
<div class="eb-no-bookings">
|
||||
<i class="far fa-frown"></i>
|
||||
<p><?php echo __('You do not have any booking yet.', 'eagle-booking')?></p>
|
||||
<a href="<?php echo admin_url( 'admin.php?page=eb_new_booking') ?>"><?php echo __('Add New Booking', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
@@ -0,0 +1,318 @@
|
||||
<?php
|
||||
|
||||
// Check if the cal_days_in_month function is enabled
|
||||
if ( function_exists( 'cal_days_in_month' ) ) {
|
||||
|
||||
// Prev / Next Month
|
||||
function eb_next_prev_month_year($eb_date, $eb_month_year, $eb_next_prev) {
|
||||
|
||||
if ($eb_next_prev == 'next') {
|
||||
$eb_get_next_month_year = date('Y-m-d', strtotime($eb_date.' + 1 month'));
|
||||
} else {
|
||||
$eb_get_next_month_year = date('Y-m-d', strtotime($eb_date.' - 1 month'));
|
||||
}
|
||||
|
||||
if ($eb_month_year == 'month') {
|
||||
$eb_next_m_y = date_format(new DateTime($eb_get_next_month_year), 'm');
|
||||
} else {
|
||||
$eb_next_m_y = date_format(new DateTime($eb_get_next_month_year), 'Y');
|
||||
}
|
||||
|
||||
return $eb_next_m_y;
|
||||
}
|
||||
|
||||
// Month Name (include translation)
|
||||
function eb_month_name($eb_date) {
|
||||
|
||||
$eb_month_name = date('Y-m-d', strtotime($eb_date));
|
||||
$eb_month = date_format(new DateTime($eb_month_name),'F');
|
||||
|
||||
$search = array(
|
||||
'January',
|
||||
'February',
|
||||
'March',
|
||||
'April',
|
||||
'May',
|
||||
'June',
|
||||
'July',
|
||||
'August',
|
||||
'September',
|
||||
'October',
|
||||
'November',
|
||||
'December',
|
||||
);
|
||||
|
||||
$replace = array(
|
||||
__('January', 'eagle-booking'),
|
||||
__('February', 'eagle-booking'),
|
||||
__('March', 'eagle-booking'),
|
||||
__('April', 'eagle-booking'),
|
||||
__('May', 'eagle-booking'),
|
||||
__('June', 'eagle-booking'),
|
||||
__('July', 'eagle-booking'),
|
||||
__('August', 'eagle-booking'),
|
||||
__('September', 'eagle-booking'),
|
||||
__('October', 'eagle-booking'),
|
||||
__('November', 'eagle-booking'),
|
||||
__('December', 'eagle-booking'),
|
||||
);
|
||||
|
||||
$eb_month = str_replace($search, $replace, $eb_month);
|
||||
|
||||
return $eb_month;
|
||||
}
|
||||
|
||||
// Check if month isset
|
||||
if (isset($_POST['eb_month'])) {
|
||||
|
||||
$eb_month = sanitize_text_field($_POST['eb_month']);
|
||||
$eb_year = sanitize_text_field($_POST['eb_year']);
|
||||
$eb_new_date = $eb_year.'-'.$eb_month.'-1';
|
||||
$eb_today = $eb_month;
|
||||
$eb_year = $eb_year;
|
||||
$eb_tot_days = cal_days_in_month(CAL_GREGORIAN, $eb_today, $eb_year);
|
||||
|
||||
$eb_next_month = eb_next_prev_month_year($eb_new_date, 'month','next');
|
||||
$eb_next_year = eb_next_prev_month_year($eb_new_date, 'year','next');
|
||||
$eb_prev_month = eb_next_prev_month_year($eb_new_date, 'month','prev');
|
||||
$eb_prev_year = eb_next_prev_month_year($eb_new_date, 'year','prev');
|
||||
|
||||
// Current / Default Month
|
||||
} else {
|
||||
|
||||
$eb_today = date('n');
|
||||
$eb_year = date('Y');
|
||||
$eb_tot_days = cal_days_in_month(CAL_GREGORIAN, $eb_today, $eb_year);
|
||||
$eb_next_month = eb_next_prev_month_year(date('Y-m-d'),'month','next');
|
||||
$eb_next_year = eb_next_prev_month_year(date('Y-m-d'),'year','next');
|
||||
$eb_prev_month = eb_next_prev_month_year(date('Y-m-d'),'month','prev');
|
||||
$eb_prev_year = eb_next_prev_month_year(date('Y-m-d'),'year','prev');
|
||||
}
|
||||
|
||||
$eb_month_name_date = $eb_year.'-'.$eb_today.'-1';
|
||||
$eb_short_month_name = mb_substr(eb_month_name($eb_month_name_date), 0, 3);
|
||||
|
||||
|
||||
$args = array(
|
||||
'taxonomy' => 'eagle_branch',
|
||||
'hide_empty' => false,
|
||||
);
|
||||
|
||||
$branch_query = new WP_Term_Query($args);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-wrapper">
|
||||
|
||||
<?php include EB_PATH.''."core/admin/bookings/elements/admin-header.php"; ?>
|
||||
|
||||
<div class="eb-admin-title">
|
||||
|
||||
<div>
|
||||
<h1 class="wp-heading-inline"><?php echo __('Calendar','eagle-booking') ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="eb-admin-new-booking">
|
||||
<a href="<?php echo admin_url( 'admin.php?page=eb_new_booking') ?>" class="eb-new-booking-btn"><?php echo __('Add New Booking','eagle-booking') ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="eb-calendar-view">
|
||||
|
||||
<div class="calendar-month">
|
||||
<span>
|
||||
<form method="POST" action="admin.php?page=eb_calendar">
|
||||
<input type="hidden" name="eb_month" value="<?php echo $eb_prev_month ?>">
|
||||
<input type="hidden" name="eb_year" value="<?php echo $eb_prev_year ?>">
|
||||
<button type="submit"><i class="fas fa-chevron-left"></i></button>
|
||||
</form>
|
||||
</span>
|
||||
<span>
|
||||
<h2><?php echo eb_month_name($eb_month_name_date).' '.$eb_year ?></h2>
|
||||
</span>
|
||||
<span>
|
||||
<form method="POST" action="admin.php?page=eb_calendar">
|
||||
<input type="hidden" name="eb_month" value="<?php echo $eb_next_month ?>">
|
||||
<input type="hidden" name="eb_year" value="<?php echo $eb_next_year ?>">
|
||||
<button type="submit"><i class="fas fa-chevron-right"></i></button>
|
||||
</form>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<table class="calendar-days">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="20%"><strong><?php echo __('Room Title', 'eagle-booking') ?></strong></th>
|
||||
<?php for ($eb_i = 1; $eb_i <= $eb_tot_days; $eb_i++) :
|
||||
$eb_date = $eb_today.'/'.$eb_i.'/'.$eb_year;
|
||||
|
||||
$day_name = date( "D",strtotime($eb_date) );
|
||||
|
||||
$search = array(
|
||||
'Mon',
|
||||
'Tue',
|
||||
'Wed',
|
||||
'Thu',
|
||||
'Fri',
|
||||
'Sat',
|
||||
'Sun',
|
||||
);
|
||||
|
||||
$replace = array(
|
||||
__('Mon', 'eagle-booking'),
|
||||
__('Tue', 'eagle-booking'),
|
||||
__('Wed', 'eagle-booking'),
|
||||
__('Thu', 'eagle-booking'),
|
||||
__('Fri', 'eagle-booking'),
|
||||
__('Sat', 'eagle-booking'),
|
||||
__('Sun', 'eagle-booking'),
|
||||
);
|
||||
|
||||
$day_name = str_replace($search, $replace, $day_name);
|
||||
|
||||
?>
|
||||
<th class="calendar-day">
|
||||
<span><strong><?php echo $day_name ?></strong></span>
|
||||
<span><strong><?php echo $eb_i ?></strong></span>
|
||||
<span><?php echo $eb_short_month_name ?></span>
|
||||
<span><?php echo $eb_year ?></span>
|
||||
</th>
|
||||
<?php endfor ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$args = array(
|
||||
'post_type' => 'eagle_rooms',
|
||||
'posts_per_page' => -1
|
||||
);
|
||||
|
||||
$the_query = new WP_Query( $args );
|
||||
|
||||
while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
|
||||
|
||||
<?php
|
||||
// Defaults
|
||||
$eb_room_title = get_the_title();
|
||||
$eb_room_id = get_the_ID();
|
||||
$eb_room_url = get_edit_post_link( $eb_room_id );
|
||||
$eb_room_qnt = get_post_meta( $eb_room_id, 'eagle_booking_mtb_room_quantity', true );
|
||||
?>
|
||||
|
||||
<tr class="calendar-room">
|
||||
|
||||
<td class="room-title">
|
||||
|
||||
<h3><a href="<?php echo esc_url($eb_room_url) ?>" target="_blank"><?php echo $eb_room_title ?> <span class="room-qnt"><?php echo $eb_room_qnt ?></span></a></h3>
|
||||
|
||||
<?php if ( !empty( $branch_query->terms ) ) : ?>
|
||||
<div class="room-branch"><?php echo eb_room_branch($eb_room_id) ?></div>
|
||||
<?php endif ?>
|
||||
|
||||
</td>
|
||||
|
||||
<?php
|
||||
|
||||
for ($eb_i = 1; $eb_i <= $eb_tot_days; $eb_i++) :
|
||||
|
||||
// Dates
|
||||
$eb_date_from = $eb_today.'/'.$eb_i.'/'.$eb_year;
|
||||
$eb_date_to = date('m/d/Y', strtotime($eb_date_from.' + 1 days'));
|
||||
$eb_date = date('m/d/Y', strtotime($eb_date_to.' - 1 days'));
|
||||
|
||||
// Check Availability
|
||||
$eb_availability = eagle_booking_is_qnt_available( eb_room_availability($eb_room_id, $eb_date_from, $eb_date_to), $eb_date_from, $eb_date_to, $eb_room_id );
|
||||
|
||||
$eb_availability_block = eb_room_is_available_block( $eb_room_id, $eb_date_from, $eb_date_to );
|
||||
|
||||
if ( $eb_availability == 0 ) {
|
||||
|
||||
// Booked / Not Available
|
||||
$eb_date_class = 'eb-room-booked eb-room-not-available';
|
||||
|
||||
|
||||
} elseif ( $eb_availability_block == 0 ) {
|
||||
|
||||
// Blocked
|
||||
$eb_date_class = 'eb-room-blocked';
|
||||
|
||||
} else {
|
||||
|
||||
if ( eb_room_availability($eb_room_id, $eb_date_from, $eb_date_to) != '' ) {
|
||||
|
||||
// Booked / Available
|
||||
$eb_date_class = 'eb-room-booked eb-room-still-available';
|
||||
|
||||
} else {
|
||||
|
||||
// Not Booked
|
||||
$eb_date_class = '';
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<td class="eb-room-availability <?php echo esc_attr($eb_date_class) ?>" data-date="<?php echo $eb_date ?>" data-room-id="<?php echo $eb_room_id ?>" data-room-title="<?php echo $eb_room_title ?>" data-displayed-date="<?php echo eagle_booking_displayd_date_format($eb_date) ?>"></td>
|
||||
|
||||
<?php endfor ?>
|
||||
</tr>
|
||||
<?php endwhile; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
|
||||
<!-- Calendar Bookings Footer -->
|
||||
<div class="calendar-bookings-footer">
|
||||
<ul class="">
|
||||
<li><span class="room-qnt"></span> <?php echo __('Room Quantity', 'eagle-booking') ?></li>
|
||||
</ul>
|
||||
<ul class="availability-calendar-list-availability eb-pull-right">
|
||||
<li><span class="available"></span><?php echo __('Booked / Available', 'eagle-booking') ?></li>
|
||||
<li><span class="not-available"></span><?php echo __('Booked / Not Available', 'eagle-booking') ?> </li>
|
||||
<li><span class="blocked"></span><?php echo __('Blocked / Not Available', 'eagle-booking') ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Create a popup here and tigger it on date hover -->
|
||||
<div id="eb-room-availability-popup" class="eb-popover" style="display: none">
|
||||
<div class="inner">
|
||||
<h2 id="eb-calendar-title-loading"><?php echo __('Loading...', 'eagle-booking') ?></h2>
|
||||
<h2 id="eb-calendar-title"><?php echo __('Bookings for', 'eagle-booking') ?> <span id="eb-calendar-room-title"></span> <?php echo __('on', 'eagle-booking' )?> <span id="eb-calendar-date"></span></h2>
|
||||
<div id="content"></div>
|
||||
<div class="popup-footer">
|
||||
<ul class="booking-status-explanation">
|
||||
<li><span class="status completed"></span><?php echo __('Completed', 'eagle-booking' ) ?></li>
|
||||
<li><span class="status pending-payment"></span><?php echo __('Pending Payment', 'eagle-booking') ?></li>
|
||||
<li><span class="status pending"></span><?php echo __('Pending', 'eagle-booking') ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Delete Popup -->
|
||||
<div class="eb-popup">
|
||||
<div class="eb-popup-inner">
|
||||
<span class="eb-close-popup"><i class="fas fa-times"></i></span>
|
||||
<div class="eb-popup-icon failed">
|
||||
<i class="far fa-trash-alt"></i>
|
||||
</div>
|
||||
<h3 class="title"><?php echo __('Delete Booking', 'eagle-booking') ?> #<span id="eb_booking_id_text"></span></h3>
|
||||
<p><?php echo __('This action cannot be undone. Are you sure you want to delete this booking?', 'eagle-booking') ?></p>
|
||||
<button class="btn btn-delete" id="eb_delete_booking_confirmation" data-booking-id="">
|
||||
<span class="eb-btn-text"><?php echo __('Yes, delete this booking', 'eagle-booking') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } else {
|
||||
|
||||
echo '<div class="error"><h3>Eagle Booking</h3><p>It seems that the PHP core function <strong>cal_days_in_month()</strong> is disabled. To display the calendar this function is mandatory. Please get in touch with your hosting provider and ask them to enable the cal_days_in_month() function. <a href="https://www.php.net/manual/en/function.cal-days-in-month.php" target="_blank">More details.</a></p></div>';
|
||||
}
|
||||
@@ -0,0 +1,589 @@
|
||||
<?php
|
||||
/* --------------------------------------------------------------------------
|
||||
* Edit Booking
|
||||
* @ since 1.0.0
|
||||
* @ modified 1.3.3
|
||||
---------------------------------------------------------------------------*/
|
||||
if ( isset($_GET["id"]) && $_GET['id'] != '' ) {
|
||||
|
||||
$eagle_booking_booking_id = $_GET['id'];
|
||||
|
||||
global $wpdb;
|
||||
|
||||
$eagle_booking_table_name = $wpdb->prefix . 'eagle_booking';
|
||||
$eb_table_meta_name = $wpdb->prefix . 'eagle_booking_meta';
|
||||
$eagle_booking_booking_update = 0;
|
||||
|
||||
// UPDATE BOOKING
|
||||
if (isset($_POST['eagle_booking_booking_id'])) {
|
||||
$eagle_booking_booking_id = sanitize_text_field($_POST['eagle_booking_booking_id']);
|
||||
$eagle_booking_checkin = sanitize_text_field($_POST['eagle_booking_booking_date_from']);
|
||||
$eagle_booking_checkout = sanitize_text_field($_POST['eagle_booking_booking_date_to']);
|
||||
|
||||
// Guests
|
||||
if (eb_get_option('eb_adults_children') == true) {
|
||||
$eagle_booking_adults = sanitize_text_field($_POST['eagle_booking_booking_adults']);
|
||||
$eagle_booking_children = sanitize_text_field($_POST['eagle_booking_booking_children']);
|
||||
$eagle_booking_guests = $eagle_booking_adults + $eagle_booking_children;
|
||||
} else {
|
||||
$eagle_booking_adults = 0;
|
||||
$eagle_booking_children = 0;
|
||||
$eagle_booking_guests = sanitize_text_field($_POST['eagle_booking_booking_guests']);
|
||||
}
|
||||
|
||||
// Deposit Amount
|
||||
if (eb_get_option('eagle_booking_deposit_amount') < 100) {
|
||||
$eb_deposit_amount = sanitize_text_field($_POST['eagle_booking_deposit_amount']);
|
||||
} else {
|
||||
$eb_deposit_amount = sanitize_text_field($_POST['eagle_booking_booking_final_trip_price']);
|
||||
}
|
||||
|
||||
$eagle_booking_edit_booking = $wpdb->update(
|
||||
$eagle_booking_table_name,
|
||||
array(
|
||||
'id' => sanitize_text_field($_POST['eagle_booking_booking_id']),
|
||||
'id_post' => sanitize_text_field($_POST['eagle_booking_booking_id_post']),
|
||||
'title_post' => sanitize_text_field($_POST['eagle_booking_booking_title_post']),
|
||||
'date' => sanitize_text_field($_POST['eagle_booking_booking_date']),
|
||||
'date_from' => eagle_booking_system_date_format($eagle_booking_checkin),
|
||||
'date_to' => eagle_booking_system_date_format($eagle_booking_checkout),
|
||||
'guests' => $eagle_booking_guests,
|
||||
'adults' => $eagle_booking_adults,
|
||||
'children' => $eagle_booking_children,
|
||||
'final_trip_price' => sanitize_text_field($_POST['eagle_booking_booking_final_trip_price']),
|
||||
'extra_services' => sanitize_text_field($_POST['eagle_booking_booking_extra_services']),
|
||||
'id_user' => sanitize_text_field($_POST['eagle_booking_booking_id_user']),
|
||||
'user_ip' => sanitize_text_field($_POST['eb_user_ip']),
|
||||
'user_first_name' => sanitize_text_field($_POST['eagle_booking_booking_user_first_name']),
|
||||
'user_last_name' => sanitize_text_field($_POST['eagle_booking_booking_user_last_name']),
|
||||
'paypal_email' => sanitize_text_field($_POST['eagle_booking_booking_paypal_email']),
|
||||
'user_phone' => sanitize_text_field($_POST['eagle_booking_booking_user_phone']),
|
||||
'user_address' => sanitize_text_field($_POST['eagle_booking_booking_user_address']),
|
||||
'user_city' => sanitize_text_field($_POST['eagle_booking_booking_user_city']),
|
||||
'user_country' => sanitize_text_field($_POST['eagle_booking_booking_user_country']),
|
||||
'deposit_amount' => $eb_deposit_amount,
|
||||
'user_message' => sanitize_text_field($_POST['eagle_booking_booking_user_message']),
|
||||
'user_arrival' => sanitize_text_field($_POST['eagle_booking_booking_user_arrival']),
|
||||
'user_coupon' => sanitize_text_field($_POST['eagle_booking_booking_user_coupon']),
|
||||
'paypal_payment_status' => sanitize_text_field($_POST['eagle_booking_booking_paypal_payment_status']),
|
||||
'paypal_currency' => sanitize_text_field($_POST['eagle_booking_booking_paypal_currency']),
|
||||
'paypal_tx' => sanitize_text_field($_POST['eagle_booking_booking_paypal_tx']),
|
||||
'action_type' => sanitize_text_field($_POST['eagle_booking_booking_action_type']),
|
||||
),
|
||||
array( 'ID' => sanitize_text_field($_POST['eagle_booking_booking_id']) )
|
||||
);
|
||||
|
||||
$eagle_booking_booking_update = 1;
|
||||
}
|
||||
|
||||
// SELECT BOOKINGS
|
||||
$bookings = $wpdb->get_results("SELECT * FROM $eagle_booking_table_name WHERE id = $eagle_booking_booking_id");
|
||||
|
||||
if (empty($bookings)) : ?>
|
||||
|
||||
<p><?php echo __('There was a DB error', 'eagle-booking') ?></p>
|
||||
|
||||
<?php else :
|
||||
|
||||
foreach ($bookings as $booking) :
|
||||
|
||||
$eagle_booking_id = $booking->id_post;
|
||||
$eagle_booking_image_id = get_post_thumbnail_id($eagle_booking_id);
|
||||
$eagle_booking_image_attributes = wp_get_attachment_image_src($eagle_booking_image_id, 'thumbnail');
|
||||
$eagle_booking_room_img_src = $eagle_booking_image_attributes[0];
|
||||
|
||||
$eb_user_id = $booking->id_user;
|
||||
if ($eb_user_id) {
|
||||
$eb_user_name = get_user_by('id', $eb_user_id)->user_login;
|
||||
}
|
||||
|
||||
|
||||
// Get the payment method text
|
||||
if ($booking->action_type === 'payment_on_arrive') {
|
||||
$eb_new_action_type_text = __('Payment on Arrival', 'eagle-booking');
|
||||
} elseif ($booking->action_type === '2checkout') {
|
||||
$eb_new_action_type_text = __('2Checkout', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'bank_transfer') {
|
||||
$eb_new_action_type_text = __('Bank Transfer', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'PayU') {
|
||||
$eb_new_action_type_text = __('PayU', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'paystack') {
|
||||
$eb_new_action_type_text = __('Paystack', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'flutterwave') {
|
||||
$eb_new_action_type_text = __('Flutterwave', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'vivawallet') {
|
||||
$eb_new_action_type_text = __('Viva Wallet', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'razorpay') {
|
||||
$eb_new_action_type_text = __('Razorpay', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'booking_request') {
|
||||
$eb_new_action_type_text = __('Booking Request', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'stripe') {
|
||||
$eb_new_action_type_text = __('Stripe', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'paypal') {
|
||||
$eb_new_action_type_text = __('PayPal', 'eagle-booking');
|
||||
} elseif ($booking->action_type === 'external') {
|
||||
$eb_new_action_type_text = __('External Payment', 'eagle-booking');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-wrapper eb-admin-page eb-admin-booking-details">
|
||||
|
||||
<?php
|
||||
|
||||
// Print Logo - too be removed
|
||||
$eb_hotel_logo = eb_get_option('hotel_logo'); ?>
|
||||
|
||||
<div class="hotel-logo-print">
|
||||
<?php
|
||||
if (!empty($eb_hotel_logo)) {
|
||||
echo "<img src=".$eb_hotel_logo." height='25px'>";
|
||||
} else {
|
||||
echo get_bloginfo('name');
|
||||
} ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php include EB_PATH.''."core/admin/bookings/elements/admin-header.php"; ?>
|
||||
|
||||
<div class="eb-admin-title">
|
||||
|
||||
<div>
|
||||
<h1 class="wp-heading-inline"><?php echo __('Edit Booking', 'eagle-booking').' #'.$eagle_booking_booking_id ?></h1>
|
||||
</div>
|
||||
|
||||
<div class="eb-admin-new-booking">
|
||||
<a href="<?php echo admin_url('admin.php?page=eb_new_booking') ?>" class="eb-new-booking-btn"><?php echo __('Add New Booking', 'eagle-booking') ?></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<form method="POST">
|
||||
<div class="eb-booking-details-page">
|
||||
|
||||
<div class="eb-main-details">
|
||||
|
||||
<?php
|
||||
if ($eagle_booking_booking_update == 1) { ?>
|
||||
<div class="update-mssg success" style="margin-bottom: 40px">
|
||||
<p>
|
||||
<strong><?php echo __('Booking Updated Successfully', 'eagle-booking') ?></strong>
|
||||
</p>
|
||||
<button type="button" class="notice-dismiss">
|
||||
<span class="screen-reader-text"><?php echo __('Dismiss this notice.', 'eagle-booking') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
} else {
|
||||
|
||||
// $wpdb->show_errors();
|
||||
// $wpdb->print_error();
|
||||
|
||||
} ?>
|
||||
|
||||
<input readonly name="eagle_booking_booking_id" style="display: none;" type="text" value="<?php echo $booking->id ?>">
|
||||
<input readonly name="eagle_booking_booking_id_post" style="display: none;" type="text" value="<?php echo $booking->id_post ?>">
|
||||
<input readonly name="eagle_booking_booking_title_post" style="display: none;" type="text" value="<?php echo $booking->title_post ?>">
|
||||
|
||||
<div class="eb-form">
|
||||
|
||||
<input readonly name="eagle_booking_booking_date" type="hidden" value="<?php echo $booking->date ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Check In', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_date_from" type="text" value="<?php echo eagle_booking_displayd_date_format($booking->date_from) ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Check Out', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_date_to" type="text" value="<?php echo eagle_booking_displayd_date_format($booking->date_to) ?>">
|
||||
</div>
|
||||
|
||||
<?php if (eb_get_option('eb_adults_children') == false) : ?>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Guests', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_guests" type="text" value="<?php echo $booking->guests ?>">
|
||||
</div>
|
||||
<?php else : ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Adults', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_adults" type="text" value="<?php echo $booking->adults ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Children', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_children" type="text" value="<?php echo $booking->children ?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Arrival', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_arrival" type="text" value="<?php echo $booking->user_arrival ?>">
|
||||
</div>
|
||||
|
||||
<input readonly name="eagle_booking_booking_id_user"style="display: none;" type="text" value="<?php echo $booking->id_user ?>">
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Name', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_first_name" type="text" value="<?php echo $booking->user_first_name ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Surname', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_last_name" type="text" value="<?php echo $booking->user_last_name ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Email', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_paypal_email" type="text" value="<?php echo $booking->paypal_email ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Phone', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_phone" type="text" value="<?php echo $booking->user_phone ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Address', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_address" type="text" value="<?php echo $booking->user_address ?>">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('City', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_city" type="text" value="<?php echo $booking->user_city ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Country', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_booking_user_country" type="text" value="<?php echo $booking->user_country ?>">
|
||||
</div>
|
||||
|
||||
<?php if (eb_get_option('eagle_booking_deposit_amount') < 100) : ?>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Deposit Amount', 'eagle-booking') ?></label>
|
||||
<input name="eagle_booking_deposit_amount" type="text" value="<?php echo $booking->deposit_amount ?>">
|
||||
</div>
|
||||
<?php endif ?>
|
||||
|
||||
<div class="customer-comments" style="clear: both;">
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Requests', 'eagle-booking') ?></label>
|
||||
<textarea style="width: 100%; min-height: 80px;" name="eagle_booking_booking_user_message"><?php echo $booking->user_message ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="booking-price">
|
||||
<input name="eagle_booking_booking_final_trip_price" type="hidden" value="<?php echo $booking->final_trip_price ?>">
|
||||
<input name="eagle_booking_booking_paypal_currency" type="hidden" value="<?php echo $booking->paypal_currency ?>">
|
||||
<input name="eagle_booking_booking_extra_services" type="hidden" value="<?php echo $booking->extra_services ?>">
|
||||
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<th style="width:95%;"><?php echo __('Description', 'eagle-booking') ?></th>
|
||||
<th style="width:5%;"><?php echo __('Amount', 'eagle-booking') ?></th>
|
||||
</thead>
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Additional Service
|
||||
*/
|
||||
$eagle_booking_services_array = explode(',', $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 = 0;
|
||||
}
|
||||
|
||||
if ($eagle_booking_mtb_service_price_type_1 == 'guest') {
|
||||
$eagle_booking_price_type_1 = $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($booking->date_from, $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;
|
||||
}
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td style="width:70%;">
|
||||
<?php echo $eagle_booking_service_name ?>
|
||||
</td>
|
||||
<td style="width:10%;">
|
||||
|
||||
<?php
|
||||
|
||||
if ( $eagle_booking_service_price == 0 ) {
|
||||
|
||||
echo __('Free', 'eagle-booking');
|
||||
|
||||
} else {
|
||||
|
||||
echo eb_price( $eagle_booking_service_price );
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
$eb_services_total_price += $eagle_booking_tot_services + $eagle_booking_service_price;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 = $eagle_booking_booking_id AND meta_key = 'tax' ");
|
||||
$booking_fees = $wpdb->get_results("SELECT * FROM $eb_table_meta_name WHERE booking_id = $eagle_booking_booking_id AND meta_key = 'fee' ");
|
||||
$room_price = $wpdb->get_row( "SELECT * FROM $eb_table_meta_name WHERE booking_id = $eagle_booking_booking_id AND meta_key = 'room_price' " );
|
||||
|
||||
$room_price = $room_price->meta_value;
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $booking->title_post ?></td>
|
||||
<td><?php echo eb_price( $room_price ); ?></td>
|
||||
</tr>
|
||||
|
||||
<?php
|
||||
|
||||
// echo '<pre>'; print_r($eb_fees); echo '</pre>';
|
||||
|
||||
if ( $booking_fees ) {
|
||||
|
||||
$html = '';
|
||||
|
||||
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($booking->date_from, $booking->date_to);
|
||||
|
||||
} elseif ( $type === 'per_booking_nights_guests' ) {
|
||||
|
||||
$fee_amount = $amount * $booking->guests * eb_total_booking_nights($booking->date_from, $booking->date_to);
|
||||
|
||||
} else {
|
||||
|
||||
$fee_amount = $amount * $booking->guests;
|
||||
|
||||
}
|
||||
|
||||
$html .= '<td>'.$item['title'].'</td>';
|
||||
$html .= '<td>'.eb_price( $fee_amount ).'</td>';
|
||||
$html .= "</tr>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$html .= "<tr>";
|
||||
|
||||
}
|
||||
|
||||
echo $html;
|
||||
|
||||
}
|
||||
|
||||
if ( $booking_taxes ) {
|
||||
|
||||
$html = '';
|
||||
|
||||
foreach( $booking_taxes as $key => $booking_tax ) {
|
||||
|
||||
foreach ( $taxes as $key => $tax ) {
|
||||
|
||||
if ( $booking_tax->meta_value == $tax['id'] ) {
|
||||
|
||||
|
||||
$services = !empty( $tax["services"] ) ? $tax["services"] : '';
|
||||
|
||||
// Check if the tax is applied on services
|
||||
if ( $services == true ) {
|
||||
|
||||
$room_tax = round($tax['amount'] * $room_price / 100);
|
||||
$services_tax = round( $tax['amount'] * $eb_services_total_price / 100 );
|
||||
|
||||
$tax_amount = $room_tax + $services_tax;
|
||||
|
||||
} else {
|
||||
|
||||
$tax_amount = $tax['amount'] * $room_price / 100;
|
||||
|
||||
}
|
||||
|
||||
$html .= '<td>'.$tax['title'].'</td>';
|
||||
$html .= '<td>'.eb_price( $tax_amount ).'</td>';
|
||||
$html .= "</tr>";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$html .= "<tr>";
|
||||
|
||||
}
|
||||
|
||||
echo $html;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
</table>
|
||||
|
||||
<div style="border-top:1px dashed #e3e3e3; margin-top: 10px">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td style="width:95%;">
|
||||
<h4><?php echo __('Total', 'eagle-booking') ?></h4>
|
||||
</td>
|
||||
<td style="width:5%;"><?php echo eb_price( $booking->final_trip_price ) ?></h4>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="eb-booking-details">
|
||||
<div class="inner">
|
||||
<div class="booking-details-header">
|
||||
<div class="room-image">
|
||||
<img src="<?php echo $eagle_booking_room_img_src ?>">
|
||||
</div>
|
||||
<div class="room-title">
|
||||
<h2><?php echo $booking->title_post ?> <?php if ( eb_room_branch( $eagle_booking_id ) ) echo " - " ?><?php echo eb_room_branch( $eagle_booking_id ) ?></h2>
|
||||
<span><?php echo __('on', 'eagle-booking').' '.$booking->date ?> </span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="booking-details-form">
|
||||
|
||||
<?php if (!empty($booking->user_coupon)) : ?>
|
||||
<label><?php echo __('Coupon', 'eagle-booking') ?></label>
|
||||
<input readonly name="eagle_booking_booking_user_coupon" type="text" value="<?php echo $booking->user_coupon ?>">
|
||||
<?php else : ?>
|
||||
<input readonly name="eagle_booking_booking_user_coupon" type="hidden" value="<?php echo $booking->user_coupon ?>">
|
||||
<?php endif ?>
|
||||
|
||||
<label><?php echo __('Transaction ID', 'eagle-booking') ?></label>
|
||||
<input readonly name="eagle_booking_booking_paypal_tx" type="text" value="<?php echo $booking->paypal_tx ?>">
|
||||
|
||||
<label><?php echo __('Customer IP', 'eagle-booking') ?></label>
|
||||
<input readonly name="eb_user_ip" type="text" value="<?php echo $booking->user_ip ?>">
|
||||
|
||||
<label><?php echo __('Payment Method', 'eagle-booking') ?></label>
|
||||
<input readonly type="text" value="<?php echo $eb_new_action_type_text ?>">
|
||||
<input name="eagle_booking_booking_action_type" type="hidden" value="<?php echo $booking->action_type ?>">
|
||||
|
||||
<label><?php echo __('Status', 'eagle-booking') ?></label>
|
||||
<select name="eagle_booking_booking_paypal_payment_status">
|
||||
<option <?php if ($booking->paypal_payment_status == 'Pending') echo 'selected="slected"' ?> value="Pending">
|
||||
<?php echo __('Pending', 'eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($booking->paypal_payment_status == 'Pending Payment') echo 'selected="slected"' ?> value="Pending Payment">
|
||||
<?php echo __('Pending Payment', 'eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($booking->paypal_payment_status == 'Completed') echo 'selected="slected"' ?> value="Completed">
|
||||
<?php echo __('Completed', 'eagle-booking') ?>
|
||||
</option>
|
||||
<option <?php if ($booking->paypal_payment_status == 'Canceled') echo 'selected="slected"' ?> value="Canceled">
|
||||
<?php echo __('Canceled', 'eagle-booking') ?>
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="status-button">
|
||||
<button class="btn" type="submit"><?php echo __('Update Booking', 'eagle-booking') ?></button>
|
||||
<button class="btn btn-delete" id="eb_delete_booking"><i class="far fa-trash-alt"></i></button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="room-buttons">
|
||||
<?php if ($eb_user_id != 0) : ?>
|
||||
<a href="<?php echo admin_url('user-edit.php?user_id=' . $eb_user_id); ?>" class="action-button">
|
||||
<i class="fas fa-user"></i>
|
||||
<?php echo __('User Profile', 'eagle-booking') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<a href="mailto:<?php echo $booking->paypal_email ?>" class="action-button">
|
||||
<i class="far fa-envelope"></i>
|
||||
<?php echo __('Contact Customer', 'eagle-booking') ?>
|
||||
</a>
|
||||
<a onClick="window.print()" class="action-button">
|
||||
<i class="fa fa-print" aria-hidden="true"></i>
|
||||
<?php echo __('Print Booking Details', 'eagle-booking') ?>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="eb-popup">
|
||||
<div class="eb-popup-inner">
|
||||
<span class="eb-close-popup"><i class="fas fa-times"></i></span>
|
||||
<div class="eb-popup-icon failed">
|
||||
<i class="far fa-trash-alt"></i>
|
||||
</div>
|
||||
<h3 class="title"><?php echo __('Delete Booking', 'eagle-booking') ?> #<span id="eb_booking_id_text"><?php echo $eagle_booking_booking_id ?></span></h3>
|
||||
<p><?php echo __('This action cannot be undone. Are you sure you want to delete this booking?', 'eagle-booking') ?></p>
|
||||
<button class="btn btn-delete" id="eb_delete_booking_confirmation" data-booking-id="<?php echo $eagle_booking_booking_id ?>">
|
||||
<span class="eb-btn-text"><?php echo __('Yes, delete this booking', 'eagle-booking') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
endforeach;
|
||||
|
||||
endif;
|
||||
|
||||
} else {
|
||||
echo "Please Select Booking";
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
<?php
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Add new booking (Admin)
|
||||
* Author: Eagle Themes
|
||||
* Since 1.0.0
|
||||
* Modified 1.2.9
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
?>
|
||||
|
||||
<div class="eb-wrapper eb-admin-page">
|
||||
|
||||
<?php include EB_PATH.''."core/admin/bookings/elements/admin-header.php"; ?>
|
||||
<div class="eb-admin-title">
|
||||
<div>
|
||||
<h1 class="wp-heading-inline"><?php echo __('New Booking','eagle-booking') ?></h1>
|
||||
</div>
|
||||
<div class="eb-admin-new-booking">
|
||||
<a href="<?php echo admin_url( 'admin.php?page=eb_new_booking') ?>" class="eb-new-booking-btn"><?php echo __('Add New Booking','eagle-booking') ?></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="POST">
|
||||
<div class="eb-new-booking-page">
|
||||
<div class="eb-main-details">
|
||||
<input type="hidden" name="eb_new_booking_added" value="1">
|
||||
<div class="eb-form">
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Room','eagle-booking') ?></label>
|
||||
<select id="eb_room_id">
|
||||
<?php
|
||||
$eagle_booking_rooms_args = array( 'posts_per_page' => -1, 'post_type'=> 'eagle_rooms', 'suppress_filters' => false );
|
||||
|
||||
$eagle_rooms = get_posts($eagle_booking_rooms_args);
|
||||
$eagle_booking_dates = '';
|
||||
$eagle_booking_guests = 2;
|
||||
$eagle_booking_adults = 1;
|
||||
$eagle_booking_children = 0;
|
||||
$eagle_booking_checkin_param = 'eb_checkin';
|
||||
$eagle_booking_checkout_param = 'eb_checkout';
|
||||
|
||||
foreach ($eagle_rooms as $eagle_booking_room) : ?>
|
||||
|
||||
<option value="<?php echo $eagle_booking_room->ID; ?>">
|
||||
<?php
|
||||
|
||||
if ( eb_room_has_branch( $eagle_booking_room->ID ) ) {
|
||||
|
||||
echo $eagle_booking_room->post_title.' - '.eb_room_branch( $eagle_booking_room->ID );
|
||||
|
||||
} else {
|
||||
|
||||
echo $eagle_booking_room->post_title;
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
</option>
|
||||
|
||||
<?php endforeach; ?>
|
||||
|
||||
</select>
|
||||
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php include EB_PATH . 'templates/elements/dates-picker.php' ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<?php include EB_PATH . 'templates/elements/guests-picker.php' ?>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Name','eagle-booking') ?></label>
|
||||
<input id="eb_firstname" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Surname','eagle-booking') ?></label>
|
||||
<input id="eb_lastname" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Email','eagle-booking') ?></label>
|
||||
<input id="eb_email" type="email">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Total Price','eagle-booking') ?></label>
|
||||
<input id="eb_price" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Deposit Amount','eagle-booking') ?></label>
|
||||
<input id="eb_deposit" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Phone','eagle-booking') ?></label>
|
||||
<input id="eb_phone" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Address','eagle-booking') ?></label>
|
||||
<input id="eb_address" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('City','eagle-booking') ?></label>
|
||||
<input id="eb_city" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Country','eagle-booking') ?></label>
|
||||
<input id="eb_country" type="text">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label><?php echo __('ZIP','eagle-booking') ?></label>
|
||||
<input id="eb_zip" type="text">
|
||||
</div>
|
||||
|
||||
<!-- Arrival -->
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Arrival','eagle-booking') ?></label>
|
||||
<select id="eb_arrival">
|
||||
<option><?php echo __('I do not know','eagle-booking'); ?></option>
|
||||
<option>12:00 - 1:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>1:00 - 2:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>2:00 - 3:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>3:00 - 4:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>4:00 - 5:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>5:00 - 6:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>6:00 - 7:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>7:00 - 8:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>8:00 - 9:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>9:00 - 10:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>10:00 - 11:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>11:00 - 12:00 <?php echo __('am','eagle-booking'); ?></option>
|
||||
<option>12:00 - 1:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>1:00 - 2:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>2:00 - 3:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>3:00 - 4:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>4:00 - 5:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>5:00 - 6:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>6:00 - 7:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>7:00 - 8:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>8:00 - 9:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>9:00 - 10:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>10:00 - 11:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
<option>11:00 - 12:00 <?php echo __('pm','eagle-booking'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label><?php echo __('Requests','eagle-booking') ?></label>
|
||||
<textarea id="eb_requests"></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-top: 30px;">
|
||||
<label><?php echo __('Additional Services','eagle-booking') ?> :</label>
|
||||
<?php
|
||||
$eagle_booking_services_args = array( 'posts_per_page' => -1, 'post_type'=> 'eagle_services', 'suppress_filters' => false );
|
||||
$eagle_booking_services = get_posts($eagle_booking_services_args);
|
||||
?>
|
||||
<?php foreach ($eagle_booking_services as $eagle_booking_service) : ?>
|
||||
<?php
|
||||
$eagle_booking_service_type = get_post_meta( $eagle_booking_service->ID, 'eagle_booking_mtb_service_type', true );
|
||||
if ( $eagle_booking_service_type == 'additional' ) :
|
||||
?>
|
||||
<div class="eb-new-booking-service">
|
||||
<input id="<?php echo $eagle_booking_service->ID; ?>" class="eb-additional-service" type="checkbox" value="<?php echo $eagle_booking_service->ID; ?><?php echo '[0]' ?>, ">
|
||||
<label for="<?php echo $eagle_booking_service->ID; ?>"><?php echo $eagle_booking_service->post_title; ?></label>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endforeach; ?>
|
||||
<input type="hidden" id="eb_services">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="eb-booking-details">
|
||||
<div class="inner">
|
||||
<div class="booking-details-form">
|
||||
|
||||
<label><?php echo __('Status','eagle-booking') ?></label>
|
||||
<select id="eb_status">
|
||||
<option value="Pending Payment"><?php echo __('Pending Payment','eagle-booking'); ?></option>
|
||||
<option value="Pending"><?php echo __('Pending','eagle-booking'); ?></option>
|
||||
<option value="Completed"><?php echo __('Completed','eagle-booking'); ?></option>
|
||||
</select>
|
||||
|
||||
<label><?php echo __('Payment Method','eagle-booking') ?></label>
|
||||
<select id="eb_payment_method">
|
||||
<option value="bank_transfer"><?php echo __('Bank Transfer','eagle-booking'); ?></option>
|
||||
<option value="payment_on_arrive"><?php echo __('Payment on Arrival','eagle-booking'); ?></option>
|
||||
<option value="booking_request"><?php echo __('Booking Request','eagle-booking'); ?></option>
|
||||
<option value="paypal"><?php echo __('Paypal','eagle-booking'); ?></option>
|
||||
<option value="stripe"><?php echo __('Stripe','eagle-booking'); ?></option>
|
||||
<option value="PayU"><?php echo __('PayU','eagle-booking'); ?></option>
|
||||
<option value="paystack"><?php echo __('Paystack','eagle-booking'); ?></option>
|
||||
<option value="razorpay"><?php echo __('Razorpay','eagle-booking'); ?></option>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="status-button" style="display: block">
|
||||
|
||||
<button id="eb_check_availability" class="btn" value="true">
|
||||
<span class="eb-btn-text"><?php echo __('Check Availability','eagle-booking'); ?></span>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<p class="eb-admin-warning"> <?php echo __('Please note: min/max guests number and min/max booking nights restrictions are not taken into consideration on the admin submission. The cost of the additional services is included in the total price.', 'eagle-booking') ?> </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Popup -->
|
||||
<div class="eb-popup">
|
||||
<div class="eb-popup-inner">
|
||||
<span class="eb-close-popup"><i class="fas fa-times"></i></span>
|
||||
<h3 id="eb_popup_heading" class="title"></h3>
|
||||
<p id="eb_popup_text"></p>
|
||||
<button class="btn btn-create" id="eb_create_booking_confirmation">
|
||||
<span class="eb-btn-text"><?php echo __('Yes, submit new booking', 'eagle-booking') ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
/* --------------------------------------------------------------------------
|
||||
* Include Admin Bookings Page
|
||||
* Author: Eagle Themes (Jomin Muskaj)
|
||||
* @since 1.0.0
|
||||
* @modified 1.2.8
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
if ( isset($_GET['delete_booking']) OR isset($_GET['eagle_booking_delete_booking_id']) ) {
|
||||
|
||||
include "include/delete.php";
|
||||
}
|
||||
|
||||
|
||||
// include "include/new.php";
|
||||
Reference in New Issue
Block a user