40 lines
1.6 KiB
PHP
40 lines
1.6 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/app.php';
|
|
|
|
$token = isset($_GET['token']) ? preg_replace('/[^a-f0-9]/', '', strtolower((string)$_GET['token'])) : '';
|
|
$lead = null;
|
|
if ($token !== '') {
|
|
try {
|
|
$lead = fetch_lead_by_token($token);
|
|
} catch (Throwable $exception) {
|
|
error_log('Thank-you lead lookup failed: ' . $exception->getMessage());
|
|
}
|
|
}
|
|
|
|
page_head('Thank You — ' . project_name(), 'Confirmation page for your landing page request.');
|
|
page_nav('home');
|
|
?>
|
|
<main class="section confirmation-page">
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-lg-8">
|
|
<article class="confirmation-card">
|
|
<p class="eyebrow">Request submitted</p>
|
|
<h1>Thank you<?= $lead ? ', ' . e($lead['name']) : '' ?>.</h1>
|
|
<p class="lead-copy">Your request has been saved. If email notifications are configured, the team also received a message with your details.</p>
|
|
<?php if ($lead): ?>
|
|
<div class="submitted-summary">
|
|
<div><span>Email</span><strong><?= e($lead['email']) ?></strong></div>
|
|
<div><span>Budget</span><strong><?= e($lead['budget'] ?: 'Not sure yet') ?></strong></div>
|
|
<div><span>Status</span><strong><?= e(ucfirst($lead['status'])) ?></strong></div>
|
|
</div>
|
|
<a class="btn btn-dark" href="lead.php?id=<?= e((string)$lead['id']) ?>">View saved lead</a>
|
|
<?php endif; ?>
|
|
<a class="btn btn-outline-dark" href="index.php">Back to landing page</a>
|
|
</article>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
<?php page_footer(); ?>
|