From bdb61800b13e76163008e1646117b6a917e22137 Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Thu, 15 Jan 2026 15:23:12 +0000 Subject: [PATCH] 01 --- assets/css/custom.css | 34 +++ db/migrations/001_create_nc_table.sql | 8 + db/migrations/migrate.php | 22 ++ index.php | 311 ++++++++++++++------------ 4 files changed, 233 insertions(+), 142 deletions(-) create mode 100644 assets/css/custom.css create mode 100644 db/migrations/001_create_nc_table.sql create mode 100644 db/migrations/migrate.php diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..9cd9da2 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,34 @@ +body { + background-color: #F8F9FA; + font-family: 'Inter', sans-serif; +} + +:root { + --bs-primary: #3498DB; + --bs-secondary: #2C3E50; + --bs-success: #27AE60; +} + +.navbar { + background-color: #FFFFFF; + border-bottom: 1px solid #dee2e6; +} + +.btn-primary { + background-color: #3498DB; + border-color: #3498DB; +} + +.btn-primary:hover { + background-color: #2980b9; + border-color: #2980b9; +} + +.modal-header { + background-color: #2C3E50; + color: #FFFFFF; +} + +.modal-header .btn-close { + filter: invert(1) grayscale(100%) brightness(200%); +} diff --git a/db/migrations/001_create_nc_table.sql b/db/migrations/001_create_nc_table.sql new file mode 100644 index 0000000..28dc928 --- /dev/null +++ b/db/migrations/001_create_nc_table.sql @@ -0,0 +1,8 @@ +CREATE TABLE IF NOT EXISTS non_conformities ( + id INT AUTO_INCREMENT PRIMARY KEY, + description TEXT NOT NULL, + type ENUM('produit', 'processus', 'service') NOT NULL, + status ENUM('ouvert', 'en_analyse', 'action_lancee', 'clos') NOT NULL DEFAULT 'ouvert', + gravity ENUM('mineure', 'majeure', 'critique') NOT NULL, + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP +); diff --git a/db/migrations/migrate.php b/db/migrations/migrate.php new file mode 100644 index 0000000..73911c2 --- /dev/null +++ b/db/migrations/migrate.php @@ -0,0 +1,22 @@ +exec($sql); + echo "Migration from $file ran successfully.\n"; + } catch (PDOException $e) { + echo "Error running migration from $file: " . $e->getMessage() . "\n"; + } + } +} + +run_migrations(); + diff --git a/index.php b/index.php index 7205f3d..c0d4a77 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,177 @@ prepare("INSERT INTO non_conformities (description, type, gravity) VALUES (?, ?, ?)"); + $stmt->execute([$description, $type, $gravity]); + $message = '
Non-conformité ajoutée avec succès.
'; + } catch (PDOException $e) { + $message = '
Erreur: ' . $e->getMessage() . '
'; + } + } else { + $message = '
Veuillez remplir tous les champs.
'; + } +} + +// Fetch non-conformities +$non_conformities = []; +try { + $pdo = db(); + $stmt = $pdo->query("SELECT id, description, type, status, gravity, created_at FROM non_conformities ORDER BY created_at DESC"); + $non_conformities = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + $message = '
Erreur de connexion à la base de données: ' . $e->getMessage() . '
'; +} ?> - - + + - - - New Style - - - - - - - - - - - - - - - - - - - + + + Q-Lean Management Platform + + + + + + -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ +
- + + +
+
+

Gestion des Non-Conformités

+ +
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
IDDescriptionTypeStatutGravitéDate de création
Aucune non-conformité trouvée.
+ + +
+
+
+
+
+ + + + + - + \ No newline at end of file