From 4df1537bcb366b1585410d3b31eb39585c11cdcd Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 2 Jan 2026 11:08:19 +0000 Subject: [PATCH] mvp.2 --- add_process.php | 33 ++++++ assets/css/custom.css | 62 +++++++++++ db/migrate.php | 18 +++ delete_process.php | 20 ++++ index.php | 253 ++++++++++++++++++------------------------ 5 files changed, 243 insertions(+), 143 deletions(-) create mode 100644 add_process.php create mode 100644 assets/css/custom.css create mode 100644 db/migrate.php create mode 100644 delete_process.php diff --git a/add_process.php b/add_process.php new file mode 100644 index 0000000..0864a5e --- /dev/null +++ b/add_process.php @@ -0,0 +1,33 @@ +prepare($sql); + $stmt->execute([$name, $description]); + } catch (PDOException $e) { + // In a real app, log this error. For now, we'll just die. + die("Database error: " . $e->getMessage()); + } + + // Redirect back to the main page after successful insertion + header('Location: index.php?success=1'); + exit; +} else { + // If not a POST request, redirect to the main page + header('Location: index.php'); + exit; +} +?> diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..202fa20 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,62 @@ +/* +ProcessFlow Optimizer Custom Stylesheet +*/ + +:root { + --bs-primary: #4A90E2; + --bs-primary-rgb: 74, 144, 226; + --bs-secondary: #50E3C2; + --bs-secondary-rgb: 80, 227, 194; + --bs-body-bg: #F8F9FA; + --bs-body-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; + --bs-border-radius: 0.5rem; + --bs-card-border-width: 0; + --bs-card-box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075); +} + +body { + color: #212529; +} + +.btn-primary { + background-color: var(--bs-primary); + border-color: var(--bs-primary); +} + +.btn-primary:hover { + opacity: 0.9; + background-color: var(--bs-primary); + border-color: var(--bs-primary); +} + +.header { + background: linear-gradient(90deg, #4A90E2 0%, #63A4F7 100%); + color: white; + padding: 2.5rem 0; + margin-bottom: -1rem; +} + +.header h1 { + font-weight: 700; + color: white; +} +.header p { + color: rgba(255,255,255,0.8) !important; +} + +.card { + border: none; + border-radius: var(--bs-border-radius); +} + +.list-group-item { + border-bottom: 1px solid #eee !important; +} +.list-group-item:last-child { + border-bottom: none !important; +} + +.form-control:focus { + border-color: #80bdff; + box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25); +} diff --git a/db/migrate.php b/db/migrate.php new file mode 100644 index 0000000..3726dcf --- /dev/null +++ b/db/migrate.php @@ -0,0 +1,18 @@ +exec($sql); + echo "Database migration successful. 'processes' table is ready."; +} catch (PDOException $e) { + die("Database migration failed: " . $e->getMessage()); +} +?> diff --git a/delete_process.php b/delete_process.php new file mode 100644 index 0000000..2387458 --- /dev/null +++ b/delete_process.php @@ -0,0 +1,20 @@ +prepare("DELETE FROM processes WHERE id = :id"); + $stmt->bindParam(':id', $id, PDO::PARAM_INT); + $stmt->execute(); + } catch (PDOException $e) { + error_log("DB Error: " . $e->getMessage()); + // Optionally, redirect with an error message + } +} + +header('Location: index.php'); +exit(); +?> \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..b08e4ed 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,117 @@ query("SELECT id, name, description, created_at FROM processes ORDER BY created_at DESC"); + $processes = $stmt->fetchAll(PDO::FETCH_ASSOC); +} catch (PDOException $e) { + // Silently log error, or display a friendly message. + error_log("DB Error: " . $e->getMessage()); +} + +$project_name = htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'ProcessFlow Optimizer'); +$project_description = htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'Analyze and optimize your business processes.'); +$project_image_url = htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + <?php echo $project_name; ?> + + + + + + + + + + + + + - -
-
-

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

-
-
- + + +
+
+

+

A business process analyzer and automated optimizer

+
+
+ +
+
+ +
+
+
+

Map a New Process

+

Define a process to begin analysis.

+
+
+ + +
+
+ + +
+ +
+
+
+
+ + +
+
+
+

Existing Processes

+ +
+ +

No processes defined yet.
Use the form to add your first process.

+
+ +
+ +
+
+
+
+ +
+
+ + +
+
+

+
+ +
+ +
+
+
+
+
+ + + + + - + \ No newline at end of file