forked from tohe/wmdeit_kaform
Display currency in table rows
This commit is contained in:
parent
f6a48e67f2
commit
4a87ecf539
12
ka.php
12
ka.php
|
@ -222,12 +222,12 @@ Grund für abweichende kontoinhabende Person"></textarea>
|
||||||
<input id="a_amount" type="text" name="amount" placeholder="Betrag*"/>
|
<input id="a_amount" type="text" name="amount" placeholder="Betrag*"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="is-col">
|
<div class="is-col">
|
||||||
<select id="a_currency" name="currency" >
|
<select id="a_currency" name="currency" >
|
||||||
<option value="EUR">EUR</option>
|
<option value="EUR">EUR</option>
|
||||||
<option value="USD">USD</option>
|
<option value="USD">USD</option>
|
||||||
<option value="CHF">CHF</option>
|
<option value="CHF">CHF</option>
|
||||||
<option value="XBT">XBT</option>
|
<option value="XBT">XBT</option>
|
||||||
</select>
|
</select>
|
||||||
<!-- <input id="a_currency" type="text" name="curreny" placeholder="Waehrung*"/> -->
|
<!-- <input id="a_currency" type="text" name="curreny" placeholder="Waehrung*"/> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="is-col">
|
<div class="is-col">
|
||||||
|
|
13
kaform.js
13
kaform.js
|
@ -193,7 +193,7 @@ function addTableRow(){
|
||||||
|
|
||||||
|
|
||||||
// add column for num
|
// add column for num
|
||||||
e += `<td>${a_amount} EUR
|
e += `<td>${a_amount} ${a_currency}
|
||||||
<input type="hidden" name="amount[${currentRowId}]" value="${a_amount}" /></td>`;
|
<input type="hidden" name="amount[${currentRowId}]" value="${a_amount}" /></td>`;
|
||||||
|
|
||||||
|
|
||||||
|
@ -225,10 +225,10 @@ function addTableRow(){
|
||||||
</span></td>`;
|
</span></td>`;
|
||||||
|
|
||||||
|
|
||||||
$node.append(element);
|
$node.append(element);
|
||||||
element.innerHTML=(e);
|
element.innerHTML=(e);
|
||||||
renumberTableRows();
|
renumberTableRows();
|
||||||
currentRowId++;
|
currentRowId++;
|
||||||
reset2();
|
reset2();
|
||||||
disableCurrency();
|
disableCurrency();
|
||||||
|
|
||||||
|
@ -385,7 +385,6 @@ function downloadDocument(mail)
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('banktype').value=banktype;
|
document.getElementById('banktype').value=banktype;
|
||||||
document.getElementById("theform").submit();
|
|
||||||
|
|
||||||
if (!document.getElementById("agree").checked){
|
if (!document.getElementById("agree").checked){
|
||||||
document.getElementById("agree").focus();
|
document.getElementById("agree").focus();
|
||||||
|
@ -394,6 +393,8 @@ function downloadDocument(mail)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
document.getElementById("theform").submit();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -310,6 +310,8 @@ function mkTable(){
|
||||||
|
|
||||||
|
|
||||||
foreach ($_POST['amount'] as $key=>$val){
|
foreach ($_POST['amount'] as $key=>$val){
|
||||||
|
$currency = $_POST['currency'][$key];
|
||||||
|
|
||||||
$html .='<tr>';
|
$html .='<tr>';
|
||||||
|
|
||||||
$html .= "<td>$pos</td>";
|
$html .= "<td>$pos</td>";
|
||||||
|
@ -336,7 +338,7 @@ function mkTable(){
|
||||||
$html .= "Bereits erhaltener Vorschuss:";
|
$html .= "Bereits erhaltener Vorschuss:";
|
||||||
$html .= '</td>';
|
$html .= '</td>';
|
||||||
$html .= '<td align="right">';
|
$html .= '<td align="right">';
|
||||||
$html .= sprintf("-%0.2f",$adv)." EUR";
|
$html .= sprintf("-%0.2f",$adv)." $currency";
|
||||||
$html .= '</td>';
|
$html .= '</td>';
|
||||||
$html .= "</tr>";
|
$html .= "</tr>";
|
||||||
|
|
||||||
|
@ -347,7 +349,7 @@ function mkTable(){
|
||||||
$html .= "<b>Summe:</b>";
|
$html .= "<b>Summe:</b>";
|
||||||
$html .= '</td>';
|
$html .= '</td>';
|
||||||
$html .= '<td align="right">';
|
$html .= '<td align="right">';
|
||||||
$html .= "<b>".calcSum()." EUR</b>";
|
$html .= "<b>".calcSum()." $currency</b>";
|
||||||
$html .= '</td>';
|
$html .= '</td>';
|
||||||
$html .= '</tr>';
|
$html .= '</tr>';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue