html-admin-page-addons.php
2 years ago
html-admin-page-builder.php
2 years ago
html-admin-page-dashboard.php
2 years ago
html-admin-page-entries-view.php
2 years ago
html-admin-page-export.php
3 years ago
html-admin-page-form-migrator.php
2 years ago
html-admin-page-form-templates.php
2 years ago
html-admin-page-import.php
2 years ago
html-admin-page-setting.php
2 years ago
html-admin-page-tools-logs.php
4 years ago
html-admin-page-tools.php
1 year ago
html-admin-settings.php
1 year ago
html-deactivation-popup.php
3 years ago
html-notice-allow-usage.php
2 years ago
html-notice-custom.php
6 years ago
html-notice-email-failed-notice.php
1 year ago
html-notice-php-deprecation.php
3 years ago
html-notice-review.php
3 years ago
html-notice-survey.php
4 years ago
html-notice-update.php
6 years ago
html-notice-updated.php
6 years ago
html-notice-updating.php
6 years ago
html-admin-page-import.php
75 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Admin View: Page - Import |
| 4 | * |
| 5 | * @package EverestForms/Admin/Import |
| 6 | */ |
| 7 | |
| 8 | defined( 'ABSPATH' ) || exit; |
| 9 | |
| 10 | ?> |
| 11 | <div class="everest-forms-import-form"> |
| 12 | <h3><?php esc_html_e( 'Import Everest Forms', 'everest-forms' ); ?></h3> |
| 13 | <p><?php esc_html_e( 'Select JSON file to import the form.', 'everest-forms' ); ?></p> |
| 14 | <div class="everest-forms-file-upload"> |
| 15 | <input type="file" name="file" id="everest-forms-import" <?php esc_attr_e( 'files selected', 'everest-forms' ); ?>" accept=".json" /> |
| 16 | <label for="everest-forms-import"><span class="everest-forms-btn dashicons dashicons-upload"><?php esc_html_e( 'Choose File', 'everest-forms' ); ?></span><span id="import-file-name"><?php esc_html_e( 'No file selected', 'everest-forms' ); ?></span></label> |
| 17 | </div> |
| 18 | <p class="description"> |
| 19 | <i class="dashicons dashicons-info"></i> |
| 20 | <?php |
| 21 | /* translators: %s: File format */ |
| 22 | printf( esc_html__( 'Only %s file is allowed.', 'everest-forms' ), '<strong>JSON</strong>' ); |
| 23 | ?> |
| 24 | </p> |
| 25 | <div class="publishing-action"> |
| 26 | <button type="submit" class="everest-forms-btn everest-forms-btn-primary everest_forms_import_action" name="everest-forms-import-form"><?php esc_html_e( 'Import Form', 'everest-forms' ); ?></button> |
| 27 | <?php wp_nonce_field( 'everest_forms_import_nonce', 'everest-forms-import-nonce' ); ?> |
| 28 | </div> |
| 29 | </div> |
| 30 | <div class="everest-forms-import-entries-wrapper"> |
| 31 | <h3><?php esc_html_e( 'Import Entries', 'everest-forms' ); ?></h3> |
| 32 | <div class="evf-form-and-csv-upload"> |
| 33 | <div class="everest-forms-upload-csv-container"> |
| 34 | <?php |
| 35 | $forms = evf_get_all_forms( false ); |
| 36 | if ( empty( $forms ) ) { |
| 37 | echo '<div id="message" class="error inline everest-froms-import_notice"><p><strong>You must have form to import entries.</strong></p></div>'; |
| 38 | } |
| 39 | ?> |
| 40 | <p><?php esc_html_e( 'Select form to import the entries.', 'everest-forms' ); ?></p> |
| 41 | <?php |
| 42 | if ( empty( $forms ) ) { |
| 43 | echo "<select class='evf-enhanced-select' style='min-width: 350px;' name='form_id' id='everest-forms-import-entries'>"; |
| 44 | echo '<option value="">' . esc_html__( 'No form found', 'everest-forms' ) . '</option>'; |
| 45 | echo '</select>'; |
| 46 | return; |
| 47 | } else { |
| 48 | echo "<select class='evf-enhanced-select' style='min-width: 350px;' name='form_id' id='everest-forms-import-entries'>"; |
| 49 | foreach ( $forms as $form_id => $form_name ) { |
| 50 | echo "<option value='" . esc_attr( $form_id ) . "'>" . esc_html( $form_name ) . '</option>'; |
| 51 | } |
| 52 | echo '</select>'; |
| 53 | } |
| 54 | ?> |
| 55 | <p><?php esc_html_e( 'Select csv file to import the entries.', 'everest-forms' ); ?></p> |
| 56 | |
| 57 | <div class="everest-forms-file-upload"> |
| 58 | <input type="file" name="file" id="everest-forms-import-csv" <?php esc_attr_e( 'files selected', 'everest-forms' ); ?>" accept=".csv" /> |
| 59 | <label for="everest-forms-import"><span class="everest-forms-btn dashicons dashicons-upload"><?php esc_html_e( 'Choose File', 'everest-forms' ); ?></span><span id="import-file-name-entry"><?php esc_html_e( 'No file selected', 'everest-forms' ); ?></span></label> |
| 60 | </div> |
| 61 | <p class="description"> |
| 62 | <i class="dashicons dashicons-info"></i> |
| 63 | <?php |
| 64 | /* translators: %s: File format */ |
| 65 | printf( esc_html__( 'Only %s file is allowed.', 'everest-forms' ), '<strong>CSV</strong>' ); |
| 66 | ?> |
| 67 | </p> |
| 68 | <div class="publishing-action"> |
| 69 | <button type="submit" class="everest-forms-btn everest-forms-btn-primary everest_forms_import_entries" name="everest-forms-import-entries"><?php esc_html_e( 'Map CSV', 'everest-forms' ); ?></button> |
| 70 | <?php wp_nonce_field( 'everest_forms_import_nonce', 'everest-forms-import-nonce' ); ?> |
| 71 | </div> |
| 72 | </div> |
| 73 | </div> |
| 74 | </div> |
| 75 |