brc/collections.php
Chris 5ffde76d5e use sqlite for collection information storage
this should be easier to extend than the multi dimensional php array
used before
2020-11-10 23:25:09 +01:00

32 lines
No EOL
851 B
PHP

<?php
$show_sep=true;
$db = new PDO('sqlite:projects_data/projects.db') or die('database error');
include('header.tpl');
?>
<div id="content_padding">
<div class="collection_container">
<?php
foreach($db->query('select id, name, cover_image from collections;') as $c) {
$collection_id = $c['id'];
$cover_image = $c['cover_image'];
$collection_name = $c['name'];
print("
<div class='collection'>
<div class='flexbox-col-img'>
<div class='col-img-container'>
<a class='col-img-desc' href='show_collection.php?id={$collection_id}'>
<img class='col-image' src='projects_data/img/{$cover_image}' alt='example image for {$collection_name}'>
</a>
</div>
</div>
<h1>{$collection_name}</h1>
</div>
");
}
?>
</div>
</div>
<?php include('footer.tpl'); ?>