Add side schrool
This commit is contained in:
@@ -233,7 +233,7 @@ function go_form_handle_submission()
|
||||
exit;
|
||||
}
|
||||
add_action('admin_post_go_form_handle_submission', 'go_form_handle_submission');
|
||||
Pleadd_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission');
|
||||
add_action('admin_post_nopriv_go_form_handle_submission', 'go_form_handle_submission');
|
||||
|
||||
// ========== Shortcode ==========
|
||||
function go_form_shortcode($atts)
|
||||
|
||||
@@ -100,6 +100,10 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="country">Country*:</label><input type="text" name="country" id="country" required>
|
||||
</div>
|
||||
@@ -108,10 +112,6 @@
|
||||
<label for="club">Club:</label><input type="text" name="club" id="club">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="egd_number">EGD Number:</label><input type="text" name="egd_number" id="egd_number">
|
||||
</div>
|
||||
|
||||
<?php
|
||||
// Display custom fields
|
||||
$custom_fields = go_form_get_custom_fields($form_id);
|
||||
@@ -197,7 +197,6 @@
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
<p>* Required fields</p>
|
||||
<input type="submit" name="go_form_submit" value="Submit">
|
||||
</form>
|
||||
|
||||
|
||||
@@ -1,69 +1,74 @@
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>N</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Rank</th>
|
||||
<th>Country</th>
|
||||
<th>Club</th>
|
||||
<th>EGD Number</th>
|
||||
<th>Date Added</th>
|
||||
<?php
|
||||
// Add custom field columns
|
||||
foreach ($custom_fields as $field):
|
||||
if ($field->is_public || $show_admin):
|
||||
echo '<th>' . esc_html($field->field_name) . '</th>';
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
<?php if ($show_admin): ?>
|
||||
<th>Rating</th>
|
||||
<th>Action</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($entries as $i => $e): ?>
|
||||
|
||||
<div class="go-form-table-container" style="overflow-x: auto; -webkit-overflow-scrolling: touch;">
|
||||
<table class="wp-list-table widefat striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<td> <?= $i + 1 ?> </td>
|
||||
<td> <?= esc_html($e->first_name) ?> </td>
|
||||
<td> <?= esc_html($e->last_name) ?> </td>
|
||||
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
|
||||
<td> <?= esc_html($e->country) ?> </td>
|
||||
<td> <?= esc_html($e->club) ?> </td>
|
||||
<td><a href="https://europeangodatabase.eu/EGD/Player_Card.php?&key=<?= esc_html($e->egd_number) ?>"><?= esc_html($e->egd_number) ?> </a> </td>
|
||||
<td> <?= esc_html($e->created_at) ?> </td>
|
||||
<th>N</th>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Rank</th>
|
||||
<th>Country</th>
|
||||
<th>Club</th>
|
||||
<th>EGD Number</th>
|
||||
<th>Date Added</th>
|
||||
<?php
|
||||
// Display custom field values
|
||||
// Add custom field columns
|
||||
foreach ($custom_fields as $field):
|
||||
if ($field->is_public || $show_admin):
|
||||
echo '<td>';
|
||||
$value = go_form_get_custom_value($e->id, $field->id);
|
||||
if ($field->field_type === 'checkbox') {
|
||||
echo $value ? 'Yes' : 'No';
|
||||
} else {
|
||||
echo esc_html($value);
|
||||
}
|
||||
echo '</td>';
|
||||
echo '<th>' . esc_html($field->field_name) . '</th>';
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
<?php if ($show_admin): ?>
|
||||
|
||||
<td> <?= esc_html($e->rating) ?> </td>
|
||||
<td>
|
||||
<a href="<?= add_query_arg(array('page' => 'go-form-settings', 'form_id' => $form_id ?? 0, 'edit_entry' => $e->id), admin_url('admin.php')) ?>" class="button button-small">Edit</a>
|
||||
<?php action_button('go_form_delete_entry', 'Delete', 'Delete this entry?', $e->id); ?>
|
||||
</td>
|
||||
|
||||
<th>Rating</th>
|
||||
<th>Action</th>
|
||||
<?php endif; ?>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<?php foreach ($entries as $i => $e): ?>
|
||||
|
||||
<tr>
|
||||
<td> <?= $i + 1 ?> </td>
|
||||
<td> <?= esc_html($e->first_name) ?> </td>
|
||||
<td> <?= esc_html($e->last_name) ?> </td>
|
||||
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
|
||||
<td> <?= esc_html($e->country) ?> </td>
|
||||
<td> <?= esc_html($e->club) ?> </td>
|
||||
<td><a
|
||||
href="<?= esc_url('https://europeangodatabase.eu/EGD/Player_Card.php?&key=' . $e->egd_number) ?>"><?= esc_html($e->egd_number) ?>
|
||||
</a> </td>
|
||||
<td> <?= esc_html($e->created_at) ?> </td>
|
||||
<?php
|
||||
// Display custom field values
|
||||
foreach ($custom_fields as $field):
|
||||
if ($field->is_public || $show_admin):
|
||||
echo '<td>';
|
||||
$value = go_form_get_custom_value($e->id, $field->id);
|
||||
if ($field->field_type === 'checkbox') {
|
||||
echo $value ? 'Yes' : 'No';
|
||||
} else {
|
||||
echo esc_html($value);
|
||||
}
|
||||
echo '</td>';
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
|
||||
<?php if ($show_admin): ?>
|
||||
|
||||
<td> <?= esc_html($e->rating) ?> </td>
|
||||
<td>
|
||||
<a href="<?= add_query_arg(array('page' => 'go-form-settings', 'form_id' => $form_id ?? 0, 'edit_entry' => $e->id), admin_url('admin.php')) ?>"
|
||||
class="button button-small">Edit</a>
|
||||
<?php action_button('go_form_delete_entry', 'Delete', 'Delete this entry?', $e->id); ?>
|
||||
</td>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user