trad
This commit is contained in:
+11
-11
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
require __DIR__ . '/includes/auth.php';
|
||||
require __DIR__ . '/includes/db.php';
|
||||
require_once __DIR__ . '/includes/i18n.php';
|
||||
require_login('/login.php');
|
||||
|
||||
// Gestion de l'onglet actif (par défaut 'recap')
|
||||
// Gestion de l'onglet actif (par défaut 'suivi')
|
||||
$tab = $_GET['tab'] ?? 'suivi';
|
||||
|
||||
$pageTitle = "PachaFamily - Budget";
|
||||
$pageTitle = tr('budget_page_title');
|
||||
$activePage = "budget";
|
||||
$pageCss = "/modules/budget/budget.css";
|
||||
|
||||
@@ -15,27 +16,27 @@ require __DIR__ . '/header.php';
|
||||
|
||||
<div class="pf-container">
|
||||
<div class="pf-hero" style="text-align: center; margin-bottom: 30px;">
|
||||
<h1 style="margin-bottom: 20px;">Gestion du Budget</h1>
|
||||
<h1 style="margin-bottom: 20px;"><?= tr('budget_main_header') ?></h1>
|
||||
|
||||
<nav class="budget-tabs-container">
|
||||
<a href="?tab=suivi" class="tab-item <?= $tab == 'suivi' ? 'active' : '' ?>">
|
||||
<span class="tab-icon">🗓️</span>
|
||||
<span>Suivi Mensuel</span>
|
||||
<span><?= tr('budget_tab_tracking') ?></span>
|
||||
</a>
|
||||
|
||||
<a href="?tab=budget_prev" class="tab-item <?= $tab == 'budget_prev' ? 'active' : '' ?>">
|
||||
<span class="tab-icon">🎯</span>
|
||||
<span>Budget 2026</span>
|
||||
<span><?= tr('budget_tab_prev') ?></span>
|
||||
</a>
|
||||
|
||||
<a href="?tab=epargne" class="tab-item <?= $tab == 'epargne' ? 'active' : '' ?>">
|
||||
<span class="tab-icon">🐷</span>
|
||||
<span>Épargne</span>
|
||||
<span><?= tr('budget_tab_savings') ?></span>
|
||||
</a>
|
||||
|
||||
<a href="?tab=recap" class="tab-item <?= $tab == 'recap' ? 'active' : '' ?>">
|
||||
<span class="tab-icon">📊</span>
|
||||
<span>Récapitulatif</span>
|
||||
<span><?= tr('budget_tab_recap') ?></span>
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
@@ -43,7 +44,6 @@ require __DIR__ . '/header.php';
|
||||
<section class="pf-section">
|
||||
<?php
|
||||
// ROUTAGE DYNAMIQUE
|
||||
// Sécurisation basique pour éviter d'inclure n'importe quoi
|
||||
$allowedTabs = ['recap', 'suivi', 'epargne', 'budget_prev'];
|
||||
|
||||
if (in_array($tab, $allowedTabs)) {
|
||||
@@ -53,12 +53,12 @@ require __DIR__ . '/header.php';
|
||||
include $viewPath;
|
||||
} else {
|
||||
echo "<div style='text-align:center; padding:50px; color:#ef4444;'>";
|
||||
echo "<h3>Oups ! Fichier introuvable.</h3>";
|
||||
echo "<p>Vérifiez que le fichier <code>views/" . htmlspecialchars($tab) . ".php</code> existe bien.</p>";
|
||||
echo "<h3>" . tr('budget_err_file_not_found') . "</h3>";
|
||||
echo "<p>" . sprintf(tr('budget_err_file_detail'), htmlspecialchars($tab)) . "</p>";
|
||||
echo "</div>";
|
||||
}
|
||||
} else {
|
||||
echo "<p>Page non autorisée.</p>";
|
||||
echo "<p>" . tr('budget_err_not_authorized') . "</p>";
|
||||
}
|
||||
?>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user