Move table to template
This commit is contained in:
48
go-form-plugin/templates/table.php
Normal file
48
go-form-plugin/templates/table.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<table class="wp-list-table widefat fixed striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>First Name</th>
|
||||
<th>Last Name</th>
|
||||
<th>Country</th>
|
||||
<th>Club</th>
|
||||
<th>Rank</th>
|
||||
<th>EGD Number</th>
|
||||
<?php if ($show_admin): ?>
|
||||
<th>Email</th>
|
||||
<th>Date Added</th>
|
||||
<th>Action</th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($entries as $e): ?>
|
||||
|
||||
<tr>
|
||||
<td> <?= esc_html($e->first_name) ?> </td>
|
||||
<td> <?= esc_html($e->last_name) ?> </td>
|
||||
<td> <?= esc_html($e->country) ?> </td>
|
||||
<td> <?= esc_html($e->club) ?> </td>
|
||||
<td> <?= esc_html($ranks[$e->rank]) ?> </td>
|
||||
<td> <?= esc_html($e->egd_number) ?> </td>
|
||||
|
||||
<?php if ($show_admin): ?>
|
||||
|
||||
<td> <?= esc_html($e->email) ?> </td>
|
||||
<td> <?= esc_html($e->created_at) ?> </td>
|
||||
<td>
|
||||
<form method="post" action=" <?= admin_url('admin-post.php') ?> ">
|
||||
<?= wp_nonce_field('go_form_delete_action', 'go_form_delete_nonce', true, false) ?>
|
||||
<input type="hidden" name="action" value="go_form_delete_entry">
|
||||
<input type="hidden" name="entry_id" value=" <?= esc_attr($e->id) ?> ">
|
||||
<input type="submit" value="Delete" class="button delete" onclick="return confirm('Delete this entry?')">
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user