40 lines
1.8 KiB
PHP
40 lines
1.8 KiB
PHP
<?php
|
|
require_once __DIR__ . '/includes/header.php';
|
|
require_once __DIR__ . '/db/config.php';
|
|
|
|
$pdo = db();
|
|
$stmt = $pdo->query("SELECT * FROM templates ORDER BY name");
|
|
$templates = $stmt->fetchAll();
|
|
?>
|
|
|
|
<main class="container">
|
|
<h1 class="text-center my-4">CV Templates</h1>
|
|
<p class="text-center text-muted mb-5">Browse our library of professionally designed templates. <a href="/register.php">Sign up</a> to use them!</p>
|
|
|
|
<div class="row">
|
|
<?php foreach ($templates as $template): ?>
|
|
<div class="col-md-6 col-lg-4 mb-4">
|
|
<div class="card h-100">
|
|
<img src="https://picsum.photos/seed/<?php echo htmlspecialchars($template['file_path']); ?>/400/500" class="card-img-top" alt="<?php echo htmlspecialchars($template['name']); ?>">
|
|
<div class="card-body">
|
|
<h5 class="card-title d-flex justify-content-between align-items-center">
|
|
<?php echo htmlspecialchars($template['name']); ?>
|
|
<?php if ($template['is_premium']): ?>
|
|
<span class="badge bg-warning text-dark">PRO</span>
|
|
<?php else: ?>
|
|
<span class="badge bg-success">FREE</span>
|
|
<?php endif; ?>
|
|
</h5>
|
|
<p class="card-text"><?php echo htmlspecialchars($template['description'] ?? 'A great template for your CV.'); ?></p>
|
|
</div>
|
|
<div class="card-footer text-center">
|
|
<a href="/register.php" class="btn btn-primary">Use this Template</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</main>
|
|
|
|
<?php require_once __DIR__ . '/includes/footer.php'; ?>
|