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