🏨 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>
114 lines
2.5 KiB
PHP
114 lines
2.5 KiB
PHP
<?php
|
|
|
|
namespace Cmb2Grid\Grid;
|
|
|
|
/**
|
|
* Description of Cmb2GridColumn.
|
|
*
|
|
* @author Pablo Pacheco <pablo.pacheco@origgami.com.br>
|
|
*/
|
|
if ( ! class_exists( '\Cmb2Grid\Grid\Column' ) ) {
|
|
|
|
class Column {
|
|
|
|
private $field;
|
|
private $fieldId;
|
|
private $grid;
|
|
private $columnClassWidth;
|
|
private $columnClass;
|
|
|
|
public function __construct( $field, Cmb2Grid $grid ) {
|
|
$this->setGrid( $grid );
|
|
if ( is_string( $field ) ) {
|
|
$this->setFieldId( $field );
|
|
} elseif ( is_array( $field ) ) {
|
|
$this->setFieldId( $field[0] );
|
|
} elseif ( is_a( $field, '\Cmb2Grid\Grid\Group\Cmb2GroupGrid' ) ) {
|
|
$this->setFieldId( $field->getParentFieldId() );
|
|
}
|
|
$fieldId = $this->getFieldId();
|
|
|
|
|
|
$finalField = cmb2_get_field( $grid->getCmb2Obj(), $fieldId );
|
|
|
|
$this->setField( $finalField );
|
|
|
|
if ( is_array( $field ) ) {
|
|
if ( isset( $field['class'] ) ) {
|
|
$this->setColumnClass( $field['class'] );
|
|
}
|
|
}
|
|
}
|
|
|
|
function getColumnClassWidth() {
|
|
return $this->columnClassWidth;
|
|
}
|
|
|
|
public function setColumnClassCmb2() {
|
|
$columnClass = $this->getColumnClass();
|
|
$field = $this->getField();
|
|
//error_log( print_r( $field, true ) );
|
|
|
|
|
|
if ( $field->args['type'] === 'group' ) {
|
|
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_group' );
|
|
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_group' );
|
|
$field->args['before_group'] .= "<div class=\"{$columnClass}\">";
|
|
$field->args['after_group'] .= '</div>';
|
|
} else {
|
|
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'before_row' );
|
|
\Cmb2Grid\Cmb2\Utils::initializeFieldArg( $field, 'after_row' );
|
|
$field->args['before_row'] .= "<div class=\"{$columnClass}\">";
|
|
$field->args['after_row'] .= '</div>';
|
|
}
|
|
|
|
}
|
|
|
|
function setColumnClass( $columnClass ) {
|
|
$this->columnClass = $columnClass;
|
|
}
|
|
|
|
function setBootstrapColumnClass( $columnClassNum, $prefix = 'col-md' ) {
|
|
$this->columnClassWidth = $columnClassNum;
|
|
$this->setColumnClass( "{$prefix}-{$columnClassNum}" );
|
|
$this->setColumnClassCmb2();
|
|
}
|
|
|
|
function getField() {
|
|
return $this->field;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return CMB2_Field
|
|
*/
|
|
function getFieldId() {
|
|
return $this->fieldId;
|
|
}
|
|
|
|
function setField( $field ) {
|
|
$this->field = $field;
|
|
}
|
|
|
|
function setFieldId( $fieldId ) {
|
|
$this->fieldId = $fieldId;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return Cmb2Grid
|
|
*/
|
|
function getGrid() {
|
|
return $this->grid;
|
|
}
|
|
|
|
function setGrid( $grid ) {
|
|
$this->grid = $grid;
|
|
}
|
|
|
|
function getColumnClass() {
|
|
return $this->columnClass;
|
|
}
|
|
}
|
|
}
|