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.

58 lines
2.7 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/.
*/
require_once __DIR__ . "/../required.php";
redirectIfNotLoggedIn();
$cards = $database->select('certificates', ['certid (id)', 'certcode (code)', 'amount', 'start_amount (start)', 'issued'], ['deleted[!]' => 1]);
?>
<div class="btn-toolbar">
<a href="app.php?page=editcertificate" class="btn btn-success"><i class="fas fa-plus"></i> <?php $Strings->get("add card"); ?></a>
</div>
<table id="certificatetable" 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-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('card number'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-balance-scale d-none d-md-inline"></i> <?php $Strings->get('balance'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php $Strings->get('start balance'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-calendar d-none d-md-inline"></i> <?php $Strings->get('issued'); ?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($cards as $c) {
?>
<tr>
<td></td>
<td>
<a class="btn btn-primary btn-sm" href="app.php?page=editcertificate&id=<?php echo $c['id']; ?>"><i class="fas fa-edit"></i> <?php $Strings->get("edit"); ?></a>
</td>
<td><?php echo $c['code']; ?></td>
<td>$<?php echo number_format($c['amount'], 2); ?></td>
<td>$<?php echo number_format($c['start'], 2); ?></td>
<td><?php echo date($SETTINGS['datetime_format'], strtotime($c['issued'])); ?></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-fw fa-hashtag d-none d-md-inline"></i> <?php $Strings->get('card number'); ?></th>
<th data-priority="2"><i class="fas fa-fw fa-balance-scale d-none d-md-inline"></i> <?php $Strings->get('balance'); ?></th>
<th data-priority="3"><i class="fas fa-fw fa-play d-none d-md-inline"></i> <?php $Strings->get('start balance'); ?></th>
<th data-priority="4"><i class="fas fa-fw fa-calendar d-none d-md-inline"></i> <?php $Strings->get('issued'); ?></th>
</tr>
</tfoot>
</table>