@ -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' ]);
$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' ];
$account_owner = $_POST [ 'owner' ];
if ( ! $account_owner ) $account_owner = $_POST [ 'realname' ];
if ( ! $account_owner ) $account_owner = $_POST [ 'realname' ];
switch ( $_POST [ 'bank' ]){
case " EU " :
$aw = $_POST ;
switch ( $_POST [ 'banktype' ]){
case " bank-eu " :
$aw = " EU-Banküberweisung " ;
$aw = " EU-Banküberweisung " ;
$aw_details = "
$aw_details = "
Kontoinhaber : $account_owner < br >
Kontoinhaber : $account_owner < br >
IBAN : $_POST [ IBAN ] < br >
BIC : $_POST [ BIC ] < br >
Bank : $_POST [ B ankname] < br >< br >
Anmerkungen :< br > $comments < br >
IBAN : $_POST [ iban ] < br >
BIC : $_POST [ bic ] < br >
Bank : $_POST [ b ankname] < br >< br >
Verwendungszweck :< br > $_POST [ purpose ] < br >
" ;
" ;
break ;
break ;
case " Non-EU " :
case " bank-noneu " :
$aw = " Non-EU-Banküberweisung " ;
$aw = " Non-EU-Banküberweisung " ;
$aw_details = "
$aw_details = "
Kontoinhaber : $account_owner < br >
Kontoinhaber : $account_owner < br >
IBAN : $_POST [ IBAN ] < br >
BIC : $_POST [ BIC ] < br >
Bank : $_POST [ B ankname] < br >< br >
Kontonummer : $_POST [ n_iban ] < br >
BIC / SWIFT : $_POST [ n_bic ] < 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-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 );
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 );
$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 );