diff --git a/config/community.php b/config/community.php new file mode 100644 index 0000000..e5553d8 --- /dev/null +++ b/config/community.php @@ -0,0 +1 @@ + PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, -]; -try { - $pdo = new PDO($dsn, $cfg['db_user'], $cfg['db_pass'], $options); -} catch (PDOException $e) { - http_response_code(500); - header('Content-Type: application/json'); - echo json_encode(['error' => 'DB connection failed']); - exit; -} diff --git a/public/api/materials.php b/public/api/materials.php deleted file mode 100755 index 3b743ed..0000000 --- a/public/api/materials.php +++ /dev/null @@ -1,6 +0,0 @@ -query("SELECT * FROM materials WHERE is_active = 1 ORDER BY code"); -echo json_encode($stmt->fetchAll(), JSON_UNESCAPED_UNICODE); diff --git a/public/api/printer-materials.php b/public/api/printer-materials.php deleted file mode 100755 index 29ccf7f..0000000 --- a/public/api/printer-materials.php +++ /dev/null @@ -1,35 +0,0 @@ - 'printer id missing']); - exit; -} - -$printerStmt = $pdo->prepare("SELECT * FROM printers WHERE id = ?"); -$printerStmt->execute([$printer_id]); -$printer = $printerStmt->fetch(); -if (!$printer) { - http_response_code(404); - echo json_encode(['error' => 'printer not found']); - exit; -} - -$sql = "SELECT m.*, pms.support_level, pms.partial_reason, pms.extra_info - FROM materials m - LEFT JOIN printer_material_support pms - ON pms.material_id = m.id AND pms.printer_id = :pid - WHERE m.is_active = 1 - ORDER BY m.code"; -$stmt = $pdo->prepare($sql); -$stmt->execute([':pid' => $printer_id]); -$materials = $stmt->fetchAll(); - -echo json_encode([ - 'printer' => $printer, - 'materials' => $materials -], JSON_UNESCAPED_UNICODE); diff --git a/public/api/printers.php b/public/api/printers.php deleted file mode 100755 index c560186..0000000 --- a/public/api/printers.php +++ /dev/null @@ -1,6 +0,0 @@ -query("SELECT * FROM printers WHERE is_active = 1 ORDER BY name"); -echo json_encode($stmt->fetchAll(), JSON_UNESCAPED_UNICODE); diff --git a/public/assets/.gitkeep b/public/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/assets/bilder/.gitkeep b/public/assets/bilder/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/assets/css/.gitkeep b/public/assets/css/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/assets/fonts/.gitkeep b/public/assets/fonts/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/assets/js/.gitkeep b/public/assets/js/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/public/index.html b/public/index.html deleted file mode 100755 index f78b489..0000000 --- a/public/index.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - 3D-Druck Materialmatrix - - - - - -
-
-
-

3D-Druck Materialmatrix

-

Schnell prüfen, welche Filamente auf welchen Druckern laufen.

-
- -
- -
- - - - -
-
- - - - - - - - - - - - - - - -
MaterialEigenschaftenTg °CDüsePlatteZusatzAnwendungKinderEmission
-
- - - - -
-

- Hinweis: Dieses Projekt wird privat betrieben und befindet sich im Aufbau. - Es sind noch nicht alle Drucker und Materialien eingetragen. - Alle Angaben erfolgen nach bestem Wissen, jedoch ohne Gewähr auf Vollständigkeit oder Richtigkeit. -

-
-
-
-
- - - - diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..e5553d8 --- /dev/null +++ b/public/index.php @@ -0,0 +1 @@ + 'localhost', - 'db_name' => 'd0453540', - 'db_user' => 'd0453540', - 'db_pass' => 'P6jGRrSaX8QSiBMEJBL7', - 'db_charset' => 'utf8mb4', -]; diff --git a/src/helpers.php b/src/helpers.php new file mode 100644 index 0000000..e5553d8 --- /dev/null +++ b/src/helpers.php @@ -0,0 +1 @@ +