From d2284a3af9ff3ca44574ce12a6da2a51906c574e Mon Sep 17 00:00:00 2001 From: pw Date: Wed, 25 Jun 2025 00:32:52 +0200 Subject: [PATCH] =?UTF-8?q?index.php=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 217 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 index.php diff --git a/index.php b/index.php new file mode 100644 index 0000000..a1b0d23 --- /dev/null +++ b/index.php @@ -0,0 +1,217 @@ + + + + + + Zinsrechner + + + +
+

Zinsrechner

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + modify("+$preset_years years"); + } + } else { + try { + $start_date = new DateTime($start_date_input); + $end_date = new DateTime($end_date_input); + + if ($start_date >= $end_date) { + $errors[] = "Das Enddatum muss nach dem Startdatum liegen."; + } + } catch (Exception $e) { + $errors[] = "Ungültiges Datumsformat. Bitte verwenden Sie das Format JJJJ-MM-TT."; + } + } + + if (empty($errors)) { + $interval = $start_date->diff($end_date); + $days = $interval->days; + + // Simple interest calculation (adjust as needed for compound interest) + $annual_interest = ($principal_amount * $interest_rate) / 100; + $calculated_interest = ($annual_interest / 365) * $days; + $final_amount = $principal_amount + $calculated_interest; + + echo '
'; + echo '

Ergebnis:

'; + echo '

Kapital: ' . number_format($principal_amount, 2, ',', '.') . ' €

'; + echo '

Zinssatz: ' . number_format($interest_rate, 2, ',', '.') . ' %

'; + echo '

Anlagedauer: ' . $days . ' Tage

'; + echo '

Berechnete Zinsen: ' . number_format($calculated_interest, 2, ',', '.') . ' €

'; + echo '

Endbetrag: ' . number_format($final_amount, 2, ',', '.') . ' €

'; + echo '
'; + } else { + echo '
'; + foreach ($errors as $error) { + echo '

' . $error . '

'; + } + echo '
'; + } + } + ?> +
+ + + \ No newline at end of file