<?php
/**
* @package CembraPay Payment Gateway for WooCommerce
* @author  Adrian Emil Tudorache
* @license GPL-2.0+
* @link    https://www.tudorache.me/
**/

namespace CembraPayWoo;

if ( ! defined( 'ABSPATH' ) ) {
    header( 'Status: 403 Forbidden' );
	header( 'HTTP/1.1 403 Forbidden' );
    exit;
}
?>
<div class="form-row form-row-wide cembrapay-birthdate-container" style="display: flex; flex-wrap: wrap; margin-bottom: 10px;">
    <?php if( $data['birthdate_field_label_type'] == 1 ) { ?>
    <label for="cembrapay_birthdate_day" style="flex-basis: 100%;"><?php echo esc_html( $data['birthdate_field_label'] ); ?> <span class="required">*</span></label>
    <?php } ?>
    
    <div class="cembrapay_birthdate_day_container" style="width: 20%;">
        <?php if( $data['birthdate_field_label_type'] == 1 && ! empty( $data['birthdate_field_day_label'] ) ) { ?>
        <label for="cembrapay_birthdate_day"><?php echo esc_html( $data['birthdate_field_day_label'] ); ?> <span class="required">*</span></label>
        <?php } ?>
        <input 
            id="cembrapay_birthdate_day"
            name="cembrapay_birthdate_day"
            class="input-text birthdate_field"
            type="text"
            inputmode="numeric"
            pattern="\d*"
            minlength="1"
            maxlength="2"
            required
            placeholder="<?php echo $data['birthdate_field_label_type'] == 2 && ! empty( $data['birthdate_field_day_label'] ) ? esc_html( $data['birthdate_field_day_label'] ) : ''; ?>"
        />
    </div>
        
    <div class="cembrapay_birthdate_month_container" style="width: 20%;">
        <?php if( $data['birthdate_field_label_type'] == 1 && ! empty( $data['birthdate_field_month_label'] ) ) { ?>
        <label for="cembrapay_birthdate_month"><?php echo esc_html( $data['birthdate_field_month_label'] ); ?> <span class="required">*</span></label>
        <?php } ?>
        <input 
            type="text"
            id="cembrapay_birthdate_month" 
            name="cembrapay_birthdate_month" 
            class="input-text birthdate_field" 
            inputmode="numeric"
            pattern="\d*"
            minlength="1"
            maxlength="2"
            required 
            placeholder="<?php echo $data['birthdate_field_label_type'] == 2 && ! empty( $data['birthdate_field_month_label'] ) ? esc_html( $data['birthdate_field_month_label'] ) : ''; ?>"
        />
    </div>
    
    <div class="cembrapay_birthdate_year_container" style="width: 50%;">
        <?php if( $data['birthdate_field_label_type'] == 1 && ! empty( $data['birthdate_field_year_label'] ) ) { ?>
        <label for="cembrapay_birthdate_year"><?php echo esc_html( $data['birthdate_field_year_label'] ); ?> <span class="required">*</span></label>
        <?php } ?>
        <input 
            type="text"
            id="cembrapay_birthdate_year"
            name="cembrapay_birthdate_year"
            class="input-text birthdate_field"
            inputmode="numeric"
            pattern="\d*"
            minlength="4"
            maxlength="4"
            required
            placeholder="<?php echo $data['birthdate_field_label_type'] == 2 && ! empty( $data['birthdate_field_year_label'] ) ? esc_html( $data['birthdate_field_year_label'] ) : ''; ?>"
        />
    </div>

</div>