checkpoint 1

This commit is contained in:
Flatlogic Bot 2025-12-15 21:56:15 +00:00
parent 7dcb29de25
commit 9a120ef6f7
2 changed files with 11 additions and 1 deletions

View File

@ -114,6 +114,7 @@
?>
<div class="header">
<h1>Candidate: <?php echo htmlspecialchars($candidate['candidate_id']); ?></h1>
<a href="project.php?id=<?php echo htmlspecialchars($candidate['project_id']); ?>" class="btn btn-secondary">Back to Project</a>
</div>
<div class="card">
@ -211,6 +212,7 @@
$stmt_sample_wells = $pdo->prepare("
SELECT
sw.sample_id,
sw.name,
wp.Temperature,
wp.incubation_start,
wp.incubation_end,
@ -257,7 +259,12 @@
c.candidate_id = ?
");
$stmt_sample_wells->execute([$_GET['id']]);
$sample_wells = $stmt_sample_wells->fetchAll(PDO::FETCH_GROUP | PDO::FETCH_ASSOC);
$sample_wells_result = $stmt_sample_wells->fetchAll(PDO::FETCH_ASSOC);
$sample_wells = [];
foreach ($sample_wells_result as $row) {
$sample_wells[$row['sample_id']][] = $row;
}
if ($sample_wells && count($sample_wells) > 0):
?>
@ -266,6 +273,7 @@
<thead>
<tr>
<th>Sample ID</th>
<th>Name</th>
<th>Composition</th>
<th>Incubation</th>
<th>PXRD Characterization</th>
@ -280,6 +288,7 @@
?>
<tr>
<td><?php echo htmlspecialchars($sample_id); ?></td>
<td><?php echo htmlspecialchars($first_row['name']); ?></td>
<td>
<ul>
<?php foreach ($rows as $row): ?>

View File

@ -123,6 +123,7 @@ CREATE TABLE IF NOT EXISTS `Sample_Well` (
`well_plate_id` Int,
`sample_id` Int NOT NULL AUTO_INCREMENT,
`picture_url` text,
`name` text,
PRIMARY KEY (`sample_id`),
FOREIGN KEY (`well_plate_id`)
REFERENCES `Well_Plate`(`well_plate_id`)