From a7f07b7d224ac8ee348cc9ba16fe998e9de90121 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 10 Mar 2024 15:46:33 +0000 Subject: [PATCH] Dateien nach "install" hochladen --- install/index.php | 10 ++++++ install/install.css | 65 +++++++++++++++++++++++++++++++++ install/install.php | 87 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 162 insertions(+) create mode 100644 install/index.php create mode 100644 install/install.css create mode 100644 install/install.php diff --git a/install/index.php b/install/index.php new file mode 100644 index 0000000..7bee84b --- /dev/null +++ b/install/index.php @@ -0,0 +1,10 @@ + + + + Installation + + +

Installation Completed

+

Installation is completed. You can now proceed to the search page.

+ + diff --git a/install/install.css b/install/install.css new file mode 100644 index 0000000..36aaece --- /dev/null +++ b/install/install.css @@ -0,0 +1,65 @@ +/* Allgemeine Stile */ +body { + font-family: 'Roboto', sans-serif; + background-color: #f4f4f4; + margin: 0; + padding: 0; +} + +.container { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.box { + max-width: 400px; + width: 100%; + background-color: #fff; + border-radius: 8px; + box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.1); + padding: 40px; +} + +h2 { + text-align: center; + margin-bottom: 30px; + color: #333; +} + +form { + text-align: left; +} + +label { + display: block; + margin-bottom: 5px; + color: #555; +} + +input[type="text"], +input[type="password"] { + width: 100%; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 16px; + margin-bottom: 10px; +} + +input[type="submit"] { + width: 100%; + padding: 12px; + background-color: #007bff; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + transition: background-color 0.3s ease; +} + +input[type="submit"]:hover { + background-color: #0056b3; +} diff --git a/install/install.php b/install/install.php new file mode 100644 index 0000000..253a2c2 --- /dev/null +++ b/install/install.php @@ -0,0 +1,87 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); + } + + // Datenbank erstellen + $sqlCreateDb = "CREATE DATABASE IF NOT EXISTS $database"; + if ($conn->query($sqlCreateDb) === TRUE) { + // Datenbank wurde erfolgreich erstellt + + // Datenbanktabellen erstellen + $conn->select_db($database); + $sqlCreateTable = " + CREATE TABLE IF NOT EXISTS articles ( + id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY, + manufacturer VARCHAR(255) NOT NULL, + set_name VARCHAR(255), + article_number VARCHAR(255) NOT NULL, + ean_barcode VARCHAR(255), + part1 VARCHAR(255), + part1_ean VARCHAR(255), + part2 VARCHAR(255), + part2_ean VARCHAR(255), + part3 VARCHAR(255), + part3_ean VARCHAR(255), + part4 VARCHAR(255), + part4_ean VARCHAR(255), + quantity INT(6) + ) + "; + if ($conn->query($sqlCreateTable) === TRUE) { + // Datenbank und Tabellen wurden erfolgreich erstellt + // Konfigurationsdatei schreiben + $configFile = '../config/config.php'; + $configData = 'error; + } + } else { + echo "Error creating database: " . $conn->error; + } + + // Verbindung schließen + $conn->close(); +} +?> + + + + + + Install + + +
+
+

Database Configuration

+
+ +

+ +

+ +

+ +

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