2020-11-10 23:25:09 +01:00
|
|
|
<?php
|
|
|
|
$show_sep=true;
|
|
|
|
$db = new PDO('sqlite:projects_data/projects.db') or die('database error');
|
|
|
|
include('header.tpl');
|
|
|
|
?>
|
2020-11-11 22:54:30 +01:00
|
|
|
<div id="collection_padding">
|
2020-11-10 23:25:09 +01:00
|
|
|
<?php
|
|
|
|
// get collection parameters
|
|
|
|
$query = 'select id, name, description, cover_image from collections where id = :id';
|
|
|
|
$col_query = $db->prepare($query);
|
|
|
|
$col_query->bindParam(':id', $_REQUEST['id']);
|
|
|
|
$col_query->execute();
|
|
|
|
|
|
|
|
$collection_info = $col_query->fetch();
|
|
|
|
|
|
|
|
// get collection items
|
2020-11-11 22:54:30 +01:00
|
|
|
$query = 'select name, material, description, cover_image, id from collection_items where collection_id = :id';
|
2020-11-10 23:25:09 +01:00
|
|
|
$ci_query = $db->prepare($query);
|
|
|
|
$ci_query->bindParam(':id', $_REQUEST['id']);
|
|
|
|
$ci_query->execute();
|
|
|
|
?>
|
|
|
|
|
2020-11-11 22:54:30 +01:00
|
|
|
<h1 class="collection_name">
|
2020-11-10 23:25:09 +01:00
|
|
|
<? print($collection_info['name']); ?>
|
|
|
|
</h1>
|
|
|
|
<section class="description">
|
|
|
|
<? print($collection_info['description']); ?>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="ci_container">
|
|
|
|
<?php
|
|
|
|
foreach($ci_query->fetchAll() as $ci) {
|
|
|
|
if ($ci['cover_image'] == null) {
|
|
|
|
$ci['cover_image'] = $collection_info['cover_image'];
|
|
|
|
}
|
|
|
|
$ci_img_url = 'projects_data/img/' . $ci['cover_image'];
|
|
|
|
print("
|
2020-11-11 22:54:30 +01:00
|
|
|
<div class='collection_item'>
|
|
|
|
<a href='show_ci.php?id={$ci['id']}'>
|
|
|
|
<img src='{$ci_img_url}' alt='Cover picture of {$ci['name']}' />
|
|
|
|
</a>
|
2020-11-10 23:25:09 +01:00
|
|
|
<h1>{$ci['name']}</h1>
|
2020-11-11 22:54:30 +01:00
|
|
|
<p class='ci_material'>
|
|
|
|
{$ci['material']}
|
|
|
|
</p>
|
|
|
|
<p>
|
|
|
|
{$ci['description']}
|
|
|
|
</p>
|
2020-11-10 23:25:09 +01:00
|
|
|
</div>
|
|
|
|
");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<?
|
|
|
|
include('footer.tpl');
|
|
|
|
$db = null;
|
|
|
|
?>
|