mirror of
https://github.com/itflow-org/itflow
synced 2026-11-11 15:07:24 +00:00
65 lines
2.1 KiB
PHP
65 lines
2.1 KiB
PHP
<?php
|
|
/*
|
|
* Client Portal
|
|
* Domain listing for PTC / technical contacts
|
|
*/
|
|
|
|
header("Content-Security-Policy: default-src 'self'");
|
|
|
|
require_once "includes/inc_all.php";
|
|
|
|
enforceContactCan('itdoc');
|
|
|
|
$domains_sql = mysqli_query($mysqli, "SELECT domain_id, domain_name, domain_expire, domain_auto_renew FROM domains WHERE domain_client_id = $session_client_id AND domain_archived_at IS NULL ORDER BY domain_expire IS NULL, domain_expire ASC");
|
|
?>
|
|
|
|
<h3>Domains</h3>
|
|
<div class="row">
|
|
|
|
<div class="col-md-10">
|
|
|
|
<?php if (mysqli_num_rows($domains_sql) == 0) { ?>
|
|
<?= portalEmptyState('There are no domains on this account yet.') ?>
|
|
<?php } else { ?>
|
|
<table class="table table-bordered border border-dark">
|
|
<thead class="table-dark">
|
|
<tr>
|
|
<th>Domain Name</th>
|
|
<th>Expiry</th>
|
|
<th>Renews automatically</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
while ($row = mysqli_fetch_assoc($domains_sql)) {
|
|
$domain_name = escapeHtml($row['domain_name']);
|
|
$domain_expire = escapeHtml($row['domain_expire']);
|
|
$expiry = domainExpiry($row['domain_expire'], $row['domain_auto_renew']);
|
|
|
|
?>
|
|
|
|
<tr>
|
|
<td><?= $domain_name ?></td>
|
|
<td>
|
|
<?= $domain_expire ?: '-' ?>
|
|
<?php if ($expiry && $expiry['state'] !== 'active') { ?>
|
|
<span class="badge text-bg-<?= $expiry['state'] === 'expired' ? 'danger' : ($expiry['auto'] ? 'info' : 'warning') ?> ms-1"><?= escapeHtml($expiry['text']) ?></span>
|
|
<?php } ?>
|
|
</td>
|
|
<td><?= intval($row['domain_auto_renew']) ? 'Yes' : 'No' ?></td>
|
|
</tr>
|
|
|
|
<?php } ?>
|
|
|
|
</tbody>
|
|
</table>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
require_once "includes/footer.php";
|