<?php
// blank message
$message='test';
$name = $data['BookingNumber'];

include "./widget/qrcode/qrlib.php";

if ($data['status']=="Completed")
$message = $companyweb.'/booking/qrview1.php?id='.$data['BookingNumber'];
else
$message = $companyweb.'/booking/qrview.php?id='.$data['BookingNumber'];

// QR Code generation using png()
// When this function has only the
// text parameter it directly
// outputs QR in the browser
// QRcode::png($message);

//set it to writable location, a place for temp generated PNG files
    $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'qrcimages'.DIRECTORY_SEPARATOR;
    
    //html PNG location prefix
    // $PNG_WEB_DIR = 'qrcimages/';

    include "qrlib.php";

    $filename = $PNG_TEMP_DIR.$name.'.png';
    
    //processing form input
    //remember to sanitize user input in real-life solution !!!
    $errorCorrectionLevel = 'L';
    
    $matrixPointSize = 3;
    
    $url = $qrweb.'widget/qrcimages/'.$name.'.png';
    
    QRcode::png($message, $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
        
    //display generated file
    echo '<img src="'.$url.'" />'; 
?>