From 44f71c32c40fe5c36e3a681885e51fb2fce4d9fb Mon Sep 17 00:00:00 2001 From: Flatlogic Bot Date: Fri, 2 Jan 2026 11:10:39 +0000 Subject: [PATCH] mvp.3 --- edit_process.php | 90 ++++++++++++++++++++++++++++++++++++++++++++++ index.php | 20 +++++++---- update_process.php | 33 +++++++++++++++++ 3 files changed, 137 insertions(+), 6 deletions(-) create mode 100644 edit_process.php create mode 100644 update_process.php diff --git a/edit_process.php b/edit_process.php new file mode 100644 index 0000000..d5c7bbd --- /dev/null +++ b/edit_process.php @@ -0,0 +1,90 @@ +prepare("SELECT id, name, description FROM processes WHERE id = :id"); + $stmt->bindParam(':id', $id, PDO::PARAM_INT); + $stmt->execute(); + $process = $stmt->fetch(PDO::FETCH_ASSOC); + + if (!$process) { + $error = "Process not found."; + } + } catch (PDOException $e) { + error_log("DB Error: " . $e->getMessage()); + $error = "Could not retrieve process details."; + } +} else { + $error = "No process ID provided."; +} + +$project_name = htmlspecialchars($_SERVER['PROJECT_NAME'] ?? 'ProcessFlow Optimizer'); +?> + + + + + + Edit Process - <?php echo $project_name; ?> + + + + + + +
+
+

+

A business process analyzer and automated optimizer

+
+
+ +
+
+
+
+
+ + + Go Back + +

Edit Process:

+

Modify the details of your process.

+
+ +
+ + +
+
+ + +
+ + Cancel +
+ +
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/index.php b/index.php index b08e4ed..0480963 100644 --- a/index.php +++ b/index.php @@ -87,12 +87,20 @@ $project_image_url = htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? '');
-
- - -
+
+
+ + +
+
+ + +
+

diff --git a/update_process.php b/update_process.php new file mode 100644 index 0000000..2e4f0b1 --- /dev/null +++ b/update_process.php @@ -0,0 +1,33 @@ +prepare("UPDATE processes SET name = :name, description = :description WHERE id = :id"); + $stmt->bindParam(':name', $name, PDO::PARAM_STR); + $stmt->bindParam(':description', $description, PDO::PARAM_STR); + $stmt->bindParam(':id', $id, PDO::PARAM_INT); + + if ($stmt->execute()) { + header('Location: index.php?status=success&message=Process updated successfully!'); + exit(); + } else { + header('Location: edit_process.php?id=' . $id . '&status=error&message=Failed to update process.'); + exit(); + } + } catch (PDOException $e) { + error_log("DB Error: " . $e->getMessage()); + header('Location: edit_process.php?id=' . $id . '&status=error&message=Database error: ' . urlencode($e->getMessage())); + exit(); + } + } +} else { + header('Location: index.php?status=error&message=Invalid request method.'); + exit(); +}