English
Spanish
French
0
Notifications
0 Non lues
Aucune notification
Voir toutes
Aucune nouvelle notification
Raccourcis
Tableau de bord
Profil
Paramètres
Voir toutes les apps
Utilisateur
Utilisateur
Profil
Messages
25
Paramètres
Solde
$47.12
Support
Se déconnecter
Dashboard
Dashboard
Éditer blog/index.php
<?php helper('text'); ?> <!-- Load helper for text truncation --> <?= view('templates/header'); ?> <?= view('templates/navbar'); ?> <?= $this->section('content') ?> <div class="container" style="margin-top: 120px;"> <div class="row"> <!-- Left Column: Categories --> <div class="col-md-3 d-none d-md-block"> <div class="p-3 bg-light rounded shadow-sm"> <h5 class="text-center mb-4" style="font-family: 'Poppins', sans-serif;">Catégories</h5> <ul class="list-group"> <li class="list-group-item"> <a href="<?= base_url('blog') ?>" class="text-decoration-none text-dark">📌 Toutes</a> </li> <?php foreach ($categories as $category): ?> <li class="list-group-item"> <a href="<?= base_url('blog/category/' . $category['id']) ?>" class="text-decoration-none text-dark"> <?= esc($category['nom']) ?> </a> </li> <?php endforeach; ?> </ul> </div> </div> <!-- Main Column: Blog Articles --> <div class="col-md-6"> <h1 class="mb-4 text-center text-uppercase font-weight-bold" style="color: #2c3e50; font-family: 'Poppins', sans-serif;">Blog BCS</h1> <?php if (!empty($posts) && is_array($posts)): ?> <div class="row"> <?php foreach ($posts as $post): ?> <div class="col-12 col-md-6 mb-4"> <div class="card shadow-sm border-0 rounded-lg" style="transition: transform 0.3s ease-in-out; overflow: hidden;"> <img src="https://via.placeholder.com/600x400" alt="Post Image" class="card-img-top rounded-lg" style="transition: transform 0.3s ease-in-out;"> <div class="card-body"> <h5 class="card-title"><?= esc($post['titre'] ?? 'Titre inconnu') ?></h5> <p class="card-text text-muted"> <?= character_limiter(strip_tags($post['contenu'] ?? ''), 150) ?> </p> <div class="d-flex justify-content-between align-items-center"> <a href="<?= base_url('blog/show/' . ($post['id'] ?? '')) ?>" class="btn btn-primary btn-sm"> Lire la suite </a> <small class="text-muted"> <?= isset($post['date_publication']) ? date('d/m/Y', strtotime($post['date_publication'])) : 'Date inconnue' ?> </small> </div> </div> </div> </div> <?php endforeach; ?> </div> <!-- Pagination --> <nav class="mt-4"> <?= $pager->links() ?> </nav> <?php else: ?> <div class="alert alert-info text-center" role="alert"> <h4 class="alert-heading">Aucun article disponible</h4> <p>Revenez plus tard pour découvrir de nouveaux contenus !</p> </div> <?php endif; ?> </div> <!-- Right Column: Recent Articles --> <div class="col-md-3"> <div class="p-3 bg-light rounded shadow-sm"> <h5 class="text-center mb-4" style="font-family: 'Poppins', sans-serif;">Articles récents</h5> <ul class="list-group"> <?php foreach ($recent_posts as $recent): ?> <li class="list-group-item"> <a href="<?= base_url('blog/show/' . ($recent['id'] ?? '')) ?>" class="text-decoration-none text-dark"> <?= esc($recent['titre']) ?> </a> </li> <?php endforeach; ?> </ul> </div> </div> </div> </div> <?= view('templates/footer'); ?>
Annuler
Enregistrer
Switcher
Theme Styles
Theme Colors
Theme Color Mode:
Light
Dark
Menu Colors: