| 1 |
<?php |
| 2 |
/** |
| 3 |
* Displays the credit card expiration select boxes. |
| 4 |
* |
| 5 |
* Override this template by copying it to yourtheme/charitable/cc-expiration.php |
| 6 |
* |
| 7 |
* @author Studio 164a |
| 8 |
* @package Charitable/Templates/Donation Form |
| 9 |
* @since 1.0.0 |
| 10 |
* @version 1.0.0 |
| 11 |
*/ |
| 12 |
|
| 13 |
// Exit if accessed directly. |
| 14 |
if ( ! defined( 'ABSPATH' ) ) { exit; } |
| 15 |
|
| 16 |
if ( ! isset( $view_args['form'] ) || ! isset( $view_args['field'] ) ) { |
| 17 |
return; |
| 18 |
} |
| 19 |
|
| 20 |
$form = $view_args['form']; |
| 21 |
$field = $view_args['field']; |
| 22 |
$classes = $view_args['classes']; |
| 23 |
$is_required = isset( $field['required'] ) ? $field['required'] : false; |
| 24 |
$current_year = date( 'Y' ); |
| 25 |
|
| 26 |
?> |
| 27 |
<div id="charitable_field_<?php echo $field['key'] ?>" class="<?php echo $classes ?>"> |
| 28 |
<fieldset class="charitable-fieldset-field-wrapper"> |
| 29 |
<?php if ( isset( $field['label'] ) ) : ?> |
| 30 |
<div class="charitable-fieldset-field-header" id="charitable_field_<?php echo esc_attr( $field['key'] ) ?>_label"> |
| 31 |
<?php echo $field['label'] ?> |
| 32 |
<?php if ( $is_required ) : ?> |
| 33 |
<abbr class="required" title="required">*</abbr> |
| 34 |
<?php endif ?> |
| 35 |
</div> |
| 36 |
<?php endif ?> |
| 37 |
<select name="<?php echo $field['key'] ?>[month]" class="month" aria-describedby="charitable_field_<?php echo esc_attr( $field['key'] ) ?>_label"> |
| 38 |
<?php foreach ( range( 1, 12 ) as $month ) : |
| 39 |
$padded_month = sprintf( '%02d', $month ); |
| 40 |
?> |
| 41 |
<option value="<?php echo $padded_month ?>"><?php echo $padded_month ?></option> |
| 42 |
<?php endforeach ?> |
| 43 |
</select> |
| 44 |
<select name="<?php echo $field['key'] ?>[year]" class="year" aria-describedby="charitable_field_<?php echo esc_attr( $field['key'] ) ?>_label"> |
| 45 |
<?php for ( $i = 0; $i < 15; $i++ ) : |
| 46 |
$year = $current_year + $i; |
| 47 |
?> |
| 48 |
<option value="<?php echo $year ?>"><?php echo $year ?></option> |
| 49 |
<?php endfor ?> |
| 50 |
</select> |
| 51 |
</fieldset><!-- .charitable-field-wrapper --> |
| 52 |
</div><!-- #charitable_field_<?php echo $field['key'] ?> --> |
| 53 |
|