2013-06-26 14:11:33 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2014-07-28 14:50:11 +00:00
|
|
|
* Admin View: Report by Date (with date filters)
|
2017-11-07 08:36:39 +00:00
|
|
|
*
|
|
|
|
* @package WooCommerce/Admin/Reporting
|
2013-06-26 14:11:33 +00:00
|
|
|
*/
|
2014-07-28 14:50:11 +00:00
|
|
|
|
2014-07-28 15:16:35 +00:00
|
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
2017-11-07 08:36:39 +00:00
|
|
|
exit; // Exit if accessed directly.
|
2014-07-28 15:16:35 +00:00
|
|
|
}
|
2014-07-28 14:50:11 +00:00
|
|
|
|
2013-06-26 14:11:33 +00:00
|
|
|
?>
|
2014-07-28 14:50:11 +00:00
|
|
|
|
2013-06-26 14:11:33 +00:00
|
|
|
<div id="poststuff" class="woocommerce-reports-wide">
|
|
|
|
<div class="postbox">
|
2016-02-17 17:40:08 +00:00
|
|
|
|
2016-07-27 19:16:54 +00:00
|
|
|
<?php if ( 'custom' === $current_range && isset( $_GET['start_date'], $_GET['end_date'] ) ) : ?>
|
2017-11-07 08:36:39 +00:00
|
|
|
<h3 class="screen-reader-text">
|
|
|
|
<?php
|
2016-10-24 07:31:07 +00:00
|
|
|
/* translators: 1: start date 2: end date */
|
|
|
|
printf(
|
|
|
|
esc_html__( 'From %1$s to %2$s', 'woocommerce' ),
|
2017-11-07 08:36:39 +00:00
|
|
|
esc_html( wc_clean( wp_unslash( $_GET['start_date'] ) ) ),
|
|
|
|
esc_html( wc_clean( wp_unslash( $_GET['end_date'] ) ) )
|
2016-10-24 07:31:07 +00:00
|
|
|
);
|
2017-11-07 08:36:39 +00:00
|
|
|
?>
|
|
|
|
</h3>
|
2016-07-27 19:16:54 +00:00
|
|
|
<?php else : ?>
|
|
|
|
<h3 class="screen-reader-text"><?php echo esc_html( $ranges[ $current_range ] ); ?></h3>
|
|
|
|
<?php endif; ?>
|
2016-02-17 17:40:08 +00:00
|
|
|
|
|
|
|
<div class="stats_range">
|
2013-07-18 11:56:12 +00:00
|
|
|
<?php $this->get_export_button(); ?>
|
2013-06-26 14:11:33 +00:00
|
|
|
<ul>
|
|
|
|
<?php
|
2017-11-07 08:36:39 +00:00
|
|
|
foreach ( $ranges as $range => $name ) {
|
|
|
|
echo '<li class="' . ( $current_range == $range ? 'active' : '' ) . '"><a href="' . esc_url( remove_query_arg( array( 'start_date', 'end_date' ), add_query_arg( 'range', $range ) ) ) . '">' . esc_html( $name ) . '</a></li>';
|
|
|
|
}
|
2013-06-26 14:11:33 +00:00
|
|
|
?>
|
2016-09-09 00:14:28 +00:00
|
|
|
<li class="custom <?php echo ( 'custom' === $current_range ) ? 'active' : ''; ?>">
|
2017-11-07 08:36:39 +00:00
|
|
|
<?php esc_html_e( 'Custom:', 'woocommerce' ); ?>
|
2013-06-26 14:11:33 +00:00
|
|
|
<form method="GET">
|
|
|
|
<div>
|
2013-06-27 15:12:17 +00:00
|
|
|
<?php
|
2017-11-07 08:36:39 +00:00
|
|
|
// Maintain query string.
|
|
|
|
foreach ( $_GET as $key => $value ) {
|
|
|
|
if ( is_array( $value ) ) {
|
|
|
|
foreach ( $value as $v ) {
|
|
|
|
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '[]" value="' . esc_attr( sanitize_text_field( $v ) ) . '" />';
|
2015-01-29 14:33:06 +00:00
|
|
|
}
|
2017-11-07 08:36:39 +00:00
|
|
|
} else {
|
|
|
|
echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '" value="' . esc_attr( sanitize_text_field( $value ) ) . '" />';
|
2015-01-29 14:33:06 +00:00
|
|
|
}
|
2017-11-07 08:36:39 +00:00
|
|
|
}
|
2013-06-27 15:12:17 +00:00
|
|
|
?>
|
|
|
|
<input type="hidden" name="range" value="custom" />
|
2017-11-07 08:36:39 +00:00
|
|
|
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['start_date'] ) ) ? esc_attr( wp_unslash( $_GET['start_date'] ) ) : ''; ?>" name="start_date" class="range_datepicker from" /><?php //@codingStandardsIgnoreLine ?>
|
2016-08-10 16:35:42 +00:00
|
|
|
<span>–</span>
|
2017-11-07 08:36:39 +00:00
|
|
|
<input type="text" size="11" placeholder="yyyy-mm-dd" value="<?php echo ( ! empty( $_GET['end_date'] ) ) ? esc_attr( wp_unslash( $_GET['end_date'] ) ) : ''; ?>" name="end_date" class="range_datepicker to" /><?php //@codingStandardsIgnoreLine ?>
|
2017-11-07 08:38:18 +00:00
|
|
|
<button type="submit" class="button" value="<?php esc_attr_e( 'Go', 'woocommerce' ); ?>"><?php esc_html_e( 'Go', 'woocommerce' ); ?></button>
|
2017-03-31 10:50:11 +00:00
|
|
|
<?php wp_nonce_field( 'custom_range', 'wc_reports_nonce', false ); ?>
|
2013-06-26 14:11:33 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2016-02-17 17:40:08 +00:00
|
|
|
</div>
|
2013-07-10 11:05:45 +00:00
|
|
|
<?php if ( empty( $hide_sidebar ) ) : ?>
|
|
|
|
<div class="inside chart-with-sidebar">
|
|
|
|
<div class="chart-sidebar">
|
2013-07-18 08:20:49 +00:00
|
|
|
<?php if ( $legends = $this->get_chart_legend() ) : ?>
|
|
|
|
<ul class="chart-legend">
|
|
|
|
<?php foreach ( $legends as $legend ) : ?>
|
2017-11-07 08:36:39 +00:00
|
|
|
<?php // @codingStandardsIgnoreStart ?>
|
2014-11-24 15:18:41 +00:00
|
|
|
<li style="border-color: <?php echo $legend['color']; ?>" <?php if ( isset( $legend['highlight_series'] ) ) echo 'class="highlight_series ' . ( isset( $legend['placeholder'] ) ? 'tips' : '' ) . '" data-series="' . esc_attr( $legend['highlight_series'] ) . '"'; ?> data-tip="<?php echo isset( $legend['placeholder'] ) ? $legend['placeholder'] : ''; ?>">
|
2013-07-18 08:20:49 +00:00
|
|
|
<?php echo $legend['title']; ?>
|
|
|
|
</li>
|
2017-11-07 08:36:39 +00:00
|
|
|
<?php // @codingStandardsIgnoreEnd ?>
|
2013-07-18 08:20:49 +00:00
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
<?php endif; ?>
|
2013-07-10 11:05:45 +00:00
|
|
|
<ul class="chart-widgets">
|
|
|
|
<?php foreach ( $this->get_chart_widgets() as $widget ) : ?>
|
|
|
|
<li class="chart-widget">
|
2018-03-05 18:59:17 +00:00
|
|
|
<?php if ( $widget['title'] ) : ?>
|
|
|
|
<h4><?php echo esc_html( $widget['title'] ); ?></h4>
|
|
|
|
<?php endif; ?>
|
2013-07-10 11:05:45 +00:00
|
|
|
<?php call_user_func( $widget['callback'] ); ?>
|
|
|
|
</li>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div class="main">
|
|
|
|
<?php $this->get_main_chart(); ?>
|
|
|
|
</div>
|
2013-06-26 14:11:33 +00:00
|
|
|
</div>
|
2013-07-10 11:05:45 +00:00
|
|
|
<?php else : ?>
|
|
|
|
<div class="inside">
|
2013-06-26 14:11:33 +00:00
|
|
|
<?php $this->get_main_chart(); ?>
|
|
|
|
</div>
|
2013-07-10 11:05:45 +00:00
|
|
|
<?php endif; ?>
|
2013-06-26 14:11:33 +00:00
|
|
|
</div>
|
2014-11-24 15:18:41 +00:00
|
|
|
</div>
|