diff --git a/.hta_slug/_home.php b/.hta_slug/_home.php
index 7fa87fb..a9f36c3 100644
--- a/.hta_slug/_home.php
+++ b/.hta_slug/_home.php
@@ -1,3 +1,7 @@
Lorem ipsum dolor sit amet consectetur adipisicing elit. Quibusdam mollitia quidem sint dolores nostrum, similique nulla consequuntur. Animi neque labore praesentium ratione a? Facere, quasi ea reprehenderit eum tempora voluptatum.
-
\ No newline at end of file
+
+
\ No newline at end of file
diff --git a/.hta_slug/_nav.php b/.hta_slug/_nav.php
index 22da05c..fd6367a 100644
--- a/.hta_slug/_nav.php
+++ b/.hta_slug/_nav.php
@@ -21,6 +21,15 @@
- setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- try {
- $db = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
- $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $stmt = $db->prepare("INSERT INTO customers (name, mobile, email) VALUES (:name, :mobile, :email)");
- $stmt->bindParam(':name', $_POST['name']);
- $stmt->bindParam(':mobile', $_POST['mobile']);
- $stmt->bindParam(':email', $_POST['email']);
+ $stmt = $db->prepare("INSERT INTO customers (name, mobile, email, customerId) VALUES (:name, :mobile, :email, :customerId)");
+ $stmt->bindParam(':name', $_POST['name']);
+ $stmt->bindParam(':mobile', $_POST['mobile']);
+ $stmt->bindParam(':email', $_POST['email']);
+ $stmt->bindParam(':customerId', $customerId);
- if ($stmt->execute()) {
- echo '
New Customer ' . htmlspecialchars($_POST['name']) . ' created successfully.
';
- } else {
- echo '
Error executing statement: ' . $stmt->errorInfo()[2] . '
';
- }
- } catch (PDOException $e) {
- echo '
Error: ' . $e->getMessage() . '
';
+ $stmt2 = $db->prepare("INSERT INTO users (name, mobile, email, type, password, customerId) VALUES (:name, :mobile, :email, :type, :password, :customerId)");
+ $stmt2->bindParam(':name', $_POST['name']);
+ $stmt2->bindParam(':mobile', $_POST['mobile']);
+ $stmt2->bindParam(':email', $_POST['email']);
+ $stmt2->bindParam(':type', $_POST['type']);
+ $stmt2->bindParam(':password', $userPassword);
+ $stmt2->bindParam(':customerId', $customerId);
+
+ if ($stmt->execute()) {
+ $stmt2->execute();
+ echo '
New Customer ' . htmlspecialchars($_POST['name']) . ' created successfully.
';
+ } else {
+ echo '
Error inserting into customers table: ' . $stmt->errorInfo()[2] . '
';
}
+ } catch (PDOException $e) {
+ echo '
Error: ' . $e->getMessage() . '
';
}
+ }
?>
+
diff --git a/customers/index.php b/customers/index.php
index b39e111..fb1a445 100644
--- a/customers/index.php
+++ b/customers/index.php
@@ -1,18 +1,25 @@
+Error: ' . $e->getMessage() . '
');
+}
+?>
+