diff --git a/christmas-list.php b/christmas-list.php new file mode 100644 index 0000000..55b1319 --- /dev/null +++ b/christmas-list.php @@ -0,0 +1,231 @@ + 'Tió', + 'NADAL' => 'Nadal', + 'REIS' => 'Reis', +]; + +// Récup données +$stmt = $pdo->prepare(" + SELECT * + FROM pf_christmas_gifts + WHERE year = :year +"); +$stmt->execute(['year' => $year]); +$gifts = $stmt->fetchAll(PDO::FETCH_ASSOC); + +// Indexer par [adult][child][occasion] +$byAdult = []; +foreach ($gifts as $gift) { + $a = $gift['adult_name']; + $c = $gift['child_name']; + $o = $gift['occasion']; + $byAdult[$a][$c][$o][] = $gift; +} +?> + +
+

Christmas list

+

Visió sintètica dels regals per adult, infant i festa. Afegeix nous regals amb el botó “+”.

+ +
+
+ + + + + + + + + + + + + + + $occLabel): ?> + + + + + + + + + + + + + + + $occLabel): ?> + + + + + + + + +
+ +
Adult
+
+ +
    + +
  • + + 0): ?> + + ( €) + + +
  • + +
+ + – Cap regal + + +
+
+ 0): ?> + Total: € + +   + +
+ + +
+
+ + +
+
+ + + + + + + +
+ + +
+ +
+ + +
+
+
+
+
+
+ +
+

Resum del pressupost

+ prepare(" + SELECT adult_name, child_name, occasion, SUM(amount) AS total + FROM pf_christmas_gifts + WHERE year = :year + GROUP BY adult_name, child_name, occasion + ORDER BY adult_name, child_name, occasion + "); + $stmtSum->execute(['year' => $year]); + $sums = $stmtSum->fetchAll(PDO::FETCH_ASSOC); + ?> + +
+ + + + + + + + + + + + + + + + + + + +
AdultInfantFestaTotal
+
+
+
+ + + + +">Family calendar + + Christmas list diff --git a/index.php b/index.php index aa77816..747e6c6 100644 --- a/index.php +++ b/index.php @@ -6,14 +6,12 @@ require_login('/index.php'); // Configuration de la page $pageTitle = "PachaFamily - Accueil"; $activePage = "home"; -$bodyClass = "pf-home"; -$pageCss = "/modules/home/home.css"; +$bodyClass = "pf-home"; +$pageCss = "/modules/home/home.css"; require __DIR__ . '/header.php'; ?> - -

Bienvenue sur PachaFamily

Centre de contrôle de l'organisation familiale.

@@ -51,15 +49,16 @@ require __DIR__ . '/header.php'; À venir
- -
-
📦
-

Liste de courses

+ + +
🎄
+

Christmas list

