| 1 |
<div class="date-interval"> |
| 2 |
|
| 3 |
<select class="field-predefined" data-placeholder="<?php esc_attr_e( 'All Time', 'stream' ) ?>"> |
| 4 |
<option></option> |
| 5 |
<option value="custom" <?php selected( 'custom' === $user_interval['key'] ) ?>><?php esc_attr_e( 'Custom', 'stream' ) ?></option> |
| 6 |
<?php |
| 7 |
foreach ( $date->intervals as $key => $interval ) { |
| 8 |
echo sprintf( |
| 9 |
'<option value="%s" data-from="%s" data-to="%s" %s>%s</option>', |
| 10 |
esc_attr( $key ), |
| 11 |
isset( $interval['start'] ) ? esc_attr( $interval['start']->format( 'Y/m/d' ) ) : null, |
| 12 |
isset( $interval['end'] ) ? esc_attr( $interval['end']->format( 'Y/m/d' ) ) : date( 'Y/m/d' ), |
| 13 |
( $key === $user_interval['key'] ) ? 'selected="selected"' : null, |
| 14 |
esc_html( $interval['label'] ) |
| 15 |
); // xss ok |
| 16 |
} |
| 17 |
?> |
| 18 |
</select> |
| 19 |
|
| 20 |
<div class="date-inputs"> |
| 21 |
<div class="box"> |
| 22 |
<i class="date-remove dashicons"></i> |
| 23 |
<input type="text" |
| 24 |
name="date_from" |
| 25 |
class="date-picker field-from" |
| 26 |
placeholder="<?php esc_attr_e( 'Start date', 'stream' ) ?>" |
| 27 |
value="<?php echo esc_attr( $user_interval['start'] ) ?>"> |
| 28 |
</div> |
| 29 |
<span class="connector dashicons"></span> |
| 30 |
<div class="box"> |
| 31 |
<i class="date-remove dashicons"></i> |
| 32 |
<input type="text" |
| 33 |
name="date_to" |
| 34 |
class="date-picker field-to" |
| 35 |
placeholder="<?php esc_attr_e( 'End date', 'stream' ) ?>" |
| 36 |
value="<?php echo esc_attr( $user_interval['end'] ) ?>"> |
| 37 |
</div> |
| 38 |
</div> |
| 39 |
|
| 40 |
<a href="<?php echo esc_url( $save_interval_url ) ?>" class="button button-primary"><?php esc_html_e( 'Update', 'stream' ) ?></a> |
| 41 |
|
| 42 |
<div class="clear"></div> |
| 43 |
|
| 44 |
</div> |
| 45 |
|