| 1 |
<?php |
| 2 |
|
| 3 |
// Exit if accessed directly. |
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Display the main reports "overview" page. |
| 10 |
* |
| 11 |
* @author David Bisset |
| 12 |
* @package Charitable/Admin View/Settings |
| 13 |
* @copyright Copyright (c) 2023, WP Charitable LLC |
| 14 |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License |
| 15 |
* @since 1.8,1 |
| 16 |
* @version 1.8.1 |
| 17 |
* @version 1.8.8.6 |
| 18 |
*/ |
| 19 |
|
| 20 |
$charitable_report_type = charitable_reports_get_donor_report_type(); |
| 21 |
|
| 22 |
$charitable_args = array(); |
| 23 |
$charitable_args['limit'] = isset( $_GET['limit'] ) ? intval( $_GET['limit'] ) : charitable_reports_get_pagination_per_page( $charitable_report_type ); // phpcs:ignore |
| 24 |
$charitable_args['offset'] = isset( $_GET['offset'] ) ? intval( $_GET['offset'] ) : 0; // phpcs:ignore |
| 25 |
$charitable_args['ppage'] = isset( $_GET['ppage'] ) ? intval( $_GET['ppage'] ) : 1; // phpcs:ignore |
| 26 |
|
| 27 |
$charitable_reports = Charitable_Reports::get_instance(); |
| 28 |
$charitable_reports->init_with_array( $charitable_report_type, $charitable_args ); |
| 29 |
|
| 30 |
$charitable_donor_breakdown = $charitable_reports->get_donor_report_by_type( $charitable_report_type, $charitable_args ); |
| 31 |
|
| 32 |
?> |
| 33 |
|
| 34 |
<div class="tablenav top with-margin"> |
| 35 |
<div class="alignleft actions"> |
| 36 |
<?php if ( ! charitable_is_pro() ) : ?> |
| 37 |
<label for="report-donor-type-filter" class="screen-reader-text"><?php echo esc_html__( 'Available Reports', 'charitable' ); ?></label> |
| 38 |
<div class="charitable-datepicker-container"><label for=""><?php echo esc_html__( 'Available Reports', 'charitable' ); ?>:</label> |
| 39 |
<?php echo $charitable_reports->get_donor_report_type_dropdown( $charitable_report_type ); // phpcs:ignore ?> |
| 40 |
</div> |
| 41 |
<?php else : ?> |
| 42 |
<label for="report-donor-type-filter" class="screen-reader-text"><?php echo esc_html__( 'Select Report', 'charitable' ); ?></label> |
| 43 |
<div class="charitable-datepicker-container"><label for="report-donor-type-filter"><?php echo esc_html__( 'Select Report', 'charitable' ); ?>:</label> |
| 44 |
<?php echo $charitable_reports->get_donor_report_type_dropdown( $charitable_report_type ); // phpcs:ignore ?> |
| 45 |
<input type="hidden" name="report-donor-limit" id="report-donor-limit" value="<?php echo intval( $charitable_args['limit'] ); ?>"> |
| 46 |
<input type="hidden" name="report-donor-ppage" id="report-donor-ppage" value="<?php echo intval( $charitable_args['ppage'] ); ?>"> |
| 47 |
<input type="hidden" name="report-donor-offset" id="report-donor-offset" value="<?php echo intval( $charitable_args['offset'] ); ?>"> |
| 48 |
</div> |
| 49 |
<?php endif; ?> |
| 50 |
</div> |
| 51 |
<div class="alignright"> |
| 52 |
<?php if ( charitable_is_pro() ) : ?> |
| 53 |
<div class="charitable-datepicker-container"><a href="#" class="button button-primary" id="charitable-reports-filter-button" data-filter-type="donor"><?php echo esc_html__( 'Filter', 'charitable' ); ?></a></div> |
| 54 |
<?php endif; ?> |
| 55 |
</div> |
| 56 |
<br class="clear"> |
| 57 |
</div> |
| 58 |
|
| 59 |
<div class="charitable-donors-report"> |
| 60 |
|
| 61 |
<div class="charitable-container charitable-title-card" id="charitable-report-donor-title-card"> |
| 62 |
|
| 63 |
<div class="charitable-title-card-content"> |
| 64 |
|
| 65 |
<?php echo $charitable_reports->generate_title_card_html( $charitable_report_type ); // phpcs:ignore ?> |
| 66 |
|
| 67 |
</div> |
| 68 |
|
| 69 |
</div> |
| 70 |
|
| 71 |
<div id="charitable-report-donor-container" class="tablenav charitable-section"> |
| 72 |
|
| 73 |
<?php |
| 74 |
echo $charitable_reports->generate_donor_breakdown_table_html( $charitable_report_type, $charitable_donor_breakdown, $charitable_args['ppage'], $charitable_args['limit'] ); // phpcs:ignore |
| 75 |
?> |
| 76 |
|
| 77 |
</div> |
| 78 |
|
| 79 |
</div> |