html-admin-dashboard-setup.php
2 years ago
html-admin-page-addons-category-nav.php
4 years ago
html-admin-page-addons.php
2 years ago
html-admin-page-product-export.php
5 years ago
html-admin-page-reports.php
2 years ago
html-admin-page-status-logs-db.php
2 years ago
html-admin-page-status-logs.php
2 years ago
html-admin-page-status-report.php
2 years ago
html-admin-page-status-tools.php
2 years ago
html-admin-page-status.php
8 years ago
html-admin-settings.php
5 years ago
html-bulk-edit-product.php
3 years ago
html-email-template-preview.php
7 years ago
html-notice-base-table-missing.php
3 years ago
html-notice-custom.php
8 years ago
html-notice-download-dir-sync-complete.php
2 years ago
html-notice-install.php
5 years ago
html-notice-legacy-shipping.php
2 years ago
html-notice-maxmind-license-key.php
6 years ago
html-notice-no-shipping-methods.php
2 years ago
html-notice-redirect-only-download.php
4 years ago
html-notice-regenerating-lookup-table.php
5 years ago
html-notice-regenerating-thumbnails.php
8 years ago
html-notice-secure-connection.php
2 years ago
html-notice-template-check.php
2 years ago
html-notice-update.php
2 years ago
html-notice-updated.php
7 years ago
html-notice-updating.php
6 years ago
html-notice-uploads-directory-is-unprotected.php
2 years ago
html-notice-wp-php-minimum-requirements.php
2 years ago
html-quick-edit-product.php
5 years ago
html-report-by-date.php
5 years ago
html-report-by-date.php
101 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Report by Date (with date filters) |
| 4 | * |
| 5 | * @package WooCommerce\Admin\Reporting |
| 6 | */ |
| 7 | |
| 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | exit; // Exit if accessed directly. |
| 10 | } |
| 11 | ?> |
| 12 | <div id="poststuff" class="woocommerce-reports-wide"> |
| 13 | <div class="postbox"> |
| 14 | |
| 15 | <?php if ( 'custom' === $current_range && isset( $_GET['start_date'], $_GET['end_date'] ) ) : ?> |
| 16 | <h3 class="screen-reader-text"> |
| 17 | <?php |
| 18 | /* translators: 1: start date 2: end date */ |
| 19 | printf( |
| 20 | esc_html__( 'From %1$s to %2$s', 'woocommerce' ), |
| 21 | esc_html( wc_clean( wp_unslash( $_GET['start_date'] ) ) ), |
| 22 | esc_html( wc_clean( wp_unslash( $_GET['end_date'] ) ) ) |
| 23 | ); |
| 24 | ?> |
| 25 | </h3> |
| 26 | <?php else : ?> |
| 27 | <h3 class="screen-reader-text"><?php echo esc_html( $ranges[ $current_range ] ); ?></h3> |
| 28 | <?php endif; ?> |
| 29 | |
| 30 | <div class="stats_range"> |
| 31 | <?php $this->get_export_button(); ?> |
| 32 | <ul> |
| 33 | <?php |
| 34 | foreach ( $ranges as $range => $name ) { |
| 35 | 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>'; |
| 36 | } |
| 37 | ?> |
| 38 | <li class="custom <?php echo ( 'custom' === $current_range ) ? 'active' : ''; ?>"> |
| 39 | <?php esc_html_e( 'Custom:', 'woocommerce' ); ?> |
| 40 | <form method="GET"> |
| 41 | <div> |
| 42 | <?php |
| 43 | // Maintain query string. |
| 44 | foreach ( $_GET as $key => $value ) { |
| 45 | if ( is_array( $value ) ) { |
| 46 | foreach ( $value as $v ) { |
| 47 | echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '[]" value="' . esc_attr( sanitize_text_field( $v ) ) . '" />'; |
| 48 | } |
| 49 | } else { |
| 50 | echo '<input type="hidden" name="' . esc_attr( sanitize_text_field( $key ) ) . '" value="' . esc_attr( sanitize_text_field( $value ) ) . '" />'; |
| 51 | } |
| 52 | } |
| 53 | ?> |
| 54 | <input type="hidden" name="range" value="custom" /> |
| 55 | <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" autocomplete="off" /><?php //@codingStandardsIgnoreLine ?> |
| 56 | <span>–</span> |
| 57 | <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" autocomplete="off" /><?php //@codingStandardsIgnoreLine ?> |
| 58 | <button type="submit" class="button" value="<?php esc_attr_e( 'Go', 'woocommerce' ); ?>"><?php esc_html_e( 'Go', 'woocommerce' ); ?></button> |
| 59 | <?php wp_nonce_field( 'custom_range', 'wc_reports_nonce', false ); ?> |
| 60 | </div> |
| 61 | </form> |
| 62 | </li> |
| 63 | </ul> |
| 64 | </div> |
| 65 | <?php if ( empty( $hide_sidebar ) ) : ?> |
| 66 | <div class="inside chart-with-sidebar"> |
| 67 | <div class="chart-sidebar"> |
| 68 | <?php if ( $legends = $this->get_chart_legend() ) : ?> |
| 69 | <ul class="chart-legend"> |
| 70 | <?php foreach ( $legends as $legend ) : ?> |
| 71 | <?php // @codingStandardsIgnoreStart ?> |
| 72 | <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'] : ''; ?>"> |
| 73 | <?php echo $legend['title']; ?> |
| 74 | </li> |
| 75 | <?php // @codingStandardsIgnoreEnd ?> |
| 76 | <?php endforeach; ?> |
| 77 | </ul> |
| 78 | <?php endif; ?> |
| 79 | <ul class="chart-widgets"> |
| 80 | <?php foreach ( $this->get_chart_widgets() as $widget ) : ?> |
| 81 | <li class="chart-widget"> |
| 82 | <?php if ( $widget['title'] ) : ?> |
| 83 | <h4><?php echo esc_html( $widget['title'] ); ?></h4> |
| 84 | <?php endif; ?> |
| 85 | <?php call_user_func( $widget['callback'] ); ?> |
| 86 | </li> |
| 87 | <?php endforeach; ?> |
| 88 | </ul> |
| 89 | </div> |
| 90 | <div class="main"> |
| 91 | <?php $this->get_main_chart(); ?> |
| 92 | </div> |
| 93 | </div> |
| 94 | <?php else : ?> |
| 95 | <div class="inside"> |
| 96 | <?php $this->get_main_chart(); ?> |
| 97 | </div> |
| 98 | <?php endif; ?> |
| 99 | </div> |
| 100 | </div> |
| 101 |