cai-exos-systems/daveadmin-exos-new:client.php
client.php
```text
<?php
/**
* Exos Systems - Client Detail Page
*/
require_once __DIR__ . '/config/config.php';
$slug = $_GET['slug'] ?? '';
$client = $slug ? getClient($slug) : null;
if (!$client) {
header('HTTP/1.1 404 Not Found');
$currentPage = 'clients';
$pageTitle = 'Client Not Found | Exos Systems';
$pageDescription = '';
require_once EXOS_INCLUDES_PATH . '/header.php';
echo '<section class="page-hero"><div class="container"><h1 class="page-hero__title">Client Not Found</h1><p class="page-hero__subtitle">The client profile you are looking for does not exist or is no longer published.</p><a href="clients.php" class="btn btn--primary" style="margin-top:1rem;">View All Clients</a></div></section>';
require_once EXOS_INCLUDES_PATH . '/footer.php';
exit;
}
$currentPage = 'clients';
$pageTitle = ($client['meta_title'] ?: $client['company_name']) . ' | Exos Systems';
$pageDescription = $client['meta_description'] ?: ($client['headline'] ?: 'Client relationship profile on Exos Systems.');
$pageSeoExtra = [
'og_title' => $client['meta_title'] ?: $client['company_name'] . ' | Exos Systems',
'og_description' => $client['meta_description'] ?: $client['headline'],
'og_image' => $client['og_image'] ?? '',
'twitter_card' => 'summary_large_image',
'canonical_url' => SITE_URL . '/client.php?slug=' . urlencode($client['slug']),
'meta_title' => $pageTitle,
'meta_description' => $pageDescription,
];
$breadcrumbItems = [
['label' => 'Clients', 'url' => 'clients.php'],
['label' => $client['company_name']],
];
$pageJsonLd = getJsonLd('BreadcrumbList', [
'items' => [
['label' => 'Home', 'url' => 'index.php'],
['label' => 'Clients', 'url' => 'clients.php'],
['label' => $client['company_name'], 'url' => getClientUrl($client)],
],
]);
$clientCaseStudies = getClientCaseStudies((int)$client['id'], 3);
$clientTestimonials = getClientTestimonials((int)$client['id'], 3);
$otherClients = fetchAll(
"SELECT c.*,
(SELECT COUNT(*) FROM exos_case_studies cs WHERE cs.client_id = c.id AND cs.is_active = 1) AS case_study_count,
(SELECT COUNT(*) FROM exos_testimonials t WHERE t.client_id = c.id AND t.is_active = 1) AS testimonial_count
FROM exos_clients c
WHERE c.id != ? AND c.is_active = 1
ORDER BY c.is_featured DESC, c.sort_order, c.company_name
LIMIT 3",
[(int)$client['id']]
);
require_once EXOS_INCLUDES_PATH . '/header.php';
?>
<section class="page-hero">
<div class="container" data-animate="fade-up">
<?= buildBreadcrumb($breadcrumbItems) ?>
<?php if (!empty($client['is_featured'])): ?>
<div class="flagship-hero__eyebrow">Featured Client</div>
<?php endif; ?>
<h1 class="page-hero__title"><?= sanitize($client['company_name']) ?></h1>
<p class="page-hero__subtitle"><?= sanitize($client['headline'] ?: 'Exos client relationship, delivery context, and related proof content.') ?></p>
<div class="profile-hero__meta">
<?php if (!empty($client['industry'])): ?>
<span><?= sanitize($client['industry']) ?></span>
<?php endif; ?>
<?php if (!empty($client['country'])): ?>
<span><?= sanitize($client['country']) ?></span>
<?php endif; ?>
</div>
<div class="section-actions" style="margin-top: 1.5rem;">
<?php if (!empty($client['website_url'])): ?>
<a href="<?= sanitize($client['website_url']) ?>" class="btn btn--outline" target="_blank" rel="noopener noreferrer">Visit Website</a>
<?php endif; ?>
<a href="contact.php" class="btn btn--primary">Discuss Similar Work</a>
</div>
</div>
</section>
<section class="section">
<div class="container">
<div class="about-grid">
<div class="about-text" data-animate="fade-up">
<div class="cms-content">
<?= $client['page_content'] ?: '<p>This client page is ready for a fuller engagement narrative, commercial context, and approved proof detail.</p>' ?>
</div>
</div>
<aside class="about-sidebar" data-animate="fade-up" data-delay="150">
<div class="about-sidebar__box">
<div class="section__label">Client Snapshot</div>
<div class="client-card__stats client-card__stats--stacked">
<?php if (!empty($client['industry'])): ?>
<span>Industry: <?= sanitize($client['industry']) ?></span>
<?php endif; ?>
<?php if (!empty($client['country'])): ?>
<span>Region: <?= sanitize($client['country']) ?></span>
<?php endif; ?>
<span><?= (int)($client['case_study_count'] ?? 0) ?> linked case studies</span>
<span><?= (int)($client['testimonial_count'] ?? 0) ?> linked testimonials</span>
</div>
</div>
<?php if ($clientTestimonials): ?>
<div class="about-sidebar__box" style="margin-top: 1.5rem;">
<div class="section__label">Client Voices</div>
<div class="client-sidebar-list">
<?php foreach ($clientTestimonials as $testimonial): ?>
<div class="client-sidebar-list__item">
<strong><?= sanitize($testimonial['author_name']) ?></strong>
<span><?= sanitize($testimonial['author_title']) ?></span>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
</aside>
</div>
</div>
</section>
client.php <span>Industry: <?= sanitize($client['industry']) ?></span> <?php endif; ?> <?php if (!empty($client['country'])): ?> <span>Region: <?= sanitize($client['country']) ?></span> <?php endif; ?> <span><?= (int)($client['case_study_count'] ?? 0) ?> linked case studies</span> <span><?= (int)($client['testimonial_count'] ?? 0) ?> linked testimonials</span> </div> </div> <?php if ($clientTestimonials): ?> <div class="about-sidebar__box" style="margin-top: 1.5rem;"> <div class="section__label">Client Voices</div> <div class="client-sidebar-list"> <?php foreach ($clientTestimonials as $testimonial): ?> <div class="client-sidebar-list__item"> <strong><?= sanitize($testimonial['author_name']) ?></strong> <span><?= sanitize($testimonial['author_title']) ?></span> </div> <?php endforeach; ?> </div> </div> <?php endif; ?> </aside> </div> </div> </section> <?php if ($clientCaseStudies || $clientTestimonials): ?> <section class="section section--alt"> <div class="container"> <div class="section__header section__header--center" data-animate="fade-up"> <div class="section__label">Linked Proof</div> <h2 class="section__title">Case Studies & Testimonials</h2> </div> <?php if ($clientCaseStudies): ?> <div class="proof-grid" style="margin-bottom: 1.5rem;"> <?php foreach ($clientCaseStudies as $i => $caseStudy): ?> <a href="<?= sanitize(getCaseStudyUrl($caseStudy)) ?>" class="case-study-card case-study-card--link" data-animate="fade-up" data-delay="<?= $i * 100 ?>" style="text-decoration: none;"> <div class="case-study-card__meta"> <span><?= sanitize($caseStudy['client_company_name'] ?? $client['company_name']) ?></span> <?php if (!empty($caseStudy['region'])): ?> <span><?= sanitize($caseStudy['region']) ?></span> <?php endif; ?> </div> <h3 class="case-study-card__title"><?= sanitize($caseStudy['title']) ?></h3> <?php if (!empty($caseStudy['summary'])): ?> <p class="case-study-card__summary"><?= sanitize($caseStudy['summary']) ?></p> <?php endif; ?> <span class="proof-link">Read case study</span> </a> <?php endforeach; ?> </div> <?php endif; ?> <?php if ($clientTestimonials): ?> <div class="testimonials-grid"> <?php foreach ($clientTestimonials as $i => $testimonial): ?> <div class="testimonial-card" data-animate="fade-up" data-delay="<?= $i * 100 ?>"> <div class="testimonial-card__quote-mark">“</div> <p class="testimonial-card__quote"><?= sanitize($testimonial['quote']) ?></p> <?php if (!empty($testimonial['engagement_scope'])): ?> <div class="testimonial-card__scope"><?= sanitize($testimonial['engagement_scope']) ?></div> <?php endif; ?> <div class="testimonial-card__author"> <div class="testimonial-card__avatar"><?= sanitize(getInitials($testimonial['author_name'])) ?></div> <div> <div class="testimonial-card__name"><?= sanitize($testimonial['author_name']) ?></div> <div class="testimonial-card__title"><?= sanitize($testimonial['author_title']) ?>, <?= sanitize($testimonial['author_company'] ?: $client['company_name']) ?></div> </div> </div> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> </section> <?php endif; ?> <?php if ($otherClients): ?> <section class="section"> <div class="container"> <div class="section__header section__header--center" data-animate="fade-up"> <div class="section__label">More Clients</div> <h2 class="section__title">Explore Related Client Profiles</h2> </div> <div class="client-grid"> <?php foreach ($otherClients as $i => $otherClient): ?> <a href="<?= sanitize(getClientUrl($otherClient)) ?>" class="client-card" data-animate="fade-up" data-delay="<?= $i * 100 ?>"> <h3 class="client-card__title"><?= sanitize($otherClient['company_name']) ?></h3> <div class="client-card__meta"> <?php if (!empty($otherClient['industry'])): ?> <span><?= sanitize($otherClient['industry']) ?></span> <?php endif; ?> <?php if (!empty($otherClient['country'])): ?> <span><?= sanitize($otherClient['country']) ?></span> <?php endif; ?> </div> <p class="client-card__summary"><?= sanitize($otherClient['headline'] ?: 'Explore the relationship summary and linked proof content.') ?></p> <span class="service-card__cta"> View Client <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg> </span> </a> <?php endforeach; ?> </div> </div> </section> <?php endif; ?> <?php require_once EXOS_INCLUDES_PATH . '/footer.php'; ?> ```
client.php <span>Industry: <?= sanitize($client['industry']) ?></span> <?php endif; ?> <?php if (!empty($client['country'])): ?> <span>Region: <?= sanitize($client['country']) ?></span> <?php endif; ?> <span><?= (int)($client['case_study_count'] ?? 0) ?> linked case studies</span> <span><?= (int)($client['testimonial_count'] ?? 0) ?> linked testimonials</span> </div> </div> <?php if ($clientTestimonials): ?> <div class="about-sidebar__box" style="margin-top: 1.5rem;"> <div class="section__label">Client Voices</div> <div class="client-sidebar-list"> <?php foreach ($clientTestimonials as $testimonial): ?> <div class="client-sidebar-list__item"> <strong><?= sanitize($testimonial['author_name']) ?></strong> <span><?= sanitize($testimonial['author_title']) ?></span> </div> <?php endforeach; ?> </div> </div> <?php endif; ?> </aside> </div> </div> </section> <?php if ($clientCaseStudies || $clientTestimonials): ?> <section class="section section--alt"> <div class="container"> <div class="section__header section__header--center" data-animate="fade-up"> <div class="section__label">Linked Proof</div> <h2 class="section__title">Case Studies & Testimonials</h2> </div> <?php if ($clientCaseStudies): ?> <div class="proof-grid" style="margin-bottom: 1.5rem;"> <?php foreach ($clientCaseStudies as $i => $caseStudy): ?> <a href="<?= sanitize(getCaseStudyUrl($caseStudy)) ?>" class="case-study-card case-study-card--link" data-animate="fade-up" data-delay="<?= $i * 100 ?>" style="text-decoration: none;"> <div class="case-study-card__meta"> <span><?= sanitize($caseStudy['client_company_name'] ?? $client['company_name']) ?></span> <?php if (!empty($caseStudy['region'])): ?> <span><?= sanitize($caseStudy['region']) ?></span> <?php endif; ?> </div> <h3 class="case-study-card__title"><?= sanitize($caseStudy['title']) ?></h3> <?php if (!empty($caseStudy['summary'])): ?> <p class="case-study-card__summary"><?= sanitize($caseStudy['summary']) ?></p> <?php endif; ?> <span class="proof-link">Read case study</span> </a> <?php endforeach; ?> </div> <?php endif; ?> <?php if ($clientTestimonials): ?> <div class="testimonials-grid"> <?php foreach ($clientTestimonials as $i => $testimonial): ?> <div class="testimonial-card" data-animate="fade-up" data-delay="<?= $i * 100 ?>"> <div class="testimonial-card__quote-mark">“</div> <p class="testimonial-card__quote"><?= sanitize($testimonial['quote']) ?></p> <?php if (!empty($testimonial['engagement_scope'])): ?> <div class="testimonial-card__scope"><?= sanitize($testimonial['engagement_scope']) ?></div> <?php endif; ?> <div class="testimonial-card__author"> <div class="testimonial-card__avatar"><?= sanitize(getInitials($testimonial['author_name'])) ?></div> <div> <div class="testimonial-card__name"><?= sanitize($testimonial['author_name']) ?></div> <div class="testimonial-card__title"><?= sanitize($testimonial['author_title']) ?>, <?= sanitize($testimonial['author_company'] ?: $client['company_name']) ?></div> </div> </div> </div> <?php endforeach; ?> </div> <?php endif; ?> </div> </section> <?php endif; ?> <?php if ($otherClients): ?> <section class="section"> <div class="container"> <div class="section__header section__header--center" data-animate="fade-up"> <div class="section__label">More Clients</div> <h2 class="section__title">Explore Related Client Profiles</h2> </div> <div class="client-grid"> <?php foreach ($otherClients as $i => $otherClient): ?> <a href="<?= sanitize(getClientUrl($otherClient)) ?>" class="client-card" data-animate="fade-up" data-delay="<?= $i * 100 ?>"> <h3 class="client-card__title"><?= sanitize($otherClient['company_name']) ?></h3> <div class="client-card__meta"> <?php if (!empty($otherClient['industry'])): ?> <span><?= sanitize($otherClient['industry']) ?></span> <?php endif; ?> <?php if (!empty($otherClient['country'])): ?> <span><?= sanitize($otherClient['country']) ?></span> <?php endif; ?> </div> <p class="client-card__summary"><?= sanitize($otherClient['headline'] ?: 'Explore the relationship summary and linked proof content.') ?></p> <span class="service-card__cta"> View Client <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="14" height="14"><line x1="5" y1="12" x2="19" y2="12"/><polyline points="12 5 19 12 12 19"/></svg> </span> </a> <?php endforeach; ?> </div> </div> </section> <?php endif; ?> <?php require_once EXOS_INCLUDES_PATH . '/footer.php'; ?> ```