<?php





	require("bezahlcode.class.php");
	
	// IBAN, BIC, accountowner, qrcodeprovider, use Bezahlcode-Frame
	// string qrprovider = default phpqrcode, options: phpqrcode, google
	// boolean use_frame = default true // Use the Frame around the QR-Code with the text "Zahlen mit Code"
	// it's possible to change the frame by setting the variable $bezahlcode->base64_frame with your own frame
	$bezahlcode = new Bezahlcode("DE72 3702 0500 0009 7097 00", "BFSWDE33XXX", "Ärzte ohne Grenzen e.V.");
//	$bezahlcode = new Bezahlcode("DE72 3702 0500 0009 7097 00", "BFSWDE33XXX", "Ärzte ohne Grenzen e.V.", "phpqrcode", false);
//	$bezahlcode = new Bezahlcode("DE72 3702 0500 0009 7097 00", "BFSWDE33XXX", "Ärzte ohne Grenzen e.V.", "google");
	$bezahlcode->generatePayload("Donation", 10.99);
	
	/*	get Bezahlcode as base64-string
	generateBase64(filetype)
	filetype defaults to jpg; options: jpg, png, gif
	----------------------------------- */
	$base64 = $bezahlcode->generateBase64('png');
	echo "<img src=\"".$base64."\" title=\"Donate via Bezahlcode\">";
	
	/*	save Bezahlcode
	saveImage(filename, filetype)
	filetype defaults to jpg; options: jpg, png, gif
	----------------------------------- */
	
	date_default_timezone_set('Europe/Berlin');
	$dt = new DateTime('now');

	$timeName = $dt->format('Y-m-d_H:i:s');

        echo $timeName;




        $filename = $bezahlcode->saveImage("./images/qrgirocode/$timeName donation.jpg", "jpg");
	// or
	$filename = $bezahlcode->saveImage("./images/qrgirocode/$timeName output.jpg");
	// or
	$filename = $bezahlcode->saveImage("./images/qrgirocode/$timeName output.png", "png");
	// or
	$filename = $bezahlcode->saveImage();

	/*	output Bezahlcode to Webbrowser
	outputImage(filetype)
	filetype defaults to jpg; options: jpg, png, gif
	----------------------------------- */
//	$bezahlcode->outputImage('png');
	// or
//	$bezahlcode->outputImage();


 echo "<img src='$filename'>";

?>

<?php
/*
date_default_timezone_set('Europe/Berlin');
$dt = new DateTime('now');

$fileName = $dt->format('Y-m-d_H.i.s');
// echo $fileName;

$kunr = "662252488";
$renr = "stephan";
$betr = "20.02";

require_once("bezahlcode.class.php");

$bezahlcode = new Bezahlcode("DE35 5185 0079 0371 1087 34", "INGDDEFFXXX", "Stephan Weiss (BhB)");
$bezahlcode->generatePayload("$kunr $renr", $betr);

        $base64 = $bezahlcode->generateBase64('png');
        echo "<img src=\"".$base64."\" title=\"Bezahlen mit Girocode\">";




imagegif($base64, "images/qrgirocode/$renr bild.gif");
//$this->data['data1']['qrcode'] = $renr . ' bild.gif';
//$this->data['data1']['blob2'] = "(0x ' .  bin2hex($im) . ')";

echo $fileName;


imagedestroy($im);

echo $fileName;
*/
?>


