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-col">
<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 class="is-col">
</div>
</div>
<br>
<div class="is-row">
<div class="is-col">
<input required type="email" size="32" id="email"
name="email" placeholder="E-Mail-Adresse*" />
name="email" placeholder="Deine E-Mail-Adresse*" />
</div>
<div class="is-col">
</div>
@ -68,13 +84,13 @@
<div class="is-col">
<nav class="tabs" data-kube="tabs" data-equal="false">
<a href="#tab1" class="is-active">Banküberweisung</a>
<a href="#tab2">Banküberweisung(Non-EU)</a>
<a href="#tab3">PayPal</a>
<a href="#tab4">Barauszahlung</a>
<a href="#bank-eu" class="is-active">Banküberweisung</a>
<a href="#bank-noneu">Banküberweisung(Non-EU)</a>
<a href="#bank-paypal">PayPal</a>
<a href="#bank-bar">Barauszahlung</a>
</nav>
<section id="tab1">
<section id="bank-eu">
<div class="is-row">
<div class="is-col">
<input type="input" size="32" name="Owner" placeholder="Kontoinhaber" />
@ -86,21 +102,21 @@
<div class="is-row">
<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 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>
<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 id="tab2">
<section id="bank-noneu">
<div class="is-row">
<div class="is-col">
<input type="input" size="32" name="Owner" placeholder="Kontoinhaber" />
@ -112,37 +128,37 @@
<div class="is-row">
<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 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>
<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>
<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>
<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>
<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 id="tab3">
<input class="paypal" type="input" size="32"
<section id="bank-paypal">
<input name="paypal" type="input" size="32"
id="paypal" placeholder="Dein PayPal Account (paypal@example.com)" />
</section>
<section id="tab4">
<section id="bank-bar">
</section>
@ -230,7 +246,7 @@
</div>
</div>
<input type="hidden" id="banktype" name="banktype"/>
<!-- <input type="submit" style="display:none" name="submitButton" /> -->
</form>
@ -243,6 +259,8 @@
<script src="addons/upload/kube.upload.min.js"></script>
<script src="addons/kube-addons.min.js"></script>
<script src="kaform.js"></script>
<script src="iban.js/iban.js"></script>
</div>
</div>
</body>

View file

@ -1,6 +1,6 @@
var currentRowId=1;
var banktype = "bank-eu";
function renumberTableRows(){
var row_no=1;
@ -228,7 +228,15 @@ $K.add('module', 'kaform', {
tabs: {
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' });
}
}
@ -291,5 +299,52 @@ function downloadDocument()
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();
}
/*
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(){
$comments = str_replace("\n","<BR>",$_POST['comments']);
$bankaddress = str_replace("\n","<BR>",$_POST['bankaddress']);
$address = str_replace("\n","<BR>",$_POST['address']);
$bankaddress = str_replace("\n","<BR>",$_POST['n_bankaddress']);
$address = str_replace("\n","<BR>",$_POST['n_address']);
$account_owner = $_POST['owner'];
if (!$account_owner) $account_owner = $_POST['realname'];
switch ($_POST['bank']){
case "EU":
$aw = $_POST;
switch ($_POST['banktype']){
case "bank-eu":
$aw = "EU-Bank&uuml;berweisung";
$aw_details = "
Kontoinhaber: $account_owner<br>
IBAN: $_POST[IBAN]<br>
BIC: $_POST[BIC]<br>
Bank: $_POST[Bankname]<br><br>
Anmerkungen:<br> $comments<br>
IBAN: $_POST[iban]<br>
BIC: $_POST[bic]<br>
Bank: $_POST[bankname]<br><br>
Verwendungszweck:<br> $_POST[purpose]<br>
";
break;
case "Non-EU":
case "bank-noneu":
$aw = "Non-EU-Bank&uuml;berweisung";
$aw_details = "
Kontoinhaber: $account_owner<br>
IBAN: $_POST[IBAN]<br>
BIC: $_POST[BIC]<br>
Bank: $_POST[Bankname]<br><br>
Kontonummer: $_POST[n_iban]<br>
BIC/SWIFT: $_POST[n_bic]<br>
Bank: $_POST[n_ankname]<br><br>
Bankanschrift:<br>$bankaddress<br><br>
Anschrift des Empf&auml;ngers:<br>$address<br><br>
Verwendungszweck:<br> $_POST[n_purpose]<br>
Anmerkungen:<br> $comments<br>
";
break;
case "bank-paypal":
$aw = "PayPal";
$aw_details = "PayPal Account:";
}
@ -149,8 +156,11 @@ function mkFrontPDF(){
<p>
&nbsp;
<br>
Nickname: $_POST[nickname]<br>
Name: $_POST[realname]<br>
Telefon: $_POST[phone]<br>
E-Mail: $_POST[email]<br>
Ansprechpartner: $_POST[wmdecontact]<br>
</p>
<hr>
<br>
@ -193,21 +203,21 @@ function mkSnippedPdf($key){
$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];
#
$amount = $_POST['amount'][$key];
$desc = $_POST['desc'][$key];
$desc = $_POST['description'][$key];
$html =
<<<EOD
<h1>Posi. $pos</h1>
<h1>Position $pos</h1>
<p>$desc</p><br>
<p>$amount EUR</p><br>
EOD;
@ -263,23 +273,24 @@ $pdfs = array();
$p = mkFrontPDF();
$file = $p;
header('Content-Disposition: attachment; filename="'. basename($file) . '"');
header('Content-Length: ' . filesize($file));
readfile($file);
#header('Content-Disposition: attachment; filename="'. basename($file) . '"');
#header('Content-Length: ' . filesize($file));
#readfile($file);
var_dump($p);
die();
#var_dump($p);
#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);
//var_dump($pdfs);
foreach ($_POST['desc'] as $key => $val) {
echo "DREESK KEY VAL $key --> $val<br>";
foreach ($_POST['description'] as $key => $val) {
// echo "DREESK KEY VAL $key --> $val<br>";
$p = mkSnippedPDF($key);
array_push($pdfs,$p);
@ -288,8 +299,7 @@ foreach ($_POST['desc'] as $key => $val) {
}
var_dump($pdfs);
//var_dump($pdfs);
$cmd = "$CONVERT_CMD";
foreach ($pdfs as $filename){
@ -297,8 +307,13 @@ foreach ($pdfs as $filename){
}
$cmd .= " cat output /tmp/result.pdf";
exec ($cmd);
echo "CMD: $cmd<br>";
//var_dump($_POST);
#echo "CMD: $cmd<br>";
#die;
$file = "/tmp/result.pdf";
header('Content-Disposition: attachment; filename="'. basename($file) . '"');
header('Content-Length: ' . filesize($file));
readfile($file);