- The medicine and terminology directories are now organized as compact rows, and each item links to a dynamic database-backed detail page:

Medicines: /medicine.php?id=46
Terms: /term.php?id=13
Key files:
Dynamic medicine page: [public/medicine.php (line 
1)](/Users/tyemeclifford/Documents/GH/workout/public/medicine.php:1)
Dynamic term page: [public/term.php (line 
1)](/Users/tyemeclifford/Documents/GH/workout/public/term.php:1)
Shared lookup/link helpers: [app/bootstrap.php (line 
1220)](/Users/tyemeclifford/Documents/GH/workout/app/bootstrap.php:1220)
Reworked medicine directory: [public/nutrition.php (line 
49)](/Users/tyemeclifford/Documents/GH/workout/public/nutrition.php:49)
Reworked terminology page: [public/medical.php (line 
64)](/Users/tyemeclifford/Documents/GH/workout/public/medical.php:64)
Overflow-safe layout CSS: [public/assets/site.css (line 
344)](/Users/tyemeclifford/Documents/GH/workout/public/assets/site.css:344)
This commit is contained in:
Ty Clifford
2026-06-30 15:41:55 -04:00
parent 96de47be43
commit b8045eb068
7 changed files with 567 additions and 56 deletions
+55 -35
View File
@@ -53,6 +53,12 @@ require __DIR__ . '/partials/site-header.php';
</article>
<?php endforeach; ?>
</div>
<?php if (!$conditions): ?>
<article class="empty-state">
<h3>No conditions found.</h3>
<p>Try another medicine, symptom, lab, or tracking term.</p>
</article>
<?php endif; ?>
</section>
<section class="admin-public-shell">
@@ -60,19 +66,30 @@ require __DIR__ . '/partials/site-header.php';
<p class="site-eyebrow">Terminology</p>
<h2>Plain-language medical terms</h2>
</div>
<div class="term-table">
<?php foreach ($terms as $term): ?>
<article>
<div>
<h3><?= htmlspecialchars($term['term'], ENT_QUOTES) ?></h3>
<span><?= htmlspecialchars($term['category'], ENT_QUOTES) ?></span>
</div>
<p><?= htmlspecialchars($term['plain_language_definition'], ENT_QUOTES) ?></p>
<p><?= htmlspecialchars($term['clinical_context'], ENT_QUOTES) ?></p>
<a href="<?= htmlspecialchars($term['source_url'], ENT_QUOTES) ?>"><?= htmlspecialchars($term['source_name'], ENT_QUOTES) ?></a>
</article>
<?php endforeach; ?>
</div>
<?php if (!$terms): ?>
<article class="empty-state">
<h3>No terms found.</h3>
<p>Try a broader medical word, lab name, symptom, or abbreviation.</p>
</article>
<?php else: ?>
<div class="library-list">
<?php foreach ($terms as $term): ?>
<article class="library-row">
<div class="library-row-main">
<h3><?= htmlspecialchars((string) $term['term'], ENT_QUOTES) ?></h3>
<p><?= htmlspecialchars((string) $term['plain_language_definition'], ENT_QUOTES) ?></p>
<div class="library-row-meta">
<span><?= htmlspecialchars((string) $term['category'], ENT_QUOTES) ?></span>
<span><?= htmlspecialchars((string) $term['source_name'], ENT_QUOTES) ?></span>
</div>
</div>
<div class="library-row-actions">
<a class="site-primary" href="<?= htmlspecialchars(term_detail_path($term), ENT_QUOTES) ?>">View term</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<section class="admin-public-shell">
@@ -80,28 +97,31 @@ require __DIR__ . '/partials/site-header.php';
<p class="site-eyebrow">Medication catalog</p>
<h2>Medicines with chemical, brand, RxNorm, DailyMed, and PubChem links</h2>
</div>
<div class="detail-grid">
<?php foreach ($medicines as $medicine): ?>
<article>
<h2><?= htmlspecialchars(ucfirst($medicine['generic_name']), ENT_QUOTES) ?></h2>
<p><strong><?= htmlspecialchars($medicine['class_name'], ENT_QUOTES) ?></strong></p>
<p><strong>Active ingredient:</strong> <?= htmlspecialchars($medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
<p><strong>Chemical name:</strong> <?= htmlspecialchars($medicine['chemical_name'] ?: $medicine['active_ingredient'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
<p><strong>Common brands:</strong> <?= htmlspecialchars($medicine['brand_names'] ?: 'Brand names vary by market', ENT_QUOTES) ?></p>
<p><strong>Generic/alternate names:</strong> <?= htmlspecialchars($medicine['generic_brands'] ?: $medicine['generic_name'], ENT_QUOTES) ?></p>
<p><?= htmlspecialchars($medicine['common_use'], ENT_QUOTES) ?></p>
<p><?= htmlspecialchars($medicine['tracking_note'], ENT_QUOTES) ?></p>
<div class="source-links">
<a href="<?= htmlspecialchars($medicine['rxnorm_url'], ENT_QUOTES) ?>">RxNorm</a>
<a href="<?= htmlspecialchars($medicine['pubchem_url'], ENT_QUOTES) ?>">PubChem</a>
<a href="<?= htmlspecialchars($medicine['dailymed_url'], ENT_QUOTES) ?>">DailyMed</a>
<a href="<?= htmlspecialchars($medicine['medlineplus_url'], ENT_QUOTES) ?>">MedlinePlus</a>
<a href="<?= htmlspecialchars($medicine['pubmed_url'], ENT_QUOTES) ?>">PubMed</a>
<a href="<?= htmlspecialchars($medicine['clinicaltrials_url'], ENT_QUOTES) ?>">Studies</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php if (!$medicines): ?>
<article class="empty-state">
<h3>No medicines found.</h3>
<p>Try a generic name, brand name, chemical name, or medication class.</p>
</article>
<?php else: ?>
<div class="library-list">
<?php foreach ($medicines as $medicine): ?>
<article class="library-row">
<div class="library-row-main">
<h3><?= htmlspecialchars(ucfirst((string) $medicine['generic_name']), ENT_QUOTES) ?></h3>
<p><?= htmlspecialchars((string) ($medicine['common_use'] ?: $medicine['tracking_note'] ?: 'Medicine reference entry.'), ENT_QUOTES) ?></p>
<div class="library-row-meta">
<span><?= htmlspecialchars((string) ($medicine['class_name'] ?: 'Medication'), ENT_QUOTES) ?></span>
<span>Active: <?= htmlspecialchars((string) ($medicine['active_ingredient'] ?: $medicine['generic_name']), ENT_QUOTES) ?></span>
<span>Brands: <?= htmlspecialchars((string) ($medicine['brand_names'] ?: 'Vary by market'), ENT_QUOTES) ?></span>
</div>
</div>
<div class="library-row-actions">
<a class="site-primary" href="<?= htmlspecialchars(medicine_detail_path($medicine), ENT_QUOTES) ?>">View medicine</a>
</div>
</article>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<section class="admin-public-shell">