This commit is contained in:
Torsten Schulz
2023-06-16 11:57:49 +02:00
commit 44da93c0e9
328 changed files with 134580 additions and 0 deletions

31
include/projects.php Normal file
View File

@@ -0,0 +1,31 @@
<?php
include 'renderer.php';
class Projects extends Renderer {
protected function generateContent(): void {
$query = 'SELECT p.short_title, p.description, pt.caption
FROM project p
JOIN project_type pt
ON pt.id = p.project_type_id
ORDER BY pt.order_id, p.short_title';
$dbResult = mysqli_query($this->dbConnection, $query);
$previousSection = '';
$output = '';
while ($row = mysqli_fetch_assoc($dbResult)) {
if ($row['caption'] != $previousSection) {
if ($output !== '') {
$output .= '</ul>';
}
$output .= '<h3>' . $row['caption'] . '</h3><ul>';
$previousSection = $row['caption'];
}
$output .= '<li>' . $row['short_title'];
if (trim($row['description']) != '') {
$output .= ' - ' . $row['description'];
}
$output .= '</li>';
}
$output .= '</ul>';
$this->content['projects'] = $output;
}
}