Date added show public
This commit is contained in:
@@ -37,16 +37,10 @@ function go_form_activate()
|
||||
email varchar(255) DEFAULT NULL,
|
||||
egd_number varchar(20) DEFAULT NULL,
|
||||
comment text DEFAULT NULL,
|
||||
created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||
created_at date DEFAULT CURRENT_TIMESTAMP NOT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY form_id (form_id)
|
||||
FOREIGN KEY (form_id) REFERENCES $forms(id) ON DELETE CASCADE
|
||||
) $charset;");
|
||||
|
||||
// Add default form if none exist
|
||||
$existing_forms = $wpdb->get_var("SELECT COUNT(*) FROM $forms");
|
||||
if ($existing_forms == 0) {
|
||||
$wpdb->insert($forms, ['name' => 'Default Form']);
|
||||
}
|
||||
}
|
||||
register_activation_hook(__FILE__, 'go_form_activate');
|
||||
|
||||
@@ -107,15 +101,11 @@ function go_form_handle_submission()
|
||||
wp_die('Security check failed');
|
||||
|
||||
global $wpdb;
|
||||
$form_id = isset($_POST['form_id']) ? intval($_POST['form_id']) : 1;
|
||||
|
||||
// Check if form exists
|
||||
$form_exists = $wpdb->get_var($wpdb->prepare(
|
||||
"SELECT COUNT(*) FROM {$wpdb->prefix}go_form_forms WHERE id = %d",
|
||||
$form_id
|
||||
));
|
||||
if (!$form_exists) {
|
||||
$form_id = 1; // Fallback to default form
|
||||
if (isset($_POST['form_id'])) {
|
||||
$form_id = intval($_POST['form_id']);
|
||||
} else {
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$rating = intval($_POST['rating']);
|
||||
@@ -218,11 +208,8 @@ function go_form_delete_form()
|
||||
if (isset($_POST['value_one'])) {
|
||||
global $wpdb;
|
||||
$id = intval($_POST['value_one']);
|
||||
if ($id > 1) {
|
||||
$wpdb->delete("{$wpdb->prefix}go_form_entries", ['form_id' => $id]);
|
||||
$wpdb->delete("{$wpdb->prefix}go_form_forms", ['id' => $id]);
|
||||
}
|
||||
}
|
||||
$redirect_url = add_query_arg(array('page' => 'go-form-settings', 'deleted' => 1), admin_url('admin.php'));
|
||||
wp_redirect($redirect_url);
|
||||
exit;
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
<th>Club</th>
|
||||
<th>Rank</th>
|
||||
<th>EGD Number</th>
|
||||
<th>Date Added</th>
|
||||
<?php if ($show_admin): ?>
|
||||
<th>Rating</th>
|
||||
<th>Email</th>
|
||||
<th>Date Added</th>
|
||||
<th>Action</th>
|
||||
<th>Comment</th>
|
||||
<?php endif; ?>
|
||||
@@ -27,12 +27,12 @@
|
||||
<td> <?= esc_html($e->club) ?> </td>
|
||||
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
|
||||
<td> <?= esc_html($e->egd_number) ?> </td>
|
||||
<td> <?= esc_html($e->created_at) ?> </td>
|
||||
|
||||
<?php if ($show_admin): ?>
|
||||
|
||||
<td> <?= esc_html($e->rating) ?> </td>
|
||||
<td> <?= esc_html($e->email) ?> </td>
|
||||
<td> <?= esc_html($e->created_at) ?> </td>
|
||||
<td>
|
||||
<?php action_button('go_form_delete_entry', 'Delete', 'Delete this entry?', $e->id); ?>
|
||||
</td>
|
||||
|
||||
@@ -19,7 +19,8 @@ echo "removed pods"
|
||||
#exit 0
|
||||
|
||||
# Recreate pod
|
||||
podman pod create -n $POD_NAME -p 8090:80
|
||||
podman pod create -n $POD_NAME -p 8090:80 -p 3306:3306
|
||||
|
||||
|
||||
# Start MariaDB
|
||||
podman run --detach --pod $POD_NAME \
|
||||
|
||||
@@ -25,7 +25,7 @@ podman pull docker.io/wordpress
|
||||
|
||||
# Create a pod instead of --link.
|
||||
# So both containers are able to reach each others.
|
||||
podman pod create -n $POD_NAME -p 8090:80
|
||||
podman pod create -n $POD_NAME -p 8090:80 -p 3306:3306
|
||||
|
||||
podman run --detach --pod $POD_NAME \
|
||||
-e MYSQL_ROOT_PASSWORD=$DB_PASS \
|
||||
|
||||
Reference in New Issue
Block a user