remove table

This commit is contained in:
2026-05-05 22:20:33 +02:00
parent 5cfd377b53
commit 44653283c8
2 changed files with 12 additions and 14 deletions

View File

@@ -153,10 +153,10 @@ function go_form_shortcode($atts) {
$msg = ''; $msg = '';
if (isset($_GET['form_success']) && $_GET['form_success'] == 1) if (isset($_GET['form_success']) && $_GET['form_success'] == 1)
$msg = '<div class="go-form-success">Entry added successfully!</div>'; $msg = '<div>Entry added successfully!</div>';
elseif (isset($_GET['form_error'])) { elseif (isset($_GET['form_error'])) {
$errors = ['1' => 'Please fill in all required fields.', 'rank' => 'Rank must be 0-40.', 'email' => 'Please enter a valid email.']; $errors = ['1' => 'Please fill in all required fields.', 'rank' => 'Rank must be 0-40.', 'email' => 'Please enter a valid email.'];
$msg = '<div class="go-form-error">'.esc_html($errors[$_GET['form_error']] ?? $errors['1']).'</div>'; $msg = '<div>'.esc_html($errors[$_GET['form_error']] ?? $errors['1']).'</div>';
} }
ob_start(); ob_start();

View File

@@ -42,22 +42,20 @@
} }
</style> </style>
<div class="go-form-container" id="form"> <div id="form">
<h2>Add New Player</h2> <h2>Add New Player</h2>
<form method="post" action="<?php echo admin_url('admin-post.php'); ?>"> <form method="post" action="<?php echo admin_url('admin-post.php'); ?>">
<?php echo wp_nonce_field('go_form_action', 'go_form_nonce', true, false); ?> <?php echo wp_nonce_field('go_form_action', 'go_form_nonce', true, false); ?>
<input type="hidden" name="action" value="go_form_submit"> <input type="hidden" name="action" value="go_form_submit">
<input type="hidden" name="form_id" value="<?php echo esc_attr($form_id); ?>"> <input type="hidden" name="form_id" value="<?php echo esc_attr($form_id); ?>">
<table class="go-form-table"> <label for="first_name">First Name*:</label><input type="text" name="first_name" id="first_name" required>
<tr><td><label for="first_name">First Name*:</label></td><td><input type="text" name="first_name" id="first_name" required></td></tr> <label for="last_name">Last Name*:</label><input type="text" name="last_name" id="last_name" required>
<tr><td><label for="last_name">Last Name*:</label></td><td><input type="text" name="last_name" id="last_name" required></td></tr> <button type="button" id="egd-search" class="button">Search EGD</button>
<tr><td></td><td><button type="button" id="egd-search" class="button">Search EGD</button></td></tr> <label for="country">Country:</label><input type="text" name="country" id="country">
<tr><td><label for="country">Country:</label></td><td><input type="text" name="country" id="country"></td></tr> <label for="club">Club:</label><input type="text" name="club" id="club">
<tr><td><label for="club">Club:</label></td><td><input type="text" name="club" id="club"></td></tr> <label for="rank">Rank:</label><?php go_form_get_rank_dropdown(); ?>
<tr><td><label for="rank">Rank:</label></td><td><?php go_form_get_rank_dropdown(); ?></td></tr> <label for="email">Email:</label><input type="email" name="email" id="email">
<tr><td><label for="email">Email:</label></td><td><input type="email" name="email" id="email"></td></tr> <label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
<tr><td><label for="egd_number">EGD Number:</label></td><td><input type="text" name="egd_number" id="egd_number"></td></tr>
</table>
<div id="egd-popup-overlay"> <div id="egd-popup-overlay">
<div id="egd-results"> <div id="egd-results">
<button id="egd-popup-close" type="button" aria-label="Close">&times;</button> <button id="egd-popup-close" type="button" aria-label="Close">&times;</button>
@@ -66,7 +64,7 @@
</div> </div>
</div> </div>
<p>* Required fields</p> <p>* Required fields</p>
<input type="submit" name="go_form_submit" value="Submit" class="go-form-submit"> <input type="submit" name="go_form_submit" value="Submit">
</form> </form>
<h2>Players</h2> <h2>Players</h2>
<?php go_form_render_entries_table(go_form_get_entries($form_id)); ?> <?php go_form_render_entries_table(go_form_get_entries($form_id)); ?>