PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.6.0
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.6.0
3.6.0 3.5.3 3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / includes / admin / views / html-admin-page-entries-view.php
everest-forms / includes / admin / views Last commit date
html-admin-header-skeleton.php 2 months ago html-admin-page-addons.php 1 year ago html-admin-page-builder.php 5 months ago html-admin-page-dashboard.php 2 years ago html-admin-page-entries-view.php 4 days ago html-admin-page-export.php 1 year ago html-admin-page-form-migrator.php 2 years ago html-admin-page-form-templates.php 5 months ago html-admin-page-import.php 1 year ago html-admin-page-payments.php 2 months ago html-admin-page-setting.php 1 week ago html-admin-page-smart-smtp-setup.php 2 months ago html-admin-page-tools-logs.php 3 months ago html-admin-page-tools.php 4 months ago html-admin-settings.php 2 months ago html-deactivation-popup.php 3 years ago html-notice-allow-usage.php 4 months ago html-notice-custom.php 4 months ago html-notice-email-failed-notice.php 4 months ago html-notice-php-deprecation.php 4 months ago html-notice-review.php 4 months ago html-notice-survey.php 4 months ago html-notice-update.php 4 months ago html-notice-updated.php 4 months ago html-notice-updating.php 4 months ago
html-admin-page-entries-view.php
399 lines
1 <?php
2 /**
3 * Admin View: Entries
4 *
5 * @package EverestForms/Admin/Entries/Views
6 */
7
8 defined( 'ABSPATH' ) || exit;
9
10 $form_id = isset( $_GET['form_id'] ) ? absint( $_GET['form_id'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification
11 $entry_id = isset( $_GET['view-entry'] ) ? absint( $_GET['view-entry'] ) : 0; // phpcs:ignore WordPress.Security.NonceVerification
12 $entry = evf_get_entry( $entry_id, true );
13 $entry_fields = json_decode( $entry->fields );
14 $form_data = evf()->form->get( $form_id, array( 'content_only' => true ) );
15 $hide_empty = isset( $_COOKIE['everest_forms_entry_hide_empty'] ) && 'true' === $_COOKIE['everest_forms_entry_hide_empty'];
16
17 $form_entries = evf_get_entries_by_form_id( $form_id, '', '', true );
18 $form_entries = array_map(
19 function ( $el ) {
20 return $el['entry_id'];
21 },
22 $form_entries
23 );
24
25 $entry_index = array_search( $entry_id, $form_entries ); // phpcs:ignore WordPress.PHP.StrictInArray
26 $prev_entry = '';
27 $next_entry = '';
28 $prev_entry_url = '#';
29 $next_entry_url = '#';
30
31 if ( false !== $entry_index ) {
32 if ( isset( $form_entries[ $entry_index - 1 ] ) ) {
33 $prev_entry = $form_entries[ $entry_index - 1 ];
34 $prev_entry_url = admin_url( sprintf( 'admin.php?page=evf-entries&amp;form_id=%d&amp;view-entry=%d', $form_id, $prev_entry ) );
35 }
36
37 if ( isset( $form_entries[ $entry_index + 1 ] ) ) {
38 $next_entry = $form_entries[ $entry_index + 1 ];
39 $next_entry_url = admin_url( sprintf( 'admin.php?page=evf-entries&amp;form_id=%d&amp;view-entry=%d', $form_id, $next_entry ) );
40 }
41
42 $next_entry = isset( $form_entries[ $entry_index + 1 ] ) ? $form_entries[ $entry_index + 1 ] : '';
43 }
44
45 ?>
46 <div class="wrap everest-forms evf-entry-view-wrapper">
47 <!-- Header Section -->
48 <div class="evf-entry-header">
49 <div class="evf-entry-header-left">
50 <a href="<?php echo esc_url( admin_url( 'admin.php?page=evf-entries&amp;form_id=' . $form_id ) ); ?>" class="evf-back-link">
51 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path d="M10.352 3.935a.917.917 0 0 1 1.296 1.297l-5.769 5.767 5.769 5.77a.916.916 0 1 1-1.296 1.296l-6.417-6.417a.917.917 0 0 1 0-1.296z"/><path d="M17.416 10.083a.917.917 0 0 1 0 1.834H4.583a.917.917 0 0 1 0-1.834z"/></svg>
52 </a>
53 <span class="evf-entry-title">
54 <?php
55 printf( esc_html__( '%1$s: Entry #%2$s', 'everest-forms' ), esc_html( _draft_or_post_title( $form_id ) ), absint( $entry_id ) );
56 ?>
57 </span>
58 </div>
59 <div class="evf-entry-header-right">
60 <a class="evf-nav-btn evf-prev-btn" href="<?php echo esc_url( $prev_entry_url ); ?>" <?php echo empty( $prev_entry ) ? 'disabled' : ''; ?>>
61 <span class="dashicons dashicons-arrow-left-alt2"></span>
62 <?php esc_html_e( 'Previous', 'everest-forms' ); ?>
63 </a>
64 <a class="evf-nav-btn evf-next-btn" href="<?php echo esc_url( $next_entry_url ); ?>" <?php echo empty( $next_entry ) ? 'disabled' : ''; ?>>
65 <?php esc_html_e( 'Next', 'everest-forms' ); ?>
66 <span class="dashicons dashicons-arrow-right-alt2"></span>
67 </a>
68 </div>
69 </div>
70
71 <?php do_action( 'everest_forms_view_entries_notices' ); ?>
72
73 <!-- Main Content Wrapper -->
74 <div class="evf-entry-content-wrapper">
75 <!-- Left Column: Entry Fields and Details -->
76 <div class="evf-entry-main-content">
77 <!-- Personal Information Section -->
78 <div id="everest-forms-entry-fields" class="evf-entry-section evf-personal-info stuffbox">
79 <div class="evf-section-header">
80 <div class="evf-section-title hndle">
81 <?php do_action( 'everest_forms_before_entry_details_hndle', $entry ); ?>
82 <span><?php esc_html_e( 'Personal Information', 'everest-forms' ); ?></span>
83 <?php do_action( 'everest_forms_after_entry_details_hndle', $entry ); ?>
84 </div>
85 <div class="evf-section-header-actions">
86 <a href="#"
87 class="evf-toggle-empty everest-forms-empty-field-toggle password_preview dashicons <?php echo $hide_empty ? 'dashicons-hidden' : 'dashicons-visibility'; ?>"
88 title="<?php echo $hide_empty ? esc_attr__( 'Show empty fields', 'everest-forms' ) : esc_attr__( 'Hide empty fields', 'everest-forms' ); ?>">
89 <?php
90 echo $hide_empty
91 ? esc_html__( 'Show Empty Fields', 'everest-forms' )
92 : esc_html__( 'Hide Empty Fields', 'everest-forms' );
93 ?>
94 </a>
95 <?php if ( current_user_can( 'everest_forms_edit_entry', $entry->entry_id ) ) : ?>
96 <?php do_action( 'everest_forms_entry_details_sidebar_action', $entry, $form_data ); ?>
97 <?php endif; ?>
98 </div>
99 </div>
100
101 <div class="evf-section-content inside">
102 <?php
103 $entry_meta = apply_filters( 'everest_forms_entry_single_data', $entry->meta, $entry, $form_data );
104
105 $field_type_by_meta_key = array();
106 $exclude_fields_array = array( 'captcha', 'recaptcha', 'hcaptcha', 'turnstile', 'private-note', 'authorize-net' );
107 $exclude_fields_array = apply_filters( 'everest_forms_view_entry_exclude_fields', $exclude_fields_array, $entry_meta, $form_data );
108
109 foreach ( $form_data['form_fields'] as $field ) {
110 if ( isset( $field['meta-key'] ) ) {
111 $field_type_by_meta_key[ $field['meta-key'] ] = $field['type'];
112 }
113 }
114
115 if ( empty( $entry_meta ) ) {
116 echo '<p class="evf-no-fields">' . esc_html__( 'This entry does not have any fields.', 'everest-forms' ) . '</p>';
117 } else {
118 foreach ( $entry_meta as $meta_key => $meta_value ) {
119 if ( in_array( $meta_key, array_keys( $field_type_by_meta_key ), true ) && in_array( $field_type_by_meta_key[ $meta_key ], $exclude_fields_array, true ) ) {
120 continue;
121 }
122
123 if ( in_array( $meta_key, apply_filters( 'everest_forms_hidden_entry_fields', array() ), true ) ) {
124 continue;
125 }
126
127 // Escape plain text values; leave serialized data untouched for further processing.
128 $meta_value = is_serialized( $meta_value ) ? $meta_value : esc_html( $meta_value );
129
130 if ( is_serialized( $meta_value ) ) {
131 $raw_meta_val = evf_maybe_unserialize( $meta_value );
132
133 $field_type_array = apply_filters(
134 'everest_forms_serialized_value_field_type',
135 array(
136 'payment-checkbox',
137 'checkbox',
138 'radio',
139 'payment-multiple',
140 )
141 );
142
143 if ( ! empty( $raw_meta_val['type'] ) && in_array( $raw_meta_val['type'], $field_type_array, true ) && empty( $raw_meta_val['label'][0] ) ) {
144 $meta_value = '';
145 } else {
146 $is_dropdown = false;
147 foreach ( $entry_fields as $field ) {
148 if ( $meta_key === $field->meta_key && 'select' === $field->type ) {
149 $is_dropdown = true;
150 break;
151 }
152 }
153
154 if ( $is_dropdown && empty( $raw_meta_val[0] ) ) {
155 $meta_value = '';
156 }
157 }
158 }
159
160 if ( evf_is_json( $meta_value ) ) {
161 $meta_value = json_decode( $meta_value, true );
162 $meta_value = $meta_value['value'];
163 }
164
165 $field_value = apply_filters( 'everest_forms_html_field_value', $meta_value, $entry_meta[ $meta_key ], $entry_meta, 'entry-single', $meta_key );
166 $is_empty = is_string( $field_value ) && ( '(empty)' === wp_strip_all_tags( $field_value ) || '' === $field_value );
167 $field_class = $is_empty ? 'evf-field-empty' : '';
168 $correct_answers = false;
169
170 $field_label = evf_get_form_data_by_meta_key( $form_id, $meta_key, $entry_fields );
171 if ( ! $field_label ) {
172 $field_label = esc_html__( 'Field ID', 'everest-forms' );
173 }
174
175 if ( apply_filters( 'everest_forms_html_field_label', false ) ) {
176 $correct_answers = apply_filters( 'everest_forms_single_entry_label', $field_label, $meta_key, $field_value );
177 }
178
179 echo '<div class="evf-field-row everest-forms-entry-field ' . esc_attr( $field_class ) . '">';
180 echo '<div class="evf-field-label field-name"><strong>' . esc_html( $field_label ) . '</strong></div>';
181 echo '<div class="evf-field-value field-value">';
182
183 if ( ! empty( $field_value ) || is_numeric( $field_value ) ) {
184 if ( is_serialized( $field_value ) ) {
185 $field_value = evf_maybe_unserialize( $field_value );
186 $field_label_val = isset( $field_value['label'] ) ? $field_value['label'] : $field_value;
187
188 if ( ! empty( $field_label_val ) && is_array( $field_label_val ) ) {
189 foreach ( $field_label_val as $field => $value ) {
190 $answer_class = '';
191 if ( $correct_answers ) {
192 if ( in_array( $value, $correct_answers, true ) ) {
193 $answer_class = 'correct_answer';
194 } else {
195 $answer_class = 'wrong_answer';
196 }
197 }
198 // Coupon data (and other addon field values) can remain an array when the owning addon is deactivated; encode arrays so the string helpers below never receive one. Scalars are left untouched.
199 if ( is_array( $value ) ) {
200 $value = wp_json_encode( $value );
201 }
202 echo '<span class="list evf-answer-badge ' . esc_attr( $answer_class ) . '">' . esc_html( wp_strip_all_tags( $value ) ) . '</span>';
203 }
204 } else {
205 // Output serialized non-array label value safely.
206 echo nl2br( esc_html( $field_label_val ) );
207 }
208 } elseif ( $correct_answers && false !== $correct_answers ) {
209 if ( in_array( $field_value, $correct_answers, true ) ) {
210 $answer_class = 'correct_answer';
211 } else {
212 $answer_class = 'wrong_answer';
213 }
214 if ( is_array( $field_value ) ) {
215 $field_value = wp_json_encode( $field_value );
216 }
217 echo '<span class="list evf-answer-badge ' . esc_attr( $answer_class ) . '">' . esc_html( wp_strip_all_tags( $field_value ) ) . '</span>';
218 } else {
219 // Coupon and other addon fields can leave an array value when their addon is deactivated; normalize it so the output helpers below never receive an array.
220 if ( is_array( $field_value ) ) {
221 $field_value = wp_json_encode( $field_value );
222 }
223 $allow_html_types = apply_filters(
224 'everest_forms_entry_view_field_types_allowing_html',
225 array( 'wysiwyg', 'repeater-fields' ),
226 $meta_key,
227 $form_data
228 );
229 $meta_field_type = isset( $field_type_by_meta_key[ $meta_key ] ) ? $field_type_by_meta_key[ $meta_key ] : '';
230 if ( is_string( $field_value ) && in_array( $meta_field_type, $allow_html_types, true ) ) {
231 echo wp_kses_post( $field_value );
232 } elseif ( in_array( $meta_field_type, array( 'file-upload', 'image-upload', 'signature', 'color', 'rating', 'country', 'likert', 'checkbox', 'radio', 'payment-checkbox' ), true ) ) {
233 echo nl2br( make_clickable( $field_value ) );
234 } else {
235 // Output plain field value safely.
236 echo nl2br( esc_html( $field_value ) );
237 }
238 }
239 } else {
240 echo '<span class="evf-empty-value">' . esc_html__( 'Empty', 'everest-forms' ) . '</span>';
241 }
242
243 echo '</div>';
244 echo '</div>';
245 }
246 }
247 ?>
248 </div>
249 </div>
250
251 <?php do_action( 'everest_forms_entry_details_content', $entry, $form_id ); ?>
252
253 <!-- Entry Details Section -->
254 <div id="everest-forms-entry-details-table" class="evf-entry-section evf-entry-details-section stuffbox">
255 <div class="evf-section-header">
256 <div class="evf-section-title hndle"><span><?php esc_html_e( 'Entry Details', 'everest-forms' ); ?></span></div>
257 </div>
258
259 <div class="evf-section-content inside">
260 <div class="evf-details-table-wrapper">
261 <table class="evf-details-table wp-list-table widefat fixed striped">
262 <thead>
263 <tr>
264 <th><?php esc_html_e( 'ID', 'everest-forms' ); ?></th>
265 <th><?php esc_html_e( 'User', 'everest-forms' ); ?></th>
266 <th><?php esc_html_e( 'IP', 'everest-forms' ); ?></th>
267 <th><?php esc_html_e( 'Status', 'everest-forms' ); ?></th>
268 <th><?php esc_html_e( 'Submitted Date', 'everest-forms' ); ?></th>
269 <?php if ( ! empty( $entry->date_modified ) ) : ?>
270 <th><?php esc_html_e( 'Modified Date', 'everest-forms' ); ?></th>
271 <?php endif; ?>
272 <th><?php esc_html_e( 'Referer Link', 'everest-forms' ); ?></th>
273 </tr>
274 </thead>
275 <tbody>
276 <tr>
277 <td><?php echo absint( $entry_id ); ?></td>
278 <td>
279 <?php
280 if ( ! empty( $entry->user_id ) && 0 !== $entry->user_id ) {
281 $user = get_userdata( $entry->user_id );
282 $user_name = ! empty( $user->display_name ) ? $user->display_name : $user->user_login;
283 $user_url = add_query_arg(
284 array(
285 'user_id' => absint( $user->ID ),
286 ),
287 admin_url( 'user-edit.php' )
288 );
289 echo '<a href="' . esc_url( $user_url ) . '">' . esc_html( $user_name ) . '</a>';
290 } else {
291 esc_html_e( 'Guest', 'everest-forms' );
292 }
293 ?>
294 </td>
295 <td><?php echo ! empty( $entry->user_ip_address ) ? esc_html( $entry->user_ip_address ) : '-'; ?></td>
296 <td>
297 <?php
298 $status = ! empty( $entry->status ) ? sanitize_text_field( $entry->status ) : 'completed';
299 $status_class = 'evf-status-' . strtolower( $status );
300 ?>
301 <span class="evf-status-badge <?php echo esc_attr( $status_class ); ?>">
302 <?php echo esc_html( ucwords( $status ) ); ?>
303 </span>
304 </td>
305 <td><?php echo esc_html( date_i18n( 'Y-m-d H:i:s', strtotime( $entry->date_created ) + ( get_option( 'gmt_offset' ) * 3600 ) ) ); ?></td>
306 <?php if ( ! empty( $entry->date_modified ) ) : ?>
307 <td><?php echo esc_html( date_i18n( 'Y-m-d H:i:s', strtotime( $entry->date_modified ) + ( get_option( 'gmt_offset' ) * 3600 ) ) ); ?></td>
308 <?php endif; ?>
309 <td>
310 <?php if ( ! empty( $entry->referer ) ) : ?>
311 <a href="<?php echo esc_url( $entry->referer ); ?>" target="_blank" class="evf-referer-link">
312 <?php esc_html_e( 'View', 'everest-forms' ); ?>
313 </a>
314 <?php else : ?>
315 -
316 <?php endif; ?>
317 </td>
318 </tr>
319 </tbody>
320 </table>
321 </div>
322
323 <?php do_action( 'everest_forms_entry_details_sidebar_details', $entry, $entry_meta, $form_data ); ?>
324 </div>
325 </div>
326 </div>
327
328 <!-- Right Sidebar -->
329 <div class="evf-entry-sidebar">
330 <div id="everest-forms-entry-actions" class="stuffbox">
331 <div class="evf-entry-actions-header"><?php esc_html_e( 'Entry Actions', 'everest-forms' ); ?></div>
332 <div class="inside">
333 <div class="everest-forms-entry-actions-meta">
334 <?php do_action( 'everest_forms_entry_details_sidebar_actions', $entry, $form_data ); ?>
335
336 <?php if ( current_user_can( 'everest_forms_delete_entry', $entry->entry_id ) ) : ?>
337 <?php
338 $trash_link = wp_nonce_url(
339 add_query_arg(
340 array(
341 'trash' => $entry_id,
342 ),
343 admin_url( 'admin.php?page=evf-entries&form_id=' . $form_id )
344 ),
345 'trash-entry'
346 );
347 ?>
348 <p class="everest-forms-entry-delete">
349 <a href="<?php echo esc_url( $trash_link ); ?>">
350 <span class="dashicons dashicons-trash"></span>
351 <?php esc_html_e( 'Delete Entry', 'everest-forms' ); ?>
352 </a>
353 </p>
354 <?php endif; ?>
355 </div>
356 </div>
357 </div>
358
359 <?php do_action( 'everest_forms_after_entry_details', $entry, $entry_meta, $form_data ); ?>
360 </div>
361 </div>
362 </div>
363
364 <script type="text/javascript">
365 jQuery(document).on('click', '.everest-forms-empty-field-toggle', function (event) {
366 event.preventDefault();
367
368 var $btn = jQuery(this);
369
370 if (wpCookies.get('everest_forms_entry_hide_empty') === 'true') {
371 wpCookies.remove('everest_forms_entry_hide_empty');
372
373 $btn
374 .removeClass('dashicons-hidden')
375 .addClass('dashicons-visibility')
376 .attr('title', '<?php esc_attr_e( 'Hide empty fields', 'everest-forms' ); ?>')
377 .text('<?php esc_html_e( 'Hide Empty Fields', 'everest-forms' ); ?>');
378
379 jQuery('.evf-field-empty').show();
380 } else {
381 wpCookies.set('everest_forms_entry_hide_empty', 'true', 2592000);
382
383 $btn
384 .removeClass('dashicons-visibility')
385 .addClass('dashicons-hidden')
386 .attr('title', '<?php esc_attr_e( 'Show empty fields', 'everest-forms' ); ?>')
387 .text('<?php esc_html_e( 'Show Empty Fields', 'everest-forms' ); ?>');
388
389 jQuery('.evf-field-empty').hide();
390 }
391 });
392
393 jQuery(document).ready(function($) {
394 if (wpCookies.get('everest_forms_entry_hide_empty') === 'true') {
395 $('.evf-field-empty').hide();
396 }
397 });
398 </script>
399