<?php
	//echo "ok"; die;
	
	$deb = "LE FRERE";
	if($sexe=="F"){ $deb="LA SOEUR"; }
	
	//echo "Generating QR Code";
	include('phpqrcode/qrlib.php');
    // how to save PNG codes to server
    $tempDir = "qrcodes/";
    
    $codeContents = $prenom." ".$nom." ".$postnom." EST CERTAINEMENT MEMBRE DE L'EGLISE ".$nomEglise.". Cliquer sur le lien suivant https://kelasionline.com/ekleziasoft/ pour accéder à votre compte.";
    
    // we need to generate filename somehow, 
    // with md5 or with database ID used to obtains $codeContents...
    $fileName = '005_file_'.md5($codeContents).'.png';
    $pngAbsoluteFilePath = $tempDir.$fileName;
    $urlRelativeFilePath = $tempDir.$fileName;
    
    // generating
    if (!file_exists($pngAbsoluteFilePath)) {
        QRcode::png($codeContents, $pngAbsoluteFilePath);
        //echo 'File generated!';
        //echo '<hr />';
    }
			
?>

<!DOCTYPE html>
<html lang="en">
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<meta name="author" content="http://templateq.com" />
</head>

<body>
	
    <?php if($fonction<>"membre"){ ?>
	<!-- <img src="img/Carte de membre_verso_pierre angulaire_by_Tomajer.jpg" style="width:84%; vertical-align:middle; z-index:1"> -->
	<div style="position:absolute; left:-5px; top:132; padding:0px; z-index:10000"> <img src="../../img/QRCodeWhite.PNG" width="200"> </div>
	<div style="position:absolute; left:-5px; top:130; padding:0px; z-index:10000"> <img src="<?php echo $urlRelativeFilePath; ?>" width="200"> </div>
	<!-- <div style="position:absolute; left:13px; top:124; padding:0px; z-index:10000; font-size:3px; color:#808080;"> <?php echo $numAdherent; ?> </div> -->
	
	<?php } ?>

</body>
</html>

