export-donors-table-row.php
100 lines
| 1 | <tr class="give-export-donors"> |
| 2 | <td scope="row" class="row-title"> |
| 3 | <h3> |
| 4 | <span><?php |
| 5 | esc_html_e('Export Donors', 'give'); ?></span> |
| 6 | </h3> |
| 7 | <p><?php |
| 8 | esc_html_e('Download a CSV of donors.', 'give'); ?></p> |
| 9 | </td> |
| 10 | <td> |
| 11 | <form method="post" id="give_donors_export" class="give-export-form"> |
| 12 | |
| 13 | <h4 class="give-export-form--heading"> |
| 14 | <?php |
| 15 | esc_html_e('Select Date Range:', 'give'); ?> |
| 16 | </h4> |
| 17 | |
| 18 | <?php |
| 19 | echo Give()->html->date_field( |
| 20 | [ |
| 21 | 'id' => 'giveDonorExport-startDate', |
| 22 | 'name' => 'giveDonorExport-startDate', |
| 23 | 'placeholder' => esc_attr__('Start Date', 'give'), |
| 24 | 'autocomplete' => 'off', |
| 25 | ] |
| 26 | ); |
| 27 | |
| 28 | echo Give()->html->date_field( |
| 29 | [ |
| 30 | 'id' => 'giveDonorExport-endDate', |
| 31 | 'name' => 'giveDonorExport-endDate', |
| 32 | 'placeholder' => esc_attr__( 'End Date', 'give' ), |
| 33 | 'autocomplete' => 'off', |
| 34 | ] |
| 35 | ); |
| 36 | |
| 37 | printf( |
| 38 | '<fieldset id="giveDonorExport-searchBy"> |
| 39 | <label for="giveDonorExport-searchBy"> |
| 40 | %s |
| 41 | </label> |
| 42 | <input type=radio id="giveDonorExport-searchByDonation" |
| 43 | name="searchBy" value="donation" checked/> |
| 44 | <label for="giveDonorExport-searchByDonation"> |
| 45 | %s |
| 46 | </label> |
| 47 | <input type=radio id="giveDonorExport-searchByDonor" name="searchBy" value="donor"/> |
| 48 | <label for="giveDonorExport-searchByDonor"> |
| 49 | %s |
| 50 | </label> |
| 51 | </fieldset>', |
| 52 | __('Search by:', 'give'), |
| 53 | __('Donation date', 'give'), |
| 54 | __('Donor creation date', 'give') |
| 55 | ); |
| 56 | |
| 57 | echo Give()->html->forms_dropdown( |
| 58 | [ |
| 59 | 'name' => 'forms', |
| 60 | 'id' => 'give_donor_export_form', |
| 61 | 'chosen' => true, |
| 62 | 'class' => 'give-width-25em', |
| 63 | ] |
| 64 | ); |
| 65 | ?> |
| 66 | <br> |
| 67 | <input type="submit" value="<?php esc_attr_e( 'Generate CSV', 'give' ); ?>" class="button-secondary"/> |
| 68 | |
| 69 | <div id="export-donor-options-wrap" class="give-clearfix"> |
| 70 | <p><?php esc_html_e( 'Export Columns:', 'give' ); ?></p> |
| 71 | <ul id="give-export-option-ul"> |
| 72 | <?php |
| 73 | $donor_export_columns = give_export_donors_get_default_columns(); |
| 74 | |
| 75 | foreach ( $donor_export_columns as $column_name => $column_label ) { |
| 76 | ?> |
| 77 | <li> |
| 78 | <label for="give-export-<?php echo esc_attr( $column_name ); ?>"> |
| 79 | <input |
| 80 | type="checkbox" |
| 81 | checked |
| 82 | name="give_export_columns[<?php echo esc_attr( $column_name ); ?>]" |
| 83 | id="give-export-<?php echo esc_attr( $column_name ); ?>" |
| 84 | /> |
| 85 | <?php echo esc_attr( $column_label ); ?> |
| 86 | </label> |
| 87 | </li> |
| 88 | <?php |
| 89 | } |
| 90 | ?> |
| 91 | </ul> |
| 92 | </div> |
| 93 | |
| 94 | <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?> |
| 95 | <input type="hidden" name="give-export-class" value="Give_Donors_Export"/> |
| 96 | <input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid( 'give_' ); ?>"/> |
| 97 | </form> |
| 98 | </td> |
| 99 | </tr> |
| 100 |