- 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:
+30
-20
@@ -46,27 +46,37 @@ require __DIR__ . '/partials/site-header.php';
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section 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>
|
||||
<section class="admin-public-shell">
|
||||
<div class="site-section-heading">
|
||||
<p class="site-eyebrow">Catalog directory</p>
|
||||
<h2>Medicine records</h2>
|
||||
</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 endforeach; ?>
|
||||
<?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>
|
||||
</main>
|
||||
<?php require __DIR__ . '/partials/site-footer.php'; ?>
|
||||
|
||||
Reference in New Issue
Block a user