Files
itflow/client/domains.php
johnnyq 75df17698b Domains makeover: rebuilt domains list with expiry pills (red expired, amber close, blue close but auto-renewing), registrar and hosts shown once per vendor with their roles, SPF/DMARC/DKIM email pills, filters for Starred, Expiring in 45 days, Expired, No auto-renew and Email gaps with counts, registrar-or-host and tag filters, search across notes, hosts and tag names, safe column sorting, open straight to a domain with ?open=ID; new domain quick look with expiry, auto-renew, registration date and status, who registers it and hosts DNS, website and email, A/NS/MX records to copy, plain-language email checks (SPF strictness and duplicates, DMARC policy, DKIM at common selectors), certificates, services, the registrar and host logins, notes, TXT records, raw WHOIS and history; tabbed add/edit form that tidies pasted addresses to the domain, checks the name as it is typed (saved as, subdomain, already on the client), auto-renew switch, star, tags, client and our own vendors as registrar and hosts, Registrar does it all; add several domains at once from a pasted list; bulk look up now, set registrar or host, tags, star and unstar; domain tags (tag type 7) with a starter pack; refresher looks up a batch of up to 50 a run, never-checked, stale and soon-to-expire first; expiry alerts skip archived domains and clients, mention auto-renew and open the domain; vendor Domains tab opens the quick look and adds a domain with that vendor as registrar, our vendors get a Client domains tab; service quick look, overview renewals and search open the domain; client portal shows days to expiry and auto-renew; more export columns and filters; demo data with auto-renew, varied DMARC and DKIM, WHOIS lines and campaign domains near expiry. Fixes lookups, edits, the refresher and API updates wiping expiry dates and records when a lookup came back empty, edits logged without a client and dropping a past expiry date, every edit running slow lookups, expiry alerts for archived domains, deleted domains left on services and certificates, bulk archive needing delete rights and list actions limited to admins, registrar and host pickers accepting another client's vendors and dropping our own on save, services linking other clients' domains, a new client's website domain not added when its expiry could not be found, the WHOIS summary cut at 254 characters, and API names, vendors and duplicates not checked. Adds functions/domain.php helpers, domain quick look and shared form, domain_check lookup; removes domain_model.php. DB 2.8.3
2026-10-15 00:09:09 -04:00

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";