- Centralisez les listes de courses et les partages entre membres. + Planifica els regals de cada nen, per al Tió, el Nadal i els Reis.
- À venir -
+ Accedir al mòdul + + diff --git a/modules/christmas-list/christmas-list.css b/modules/christmas-list/christmas-list.css new file mode 100644 index 0000000..cf50576 --- /dev/null +++ b/modules/christmas-list/christmas-list.css @@ -0,0 +1,221 @@ +/* Christmas list : vue synthétique avec bouton + et menu flottant */ + +.pf-christmas-list h1 { + margin-bottom: 4px; +} + +.pf-christmas-list p { + margin-top: 0; + margin-bottom: 12px; + font-size: 13px; + color: #4b5563; +} + +/* Grille principale */ +.cl-grid-wrapper { + overflow-x: auto; /* sécurité pour petits écrans */ +} + +.cl-grid-table { + font-size: 11px; +} + +/* En-têtes */ +.cl-grid-table thead th { + padding: 6px 4px; +} + +.cl-child-header { + text-align: center; + font-weight: 600; + white-space: nowrap; +} + +.cl-header-adult { + text-align: left; + white-space: nowrap; +} + +.cl-header-occ { + text-align: center; + font-weight: 500; + color: #627d98; +} + +/* Colonne adulte */ +.cl-adult-cell { + font-weight: 600; + white-space: nowrap; + padding: 8px 6px; +} + +/* Cellules cadeau */ +.cl-gift-cell { + min-width: 120px; + vertical-align: top; + padding: 6px 4px; +} + +/* Contenu de la cellule : colonne verticale */ +.cl-gift-cell-content { + display: flex; + flex-direction: column; + gap: 4px; +} + +/* Liste des cadeaux : alignée à gauche */ +.cl-gift-list { + list-style: none; + margin: 0; + padding: 0; + text-align: left; +} + +.cl-gift-list li { + margin-bottom: 2px; +} + +/* Montant par cadeau */ +.cl-gift-amount { + font-size: 10px; + color: #627d98; + margin-left: 2px; +} + +/* Cellule vide */ +.cl-empty { + display: inline-block; + margin-bottom: 2px; + font-size: 11px; + color: #9fb3c8; +} + +/* Ligne Total + bouton + */ +.cl-total-and-add { + display: flex; + align-items: center; + justify-content: space-between; /* Total à gauche, + à droite */ + gap: 4px; + margin-top: 2px; +} + +/* Texte Total */ +.cl-gift-total { + font-size: 10px; + font-weight: 600; + color: #243b53; +} + +/* Bouton + */ +.cl-add-btn { + width: 20px; + height: 20px; + border-radius: 50%; + border: 1px solid #d9e2ec; + background: #f0f4f8; + color: #243b53; + font-size: 12px; + line-height: 18px; + text-align: center; + padding: 0; + cursor: pointer; +} + +.cl-add-btn:hover { + background: #d9e2ec; +} + +/* Menu d'ajout (caché par défaut) */ +.cl-add-menu { + display: none; + margin-top: 4px; + padding: 6px; + border-radius: 6px; + border: 1px solid #d9e2ec; + background: #f8fafc; + box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12); +} + +/* Classe pour afficher le menu */ +.cl-add-menu--open { + display: block; +} + +/* Formulaire dans le menu */ +.cl-gift-form { + display: flex; + flex-direction: column; + gap: 4px; +} + +/* Ligne du formulaire (lien + montant) */ +.cl-gift-form-row { + display: flex; + gap: 4px; +} + +/* Champs du formulaire */ +.cl-gift-form input[type="text"], +.cl-gift-form input[type="url"], +.cl-gift-form input[type="number"] { + font-size: 10px; + padding: 2px 4px; + border-radius: 4px; + border: 1px solid #d9e2ec; +} + +.cl-gift-form input[type="text"] { + width: 100%; +} + +.cl-gift-form input[type="url"] { + flex: 1 1 auto; +} + +.cl-gift-form input[type="number"] { + width: 60px; +} + +/* Boutons OK / Cancel */ +.cl-gift-form-actions { + display: flex; + justify-content: flex-end; + gap: 4px; + margin-top: 2px; +} + +.cl-gift-form-actions button { + font-size: 10px; + padding: 2px 6px; + border-radius: 4px; + border: 1px solid #d9e2ec; + background: #f0f4f8; + cursor: pointer; +} + +.cl-gift-form-actions button:hover { + background: #d9e2ec; +} + +.cl-ok-btn { + font-weight: 600; + color: #1f2933; +} + +.cl-cancel-btn { + color: #9fb3c8; +} + +/* Récap global en bas */ +.cl-budget-wrapper { + margin-top: 4px; +} + +.cl-budget-wrapper .pf-table { + font-size: 11px; +} + +.cl-budget-wrapper .pf-table th, +.cl-budget-wrapper .pf-table td { + padding: 4px 4px; +} diff --git a/modules/christmas-list/save-gift.php b/modules/christmas-list/save-gift.php new file mode 100644 index 0000000..3a31277 --- /dev/null +++ b/modules/christmas-list/save-gift.php @@ -0,0 +1,38 @@ +prepare(" + INSERT INTO pf_christmas_gifts + (year, adult_name, child_name, occasion, gift_description, product_link, amount) + VALUES + (:year, :adult_name, :child_name, :occasion, :gift_description, :product_link, :amount) + "); + + $stmt->execute([ + 'year' => $year, + 'adult_name' => $adult_name, + 'child_name' => $child_name, + 'occasion' => $occasion, + 'gift_description'=> $gift_desc, + 'product_link' => $product_link ?: null, + 'amount' => $amount, + ]); + } +} + +// Retour à la page Christmas list +header('Location: /christmas-list.php'); +exit; diff --git a/modules/home/assets/img/background.jpg b/modules/home/assets/img/background.jpg index b326f32..abe3d0d 100644 Binary files a/modules/home/assets/img/background.jpg and b/modules/home/assets/img/background.jpg differ diff --git a/modules/home/assets/img/background_OLD.jpg b/modules/home/assets/img/background_OLD.jpg new file mode 100644 index 0000000..b326f32 Binary files /dev/null and b/modules/home/assets/img/background_OLD.jpg differ diff --git a/modules/home/home.css b/modules/home/home.css index 01e96df..0a9bca4 100644 --- a/modules/home/home.css +++ b/modules/home/home.css @@ -1,12 +1,15 @@ /* === HOME : fond et overlay === */ -/* Fond image + overlay uniquement pour la home */ +/* Fond image uniquement pour la home */ body.pf-home { position: relative; background-image: url("/modules/home/assets/img/background.jpg"); background-size: cover; - background-position: top center; + background-position: center center; background-repeat: no-repeat; + + /* Texte global plutôt clair sur la home (sur l'image) */ + color: #f9fafb; } /* Header translucide par-dessus l'image sur la home */ @@ -30,6 +33,11 @@ body.pf-home > * { z-index: 0; } +/* Descendre légèrement le contenu sous le header sur la home */ +body.pf-home .pf-main { + padding-top: 60px; /* au lieu de 24px défini dans global.css */ +} + /* === HOME / MODULES CARDS === */ /* Container des cartes de modules */ @@ -103,11 +111,11 @@ body.pf-home > * { .pf-user-info { margin-top: 12px; font-size: 13px; - color: #4b5563; + color: #f9fafb; /* lisible sur le fond */ } .pf-user-info a { - color: #c81e1e; + color: #ffb4b4; text-decoration: none; font-weight: 500; } @@ -115,3 +123,18 @@ body.pf-home > * { .pf-user-info a:hover { text-decoration: underline; } + +/* Dans les cards (fond clair) : texte foncé */ +body.pf-home .pf-card, +body.pf-home .pf-section--panel { + color: #222; +} + +/* S’assurer que les titres / textes intro sont bien à gauche et lisibles */ +body.pf-home h1, +body.pf-home .pf-container > p, +body.pf-home .pf-user-info, +body.pf-home .pf-section > h2 { + text-align: left; + color: #f9fafb; +}