step_confirmation.php
9 months ago
step_done.php
9 months ago
step_mapping.php
9 months ago
step_upload_csv.php
9 months ago
step_confirmation.php
45 lines
| 1 | <?php |
| 2 | /** @var bool $can_be_imported |
| 3 | * @var array $conflicts |
| 4 | * @var array $latepoint_column_mapping |
| 5 | */ |
| 6 | ?> |
| 7 | |
| 8 | <div class="customer-csv-step" data-customer-csv-step="confirmation" data-customer-csv-next-btn="<?php _e('Start Import', 'latepoint'); ?>"> |
| 9 | <div class="latepoint-message latepoint-message-subtle"><?php _e('Please review the data before importing.', 'latepoint') ?></div> |
| 10 | <?php $has_duplicates = false; ?> |
| 11 | <div class="customer-csv-confirmation-table-wrapper"> |
| 12 | <table class="customer-csv-confirmation-table"> |
| 13 | <tr> |
| 14 | <td><?php _e('New Customers', 'latepoint') ?></td> |
| 15 | <td><?php echo $can_be_imported; ?></td> |
| 16 | </tr> |
| 17 | <?php |
| 18 | if ( ! empty( $conflicts ) ) { |
| 19 | foreach ( $conflicts as $conflict_type => $conflict_data ) { |
| 20 | echo '<tr>'; |
| 21 | switch($conflict_type){ |
| 22 | case 'invalid': |
| 23 | echo '<td>'.__('Invalid emails', 'latepoint').'</td>'; |
| 24 | echo '<td>'.count($conflict_data).'</td>'; |
| 25 | break; |
| 26 | case 'duplicate': |
| 27 | $has_duplicates = true; |
| 28 | echo '<td>'.__('Existing emails', 'latepoint').'</td>'; |
| 29 | echo '<td>'.count($conflict_data).'</td>'; |
| 30 | break; |
| 31 | } |
| 32 | echo '</tr>'; |
| 33 | echo '<tr style="display: none;"><td colspan="2">'.implode(', ', $conflict_data).'</td></tr>'; |
| 34 | ?> |
| 35 | <?php } ?> |
| 36 | <?php |
| 37 | } ?> |
| 38 | </table> |
| 39 | </div> |
| 40 | <?php if($has_duplicates){ |
| 41 | echo OsFormHelper::checkbox_field('latepoint_update_customers_acknowledgement', __('Fill in missing values for existing emails', 'latepoint'), 'on', true); |
| 42 | } |
| 43 | ?> |
| 44 | <?php echo OsFormHelper::hidden_field( 'latepoint_column_mapping', wp_json_encode($latepoint_column_mapping) ); ?> |
| 45 | </div> |