From 4a87ecf539ceb41b3a35e33a4cd371ad5a1b4bc8 Mon Sep 17 00:00:00 2001 From: Tobias Herre Date: Tue, 22 Sep 2020 14:01:41 +0000 Subject: [PATCH] Display currency in table rows --- ka.php | 12 ++++++------ kaform.js | 15 ++++++++------- submit.php | 6 ++++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ka.php b/ka.php index 9770119..2b9c10e 100644 --- a/ka.php +++ b/ka.php @@ -222,12 +222,12 @@ Grund für abweichende kontoinhabende Person">
- +
diff --git a/kaform.js b/kaform.js index 89c7b33..51e684b 100644 --- a/kaform.js +++ b/kaform.js @@ -191,9 +191,9 @@ function addTableRow(){ e += `${a_description} `; - + // add column for num - e += `${a_amount} EUR + e += `${a_amount} ${a_currency} `; @@ -225,10 +225,10 @@ function addTableRow(){ `; - $node.append(element); - element.innerHTML=(e); - renumberTableRows(); - currentRowId++; + $node.append(element); + element.innerHTML=(e); + renumberTableRows(); + currentRowId++; reset2(); disableCurrency(); @@ -385,7 +385,6 @@ function downloadDocument(mail) document.getElementById('banktype').value=banktype; - document.getElementById("theform").submit(); if (!document.getElementById("agree").checked){ document.getElementById("agree").focus(); @@ -394,6 +393,8 @@ function downloadDocument(mail) }; + document.getElementById("theform").submit(); + } diff --git a/submit.php b/submit.php index 7b5ca7a..96c447b 100644 --- a/submit.php +++ b/submit.php @@ -310,6 +310,8 @@ function mkTable(){ foreach ($_POST['amount'] as $key=>$val){ + $currency = $_POST['currency'][$key]; + $html .=''; $html .= "$pos"; @@ -336,7 +338,7 @@ function mkTable(){ $html .= "Bereits erhaltener Vorschuss:"; $html .= ''; $html .= ''; - $html .= sprintf("-%0.2f",$adv)." EUR"; + $html .= sprintf("-%0.2f",$adv)." $currency"; $html .= ''; $html .= ""; @@ -347,7 +349,7 @@ function mkTable(){ $html .= "Summe:"; $html .= ''; $html .= ''; - $html .= "".calcSum()." EUR"; + $html .= "".calcSum()." $currency"; $html .= ''; $html .= '';