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,178 @@
|
||||
<?php
|
||||
/**
|
||||
* Field Select Image
|
||||
*
|
||||
* @package Redux Framework/Fields
|
||||
* @since 3.1.2
|
||||
* @author Kevin Provance <kprovance>
|
||||
* @version 4.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( ! class_exists( 'Redux_Select_Image', false ) ) {
|
||||
|
||||
/**
|
||||
* Class Redux_Select_Image
|
||||
*/
|
||||
class Redux_Select_Image extends Redux_Field {
|
||||
|
||||
/**
|
||||
* Set field defaults.
|
||||
*/
|
||||
public function set_defaults() {
|
||||
$defaults = array(
|
||||
'options' => array(),
|
||||
'placeholder' => esc_html__( 'Select an item', 'redux-framework' ),
|
||||
);
|
||||
|
||||
$this->field = wp_parse_args( $this->field, $defaults );
|
||||
}
|
||||
|
||||
/**
|
||||
* Field Render Function.
|
||||
* Takes the vars and outputs the HTML for the field in the settings
|
||||
*
|
||||
* @since ReduxFramework 1.0.0
|
||||
*/
|
||||
public function render() {
|
||||
|
||||
// If options is NOT empty, the process.
|
||||
if ( ! empty( $this->field['options'] ) ) {
|
||||
|
||||
// bean counter.
|
||||
$x = 1;
|
||||
|
||||
// Process width.
|
||||
if ( ! empty( $this->field['width'] ) ) {
|
||||
$width = ' style="width:' . esc_attr( $this->field['width'] ) . ';"';
|
||||
} else {
|
||||
$width = ' style="width: 40%;"';
|
||||
}
|
||||
|
||||
// Process placeholder.
|
||||
$placeholder = esc_attr( $this->field['placeholder'] );
|
||||
|
||||
$this->select2_config['allowClear'] = true;
|
||||
|
||||
if ( isset( $this->field['select2'] ) ) {
|
||||
$this->field['select2'] = wp_parse_args( $this->field['select2'], $this->select2_config );
|
||||
} else {
|
||||
$this->field['select2'] = $this->select2_config;
|
||||
}
|
||||
|
||||
$this->field['select2'] = Redux_Functions::sanitize_camel_case_array_keys( $this->field['select2'] );
|
||||
|
||||
$select2_data = Redux_Functions::create_data_string( $this->field['select2'] );
|
||||
|
||||
// Begin the <select> tag.
|
||||
echo '<select
|
||||
data-id="' . esc_attr( $this->field['id'] ) . '"
|
||||
data-placeholder="' . esc_attr( $placeholder ) . '"
|
||||
name="' . esc_attr( $this->field['name'] . $this->field['name_suffix'] ) . '"
|
||||
class="redux-select-item redux-select-images ' . esc_attr( $this->field['class'] ) . '"' .
|
||||
$width . ' rows="6"' . esc_attr( $select2_data ) . '>'; // phpcs:ignore WordPress.Security.EscapeOutput
|
||||
|
||||
echo '<option></option>';
|
||||
|
||||
// Enum through the options array.
|
||||
foreach ( $this->field['options'] as $v ) {
|
||||
|
||||
// No array? No problem!
|
||||
if ( ! is_array( $v ) ) {
|
||||
$v = array( 'img' => $v );
|
||||
}
|
||||
|
||||
// No title set? Make it blank.
|
||||
if ( ! isset( $v['title'] ) ) {
|
||||
$v['title'] = '';
|
||||
}
|
||||
|
||||
// No alt? Set it to title. We do this so the alt tag shows
|
||||
// something. It also makes HTML/SEO purists happy.
|
||||
if ( ! isset( $v['alt'] ) ) {
|
||||
$v['alt'] = $v['title'];
|
||||
}
|
||||
|
||||
// Set the selected entry.
|
||||
$selected = selected( $this->value, $v['img'], false );
|
||||
|
||||
// If selected returns something other than a blank space, we
|
||||
// found our default/saved name. Save the array number in a
|
||||
// variable to use later on when we want to extract its associated
|
||||
// url.
|
||||
if ( '' !== $selected ) {
|
||||
$arr_num = $x;
|
||||
}
|
||||
|
||||
// Add the option tag, with values.
|
||||
echo '<option value="' . esc_url( $v['img'] ) . '" ' . esc_html( $selected ) . '>' . esc_attr( $v['alt'] ) . '</option>';
|
||||
|
||||
// Add a bean.
|
||||
++$x;
|
||||
}
|
||||
|
||||
// Close the <select> tag.
|
||||
echo '</select>';
|
||||
|
||||
// Some space.
|
||||
echo '<br /><br />';
|
||||
|
||||
// Show the preview image.
|
||||
echo '<div>';
|
||||
|
||||
// just in case. You never know.
|
||||
if ( ! isset( $arr_num ) ) {
|
||||
$this->value = '';
|
||||
}
|
||||
|
||||
// Set the default image. To get the url from the default name,
|
||||
// we save the array count from the for/each loop, when the default image
|
||||
// is mark as selected. Since the for/each loop starts at one, we must
|
||||
// subtract one from the saved array number. We then pull the url
|
||||
// out of the options array, and there we go.
|
||||
if ( '' === $this->value ) {
|
||||
echo '<img src="#" class="redux-preview-image" style="visibility:hidden;" id="image_' . esc_attr( $this->field['id'] ) . '">';
|
||||
} else {
|
||||
echo '<img src=' . esc_url( $this->value ) . ' class="redux-preview-image" id="image_' . esc_attr( $this->field['id'] ) . '">';
|
||||
}
|
||||
|
||||
// Close the <div> tag.
|
||||
echo '</div>';
|
||||
} else {
|
||||
|
||||
// No options specified. Really?
|
||||
echo '<strong>' . esc_html__( 'No items of this type were found.', 'redux-framework' ) . '</strong>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enqueue Function.
|
||||
* If this field requires any scripts, or css define this function and register/enqueue the scripts/css
|
||||
*
|
||||
* @since ReduxFramework 1.0.0
|
||||
*/
|
||||
public function enqueue() {
|
||||
wp_enqueue_style( 'select2-css' );
|
||||
|
||||
wp_enqueue_script(
|
||||
'redux-field-select-image',
|
||||
Redux_Core::$url . 'inc/fields/select_image/redux-select-image' . Redux_Functions::is_min() . '.js',
|
||||
array( 'jquery', 'select2-js', 'redux-js' ),
|
||||
$this->timestamp,
|
||||
true
|
||||
);
|
||||
|
||||
if ( $this->parent->args['dev_mode'] ) {
|
||||
wp_enqueue_style(
|
||||
'redux-field-select-image',
|
||||
Redux_Core::$url . 'inc/fields/select_image/redux-select-image.css',
|
||||
array(),
|
||||
$this->timestamp
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class_alias( 'Redux_Select_Image', 'ReduxFramework_Select_Image' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
_deprecated_file( 'field_select_image.php', '4.3', 'class-redux-select-image.php', 'This file has been renamed and is no longer used in Redux 4. Please change any references to it as it will be removed in future versions of Redux.' );
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Silence is golden.
|
||||
*
|
||||
* @package Redux Framework
|
||||
*/
|
||||
|
||||
echo null;
|
||||
@@ -0,0 +1,7 @@
|
||||
.redux-container-select_image { margin-top: 2px; margin-left: 5px; width: 100%; margin-bottom: 0; }
|
||||
|
||||
.redux-preview-image { max-height: 250px; max-width: 250px; padding: 5px; margin-top: 10px; border: 1px solid #e3e3e3; background: #f7f7f7; border-radius: 3px; }
|
||||
|
||||
/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtc2VsZWN0LWltYWdlLmNzcyIsInNvdXJjZXMiOlsicmVkdXgtc2VsZWN0LWltYWdlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFBQSw2QkFBNkIsQ0FBQyxFQUMxQixVQUFVLEVBQUUsR0FBRyxFQUNmLFdBQVcsRUFBRSxHQUFHLEVBQ2hCLEtBQUssRUFBRSxJQUFJLEVBQ1gsYUFBYSxFQUFFLENBQUMsR0FDbkI7O0FBRUQsQUFBQSxvQkFBb0IsQ0FBQyxFQUNqQixVQUFVLEVBQUUsS0FBSyxFQUNqQixTQUFTLEVBQUUsS0FBSyxFQUNoQixPQUFPLEVBQUUsR0FBRyxFQUNaLFVBQVUsRUFBRSxJQUFJLEVBQ2hCLE1BQU0sRUFBRSxpQkFBaUIsRUFDekIsVUFBVSxFQUFFLE9BQU8sRUFDbkIsa0JBQWtCLEVBQUUsR0FBRyxFQUN2QixxQkFBcUIsRUFBRSxHQUFHLEVBQzFCLGFBQWEsRUFBRSxHQUFHLEdBQ3JCIn0= */
|
||||
|
||||
/*# sourceMappingURL=redux-select-image.css.map */
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["redux-select-image.scss","redux-select-image.css"],"names":[],"mappings":"AAAA,gCCCI,eAAe,EDMnB,gBAAoB,ECJhB,WAAW,EACX,gBAAgB,EAAA;;AAGpB,uBACI,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,yBAAyB,EACzB,mBAAmB,EAGnB,kBAAkB,EAAA;;AAZtB,6oBAA6oB","file":"redux-select-image.css","sourcesContent":[".redux-container-select_image {\n margin-top: 2px;\n margin-left: 5px;\n width: 100%;\n margin-bottom: 0;\n}\n\n.redux-preview-image {\n max-height: 250px;\n max-width: 250px;\n padding: 5px;\n margin-top: 10px;\n border: 1px solid #e3e3e3;\n background: #f7f7f7;\n -moz-border-radius: 3px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n}\n\n",".redux-container-select_image { margin-top: 2px; margin-left: 5px; width: 100%; margin-bottom: 0; }\n\n.redux-preview-image { max-height: 250px; max-width: 250px; padding: 5px; margin-top: 10px; border: 1px solid #e3e3e3; background: #f7f7f7; border-radius: 3px; }\n\n/*# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVkdXgtc2VsZWN0LWltYWdlLmNzcyIsInNvdXJjZXMiOlsicmVkdXgtc2VsZWN0LWltYWdlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsQUFBQSw2QkFBNkIsQ0FBQyxFQUMxQixVQUFVLEVBQUUsR0FBRyxFQUNmLFdBQVcsRUFBRSxHQUFHLEVBQ2hCLEtBQUssRUFBRSxJQUFJLEVBQ1gsYUFBYSxFQUFFLENBQUMsR0FDbkI7O0FBRUQsQUFBQSxvQkFBb0IsQ0FBQyxFQUNqQixVQUFVLEVBQUUsS0FBSyxFQUNqQixTQUFTLEVBQUUsS0FBSyxFQUNoQixPQUFPLEVBQUUsR0FBRyxFQUNaLFVBQVUsRUFBRSxJQUFJLEVBQ2hCLE1BQU0sRUFBRSxpQkFBaUIsRUFDekIsVUFBVSxFQUFFLE9BQU8sRUFDbkIsa0JBQWtCLEVBQUUsR0FBRyxFQUN2QixxQkFBcUIsRUFBRSxHQUFHLEVBQzFCLGFBQWEsRUFBRSxHQUFHLEdBQ3JCIn0= */\n\n/*# sourceMappingURL=redux-select-image.css.map */\n"]}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*global redux*/
|
||||
|
||||
(function( $ ) {
|
||||
'use strict';
|
||||
|
||||
redux.field_objects = redux.field_objects || {};
|
||||
redux.field_objects.select_image = redux.field_objects.select_image || {};
|
||||
|
||||
redux.field_objects.select_image.init = function( selector ) {
|
||||
selector = $.redux.getSelector( selector, 'select_image' );
|
||||
|
||||
$( selector ).each(
|
||||
function() {
|
||||
var value;
|
||||
var preview;
|
||||
|
||||
var el = $( this );
|
||||
var parent = el;
|
||||
|
||||
if ( ! el.hasClass( 'redux-field-container' ) ) {
|
||||
parent = el.parents( '.redux-field-container:first' );
|
||||
}
|
||||
|
||||
if ( parent.is( ':hidden' ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( parent.hasClass( 'redux-field-init' ) ) {
|
||||
parent.removeClass( 'redux-field-init' );
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
|
||||
el.find( 'select.redux-select-images' ).select2();
|
||||
|
||||
value = el.find( 'select.redux-select-images' ).val();
|
||||
preview = el.find( 'select.redux-select-images' ).parents( '.redux-field:first' ).find( '.redux-preview-image' );
|
||||
|
||||
preview.attr( 'src', value );
|
||||
|
||||
el.find( '.redux-select-images' ).on(
|
||||
'change',
|
||||
function() {
|
||||
var preview = $( this ).parents( '.redux-field:first' ).find( '.redux-preview-image' );
|
||||
|
||||
if ( '' === $( this ).val() ) {
|
||||
preview.fadeOut(
|
||||
'medium',
|
||||
function() {
|
||||
preview.attr( 'src', '' );
|
||||
}
|
||||
);
|
||||
} else {
|
||||
preview.attr( 'src', $( this ).val() );
|
||||
preview.fadeIn().css( 'visibility', 'visible' );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
})( jQuery );
|
||||
@@ -0,0 +1 @@
|
||||
!function(s){"use strict";redux.field_objects=redux.field_objects||{},redux.field_objects.select_image=redux.field_objects.select_image||{},redux.field_objects.select_image.init=function(e){e=s.redux.getSelector(e,"select_image"),s(e).each(function(){var e=s(this),i=e;(i=e.hasClass("redux-field-container")?i:e.parents(".redux-field-container:first")).is(":hidden")||i.hasClass("redux-field-init")&&(i.removeClass("redux-field-init"),e.find("select.redux-select-images").select2(),i=e.find("select.redux-select-images").val(),e.find("select.redux-select-images").parents(".redux-field:first").find(".redux-preview-image").attr("src",i),e.find(".redux-select-images").on("change",function(){var e=s(this).parents(".redux-field:first").find(".redux-preview-image");""===s(this).val()?e.fadeOut("medium",function(){e.attr("src","")}):(e.attr("src",s(this).val()),e.fadeIn().css("visibility","visible"))}))})}}(jQuery);
|
||||
@@ -0,0 +1,19 @@
|
||||
.redux-container-select_image {
|
||||
margin-top: 2px;
|
||||
margin-left: 5px;
|
||||
width: 100%;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.redux-preview-image {
|
||||
max-height: 250px;
|
||||
max-width: 250px;
|
||||
padding: 5px;
|
||||
margin-top: 10px;
|
||||
border: 1px solid #e3e3e3;
|
||||
background: #f7f7f7;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user