<?php 

	/*
 * PHP QR Code encoder
 *
 * Exemplatory usage
 *
 * PHP QR Code is distributed under LGPL 3
 * Copyright (C) 2010 Dominik Dzienia <deltalab at poczta dot fm>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 */
 
	#	http://phpqrcode.sourceforge.net/docs/html/class_q_rcode.html
	
	# available param for canvas use: 
	# 	static QRcode::canvas 	( $text, $elemId = false, $level = QR_ECLEVEL_L, $width = false, $size = false, $margin = 4, $autoInclude = false  ) 	
	# Parameters description:
		# String	$text	text string to encode,  String	$elemId	(optional) target Canvas tag id attribute, if false Canvas tag with auto id will be created
		#	Integer	$level	(optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H,  Integer	$width	(optional) CANVAS element width (sam as height)
		# 	Integer	$size	(optional) pixel size, multiplier for each 'virtual' pixel,  Integer	$margin	(optional) code margin (silent zone) in 'virtual' pixels
		#	Boolean	$autoInclude	(optional) if true, required qrcanvas.js lib will be included (only once)

		#	Returns
			#	String containing JavaScript creating the code, Canvas element (when $elemId is false) and script tag with required lib (when $autoInclude is true and not yet included) 
	
	# available param for png use: 
	#	static QRcode::png 	( $text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint = false  ) 		
	# Parameters description:
		# String	$text	text string to encode, String	$outfile	(optional) output file name, if false outputs to browser with required headers
		#	Integer	$level	(optional) error correction level QR_ECLEVEL_L, QR_ECLEVEL_M, QR_ECLEVEL_Q or QR_ECLEVEL_H
		#	Integer	$size	(optional) pixel size, multiplier for each 'virtual' pixel, Integer	$margin	(optional) code margin (silent zone) in 'virtual' pixels
		#	Boolean	$saveandprint	(optional) if true code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified. 
	
	


	 $qrImg_temp_dir = dirname(__FILE__). DIRECTORY_SEPARATOR . 'temp'. DIRECTORY_SEPARATOR;
	 $qrData_store_dir = realpath(__DIR__ . '/../..').'/docs/qr_data/';

	#  dirname(__FILE__)."../../docs/";	 
		
	 #$qrImg_temp_dir ="include/qr_lib/temp/";

    //html PNG location prefix
    $PNG_WEB_DIR = 'temp/';

 #   include "qrlib.php";    
 
	include ("qrconst.php");
	include ("qrconfig.php");
	include ("qrtools.php");
	include ("qrspec.php");
	include ("qrimage.php");
	include ("qrinput.php");
	include ("qrbitstream.php");
	include ("qrsplit.php");
	include ("qrrscode.php");
	include ("qrmask.php");
	include ("qrencode.php");
    
    //ofcourse we need rights to create temp dir
    if (!file_exists($qrImg_temp_dir))
        mkdir($qrImg_temp_dir);
    
	#kp   options: 'L','M','Q','H', dot size: 1-10
	$errorCorrectionLevel="L";
	$matrixPointSize = 1;
	$qrMargin=4;
	
	# wird beim drucken aufgerufen
	# QRcode::png('qr code text content', $kpFilename, $errorCorrectionLevel, $matrixPointSize, 2); 
	 

	


























	 
	  
?>