@@ -30,14 +30,13 @@
getQnA();
$qna -> insertQnA();
-
?>
From 0b402fea69af464cf1cbd422be19f22e535c18d4 Mon Sep 17 00:00:00 2001
From: Kostia365 <90925004+Kostia365@users.noreply.github.com>
Date: Sun, 25 May 2025 17:17:23 +0200
Subject: [PATCH 6/6] commit with bugs
---
.idea/dataSources.local.xml | 2 +-
.idea/workspace.xml | 62 ++++++++++++++++++++-----------------
classes/Kontakt.php | 19 ++++++++++++
db/spracovanieFormulara.php | 4 +--
kontakt.php | 2 +-
otazky.php | 4 +--
6 files changed, 58 insertions(+), 35 deletions(-)
diff --git a/.idea/dataSources.local.xml b/.idea/dataSources.local.xml
index afa0a1c..c1dc998 100644
--- a/.idea/dataSources.local.xml
+++ b/.idea/dataSources.local.xml
@@ -1,6 +1,6 @@
-
+
#@
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 14ccceb..7831ac6 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -7,6 +7,10 @@
+
+
+
+
@@ -56,38 +60,38 @@
- {
+ "keyToString": {
+ "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "DefaultHtmlFileTemplate": "HTML File",
+ "JavaScript Debug.functions.php.executor": "Run",
+ "JavaScript Debug.index.html.executor": "Run",
+ "JavaScript Debug.index.php.executor": "Run",
+ "JavaScript Debug.kontakt.php.executor": "Run",
+ "JavaScript Debug.otazky.php.executor": "Run",
+ "JavaScript Debug.portfolio.php.executor": "Run",
+ "JavaScript Debug.qna.html.executor": "Run",
+ "JavaScript Debug.qna.php.executor": "Run",
+ "PHP Script.index.php.executor": "Run",
+ "PHP Script.spracovanieFormulara.php.executor": "Run",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "RunOnceActivity.git.unshallow": "true",
+ "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+ "git-widget-placeholder": "feature/database",
+ "last_opened_file_path": "C:/xampp/htdocs/test_project",
+ "node.js.detected.package.eslint": "true",
+ "node.js.detected.package.tslint": "true",
+ "node.js.selected.package.eslint": "(autodetect)",
+ "node.js.selected.package.tslint": "(autodetect)",
+ "nodejs_package_manager_path": "npm",
+ "vue.rearranger.settings.migration": "true"
},
- "keyToStringList": {
- "DatabaseDriversLRU": [
- "mysql"
+ "keyToStringList": {
+ "DatabaseDriversLRU": [
+ "mysql"
]
}
-}]]>
+}
diff --git a/classes/Kontakt.php b/classes/Kontakt.php
index 4417a18..c65bcf3 100644
--- a/classes/Kontakt.php
+++ b/classes/Kontakt.php
@@ -27,9 +27,28 @@ private function connect()
die("Chyba pripojenia: " . $e->getMessage());
}
}
+ public function ulozitSpravu($meno, $email, $sprava) {
+ $sql = "INSERT INTO kontakt_formular (meno, email, sprava)
+ VALUE ('" . $meno . "', '" . $email . "', '" . $sprava . "')";
+ $statement = $this->conn->prepare($sql);
+ try {
+ $insert = $statement->execute();
+ header("Location: http://localhost/cvicnasablona/thankyou.php");
+ http_response_code(200);
+ return $insert;
+ } catch (\Exception $exception) {
+ return http_response_code(404);
+ }
+ }
+ public function __destruct() {
+ $this->conn = null;
+ }
+
+
}
+
namespace otazkyodpovede;
define('__ROOT__', dirname(dirname(__FILE__)));
require_once(__ROOT__.'/db/config.php');
diff --git a/db/spracovanieFormulara.php b/db/spracovanieFormulara.php
index 2f72c53..7692d05 100644
--- a/db/spracovanieFormulara.php
+++ b/db/spracovanieFormulara.php
@@ -2,9 +2,9 @@
$conn = null;
require_once('../classes/Kontakt.php');
use formular\Kontakt;
-$meno = $_POST['meno'];
+$meno = $_POST['name'];
$email = $_POST['email'];
-$sprava = $_POST['sprava'];
+$sprava = $_POST['work'];
// Overenie údajov
if (empty($meno) || empty($email) || empty($sprava)) {
diff --git a/kontakt.php b/kontakt.php
index b289aeb..dafb2f8 100644
--- a/kontakt.php
+++ b/kontakt.php
@@ -39,7 +39,7 @@