Added stuff to avaluate bank details

This commit is contained in:
7u83 2020-02-28 15:04:43 +00:00
parent 7daa5d6231
commit 4a8f38ac69
3 changed files with 141 additions and 53 deletions

60
ka.php
View File

@ -48,16 +48,32 @@
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input required type="input" size="32" <input required type="input" size="32"
` id="realname" name="realname" placeholder="Realname*" /> ` id="realname" name="realname" placeholder="Dein Realname (Vorname Nachname)*" />
</div>
<div class="is-col">
<input required type="input" size="32"
` id="wmdecontact" name="wmdecontact" placeholder="Deine Ansprechperson bei Wikimedia*" />
</div>
</div>
<br>
<div class="is-row">
<div class="is-col">
<input required type="tel" size="32"
id="phone" name="phone"
placeholder="Deine Telefonnummer" />
</div> </div>
<div class="is-col"> <div class="is-col">
</div> </div>
</div> </div>
<br> <br>
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input required type="email" size="32" id="email" <input required type="email" size="32" id="email"
name="email" placeholder="E-Mail-Adresse*" /> name="email" placeholder="Deine E-Mail-Adresse*" />
</div> </div>
<div class="is-col"> <div class="is-col">
</div> </div>
@ -68,13 +84,13 @@
<div class="is-col"> <div class="is-col">
<nav class="tabs" data-kube="tabs" data-equal="false"> <nav class="tabs" data-kube="tabs" data-equal="false">
<a href="#tab1" class="is-active">Banküberweisung</a> <a href="#bank-eu" class="is-active">Banküberweisung</a>
<a href="#tab2">Banküberweisung(Non-EU)</a> <a href="#bank-noneu">Banküberweisung(Non-EU)</a>
<a href="#tab3">PayPal</a> <a href="#bank-paypal">PayPal</a>
<a href="#tab4">Barauszahlung</a> <a href="#bank-bar">Barauszahlung</a>
</nav> </nav>
<section id="tab1"> <section id="bank-eu">
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input type="input" size="32" name="Owner" placeholder="Kontoinhaber" /> <input type="input" size="32" name="Owner" placeholder="Kontoinhaber" />
@ -86,21 +102,21 @@
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input type="input" size="32" id="iban" name="IBAN" placeholder="IBAN*" /> <input type="input" size="32" id="iban" name="iban" placeholder="IBAN*" />
</div> </div>
<div class="is-col"> <div class="is-col">
<input type="input" size="32" id="bic" name="BIC" placeholder="BIC*" /> <input type="input" size="32" id="bic" name="bic" placeholder="BIC*" />
</div> </div>
</div> </div>
<br> <br>
<input type="input" size="32" id="bic" name="purpose" placeholder="Verwendungszweck" /> <input type="input" size="32" id="purpose" name="purpose" placeholder="Verwendungszweck" />
</section> </section>
<section id="tab2"> <section id="bank-noneu">
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input type="input" size="32" name="Owner" placeholder="Kontoinhaber" /> <input type="input" size="32" name="Owner" placeholder="Kontoinhaber" />
@ -112,37 +128,37 @@
<div class="is-row"> <div class="is-row">
<div class="is-col"> <div class="is-col">
<input type="input" size="32" id="iban" name="IBAN" placeholder="Kontonummer*" /> <input type="input" size="32" id="n_iban" name="n_iban" placeholder="Kontonummer*" />
</div> </div>
<div class="is-col"> <div class="is-col">
<input type="input" size="32" id="bic" name="BIC" placeholder="BIC/SWIFT*" /> <input type="input" size="32" id="n_bic" name="n_bic" placeholder="BIC/SWIFT*" />
</div> </div>
</div> </div>
<br> <br>
<input class="EU nonEU" type="input" size="32" id="bank" name="Bankname" placeholder="Name der Bank*" /> <input class="EU nonEU" type="input" size="32" id="n_bank" name="n_bankname" placeholder="Name der Bank*" />
<br> <br>
<textarea class="nonEU" name="bankaddress" id="bankaddress" style="resize:both;" cols="32" rows="4" placeholder="Adresse der Bank (Strasse und Hausnummer/Postleitzahl/Land)"></textarea> <textarea class="nonEU" name="n_bankaddress" id="n_bankaddress" style="resize:both;" cols="32" rows="4" placeholder="Adresse der Bank (Strasse und Hausnummer/Postleitzahl/Land)"></textarea>
<br> <br>
<textarea name="address" lang="de" class="nonEU" id="address" style="resize:both;" cols="32" rows="4" placeholder="Deine Anschrift (Srtasse und Hausnummer/Postleitzahl/Land) <textarea name="n_address" lang="de" class="nonEU" id="n_address" style="resize:both;" cols="32" rows="4" placeholder="Deine Anschrift (Srtasse und Hausnummer/Postleitzahl/Land)
"></textarea> "></textarea>
<br> <br>
<input type="input" size="32" id="bic" name="purpose" placeholder="Verwendungszweck" /> <input type="input" size="32" id="n_purpose" name="n_purpose" placeholder="Verwendungszweck" />
</section> </section>
<section id="tab3"> <section id="bank-paypal">
<input class="paypal" type="input" size="32" <input name="paypal" type="input" size="32"
id="paypal" placeholder="Dein PayPal Account (paypal@example.com)" /> id="paypal" placeholder="Dein PayPal Account (paypal@example.com)" />
</section> </section>
<section id="tab4"> <section id="bank-bar">
</section> </section>
@ -230,7 +246,7 @@
</div> </div>
</div> </div>
<input type="hidden" id="banktype" name="banktype"/>
<!-- <input type="submit" style="display:none" name="submitButton" /> --> <!-- <input type="submit" style="display:none" name="submitButton" /> -->
</form> </form>
@ -243,6 +259,8 @@
<script src="addons/upload/kube.upload.min.js"></script> <script src="addons/upload/kube.upload.min.js"></script>
<script src="addons/kube-addons.min.js"></script> <script src="addons/kube-addons.min.js"></script>
<script src="kaform.js"></script> <script src="kaform.js"></script>
<script src="iban.js/iban.js"></script>
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,6 +1,6 @@
var currentRowId=1; var currentRowId=1;
var banktype = "bank-eu";
function renumberTableRows(){ function renumberTableRows(){
var row_no=1; var row_no=1;
@ -228,7 +228,15 @@ $K.add('module', 'kaform', {
tabs: { tabs: {
opened: function(sender) opened: function(sender)
{ {
console.log('Tab box is ',sender.getActiveBox()); console.log('Tab box is ',sender.getActiveBox().nodes[0]);
banktype = sender.getActiveBox().nodes[0].attributes.id.value;
console.log(banktype);
// console.log(sender);
// this.message.show({ message: 'My message' }); // this.message.show({ message: 'My message' });
} }
} }
@ -291,5 +299,52 @@ function downloadDocument()
return; return;
} }
if (banktype == "bank-eu"){
iban = document.getElementById('iban');
if (!IBAN.isValid(iban.value)){
document.getElementById("iban").focus();
showAlert("Bitte igib eine korrekte IBAN ein!");
return;
}
}
if (banktype == "bank-paypal"){
ii = document.getElementById('paypal');
if (!document.getElementById('paypal').value.trim().length){
document.getElementById("paypal").focus();
showAlert("Bitte gib einen PayPal Account an!");
return;
}
}
document.getElementById('banktype').value=banktype;
document.getElementById("theform").submit(); document.getElementById("theform").submit();
} }
/*
function checkIban()
{
iban = document.getElementById('iban');
if(IBAN.isValid(iban.value))
if( document.getElementById('eu').checked ) {
if(IBAN.isValid(iban.value))
{
if(iban.classList.contains('invalid')) iban.classList.remove('invalid');
iban.classList.add('valid');
}
else {
if(iban.classList.contains('valid')) iban.classList.remove('valid');
iban.classList.add('invalid');
}
} else {
if(iban.classList.contains('invalid')) iban.classList.remove('invalid');
if(iban.classList.contains('valid')) iban.classList.remove('valid');
}
}
*/

View File

@ -37,36 +37,43 @@ class kaformPDF extends TCPDF {
function mkFrontPDF(){ function mkFrontPDF(){
$comments = str_replace("\n","<BR>",$_POST['comments']); $comments = str_replace("\n","<BR>",$_POST['comments']);
$bankaddress = str_replace("\n","<BR>",$_POST['bankaddress']); $bankaddress = str_replace("\n","<BR>",$_POST['n_bankaddress']);
$address = str_replace("\n","<BR>",$_POST['address']); $address = str_replace("\n","<BR>",$_POST['n_address']);
$account_owner = $_POST['owner']; $account_owner = $_POST['owner'];
if (!$account_owner) $account_owner = $_POST['realname']; if (!$account_owner) $account_owner = $_POST['realname'];
switch ($_POST['bank']){ $aw = $_POST;
case "EU":
switch ($_POST['banktype']){
case "bank-eu":
$aw = "EU-Bank&uuml;berweisung"; $aw = "EU-Bank&uuml;berweisung";
$aw_details = " $aw_details = "
Kontoinhaber: $account_owner<br> Kontoinhaber: $account_owner<br>
IBAN: $_POST[IBAN]<br> IBAN: $_POST[iban]<br>
BIC: $_POST[BIC]<br> BIC: $_POST[bic]<br>
Bank: $_POST[Bankname]<br><br> Bank: $_POST[bankname]<br><br>
Anmerkungen:<br> $comments<br> Verwendungszweck:<br> $_POST[purpose]<br>
"; ";
break; break;
case "Non-EU": case "bank-noneu":
$aw = "Non-EU-Bank&uuml;berweisung"; $aw = "Non-EU-Bank&uuml;berweisung";
$aw_details = " $aw_details = "
Kontoinhaber: $account_owner<br> Kontoinhaber: $account_owner<br>
IBAN: $_POST[IBAN]<br> Kontonummer: $_POST[n_iban]<br>
BIC: $_POST[BIC]<br> BIC/SWIFT: $_POST[n_bic]<br>
Bank: $_POST[Bankname]<br><br> Bank: $_POST[n_ankname]<br><br>
Bankanschrift:<br>$bankaddress<br><br> Bankanschrift:<br>$bankaddress<br><br>
Anschrift des Empf&auml;ngers:<br>$address<br><br> Anschrift des Empf&auml;ngers:<br>$address<br><br>
Verwendungszweck:<br> $_POST[n_purpose]<br>
Anmerkungen:<br> $comments<br> Anmerkungen:<br> $comments<br>
"; ";
break; break;
case "bank-paypal":
$aw = "PayPal";
$aw_details = "PayPal Account:";
} }
@ -149,8 +156,11 @@ function mkFrontPDF(){
<p> <p>
&nbsp; &nbsp;
<br> <br>
Nickname: $_POST[nickname]<br>
Name: $_POST[realname]<br> Name: $_POST[realname]<br>
Telefon: $_POST[phone]<br>
E-Mail: $_POST[email]<br> E-Mail: $_POST[email]<br>
Ansprechpartner: $_POST[wmdecontact]<br>
</p> </p>
<hr> <hr>
<br> <br>
@ -193,21 +203,21 @@ function mkSnippedPdf($key){
$pdf->AddPage('L'); $pdf->AddPage('L');
$pos = array_search($key,array_keys($_POST['desc']))+1; $pos = array_search($key,array_keys($_POST['description']))+1;
echo "<br>Make Snipped for $key -> $pos<br>"; // echo "<br>Make Snipped for $key -> $pos<br>";
# $mydesk = $_POST[desc][$key]; # $mydesk = $_POST[desc][$key];
# #
$amount = $_POST['amount'][$key]; $amount = $_POST['amount'][$key];
$desc = $_POST['desc'][$key]; $desc = $_POST['description'][$key];
$html = $html =
<<<EOD <<<EOD
<h1>Posi. $pos</h1> <h1>Position $pos</h1>
<p>$desc</p><br> <p>$desc</p><br>
<p>$amount EUR</p><br> <p>$amount EUR</p><br>
EOD; EOD;
@ -263,23 +273,24 @@ $pdfs = array();
$p = mkFrontPDF(); $p = mkFrontPDF();
$file = $p; $file = $p;
header('Content-Disposition: attachment; filename="'. basename($file) . '"'); #header('Content-Disposition: attachment; filename="'. basename($file) . '"');
header('Content-Length: ' . filesize($file)); #header('Content-Length: ' . filesize($file));
readfile($file); #readfile($file);
var_dump($p); #var_dump($p);
die(); #die();
echo "Making Fromt PDF<BR>"; #echo "Making Fromt PDF<BR>";
echo "Did Making Fromt PDF<BR>"; #echo "Did Making Fromt PDF<BR>";
array_push($pdfs,$p); array_push($pdfs,$p);
//var_dump($pdfs);
foreach ($_POST['desc'] as $key => $val) { foreach ($_POST['description'] as $key => $val) {
echo "DREESK KEY VAL $key --> $val<br>"; // echo "DREESK KEY VAL $key --> $val<br>";
$p = mkSnippedPDF($key); $p = mkSnippedPDF($key);
array_push($pdfs,$p); array_push($pdfs,$p);
@ -288,8 +299,7 @@ foreach ($_POST['desc'] as $key => $val) {
} }
var_dump($pdfs); //var_dump($pdfs);
$cmd = "$CONVERT_CMD"; $cmd = "$CONVERT_CMD";
foreach ($pdfs as $filename){ foreach ($pdfs as $filename){
@ -297,8 +307,13 @@ foreach ($pdfs as $filename){
} }
$cmd .= " cat output /tmp/result.pdf"; $cmd .= " cat output /tmp/result.pdf";
exec ($cmd); exec ($cmd);
//var_dump($_POST);
echo "CMD: $cmd<br>"; #echo "CMD: $cmd<br>";
#die;
$file = "/tmp/result.pdf";
header('Content-Disposition: attachment; filename="'. basename($file) . '"');
header('Content-Length: ' . filesize($file));
readfile($file);