Add comments

This commit is contained in:
2026-05-06 12:31:21 +02:00
parent 6884ce93a4
commit cd4635865c
3 changed files with 8 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ function go_form_activate()
rank tinyint(2) DEFAULT 0, rank tinyint(2) DEFAULT 0,
email varchar(255) DEFAULT NULL, email varchar(255) DEFAULT NULL,
egd_number varchar(50) DEFAULT NULL, egd_number varchar(50) DEFAULT NULL,
comment text DEFAULT NULL,
created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
KEY form_id (form_id) KEY form_id (form_id)
@@ -107,7 +108,8 @@ function go_form_handle_submission()
'club' => sanitize_text_field($_POST['club'] ?? ''), 'club' => sanitize_text_field($_POST['club'] ?? ''),
'rank' => intval($_POST['rank']), 'rank' => intval($_POST['rank']),
'email' => sanitize_email($_POST['email'] ?? ''), 'email' => sanitize_email($_POST['email'] ?? ''),
'egd_number' => sanitize_text_field($_POST['egd_number'] ?? '') 'egd_number' => sanitize_text_field($_POST['egd_number'] ?? ''),
'comment' => sanitize_textarea_field($_POST['comment'] ?? '')
]; ];
if (empty($data['first_name']) || empty($data['last_name'])) { if (empty($data['first_name']) || empty($data['last_name'])) {

View File

@@ -73,6 +73,8 @@
<label for="email">Email:</label><input type="email" name="email" id="email"> <label for="email">Email:</label><input type="email" name="email" id="email">
<label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number"> <label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
<label for="comment">Comment</label>
<textarea name="comment" id="comment" rows="3"></textarea>
<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>

View File

@@ -11,6 +11,7 @@
<th>Email</th> <th>Email</th>
<th>Date Added</th> <th>Date Added</th>
<th>Action</th> <th>Action</th>
<th>Comment</th>
<?php endif; ?> <?php endif; ?>
</tr> </tr>
</thead> </thead>
@@ -38,6 +39,7 @@
<input type="submit" value="Delete" class="button delete" onclick="return confirm('Delete this entry?')"> <input type="submit" value="Delete" class="button delete" onclick="return confirm('Delete this entry?')">
</form> </form>
</td> </td>
<td> <?= esc_html($e->comment) ?> </td>
<?php endif; ?> <?php endif; ?>