diff --git a/go-form-plugin/go-form-plugin.php b/go-form-plugin/go-form-plugin.php index b0d6de8..fb60244 100644 --- a/go-form-plugin/go-form-plugin.php +++ b/go-form-plugin/go-form-plugin.php @@ -151,7 +151,8 @@ function go_form_get_custom_value($entry_id, $field_id) return $wpdb->get_var($wpdb->prepare( "SELECT value FROM {$wpdb->prefix}go_form_entry_custom_values WHERE entry_id = %d AND field_id = %d", - $entry_id, $field_id + $entry_id, + $field_id )); } @@ -232,12 +233,12 @@ function go_form_handle_submission() // Send notification email // $to = 'nikola@petrovv.com'; // $subject = 'New Go Tournament Registration'; - + // $message = "A new player has signed up:\n\n"; // $message .= "Form ID: {$form_id}\n"; // $message .= "Name: {$data['first_name']} {$data['last_name']}\n"; - + // wp_mail($to, $subject, $message); wp_redirect($_SERVER['HTTP_REFERER']); @@ -435,7 +436,7 @@ add_action('admin_post_go_form_delete_custom_field', 'go_form_delete_custom_fiel function go_form_update_egd_data() { go_form_admin_action('update_egd_data'); - + if (!isset($_POST['value_one'])) { wp_redirect(admin_url('admin.php?page=go-form-settings')); exit; @@ -453,9 +454,9 @@ function go_form_update_egd_data() $pin = trim($entry->egd_number); $url = 'https://europeangodatabase.eu/EGD/GetPlayerDataByPIN.php?pin=' . urlencode($pin); - + $response = wp_remote_get($url, ['timeout' => 10]); - + if (is_wp_error($response)) { continue; } @@ -503,7 +504,7 @@ function go_form_update_entry() global $wpdb; $entry_id = intval($_POST['entry_id']); $form_id = intval($_POST['form_id']); - + $rating = intval($_POST['rating']); $rank = intval($_POST['rank']); if ($rating < -900) { @@ -541,13 +542,15 @@ function go_form_update_entry() } else { $value = sanitize_text_field($value); } - + // Check if custom value exists $existing = go_form_get_custom_value($entry_id, $field->id); if ($existing !== null) { - $wpdb->update("{$wpdb->prefix}go_form_entry_custom_values", - ['value' => $value], - ['entry_id' => $entry_id, 'field_id' => $field->id]); + $wpdb->update( + "{$wpdb->prefix}go_form_entry_custom_values", + ['value' => $value], + ['entry_id' => $entry_id, 'field_id' => $field->id] + ); } else { $wpdb->insert("{$wpdb->prefix}go_form_entry_custom_values", [ 'entry_id' => $entry_id, diff --git a/go-form-plugin/templates/table.php b/go-form-plugin/templates/table.php index 01c0d36..b5d914b 100644 --- a/go-form-plugin/templates/table.php +++ b/go-form-plugin/templates/table.php @@ -58,14 +58,13 @@ rating) ?> - + Edit - id); ?> + class="button" style="margin-right: 4px;">Edit + id); ?> -