Show row number
This commit is contained in:
@@ -18,16 +18,16 @@ header('Content-Disposition: attachment; filename="go-form-' . sanitize_title($f
|
|||||||
$output = fopen('php://output', 'w');
|
$output = fopen('php://output', 'w');
|
||||||
|
|
||||||
// Build header row
|
// Build header row
|
||||||
$header = ['ID', 'First Name', 'Last Name', 'Country', 'Club', 'Rank', 'Rating', 'EGD Number', 'Date Added'];
|
$header = ['N', 'First Name', 'Last Name', 'Country', 'Club', 'Rank', 'Rating', 'EGD Number', 'Date Added'];
|
||||||
foreach ($custom_fields as $field) {
|
foreach ($custom_fields as $field) {
|
||||||
$header[] = $field->field_name;
|
$header[] = $field->field_name;
|
||||||
}
|
}
|
||||||
fputcsv($output, $header);
|
fputcsv($output, $header);
|
||||||
|
|
||||||
foreach ($entries as $e) {
|
foreach ($entries as $i => $e) {
|
||||||
global $ranks;
|
global $ranks;
|
||||||
$row = [
|
$row = [
|
||||||
$e->id,
|
$i,
|
||||||
$e->first_name,
|
$e->first_name,
|
||||||
$e->last_name,
|
$e->last_name,
|
||||||
$e->country,
|
$e->country,
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<table class="wp-list-table widefat striped">
|
<table class="wp-list-table widefat striped">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th>N</th>
|
||||||
<th>First Name</th>
|
<th>First Name</th>
|
||||||
<th>Last Name</th>
|
<th>Last Name</th>
|
||||||
<th>Country</th>
|
<th>Country</th>
|
||||||
@@ -24,9 +25,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php foreach ($entries as $e): ?>
|
<?php foreach ($entries as $i => $e): ?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td> <?= $i + 1 ?> </td>
|
||||||
<td> <?= esc_html($e->first_name) ?> </td>
|
<td> <?= esc_html($e->first_name) ?> </td>
|
||||||
<td> <?= esc_html($e->last_name) ?> </td>
|
<td> <?= esc_html($e->last_name) ?> </td>
|
||||||
<td> <?= esc_html($e->country) ?> </td>
|
<td> <?= esc_html($e->country) ?> </td>
|
||||||
|
|||||||
Reference in New Issue
Block a user