umgestellt auf Docker

This commit is contained in:
rxf
2025-09-20 16:01:52 +02:00
commit efe6ff4864
39 changed files with 2075 additions and 0 deletions

BIN
uploads/R001/R001_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 KiB

BIN
uploads/R001/R001_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

BIN
uploads/R001/R001_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 496 KiB

View File

@@ -0,0 +1,44 @@
<?php
require_once 'db_connection.php';
// 1. Alle bestehenden Einträge in rezepte_bilder löschen
$link->query("DELETE FROM rezepte_bilder");
$link->query("ALTER TABLE rezepte_bilder AUTO_INCREMENT = 1");
echo "Alle Einträge in rezepte_bilder wurden gelöscht.<br>";
// 2. Bilder für R001 bis R043 eintragen
for ($i = 1; $i <= 43; $i++) {
$r_nummer = 'R' . str_pad($i, 3, '0', STR_PAD_LEFT);
$upload_dir = 'uploads/' . $r_nummer . '/';
if (file_exists($upload_dir)) {
$files = glob($upload_dir . $r_nummer . '_*.jpg');
if (!empty($files)) {
// Hole die korrekte rezepte_id (id aus Rezepte für Rezeptnummer = $i)
$sql_rezept = "SELECT id FROM Rezepte WHERE Rezeptnummer = ?";
$stmt_rezept = $link->prepare($sql_rezept);
$stmt_rezept->bind_param('i', $i);
$stmt_rezept->execute();
$result_rezept = $stmt_rezept->get_result();
if ($result_rezept->num_rows > 0) {
$row_rezept = $result_rezept->fetch_assoc();
$rezepte_id = $row_rezept['id']; // Korrekte id aus Rezepte (z. B. 6 für Rezeptnummer 1)
foreach ($files as $file) {
$file_name = basename($file);
$datei_pfad = 'uploads/' . $r_nummer . '/' . $file_name;
$insert_sql = "INSERT INTO rezepte_bilder (rezepte_id, datei_pfad) VALUES (?, ?)";
$insert_stmt = $link->prepare($insert_sql);
$insert_stmt->bind_param('is', $rezepte_id, $datei_pfad);
$insert_stmt->execute();
echo "Eintrag: rezepte_id = $rezepte_id, datei_pfad = $datei_pfad<br>";
}
}
}
}
}
echo "Fertig!";
?>

BIN
uploads/R002/R002_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
uploads/R002/R002_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
uploads/R002/R002_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

BIN
uploads/R002/R002_3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

BIN
uploads/R003/R003_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

BIN
uploads/R003/R003_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
uploads/R003/R003_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

BIN
uploads/R005/R005_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
uploads/R005/R005_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

BIN
uploads/R005/R005_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
uploads/R005/R005_3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
uploads/R005/R005_4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

BIN
uploads/R005/R005_5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
uploads/R005/R005_6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 KiB

BIN
uploads/R005/R005_7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
uploads/R030/R030_0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

BIN
uploads/R030/R030_1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

BIN
uploads/R030/R030_2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

BIN
uploads/R030/R030_3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB