You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
4.1 KiB
PHP

<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
redirectIfNotLoggedIn();
$user = new User($_SESSION['uid']);
?>
<div>
<a href="app.php?page=editcamper" class="btn btn-success"><i class="fas fa-plus"></i> <?php $Strings->get("Add Camper"); ?></a>
</div>
<table id="campertable" class="table table-bordered table-hover table-sm">
<thead>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
<th data-priority="1"><i class="fas fa-user hidden-sm"></i> <?php $Strings->get('First'); ?></th>
<th data-priority="2"><i class="fas fa-users hidden-sm"></i> <?php $Strings->get('Last'); ?></th>
<th data-priority="2"><i class="fas fa-male hidden-sm"></i> <?php $Strings->get('Parent'); ?></th>
<th data-priority="3"><i class="fas fa-phone hidden-sm"></i> <?php $Strings->get('Phone'); ?></th>
<th data-priority="4"><i class="fas fa-at hidden-sm"></i> <?php $Strings->get('Email'); ?></th>
<th data-priority="5"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('Unit'); ?></th>
<th data-priority="5"><i class="fas fa-certificate hidden-sm"></i> <?php $Strings->get('Rank'); ?></th>
<th data-priority="5"><i class="fas fa-restroom hidden-sm"></i> <?php $Strings->get('Sex'); ?></th>
</tr>
</thead>
<tbody>
<?php
$campers = $database->select(
"people", [
"[>]campers" => [
"camperid" => "camperid"
]
], [
'personid (id)',
'firstname',
'lastname',
'address',
'zip',
'phone1',
'phone2',
'email',
'unit',
'shirt',
'sex',
'parentname',
'rank'
], [
'people.camperid[!]' => null
]);
foreach ($campers as $person) {
?>
<tr>
<td></td>
<td>
<a class="btn btn-info btn-sm" href="app.php?page=viewperson&id=<?php echo $person['id']; ?>"><i class="fas fa-eye"></i> <?php $Strings->get("View"); ?></a>
<a class="btn btn-primary btn-sm" href="app.php?page=editperson&id=<?php echo $person['id']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("Edit"); ?></a>
</td>
<td><?php echo $person['firstname']; ?></td>
<td><?php echo $person['lastname']; ?></td>
<td><?php echo $person['parentname']; ?></td>
<td><?php echo $person['phone1']; ?></td>
<td><?php echo $person['email']; ?></td>
<td><?php echo $person['unit']; ?></td>
<td><?php echo $person['rank']; ?></td>
<td><?php echo $person['sex']; ?></td>
</tr>
<?php
}
?>
</tbody>
<tfoot>
<tr>
<th data-priority="0"></th>
<th data-priority="1"><?php $Strings->get('Actions'); ?></th>
<th data-priority="1"><i class="fas fa-user hidden-sm"></i> <?php $Strings->get('First'); ?></th>
<th data-priority="2"><i class="fas fa-users hidden-sm"></i> <?php $Strings->get('Last'); ?></th>
<th data-priority="2"><i class="fas fa-male hidden-sm"></i> <?php $Strings->get('Parent'); ?></th>
<th data-priority="3"><i class="fas fa-phone hidden-sm"></i> <?php $Strings->get('Phone'); ?></th>
<th data-priority="4"><i class="fas fa-at hidden-sm"></i> <?php $Strings->get('Email'); ?></th>
<th data-priority="5"><i class="fas fa-hashtag hidden-sm"></i> <?php $Strings->get('Unit'); ?></th>
<th data-priority="5"><i class="fas fa-certificate hidden-sm"></i> <?php $Strings->get('Rank'); ?></th>
<th data-priority="5"><i class="fas fa-restroom hidden-sm"></i> <?php $Strings->get('Sex'); ?></th>
</tr>
</tfoot>
</table>